summaryrefslogtreecommitdiffstats
path: root/kate/interfaces/toolviewmanager.h
blob: 88a669476615be522d34ecde65acc5cced41eebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* This file is part of the KDE project
   Copyright (C) 2002 Joseph Wenninger <jowenn@kde.org>
   Copyright (C) 2002 Christoph Cullmann <cullmann@kde.org>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License version 2 as published by the Free Software Foundation.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
*/

#ifndef _KATE_TOOLVIEWMANAGER_INCLUDE_
#define _KATE_TOOLVIEWMANAGER_INCLUDE_

#include <tqwidget.h>
#include <kurl.h>

namespace Kate
{

/**
  Interface to the toolviewmanager
 */
class KDE_EXPORT ToolViewManager : public TQObject
{
  friend class PrivateToolViewManager;

  Q_OBJECT

  public:
    /**
     * Construtor, should not interest, internal usage
     */
    ToolViewManager (void *toolViewManager);

    /**
     * Desctructor
     */
    virtual ~ToolViewManager ();

  public:
    /**
     * positions
     */
    enum Position {Left, Right, Top, Bottom};

    /**
     * add a given widget to the given sidebar if possible, name is very important
     * @param identifier unique identifier for this toolview
     * @param pos position for the toolview, if we are in session restore, this is only a preference
     * @param icon icon to use for the toolview
     * @param text text to use in addition to icon
     * @return created toolview on success or 0
     */
    TQWidget *createToolView (const TQString &identifier, ToolViewManager::Position pos, const TQPixmap &icon, const TQString &text);

    /**
     * Move the toolview
     * @param widget to show, widget given must be widget constructed by createToolView
     * @param pos position to move widget to
     * @return bool success
     */
    bool moveToolView (TQWidget *widget, ToolViewManager::Position pos);

    /**
     * Show the toolview
     * @param widget to show, widget given must be widget constructed by createToolView
     * @return bool success
     */
    bool showToolView (TQWidget *widget);

    /**
     * Hide the toolview
     * @param widget to hide, widget given must be widget constructed by createToolView
     * @return bool success
     */
    bool hideToolView (TQWidget *widget);

  private:
    /**
     * REALLY PRIVATE ;)
     */
    class PrivateToolViewManager *d;
};

}

#endif