SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kttsd / libkttsd / utils.h
blob5937403581f6f8526cf16db07e580f1cb4637a32
1 /***************************************************************************
2 Class of utility functions.
3 -------------------
4 Copyright : (C) 2004 Paul Giannaros <ceruleanblaze@gmail.com>
5 -------------------
6 Original author: Paul Giannaros <ceruleanblaze@gmail.com>
7 Current Maintainer: Paul Giannaros <ceruleanblaze@gmail.com>
8 ****************************************************************************/
10 /***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; version 2 of the License. *
15 * *
16 ***************************************************************************/
18 #ifndef UTILS_H
19 #define UTILS_H
21 #include <kdemacros.h>
23 class QString;
24 class KComboBox;
26 class KDE_EXPORT KttsUtils {
28 public:
29 /// Constructor
30 KttsUtils();
31 /// Destructor
32 ~KttsUtils();
34 /**
35 * Check if an XML document has a certain root element.
36 * @param xmldoc The document to check for the element.
37 * @param elementName The element to check for in the document.
38 * @returns true if the root element exists in the document, false otherwise.
40 static bool hasRootElement(const QString &xmldoc, const QString &elementName);
42 /**
43 * Check if an XML document has a certain DOCTYPE.
44 * @param xmldoc The document to check for the doctype.
45 * @param name The doctype name to check for. Pass QString() to not check the name.
46 * @param publicId The public ID to check for. Pass QString() to not check the ID.
47 * @param systemId The system ID to check for. Pass QString() to not check the ID.
48 * @returns true if the parameters match the doctype, false otherwise.
50 static bool hasDoctype(const QString &xmldoc, const QString &name/*, const QString &publicId, const QString &systemId*/);
52 /**
53 * Sets the current item in the given combobox to the item with the given text.
54 * If item with the text not found, does nothing.
56 static void setCbItemFromText(KComboBox* cb, const QString& text);
60 #endif