parts/bookmarks/bookmarks_part.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
#ifndef __KDEVPART_BOOKMARKS_H__
00014
#define __KDEVPART_BOOKMARKS_H__
00015
00016
00017
#include <qguardedptr.h>
00018
#include <qvaluelist.h>
00019
#include <qdict.h>
00020
#include <qpair.h>
00021
00022
#include <kparts/part.h>
00023
#include <kurl.h>
00024
00025
#include <kdevplugin.h>
00026
00027
class QTimer;
00028
class KDialogBase;
00029
class BookmarksConfig;
00030
class ConfigWidgetProxy;
00031
00032 struct EditorData
00033 {
00034 KURL url;
00035 QValueList< QPair<int,QString> >
marks;
00036 };
00037
00038
class BookmarksWidget;
00039
class QDomElement;
00040
00041 class BookmarksPart :
public KDevPlugin
00042 {
00043 Q_OBJECT
00044
00045
public:
00046
00047
BookmarksPart(
QObject *parent,
const char *name,
const QStringList &);
00048
~BookmarksPart();
00049
00050
00051
void restorePartialProjectSession(
const QDomElement * el );
00052
void savePartialProjectSession(
QDomElement * el );
00053
00054
BookmarksConfig *
config();
00055
00056
QStringList getContext(
KURL const & url,
unsigned int line,
unsigned int context );
00057
00058
private slots:
00059
00060
void partAdded(
KParts::Part * part );
00061
00062
00063
void marksEvent();
00064
00065
00066
void marksChanged();
00067
00068
00069
void reload();
00070
00071
00072
void removeAllBookmarksForURL(
const KURL & );
00073
void removeBookmarkForURL(
const KURL &,
int );
00074
00075
void insertConfigWidget(
const KDialogBase * dlg,
QWidget * page,
unsigned int );
00076
00077
private:
00078
bool setBookmarksForURL(
KParts::ReadOnlyPart * );
00079
bool clearBookmarksForURL(
KParts::ReadOnlyPart * );
00080
void setBookmarksForAllURLs();
00081
00082
EditorData *
storeBookmarksForURL(
KParts::ReadOnlyPart * );
00083
void storeBookmarksForAllURLs();
00084
00085
void updateContextStringForURL(
KParts::ReadOnlyPart * );
00086
void updateContextStringForURL(
KURL const & url );
00087
void updateContextStringForAll();
00088
00089
QStringList getContextFromStream(
QTextStream & istream,
unsigned int line,
unsigned int context );
00090
00091
KParts::ReadOnlyPart *
partForURL(
KURL const & url );
00092
bool partIsSane(
KParts::ReadOnlyPart * );
00093
00094 QGuardedPtr<BookmarksWidget> _widget;
00095 QDict<EditorData> _editorMap;
00096 bool _settingMarks;
00097
00098 BookmarksConfig *
_config;
00099
00100 ConfigWidgetProxy *
_configProxy;
00101
00102 QTimer *
_marksChangeTimer;
00103 QValueList<KParts::ReadOnlyPart*> _dirtyParts;
00104 };
00105
00106
00107
#endif
00108
00109
This file is part of the documentation for KDevelop Version 3.0.4.