• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

lokalize

  • sources
  • kde-4.14
  • kdesdk
  • lokalize
  • src
  • webquery
webquerycontroller.h
Go to the documentation of this file.
1 /*****************************************************************************
2  This file is part of KAider
3 
4  Copyright (C) 2007 by Nick Shaforostoff <shafff@ukr.net>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 
20  In addition, as a special exception, the copyright holders give
21  permission to link the code of this program with any edition of
22  the Qt library by Trolltech AS, Norway (or with modified versions
23  of Qt that use the same license as Qt), and distribute linked
24  combinations including the two. You must obey the GNU General
25  Public License in all respects for all of the code used other than
26  Qt. If you modify this file, you may extend this exception to
27  your version of the file, but you are not obligated to do so. If
28  you do not wish to do so, delete this exception statement from
29  your version.
30 
31 **************************************************************************** */
32 
33 
34 #ifndef WEBQUERYCONTROLLER_H
35 #define WEBQUERYCONTROLLER_H
36 
37 
38 #include <QObject>
39 #include <QQueue>
40 #include <QRegExp>
41 class Catalog;
42 class WebQueryView;
43 class QTextCodec;
44 class KJob;
45 
46 struct CatalogData
47 {
48  QString msg;
49 
50  //used when the script asks for the same file but with another target language
51  // e.g. it easier for machine to translate from russian to ukrainian than from english to ukrainian
52  QString msg2;
53 
54  WebQueryView* webQueryView;//object to call slots
55 };
56 
57 
58 
64 class WebQueryController: public /*QThread*/QObject
65 {
66  Q_OBJECT
67 public:
68 
69  WebQueryController(const QString& name, QObject* parent);
70 
71 public slots:
72  void query(const CatalogData& data);
73 
74  void slotDownloadResult(KJob*);
75 signals:
76  void addWebQueryResult(const QString&,const QString&);
77 
78 //These are for scripts:
79 signals:
80  void doQuery();
81  void postProcess(QString);
82 
83 
84 //these are for scripts:
85 public slots:
86  QString msg();
87 
88  QString filePath();
89  void setTwinLangFilePath(QString);
90  QString twinLangMsg();
91 
92 
102  void doDownloadAndFilter(QString url, QString codec, QString rx/*, int repeat*/);
103 
104  void setResult(QString);
105 
106 
107 
108 
109 
110 
111 /* // If emitted calls the update() scripting function
112  // if available.
113  void update();*/
114 
115 // protected:
116 // void run();
117 
118 private:
119  QQueue<CatalogData> m_queue;
120  bool m_running;
121  QString m_name;//of the script file
122 
123  //QString urlStr
124  QTextCodec* codec;
125  QRegExp filter;
126 // int repeat;
127 // QMutex m_mutex;
128 };
129 
130 
131 
132 #endif
WebQueryController
uses async http reading.
Definition: webquerycontroller.h:64
QQueue< CatalogData >
WebQueryController::setResult
void setResult(QString)
Definition: webquerycontroller.cpp:124
WebQueryController::msg
QString msg()
Definition: webquerycontroller.cpp:65
WebQueryView
unlike other views, we keep data like catalog pointer in our child view: ui_queryControl contains our...
Definition: webqueryview.h:58
CatalogData::msg
QString msg
Definition: webquerycontroller.h:48
CatalogData::msg2
QString msg2
Definition: webquerycontroller.h:52
WebQueryController::WebQueryController
WebQueryController(const QString &name, QObject *parent)
Definition: webquerycontroller.cpp:45
WebQueryController::filePath
QString filePath()
Definition: webquerycontroller.cpp:70
WebQueryController::setTwinLangFilePath
void setTwinLangFilePath(QString)
Definition: webquerycontroller.cpp:74
QRegExp
QObject::name
const char * name() const
WebQueryController::postProcess
void postProcess(QString)
QObject
WebQueryController::doQuery
void doQuery()
QString
QTextCodec
CatalogData::webQueryView
WebQueryView * webQueryView
Definition: webquerycontroller.h:54
CatalogData
Definition: webquerycontroller.h:46
WebQueryController::query
void query(const CatalogData &data)
Definition: webquerycontroller.cpp:53
Catalog
This class represents a catalog It uses CatalogStorage interface to work with catalogs in different f...
Definition: catalog.h:74
WebQueryController::slotDownloadResult
void slotDownloadResult(KJob *)
Definition: webquerycontroller.cpp:100
WebQueryController::addWebQueryResult
void addWebQueryResult(const QString &, const QString &)
WebQueryController::twinLangMsg
QString twinLangMsg()
Definition: webquerycontroller.cpp:79
QObject::parent
QObject * parent() const
KJob
WebQueryController::doDownloadAndFilter
void doDownloadAndFilter(QString url, QString codec, QString rx)
Also may be used to get name of another html file (e.g.
Definition: webquerycontroller.cpp:85
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:07 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

lokalize

Skip menu "lokalize"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal