sublime
areaindex.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef SUBLIMEAREAINDEX_H
00020 #define SUBLIMEAREAINDEX_H
00021
00022 #include <QtCore/Qt>
00023 #include <QtCore/QList>
00024
00025 #include <KConfigGroup>
00026
00027 #include "sublimeexport.h"
00028
00029 namespace Sublime {
00030
00031 class View;
00032
00106 class SUBLIME_EXPORT AreaIndex {
00107 public:
00108 ~AreaIndex();
00109 AreaIndex(const AreaIndex &index);
00110
00112 AreaIndex *parent() const;
00113
00115 AreaIndex *first() const;
00117 AreaIndex *second() const;
00119 bool isSplitted() const;
00121 Qt::Orientation orientation() const;
00123 void setOrientation(Qt::Orientation orientation) const;
00124
00129 void add(View *view, View *after = 0);
00132 void remove(View *view);
00136 void split(View *newView, Qt::Orientation orientation);
00139 void split(Qt::Orientation orientation);
00140
00143 View *viewAt(int position) const;
00145 int viewCount() const;
00147 bool hasView(View *view) const;
00149 QList<View*> &views() const;
00150
00151 protected:
00153 AreaIndex();
00154
00155 private:
00157 AreaIndex(AreaIndex *parent);
00158
00160 void setParent(AreaIndex *parent);
00161
00163 void copyTo(AreaIndex *target);
00165 void copyChildrenTo(AreaIndex *target);
00168 void unsplit(AreaIndex *childToRemove);
00169
00170 struct AreaIndexPrivate * const d;
00171
00172 };
00173
00180 class SUBLIME_EXPORT RootAreaIndex: public AreaIndex {
00181 public:
00182 RootAreaIndex();
00183 private:
00184 class RootAreaIndexPrivate* const d;
00185 };
00186
00187 }
00188
00189 #endif
00190