Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
cmdlineparser.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef CMDLINEPARSER_H
5#define CMDLINEPARSER_H
6
7#include <QtCore/QCoreApplication>
8#include <QtCore/QStringList>
9#include <QtCore/QUrl>
10
12
14{
16public:
17 enum Result {Ok, Help, Error};
20
21 CmdLineParser(const QStringList &arguments);
22 Result parse();
23
24 void setCollectionFile(const QString &file);
25 QString collectionFile() const;
26 bool collectionFileGiven() const;
28 QUrl url() const;
29 bool enableRemoteControl() const;
30 ShowState contents() const;
31 ShowState index() const;
32 ShowState bookmarks() const;
33 ShowState search() const;
34 QString currentFilter() const;
35 bool removeSearchIndex() const;
36 bool rebuildSearchIndex() const;
38 QString helpFile() const;
39
40 void showMessage(const QString &msg, bool error);
41
42private:
43 QString getFileName(const QString &fileName);
44 bool hasMoreArgs() const;
45 const QString &nextArg();
46 void handleCollectionFileOption();
47 void handleShowUrlOption();
48 void handleShowOption();
49 void handleHideOption();
50 void handleActivateOption();
51 void handleShowOrHideOrActivateOption(ShowState state);
52 void handleRegisterOption();
53 void handleUnregisterOption();
54 void handleRegisterOrUnregisterOption(RegisterState state);
55 void handleSetCurrentFilterOption();
56
57 QStringList m_arguments;
58 int m_pos;
59 QString m_collectionFile;
60 QString m_cloneFile;
61 QString m_helpFile;
62 QUrl m_url;
63 bool m_enableRemoteControl;
64
65 ShowState m_contents;
66 ShowState m_index;
67 ShowState m_bookmarks;
68 ShowState m_search;
69 RegisterState m_register;
70 QString m_currentFilter;
71 bool m_removeSearchIndex;
72 bool m_quiet;
73 QString m_error;
74};
75
76QT_END_NAMESPACE
77
78#endif
int main(int argc, char *argv[])
[2]
Definition buffer.cpp:77
RegisterState registerRequest() const
QUrl url() const
ShowState index() const
QString helpFile() const
void showMessage(const QString &msg, bool error)
ShowState contents() const
CmdLineParser(const QStringList &arguments)
QString currentFilter() const
ShowState bookmarks() const
bool rebuildSearchIndex() const
QString collectionFile() const
bool enableRemoteControl() const
void setCollectionFile(const QString &file)
bool collectionFileGiven() const
bool removeSearchIndex() const
ShowState search() const
QString cloneFile() const
static const QByteArray applicationIcon(const QHelpEngineCore &helpEngine)
static void setFullTextSearchFallbackEnabled(QHelpEngineCore &helpEngine, bool on)
static void setDefaultHomePage(QHelpEngineCore &helpEngine, const QString &page)
static bool filterFunctionalityEnabled(const QHelpEngineCore &helpEngine)
static bool isNewer(const QHelpEngineCore &newer, const QHelpEngineCore &older)
static void setLastTabPage(QHelpEngineCore &helpEngine, int lastPage)
static uint creationTime(const QHelpEngineCore &helpEngine)
static bool addressBarVisible(const QHelpEngineCore &helpEngine)
static bool addressBarEnabled(const QHelpEngineCore &helpEngine)
static void setAboutMenuTexts(QHelpEngineCore &helpEngine, const QByteArray &texts)
static void setAddressBarVisible(QHelpEngineCore &helpEngine, bool visible)
static const QString windowTitle(const QHelpEngineCore &helpEngine)
static const QStringList lastZoomFactors(const QHelpEngineCore &helpEngine)
static const QString defaultHomePage(const QHelpEngineCore &helpEngine)
static void setDocumentationManagerEnabled(QHelpEngineCore &helpEngine, bool enabled)
static void setLastShownPages(QHelpEngineCore &helpEngine, const QStringList &lastShownPages)
static void setAboutIcon(QHelpEngineCore &helpEngine, const QByteArray &icon)
static bool documentationManagerEnabled(const QHelpEngineCore &helpEngine)
static void copyConfiguration(const QHelpEngineCore &source, QHelpEngineCore &target)
static void setAboutImages(QHelpEngineCore &helpEngine, const QByteArray &images)
static void setAddressBarEnabled(QHelpEngineCore &helpEngine, bool enabled)
static const QString ListSeparator
static void setAboutTexts(QHelpEngineCore &helpEngine, const QByteArray &texts)
static const QString DefaultZoomFactor
static const QByteArray aboutIcon(const QHelpEngineCore &helpEngine)
static void updateLastRegisterTime(QHelpEngineCore &helpEngine)
static const QByteArray aboutTexts(const QHelpEngineCore &helpEngine)
static int lastTabPage(const QHelpEngineCore &helpEngine)
static bool cacheDirIsRelativeToCollection(const QHelpEngineCore &helpEngine)
static void setApplicationIcon(QHelpEngineCore &helpEngine, const QByteArray &icon)
static void setCreationTime(QHelpEngineCore &helpEngine, uint time)
static void setFilterToolbarVisible(QHelpEngineCore &helpEngine, bool visible)
static const QStringList lastShownPages(const QHelpEngineCore &helpEngine)
static void setWindowTitle(QHelpEngineCore &helpEngine, const QString &windowTitle)
static const QByteArray aboutMenuTexts(const QHelpEngineCore &helpEngine)
static const QByteArray aboutImages(const QHelpEngineCore &helpEngine)
static void setCacheDir(QHelpEngineCore &helpEngine, const QString &cacheDir, bool relativeToCollection)
static void updateLastRegisterTime(QHelpEngineCore &helpEngine, QDateTime dt)
static void setFilterFunctionalityEnabled(QHelpEngineCore &helpEngine, bool enabled)
static bool filterToolbarVisible(const QHelpEngineCore &helpEngine)
static bool fullTextSearchFallbackEnabled(const QHelpEngineCore &helpEngine)
static const QDateTime lastRegisterTime(const QHelpEngineCore &helpEngine)
static const QString cacheDir(const QHelpEngineCore &helpEngine)
static void setLastZoomFactors(QHelpEngineCore &helPEngine, const QStringList &lastZoomFactors)
void setHomePage(const QString &page)
QHelpEngineCore * helpEngine() const
QHelpFilterEngine * filterEngine() const
bool registerDocumentation(const QString &docFile)
void documentationUpdated(const QString &namespaceName)
static HelpEngineWrapper & instance(const QString &collectionFile)
const QString defaultHomePage() const
void setStartOption(int option)
QHelpSearchEngine * searchEngine() const
const QByteArray bookmarks() const
const QStringList lastShownPages() const
void setDefaultHomePage(const QString &page)
static void removeInstance()
const QString homePage() const
bool fullTextSearchFallbackEnabled() const
void setAddressBarEnabled(bool enabled)
QHelpIndexWidget * indexWidget()
bool cacheDirIsRelativeToCollection() const
const QString windowTitle() const
void setLastZoomFactors(const QStringList &lastZoomFactors)
void setFilterFunctionalityEnabled(bool enabled)
void setShowTabs(bool show)
const QStringList qtDocInfo(const QString &component) const
void setBookmarks(const QByteArray &bookmarks)
const QByteArray mainWindow() const
static HelpEngineWrapper & instance()
const QByteArray mainWindowGeometry() const
void setBrowserFont(const QFont &font)
const QByteArray topicChooserGeometry() const
bool addressBarEnabled() const
const QFont browserFont() const
void setAboutMenuTexts(const QByteArray &texts)
void setFilterToolbarVisible(bool visible)
const QByteArray aboutMenuTexts() const
const QString collectionFile() const
void setAppWritingSystem(QFontDatabase::WritingSystem system)
QByteArray fileData(const QUrl &url) const
void setBrowserWritingSystem(QFontDatabase::WritingSystem system)
void setAppFont(const QFont &font)
bool unregisterDocumentation(const QString &namespaceName)
bool addressBarVisible() const
void setAboutIcon(const QByteArray &icon)
void setUseBrowserFont(bool useBrowserFont)
void setCacheDir(const QString &cacheDir, bool relativeToCollection)
bool documentationManagerEnabled() const
QFontDatabase::WritingSystem browserWritingSystem() const
void setApplicationIcon(const QByteArray &icon)
const QStringList registeredDocumentations() const
QHelpContentWidget * contentWidget()
const QByteArray aboutTexts() const
QHelpIndexModel * indexModel() const
void setAboutImages(const QByteArray &images)
void setTopicChooserGeometry(const QByteArray &geometry)
bool filterFunctionalityEnabled() const
void setMainWindowGeometry(const QByteArray &geometry)
void setAboutTexts(const QByteArray &texts)
void setAddressBarVisible(bool visible)
void setLastTabPage(int lastPage)
const QString cacheDir() const
QUrl findFile(const QUrl &url) const
const QStringList lastZoomFactors() const
const QByteArray applicationIcon() const
const QByteArray aboutImages() const
QList< QHelpLink > documentsForIdentifier(const QString &id) const
QFontDatabase::WritingSystem appWritingSystem() const
void setQtDocInfo(const QString &component, const QStringList &doc)
void setDocumentationManagerEnabled(bool enabled)
void setWindowTitle(const QString &windowTitle)
bool filterToolbarVisible() const
const QByteArray aboutIcon() const
void setUseAppFont(bool useAppFont)
QHelpContentModel * contentModel() const
void setLastShownPages(const QStringList &lastShownPages)
void setMainWindow(const QByteArray &mainWindow)
QString documentationFileName(const QString &namespaceName) const
const QFont appFont() const
void closeEvent(QCloseEvent *event) override
[21]
void setIndexString(const QString &str)
~MainWindow() override
void syncContents()
void setBookmarksVisible(bool visible)
static void activateCurrentBrowser()
static QString collectionFileDirectory(bool createDir=false, const QString &cacheDir=QString())
void activateCurrentCentralWidgetTab()
static QString defaultHelpCollectionFileName()
void expandTOC(int depth)
void setIndexVisible(bool visible)
void setSearchVisible(bool visible)
void currentFilterChanged(const QString &filter)
bool usesDefaultCollection() const
@ ShowBlankPage
@ ShowLastPages
@ ShowHomePage
Combined button and popup list for selecting options.
static ExitStatus preliminarySetup(CmdLineParser *cmd)
Definition main.cpp:241
ExitStatus
Definition main.cpp:235
@ ExitSuccess
Definition main.cpp:236
@ ExitFailure
Definition main.cpp:237
@ NoExit
Definition main.cpp:238
#define TRACE_OBJ
Definition tracer.h:34