summaryrefslogtreecommitdiffstats
path: root/tdefilereplace/tdefilereplaceview.h
blob: cf738964ae0d9d5ea670775fea85404fabfe5afb (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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/***************************************************************************
                          tdefilereplaceview.h  -  description
                             -------------------
    begin                : sam oct 16 15:28:00 CEST 1999
    copyright            : (C) 1999 by François Dupoux <dupoux@dupoux.com>
                           (C) 2004 Emiliano Gulmini <emi_barbarossa@yahoo.it>
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 TDEFILEREPLACEVIEW_H
#define TDEFILEREPLACEVIEW_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

//QT
#include <tqlcdnumber.h>
#include <tqwidgetstack.h>
class TQPixMap;

//KDE
class TDEPopupMenu;
class TDEListView;

//local
#include "tdefilereplaceviewwdg.h"
#include "configurationclasses.h"

class coord
{
  public:
    int line,
        column;
  public:
    coord(){ line = 1;
             column = 1;}
    coord(const coord& c) { line = c.line;
                            column = c.column;}
    coord operator=(const coord& c) { line = c.line;
                                      column = c.column;
                                      return (*this);}
};


/**
 * The view of KFilereplace.
 */
class TDEFileReplaceView : public TDEFileReplaceViewWdg
{
  Q_OBJECT
  
  private:
    TDEPopupMenu* m_menuResult;
    RCOptions* m_option;
    TDEListViewItem* m_lviCurrent;
    TDEListView* m_rv,
             * m_sv;

  public://Constructors
    TDEFileReplaceView(RCOptions* info, TQWidget *parent,const char *name);

  public:
    TQString currentPath();
    void showSemaphore(TQString s);
    void displayScannedFiles(int filesNumber) { m_lcdFilesNumber->display(TQString::number(filesNumber,10)); }
    void stringsInvert(bool invertAll);
    void changeView(bool searchingOnlyMode);
    TDEListView* getResultsView();
    TDEListView* getStringsView();
    void updateOptions(RCOptions* info) { m_option = info; }
    void loadMap(KeyValueMap extMap){ loadMapIntoView(extMap); }
    KeyValueMap getStringsViewMap()const { return m_option->m_mapStringsView;}
    void setCurrentStringsViewMap(){ setMap(); }
    //void emitSearchingOnlyMode(bool b) { emit searchingOnlyMode(b); }

  public slots:
    void slotMouseButtonClicked (int button, TQListViewItem *lvi, const TQPoint &pos);
    void slotResultProperties();
    void slotResultOpen();
    void slotResultOpenWith();
    void slotResultDirOpen();
    void slotResultEdit();
    void slotResultDelete();
    void slotResultTreeExpand();
    void slotResultTreeReduce();
    void slotStringsAdd();
    void slotQuickStringsAdd(const TQString& quickSearch, const TQString& quickReplace);
    void slotStringsDeleteItem();
    void slotStringsEmpty();
    void slotStringsEdit();
    void slotStringsSave();

  private:
    void initGUI();
    void raiseStringsView();
    void raiseResultsView();
    coord extractWordCoordinates(TQListViewItem* lvi);
    void expand(TQListViewItem *lviCurrent, bool b);
    void setMap();
    void loadMapIntoView(KeyValueMap map);
    void whatsThis();

  /*signals:
    void resetActions();
    void searchingOnlyMode(bool);*/
};

#endif // TDEFILEREPLACEVIEW_H