File: sidebar_part.h

package info (click to toggle)
kde-baseapps 4:16.08.3-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 12,308 kB
  • ctags: 12,389
  • sloc: cpp: 109,033; ansic: 2,197; python: 943; xml: 853; sh: 197; ruby: 112; makefile: 7
file content (83 lines) | stat: -rw-r--r-- 2,627 bytes parent folder | download | duplicates (4)
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
/***************************************************************************
                               sidebar_part.h
                             -------------------
    begin                : Sat June 2 16:25:27 CEST 2001
    copyright            : (C) 2001 Joseph Wenninger
    email                : jowenn@kde.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/
#ifndef KONQSIDEBARPART_H
#define KONQSIDEBARPART_H

#include <kparts/part.h>
#include <kparts/browserextension.h>
#include <QtCore/QPointer>
#include "sidebar_widget.h"

class KonqSidebarPart;

class KonqSidebarBrowserExtension : public KParts::BrowserExtension
{
    Q_OBJECT
public:
    KonqSidebarBrowserExtension(KonqSidebarPart *part, Sidebar_Widget *widget);
    ~KonqSidebarBrowserExtension(){}

protected:
    QPointer<Sidebar_Widget> widget;

    // The following slots are needed for konqueror's standard actions
    // They are called from the RMB popup menu
protected Q_SLOTS:
    void copy() { if (widget) widget->stdAction("copy"); }
    void cut() { if (widget) widget->stdAction("cut"); }
    void paste() { if (widget) widget->stdAction("paste"); }
    void pasteTo(const KUrl&) { if (widget) widget->stdAction("pasteToSelection"); }
};

/**
 * This is a "Part".  It that does all the real work in a KPart
 * application.
 *
 * @short Main Part
 * @author Joseph WENNINGER <jowenn@bigfoot.com>
 * @version 0.1
 */
class KonqSidebarPart : public KParts::ReadOnlyPart
{
    Q_OBJECT
public:
    /**
     * Default constructor
     */
    KonqSidebarPart(QWidget *parentWidget, QObject *parent, const QVariantList&);

    /**
     * Destructor
     */
    virtual ~KonqSidebarPart();

    virtual bool openUrl(const KUrl &url);

protected:
    /**
     * This must be implemented by each part
     */
    KonqSidebarBrowserExtension * m_extension;
    virtual bool openFile();

    virtual void customEvent(QEvent* ev);

private:
    Sidebar_Widget *m_widget;
};

#endif // KONQSIDEBARPART_H