• 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
  • project
project.h
Go to the documentation of this file.
1 /* ****************************************************************************
2  This file is part of Lokalize
3 
4  Copyright (C) 2007-2009 by Nick Shaforostoff <shafff@ukr.net>
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License as
8  published by the Free Software Foundation; either version 2 of
9  the License or (at your option) version 3 or any later version
10  accepted by the membership of KDE e.V. (or its successor approved
11  by the membership of KDE e.V.), which shall act as a proxy
12  defined in Section 14 of version 3 of the license.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program. If not, see <http://www.gnu.org/licenses/>.
21 
22 **************************************************************************** */
23 
24 
25 #ifndef PROJECT_H
26 #define PROJECT_H
27 
28 #include <QVector>
29 #include <QList>
30 #include "projectbase.h"
31 
32 #define WEBQUERY_ENABLE
33 
34 class ProjectModel;
35 class ProjectLocal;
36 namespace GlossaryNS{class Glossary;}
37 namespace GlossaryNS{class GlossaryWindow;}
38 namespace TM{class TMManagerWin;}
39 
50 class Project: public ProjectBase
52 {
53  Q_OBJECT
54  Q_CLASSINFO("D-Bus Interface", "org.kde.Lokalize.Project")
55  //qdbuscpp2xml -m -s project.h -o org.kde.lokalize.Project.xml
56 public:
57  explicit Project();
58  virtual ~Project();
59 
60  void load(const QString &file);
61  void save();
62  bool isLoaded()const{return !m_path.isEmpty();}
63  ProjectModel* model();
64 
65  //void setPath(const QString& p){m_path=p;}
66  QString path()const{return m_path;}
67  QString projectDir()const{return m_projectDir;}
68  QString poDir()const{return absolutePath(poBaseDir());}
69  QString potDir()const{return absolutePath(potBaseDir());}
70  QString branchDir()const{return absolutePath(ProjectBase::branchDir());}
71  QString glossaryPath()const{return absolutePath(glossaryTbx());}
72  QString qaPath()const{return absolutePath(mainQA());}
73  GlossaryNS::Glossary* glossary()const{return m_glossary;}
74  QString altTransDir()const{return absolutePath(altDir());}
75 
76  bool queryCloseForAuxiliaryWindows();
77 
78  void setDefaults();
79 // private slots:
80 // void initLater();
81 
82 public slots:
83  Q_SCRIPTABLE QString translationsRoot()const{return poDir();}
84  Q_SCRIPTABLE QString templatesRoot()const{return potDir();}
85 
86 
87  Q_SCRIPTABLE QString targetLangCode()const{return ProjectBase::langCode();}
88  Q_SCRIPTABLE QString sourceLangCode()const{return ProjectBase::sourceLangCode();}
89  Q_SCRIPTABLE void init(const QString& path, const QString& kind, const QString& id,
90  const QString& sourceLang, const QString& targetLang);
91  Q_SCRIPTABLE QString kind()const{return ProjectBase::kind();}
92 
93  Q_SCRIPTABLE QString absolutePath(const QString&) const;
94 
95  Q_SCRIPTABLE void setDesirablePath(const QString& path){m_desirablePath=path;}
96  Q_SCRIPTABLE QString desirablePath() const{return m_desirablePath;}
97 
98  Q_SCRIPTABLE bool isTmSupported() const;
99 
100 signals:
101  Q_SCRIPTABLE void loaded();
102 
103 public slots:
104  void populateDirModel();
105  void populateGlossary();
106 
107  void showTMManager();
108  GlossaryNS::GlossaryWindow* showGlossary();
109  GlossaryNS::GlossaryWindow* defineNewTerm(QString en=QString(),QString target=QString());
110 
111 private:
112  static Project* _instance;
113  static void cleanupProject();
114 public:
115  static Project* instance();
116  static ProjectLocal* local(){return instance()->m_localConfig;}
117 
118 private:
119  QString m_path;
120  QString m_desirablePath;
121  ProjectLocal* m_localConfig;
122  ProjectModel* m_model;
123  GlossaryNS::Glossary* m_glossary;
124  GlossaryNS::GlossaryWindow* m_glossaryWindow;
125  TM::TMManagerWin* m_tmManagerWindow;
126 
127  //cache
128  QString m_projectDir;
129  };
130 
131 
132 
133 
134 #endif
ProjectBase::altDir
QString altDir() const
Get AltDir.
Definition: projectbase.h:184
Project::init
Q_SCRIPTABLE void init(const QString &path, const QString &kind, const QString &id, const QString &sourceLang, const QString &targetLang)
Definition: project.cpp:279
Project::kind
Q_SCRIPTABLE QString kind() const
Definition: project.h:91
Project::qaPath
QString qaPath() const
Definition: project.h:72
GlossaryNS::GlossaryWindow
Definition: glossarywindow.h:69
Project::populateDirModel
void populateDirModel()
Definition: project.cpp:190
Project::translationsRoot
Q_SCRIPTABLE QString translationsRoot() const
Definition: project.h:83
Project::instance
static Project * instance()
Definition: project.cpp:67
ProjectBase::langCode
QString langCode() const
Get LangCode.
Definition: projectbase.h:65
Project::projectDir
QString projectDir() const
Definition: project.h:67
Project::local
static ProjectLocal * local()
Definition: project.h:116
Project::potDir
QString potDir() const
Definition: project.h:69
Project::setDesirablePath
Q_SCRIPTABLE void setDesirablePath(const QString &path)
Definition: project.h:95
TM::TMManagerWin
Window for managing Translation Memory databases.
Definition: tmmanager.h:50
Project::isTmSupported
Q_SCRIPTABLE bool isTmSupported() const
Definition: project.cpp:234
ProjectBase
Definition: projectbase.h:12
ProjectModel
Some notes: Uses two KDirModels for template and translations dir.
Definition: projectmodel.h:54
Project::defineNewTerm
GlossaryNS::GlossaryWindow * defineNewTerm(QString en=QString(), QString target=QString())
Definition: project.cpp:211
Project
Singleton object that represents project.
Definition: project.h:51
Project::loaded
Q_SCRIPTABLE void loaded()
GlossaryNS::Glossary
Internal representation of glossary.
Definition: glossary.h:95
Project::save
void save()
Definition: project.cpp:256
Project::showGlossary
GlossaryNS::GlossaryWindow * showGlossary()
Definition: project.cpp:206
Project::glossary
GlossaryNS::Glossary * glossary() const
Definition: project.h:73
ProjectBase::mainQA
QString mainQA() const
Get MainQA.
Definition: projectbase.h:218
QString::isEmpty
bool isEmpty() const
Project::model
ProjectModel * model()
Definition: project.cpp:265
Project::queryCloseForAuxiliaryWindows
bool queryCloseForAuxiliaryWindows()
Definition: project.cpp:226
ProjectBase::poBaseDir
QString poBaseDir() const
Get PoBaseDir.
Definition: projectbase.h:133
Project::desirablePath
Q_SCRIPTABLE QString desirablePath() const
Definition: project.h:96
ProjectBase::sourceLangCode
QString sourceLangCode() const
Get SourceLangCode.
Definition: projectbase.h:99
Project::targetLangCode
Q_SCRIPTABLE QString targetLangCode() const
Definition: project.h:87
ProjectBase::glossaryTbx
QString glossaryTbx() const
Get GlossaryTbx.
Definition: projectbase.h:201
QString
Project::isLoaded
bool isLoaded() const
Definition: project.h:62
projectbase.h
ProjectBase::potBaseDir
QString potBaseDir() const
Get PotBaseDir.
Definition: projectbase.h:150
Project::templatesRoot
Q_SCRIPTABLE QString templatesRoot() const
Definition: project.h:84
Project::glossaryPath
QString glossaryPath() const
Definition: project.h:71
Project::load
void load(const QString &file)
Definition: project.cpp:115
Project::poDir
QString poDir() const
Definition: project.h:68
Project::altTransDir
QString altTransDir() const
Definition: project.h:74
Project::branchDir
QString branchDir() const
Definition: project.h:70
Project::absolutePath
Q_SCRIPTABLE QString absolutePath(const QString &) const
Definition: project.cpp:178
Project::setDefaults
void setDefaults()
Definition: project.cpp:273
ProjectLocal
Definition: projectlocal.h:10
Project::path
QString path() const
Definition: project.h:66
Project::populateGlossary
void populateGlossary()
Definition: project.cpp:201
ProjectBase::kind
QString kind() const
Get Kind.
Definition: projectbase.h:48
Project::showTMManager
void showTMManager()
Definition: project.cpp:240
ProjectBase::branchDir
QString branchDir() const
Get BranchDir.
Definition: projectbase.h:167
Project::sourceLangCode
Q_SCRIPTABLE QString sourceLangCode() const
Definition: project.h:88
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