summaryrefslogtreecommitdiffstats
path: root/quanta/treeviews/servertreeview.h
blob: 5c36771b38200d15c83047b461b8911e2ffab217 (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
/***************************************************************************
                          servertreeview.h  -  description
                             -------------------
    begin                : Thu Jun 1 2000
    copyright            : (C) 2000 by Dmitry Poplavsky & Alexander Yakovlev & Eric Laffoon <pdima@users.sourceforge.net,yshurik@linuxfan.com,sequitur@easystreet.com>
                           (C) 2001-2004 Andras Mantia <amantia@kde.org>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SERVERTREEVIEW_H
#define SERVERTREEVIEW_H

// quanta includes
#include "basetreeview.h"

//foward declarations
class TQListViewItem;
class TQPoint;
class KPopupMenu;
class KURL;
class ProjectList;

/**
      TreeViewItem with special painter
*/

class ServerTreeViewItem : public BaseTreeViewItem {

public:
  ServerTreeViewItem( KFileTreeViewItem *parent, KFileItem* item, KFileTreeBranch *brnch );
  /** makes document not in project lighter */
  void paintCell(TQPainter *p, const TQColorGroup &cg, int column, int width, int align);
};

/**
      the branch for using @ref ServerTreeViewItem
*/

class ServerTreeBranch : public BaseTreeBranch {

public:
  ServerTreeBranch(KFileTreeView *parent, const KURL& url,
                   const TQString& name, const TQPixmap& pix,
                   bool showHidden = false, KFileTreeViewItem *branchRoot = 0L);

  /** check for CVS and visible*/
  virtual KFileTreeViewItem* createTreeViewItem(KFileTreeViewItem *parent,
                                                KFileItem *fileItem );
};


class ServerTreeView : public BaseTreeView {
   Q_OBJECT
  TQ_OBJECT

public:
  ServerTreeView(KConfig *config, TQWidget *parent, const KURL &url, const char *name = 0L);
  virtual ~ServerTreeView();

protected slots:

  void slotMenu(KListView *listView, TQListViewItem *item, const TQPoint &point);
  
  /** repaints the treeview items, because they might be added to or removed from the project*/
  void slotReloadTree( ProjectList *fileList, bool buildNewTree, const TQStringList &folderToOpen);
  
protected:
  KFileTreeBranch* newBranch(const KURL& url);

  KPopupMenu *m_fileMenu;
  KPopupMenu *m_folderMenu;
  int m_menuClose;                ///< remembers the menu entry
  int m_menuPasteFolder;          ///< remembers the menu entry
  int m_insertFileInProject;
  int m_insertFolderInProject;
  // config
  KConfig *m_config;

private:
  int m_menuDel;
  int m_reloadMenuId;
  int m_renameId;
};

#endif