~ubuntu-branches/ubuntu/precise/konsole/precise-proposed

« back to all changes in this revision

Viewing changes to src/ViewSplitter.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-16 13:14:43 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111216131443-rhdplbmmuxntat3k
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
    This file is part of the Konsole Terminal.
3
 
    
 
3
 
4
4
    Copyright 2006-2008 Robert Knight <robertknight@gmail.com>
5
5
 
6
6
    This program is free software; you can redistribute it and/or modify
22
22
#ifndef VIEWSPLITTER_H
23
23
#define VIEWSPLITTER_H
24
24
 
 
25
// Qt
25
26
#include <QtCore/QList>
26
27
#include <QtGui/QSplitter>
27
28
 
40
41
 * Each splitter can also contain child ViewSplitter widgets, allowing
41
42
 * for a hierarchy of view splitters and containers.
42
43
 *
43
 
 * The addContainer() method is used to split the existing view and 
 
44
 * The addContainer() method is used to split the existing view and
44
45
 * insert a new view container.
45
46
 * Containers can only be removed from the hierarchy by deleting them.
46
47
 */
53
54
 
54
55
    /**
55
56
     * Locates the child ViewSplitter widget which currently has the focus
56
 
     * and inserts the container into it.   
57
 
     * 
 
57
     * and inserts the container into it.
 
58
     *
58
59
     * @param container The container to insert
59
60
     * @param orientation Specifies whether the view should be split
60
61
     *                    horizontally or vertically.  If the orientation
64
65
     *                    will be added to that splitter.  If the orientation
65
66
     *                    is different, then a new child splitter
66
67
     *                    will be created, into which the container will
67
 
     *                    be inserted.   
 
68
     *                    be inserted.
68
69
     */
69
70
    void addContainer( ViewContainer* container , Qt::Orientation orientation );  
70
71
 
73
74
 
74
75
    /** Returns the child ViewSplitter widget which currently has the focus */
75
76
    ViewSplitter* activeSplitter() ;
76
 
 
77
 
    /** 
 
77
 
 
78
    /**
78
79
     * Returns the container which currently has the focus or 0 if none
79
 
     * of the immediate child containers have the focus.  This does not 
 
80
     * of the immediate child containers have the focus.  This does not
80
81
     * search through child splitters.  activeSplitter() can be used
81
82
     * to search recursively through child splitters for the splitter
82
83
     * which currently has the focus.
88
89
    ViewContainer* activeContainer() const; 
89
90
 
90
91
    /**
91
 
     * Gives the focus to the active view in the specified container 
 
92
     * Gives the focus to the active view in the specified container
92
93
     */
93
94
    void setActiveContainer(ViewContainer* container);
94
95
 
96
97
     * Returns a list of the containers held by this splitter
97
98
     */
98
99
    QList<ViewContainer*> containers() const {return _containers;}
99
 
   
 
100
 
100
101
    /**
101
102
     * Gives the focus to the active view in the next container
102
103
     */
104
105
 
105
106
    /**
106
107
     * Changes the size of the specified @p container by a given @p percentage.
107
 
     * @p percentage may be positive ( in which case the size of the container 
108
 
     * is increased ) or negative ( in which case the size of the container 
109
 
     * is decreased ).  
 
108
     * @p percentage may be positive ( in which case the size of the container
 
109
     * is increased ) or negative ( in which case the size of the container
 
110
     * is decreased ).
110
111
     *
111
112
     * The sizes of the remaining containers are increased or decreased
112
113
     * uniformly to maintain the width of the splitter.
120
121
 
121
122
   /**
122
123
    * Specifies whether the view may be split recursively.
123
 
    * 
 
124
    *
124
125
    * If this is false, all containers will be placed into the same
125
126
    * top-level splitter.  Adding a container with an orientation
126
127
    * which is different to that specified when adding the previous
127
 
    * containers will change the orientation for all dividers 
 
128
    * containers will change the orientation for all dividers
128
129
    * between containers.
129
130
    *
130
131
    * If this is true, adding a container to the view splitter with
131
132
    * an orientation different to the orientation of the previous
132
133
    * area will result in the previously active container being
133
134
    * replaced with a new splitter containing the active container
134
 
    * and the newly added container.  
 
135
    * and the newly added container.
135
136
    */
136
137
   void setRecursiveSplitting(bool recursive);
137
138
 
138
 
   /** 
 
139
   /**
139
140
    * Returns whether the view may be split recursively.
140
 
    * See setRecursiveSplitting() 
 
141
    * See setRecursiveSplitting()
141
142
    */
142
143
   bool recursiveSplitting() const;
143
144
 
145
146
    /** Signal emitted when the last child widget is removed from the splitter */
146
147
    void empty(ViewSplitter* splitter);
147
148
 
148
 
    /** 
 
149
    /**
149
150
     * Signal emitted when the containers held by this splitter become empty, this
150
151
     * differs from the empty() signal which is only emitted when all of the containers
151
152
     * are deleted.  This signal is emitted even if there are still container widgets.
152
153
     *
153
 
     * TODO: This does not yet work recursively (ie. when splitters inside splitters have empty containers)  
 
154
     * TODO: This does not yet work recursively (ie. when splitters inside splitters have empty containers)
154
155
     */
155
156
    void allContainersEmpty();
156
157