sublime
area.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SUBLIMEAREA_H
00020 #define SUBLIMEAREA_H
00021
00022 #include <QtCore/QObject>
00023
00024 #include "sublimeexport.h"
00025
00026 #include "areaindex.h"
00027 #include "sublimedefs.h"
00028
00029 #include <KConfigGroup>
00030
00031 namespace Sublime {
00032
00033 class AreaIndex;
00034 class RootAreaIndex;
00035 class Controller;
00036 class View;
00037
00058 class SUBLIME_EXPORT Area: public QObject {
00059 Q_OBJECT
00060 public:
00068 Area(Controller *controller, const QString &name, const QString &title = "");
00069 Area(const Area &area);
00070 ~Area();
00071
00072 QString title() const;
00073 void setTitle(const QString &title);
00074
00076 void addView(View *view, AreaIndex *index);
00077
00079 void addView(View *view, View *after = 0);
00082 void addView(View *view, View *viewToSplit, Qt::Orientation orientation);
00084 View* removeView(View *view);
00088 QList<View*> views();
00089
00091 AreaIndex *indexOf(View *view);
00094 RootAreaIndex *rootIndex() const;
00095
00099 void addToolView(View *toolView, Position defaultPosition);
00100
00102 View* removeToolView(View *toolView);
00103
00105 void moveToolView(View *toolView, Position newPosition);
00106
00108 void raiseToolView(View *toolView);
00110 QList<View*> &toolViews() const;
00112 Position toolViewPosition(View *toolView) const;
00113
00114
00115
00116
00117
00118 bool wantToolView(const QString& id);
00119 void setShownToolView(Sublime::Position pos, const QString& id);
00120 QString shownToolView(Sublime::Position pos) const;
00121 void setDesiredToolViews(
00122 const QMap<QString, Sublime::Position>& desiredToolViews);
00123
00124 void setThickness(Sublime::Position pos, int thickness);
00125 int thickness(Sublime::Position pos) const;
00126
00127 void save(KConfigGroup& group) const;
00128 void load(const KConfigGroup& group);
00129
00131 Controller *controller() const;
00132
00134 enum WalkerMode {
00135 StopWalker,
00136 ContinueWalker
00137 };
00138
00158 template <typename Operator>
00159 void walkViews(Operator &op, AreaIndex *index);
00160
00180 template <typename Operator>
00181 void walkToolViews(Operator &op, Positions positions);
00182
00183 Q_SIGNALS:
00185 void viewAdded(Sublime::AreaIndex*, Sublime::View*);
00187 void aboutToRemoveView(Sublime::AreaIndex*, Sublime::View*);
00189 void toolViewAdded(Sublime::View*, Sublime::Position);
00191 void requestToolViewRaise(Sublime::View*);
00193 void aboutToRemoveToolView(Sublime::View*, Sublime::Position);
00195 void toolViewMoved(Sublime::View*, Sublime::Position);
00196
00197 private:
00198 template <typename Operator>
00199 WalkerMode walkViewsInternal(Operator &op, AreaIndex *index);
00200
00201 void initialize();
00202
00203 struct AreaPrivate *const d;
00204
00205 };
00206
00207 }
00208
00209 #include "areawalkers.h"
00210
00211 #endif
00212