• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDevelop Platform Libraries
  • Sitemap
  • Contact Us
 

sublime

area.h

00001 /***************************************************************************
00002  *   Copyright 2006-2007 Alexander Dymo  <adymo@kdevelop.org>              *
00003  *                                                                         *
00004  *   This program is free software; you can redistribute it and/or modify  *
00005  *   it under the terms of the GNU Library General Public License as       *
00006  *   published by the Free Software Foundation; either version 2 of the    *
00007  *   License, or (at your option) any later version.                       *
00008  *                                                                         *
00009  *   This program is distributed in the hope that it will be useful,       *
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00012  *   GNU General Public License for more details.                          *
00013  *                                                                         *
00014  *   You should have received a copy of the GNU Library General Public     *
00015  *   License along with this program; if not, write to the                 *
00016  *   Free Software Foundation, Inc.,                                       *
00017  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
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     /* Returns true if this area actively desires to show a tool view
00115        with id of 'id'.  The area, of course, will show any tool view
00116        added with 'addToolView', however, this method can be used
00117        to guess a set of tool views that make most sense to be added.  */
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 

sublime

Skip menu "sublime"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDevelop Platform Libraries

Skip menu "KDevelop Platform Libraries"
  • interfaces
  • language
  •   duchain
  •   editor
  • outputview
  • project
  • shell
  • sublime
  • util
  • vcs
Generated for KDevelop Platform Libraries by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal