1/***************************************************************************
2 kfilereplaceview.h - description
3 -------------------
4 begin : sam oct 16 15:28:00 CEST 1999
5 copyright : (C) 1999 by François Dupoux <dupoux@dupoux.com>
6 (C) 2004 Emiliano Gulmini <emi_barbarossa@yahoo.it>
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef KFILEREPLACEVIEW_H
19#define KFILEREPLACEVIEW_H
20
21//QT
22#include <qlcdnumber.h>
23
24//KDE
25class KMenu;
26class K3ListView;
27
28//local
29#include "kfilereplaceviewwdg.h"
30#include "configurationclasses.h"
31
32class coord
33{
34 public:
35 int line,
36 column;
37 public:
38 coord(){ line = 1;
39 column = 1;}
40 coord(const coord& c) { line = c.line;
41 column = c.column;}
42 coord operator=(const coord& c) { line = c.line;
43 column = c.column;
44 return (*this);}
45};
46
47
48/**
49 * The view of KFilereplace.
50 */
51class KFileReplaceView : public KFileReplaceViewWdg
52{
53 Q_OBJECT
54 private:
55 KMenu* m_menuResult;
56 RCOptions* m_option;
57 K3ListViewItem* m_lviCurrent;
58 K3ListView* m_rv,
59 * m_sv;
60
61 public://Constructors
62 KFileReplaceView(RCOptions* info, QWidget *parent,const char *name);
63
64 public:
65 QString currentPath();
66 void showSemaphore(const QString &s);
67 void displayScannedFiles(int filesNumber) { m_lcdFilesNumber->display(QString::number(filesNumber,10)); }
68 void stringsInvert(bool invertAll);
69 void changeView(bool searchingOnlyMode);
70 K3ListView* getResultsView();
71 K3ListView* getStringsView();
72 void updateOptions(RCOptions* info) { m_option = info; }
73 void loadMap(KeyValueMap extMap){ loadMapIntoView(extMap); }
74 KeyValueMap getStringsViewMap()const { return m_option->m_mapStringsView;}
75 void setCurrentStringsViewMap(){ setMap(); }
76 //void emitSearchingOnlyMode(bool b) { emit searchingOnlyMode(b); }
77
78 public slots:
79 void slotMouseButtonClicked (int button, Q3ListViewItem *lvi, const QPoint &pos);
80 void slotResultProperties();
81 void slotResultOpen();
82 void slotResultOpenWith();
83 void slotResultDirOpen();
84 void slotResultEdit();
85 void slotResultDelete();
86 void slotResultTreeExpand();
87 void slotResultTreeReduce();
88 void slotStringsAdd();
89 void slotQuickStringsAdd(const QString& quickSearch, const QString& quickReplace);
90 void slotStringsDeleteItem();
91 void slotStringsEmpty();
92 void slotStringsEdit();
93 void slotStringsSave();
94
95 private:
96 void initGUI();
97 void raiseStringsView();
98 void raiseResultsView();
99 coord extractWordCoordinates(Q3ListViewItem* lvi);
100 void expand(Q3ListViewItem *lviCurrent, bool b);
101 void setMap();
102 void loadMapIntoView(KeyValueMap map);
103 void whatsThis();
104
105 /*signals:
106 void resetActions();
107 void searchingOnlyMode(bool);*/
108};
109
110#endif // KFILEREPLACEVIEW_H
111