summaryrefslogtreecommitdiffstats
path: root/plugin/smb4k_konqplugin.h
blob: f90b8bf84d7ab98e0e610930ef69e8e9cea65d26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/***************************************************************************
 *   Copyright (C) 2004 by Massimo Callegari                               *
 *   [email protected]                                           *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.             *
 ***************************************************************************/

#ifndef SAMBROWSER_H
#define SAMBROWSER_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <konqsidebarplugin.h>
#include <tqstring.h>
#include <tqwidget.h>
#include <tqvbox.h>
#include <tqwidgetstack.h>
#include <tdepopupmenu.h>
#include <tdetoolbar.h>
#include <tdehtml_part.h>
// KDE includes
#include <tdeaction.h>
#include <tdeparts/dockmainwindow.h>
#include <tdeparts/part.h>
#include <tdeparts/factory.h>


class smb4kWidget : public TQVBox
{
Q_OBJECT
  
public:
    smb4kWidget( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 );

private:

};

class KonqSidebar_Smb4K : public KonqSidebarPlugin
{
    Q_OBJECT
  
public:
    /**
     * Construct a @ref KonqSidebarPlugin.
     *
     * @param inst The sidebar's kinstance class.
     * @param parent The sidebar internal button info class responsible for this plugin.
     * @param widgetParent The container which will contain the plugins widget.
     * @param desktopName The filename of the configuration file.
     * @param name A TQt object name for your plugin.
     **/
     KonqSidebar_Smb4K(TDEInstance *inst,TQObject *parent,TQWidget *widgetParent, TQString &desktopName, const char* name=0);

    /** destructor */
    ~KonqSidebar_Smb4K();

    TDEHTMLPart* m_part;
    virtual TQWidget *getWidget(){ return (TQWidget*)widget;}
    virtual void *provides(const TQString &) {return 0;}
    void emitStatusBarText (const TQString &) {;}

private:
    /**
     * The browser part
     */
    KParts::Part *m_browser_part;

    /**
     * The search dialog part
     */
    KParts::Part *m_search_part;

protected:
     /**
      * The main plugin widget. Contains a tdelistview and a tdetoolbox objects
      */
     smb4kWidget *widget;

     TQString                currentKonquerorURL;


    virtual void handleURL(const KURL &url);
protected slots:
    /**
     * This slot initializes a rescan of the network neighborhood.
     */
    void slotRescan();
    /**
     * This slot is connected to the clicked() signal of the topBar search button
     * It brings up the "Search" dialog.
     */
    void slotSearch();
    /**
     * Opens the configuration dialog.
     */
    void slotSmb4KOptionsDlg();
    /**
     * This slot is invoked when the config dialog is closed and the settings have
     * been changed. Emits the reloadSettings() signal and adjusts the system tray
     * widget to the new settings afterwards.
     */
    void slotSettingsChanged();
    /**
     * Called from mounter when a share is mounted
     */
    void slotMountedShare( const TQString & );
    /**
     * Called from the mounter just before a share is unmounted. This slot
     * changes the URL to the user's home so that we can unmount the share
     * without problems.
     *
     * @param mountpoint      The mount point of the share that's going to
     *                        be unmounted.
     */
    void slotPrepareUnmount( const TQString &mounpoint );
  signals:
    // see <konqsidebarplugin.h>
    void openURLRequest(const KURL &url,
                        const KParts::URLArgs &args = KParts::URLArgs());
};

#endif