# HG changeset patch # User William Roberts # Date 1279813013 -3600 # Node ID f378acbc9cfb31555ec560ce52b0bbc7b7a12400 # Parent 730c025d4b779811388cd6c1c0d5526385c28b57# Parent 26ab07a20e1349103861314fe5031724b6ea4595 Catchup to latest Symbian^4 diff -r 730c025d4b77 -r f378acbc9cfb bin/hbthemeindexer_symbian.exe Binary file bin/hbthemeindexer_symbian.exe has changed diff -r 730c025d4b77 -r f378acbc9cfb bin/synchb.py --- a/bin/synchb.py Thu Jul 15 14:03:49 2010 +0100 +++ b/bin/synchb.py Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,8 @@ # Globals # ============================================================================ VERBOSE = False -EXCLUDE = ["hbplugins", "hbservers", "3rdparty", "internal", "tsrc", "debug", "release"] +EXCLUDE = ["hbapps", "hbplugins", "hbservers", "hbtools", "3rdparty", + "internal", "tsrc", "debug", "release", "bwins", "eabi"] COLLECTIONS = {"hbcore": "HbCore", "hbfeedback": "HbFeedback", "hbinput": "HbInput", @@ -87,8 +88,23 @@ except IOError, e: print(e) -def write_header(filepath, include): - write_file(filepath, "#include \"%s\"\n" % include) +def include_directive(header): + return "#include \"%s\"\n" % header.replace("\\", "/") + +def write_header(header, include, path): + filename = os.path.basename(header) + filepath = os.path.join(path, filename) + skip = False + if os.path.exists(filepath): + directive = include_directive(include) + oldsize = os.path.getsize(filepath) + newsize = len(directive) + if oldsize == newsize and directive == read_file(filepath): + skip = True + if not skip: + if VERBOSE: + print("INFO:\t ==> %s" % os.path.basename(filepath)) + write_file(filepath, include_directive(include)) # ============================================================================ # Component @@ -96,8 +112,9 @@ class Component: def __init__(self, name): self.name = name - self.headers = list() - self.privates = list() + self.headers = [] + self.privates = [] + self.restricted = [] def read(self, path): entries = os.listdir(path) @@ -106,51 +123,52 @@ if os.path.isdir(entrypath): self.read(entrypath) elif os.path.isfile(entrypath): - if entry.endswith("_p_p.h"): + if re.match(entry, ".*?_[pr]_[pr]\.h"): continue elif entry.endswith("_p.h"): self.privates.append(entrypath) + elif entry.endswith("_r.h"): + self.restricted.append(entrypath) elif entry.endswith(".h"): self.headers.append(entrypath) def write(self, path): + written = [] if len(self.headers) > 0: self._makedirs(path) - self._write(path, self.headers, True) + written += self._write(path, self.headers, True) + + if len(self.restricted) > 0: + restpath = os.path.join(path, "restricted") + self._makedirs(restpath) + written += self._write(restpath, self.restricted, True) if len(self.privates) > 0: privpath = os.path.join(path, "private") self._makedirs(privpath) - self._write(privpath, self.privates, False) + written += self._write(privpath, self.privates, False) + return written def _write(self, path, headers, convenience): - global VERBOSE - if VERBOSE: - print("INFO: Writing headers to '%s'" % path) + written = [] for header in headers: - filename = os.path.basename(header) - filepath = os.path.join(path, filename) - relpath = os.path.relpath(header, path) - if VERBOSE: - print("INFO:\t ==> %s" % os.path.basename(filepath)) - write_header(filepath, relpath.replace("\\", "/")) + write_header(header, os.path.relpath(header, path), path) + written.append(os.path.join(path, os.path.basename(header))) if convenience: - classes = list() + classes = [] content = read_file(header) - for match in re.finditer("(?:class|namespace)\s+(?:HB_[^_]+_EXPORT\s+)?(Hb\w*)(\s*;)?", content): + for match in re.finditer("(?:class|namespace)\s+(?:HB_[^_]+(?:_RESTRICTED)?_EXPORT\s+)?(Hb\w*)(\s*;)?", content): if not match.group(2): classes.append(match.group(1)) for match in re.finditer("#pragma hb_header\((\w+)\)", content): classes.append(match.group(1)) for cls in classes: - filepath = os.path.join(path, cls) - write_header(filepath, filename) + write_header(cls, os.path.basename(header), path) + written.append(os.path.join(path, cls)) + return written def _makedirs(self, path): - global VERBOSE if not os.path.exists(path): - if VERBOSE: - print("INFO: Creating include dir '%s'" % path) os.makedirs(path) # ============================================================================ @@ -171,25 +189,55 @@ self.components.append(component) def write(self, path): - global COLLECTIONS + global COLLECTIONS, VERBOSE + path = os.path.join(os.path.abspath(path), self.name) + if VERBOSE: + print("INFO: Writing headers to '%s'..." % path) + # there's no set in python 2.3 so use a list + leftovers = [] + for root, dirs, files in os.walk(path): + for file in files: + leftovers.append(os.path.abspath(os.path.join(root, file))) + # include/hbcore - includes = list() - path = os.path.join(path, self.name) + includes = [] + written = [] for component in self.components: - component.write(path) + written += component.write(path) for header in component.headers: includes.append("#include \"%s\"\n" % os.path.basename(header)) + if self.name in COLLECTIONS: - write_file(os.path.join(path, self.name + ".h"), "".join(includes)) - write_header(os.path.join(path, COLLECTIONS[self.name]), self.name + ".h") + collectionheader = os.path.join(path, self.name + ".h") + write_file(collectionheader, "".join(includes)) + written.append(collectionheader) + if collectionheader in leftovers: + leftovers.remove(collectionheader) + convenienceheader = os.path.join(path, COLLECTIONS[self.name]) + write_file(convenienceheader, include_directive(self.name + ".h")) + written.append(convenienceheader) + if convenienceheader in leftovers: + leftovers.remove(convenienceheader) + + for filepath in written: + filepath = os.path.abspath(filepath) + if filepath in leftovers: + leftovers.remove(filepath) + + if VERBOSE and len(leftovers) > 0: + print("INFO: Removing obsolete headers from '%s'..." % path) + for leftover in leftovers: + if VERBOSE: + print("INFO:\t ==> %s" % leftover) # os.path.basename(leftover)) + os.remove(leftover) # ============================================================================ # Package # ============================================================================ class Package: def __init__(self, name): - self.path = name - self.collections = list() + self.name = name + self.collections = [] def read(self, path): global EXCLUDE @@ -228,11 +276,6 @@ if not os.path.basename(os.path.normpath(options.outputdir)) == "include": options.outputdir = os.path.join(options.outputdir, "include") - if os.path.exists(options.outputdir): - if VERBOSE: - print("INFO: Removing include dir '%s'" % options.outputdir) - shutil.rmtree(options.outputdir, ignore_errors=True) - package = Package("hb") package.read(options.inputdir) package.write(options.outputdir) diff -r 730c025d4b77 -r f378acbc9cfb config.tests/all/openvg/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/all/openvg/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,47 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the Config module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include +#include +#include + +#if defined(QT_LOWER_CASE_VG_INCLUDES) +#include +#else +#include +#endif + +Q_DECL_IMPORT VGImage qPixmapToVGImage(const QPixmap &pixmap); // see qpixmapdata_vg.cpp in qt/src/openvg + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + VGPaint paint = vgCreatePaint(); + Q_UNUSED(paint); + QPixmap pm(100, 200); + VGImage img = qPixmapToVGImage(pm); + Q_UNUSED(img); + return 0; +} diff -r 730c025d4b77 -r f378acbc9cfb config.tests/all/openvg/openvg.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/all/openvg/openvg.pro Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,45 @@ +# +############################################################################# +## +## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# +# + +TEMPLATE = app +TARGET = hbconftest_openvg +DEPENDPATH += . +INCLUDEPATH += . +CONFIG += openvg + +# Input +SOURCES += main.cpp + +# OpenVG libraries, the same way hbcore uses them +QT *= openvg +!isEmpty(QMAKE_LIBS_OPENVG) { + LIBS += $$QMAKE_LIBS_OPENVG +} else { + symbian: LIBS += -llibopenvg -llibopenvgu + else:win32-msvc*: LIBS += -llibopenvg + else: LIBS += -lopenvg +} diff -r 730c025d4b77 -r f378acbc9cfb config.tests/maemo/dui/dui.pro --- a/config.tests/maemo/dui/dui.pro Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -# -############################################################################# -## -## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -## All rights reserved. -## Contact: Nokia Corporation (developer.feedback@nokia.com) -## -## This file is part of the UI Extensions for Mobile. -## -## GNU Lesser General Public License Usage -## This file may be used under the terms of the GNU Lesser General Public -## License version 2.1 as published by the Free Software Foundation and -## appearing in the file LICENSE.LGPL included in the packaging of this file. -## Please review the following information to ensure the GNU Lesser General -## Public License version 2.1 requirements will be met: -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## In addition, as a special exception, Nokia gives you certain additional -## rights. These rights are described in the Nokia Qt LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## If you have questions regarding the use of this file, please contact -## Nokia at developer.feedback@nokia.com. -## -############################################################################# -# - -TEMPLATE = app -TARGET = hbconftest_dui -DEPENDPATH += . -INCLUDEPATH += /usr/include/dui /usr/local/include/dui -LIBS += -ldui - -SOURCES += main.cpp diff -r 730c025d4b77 -r f378acbc9cfb config.tests/maemo/dui/main.cpp --- a/config.tests/maemo/dui/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the Config module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include - -int main() -{ - DuiApplication *app = DuiApplication::instance(); - app = 0; -} diff -r 730c025d4b77 -r f378acbc9cfb config.tests/meego/meegotouch/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/meego/meegotouch/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,32 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the Config module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include + +int main() +{ + MApplication *app = MApplication::instance(); + app = 0; +} diff -r 730c025d4b77 -r f378acbc9cfb config.tests/meego/meegotouch/meegotouch.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/meego/meegotouch/meegotouch.pro Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,34 @@ +# +############################################################################# +## +## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# +# + +TEMPLATE = app +TARGET = hbconftest_meegotouch +DEPENDPATH += . +INCLUDEPATH += /usr/include/meegotouch /usr/local/include/meegotouch +LIBS += -lmeegotouchcore -lmeegotouchextensions -lmeegotouchsettings -lmeegotouchviews + +SOURCES += main.cpp diff -r 730c025d4b77 -r f378acbc9cfb config.tests/symbian/sgimagelite/main.cpp --- a/config.tests/symbian/sgimagelite/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/config.tests/symbian/sgimagelite/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,11 +24,9 @@ ****************************************************************************/ #include -#include #ifndef VSW_GSW_SGIMAGELITE #error VSW_GSW_SGIMAGELITE not defined #endif -int main() { return 0;} - +int main() { } diff -r 730c025d4b77 -r f378acbc9cfb config.tests/symbian/sgimagelite/sgimagelite.pro --- a/config.tests/symbian/sgimagelite/sgimagelite.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/config.tests/symbian/sgimagelite/sgimagelite.pro Thu Jul 22 16:36:53 2010 +0100 @@ -30,6 +30,8 @@ DEPENDPATH += . INCLUDEPATH += . CONFIG -= qt +CONFIG += no_icon +QMAKE_LIBS = -llibc -llibm -leuser -llibdl #INCLUDEPATH += $${EPOCROOT}epoc32/include # Input diff -r 730c025d4b77 -r f378acbc9cfb config.tests/symbian/tchunkcreateinfo/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/symbian/tchunkcreateinfo/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,31 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the Config module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include + +int main() { + TChunkCreateInfo info; + info.SetReadOnly(); +} diff -r 730c025d4b77 -r f378acbc9cfb config.tests/symbian/tchunkcreateinfo/tchunkcreateinfo.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/symbian/tchunkcreateinfo/tchunkcreateinfo.pro Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,36 @@ +# +############################################################################# +## +## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# +# + +TEMPLATE = app +TARGET = hbconftest_tchunkcreateinfo +DEPENDPATH += . +INCLUDEPATH += . +CONFIG -= qt +#INCLUDEPATH += $${EPOCROOT}epoc32/include + +# Input +SOURCES += main.cpp diff -r 730c025d4b77 -r f378acbc9cfb config.tests/symbian/touchfeedback/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/symbian/touchfeedback/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,30 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the Config module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include + +int main() { + return !ETouchFeedbackLongPress; +} diff -r 730c025d4b77 -r f378acbc9cfb config.tests/symbian/touchfeedback/touchfeedback.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/config.tests/symbian/touchfeedback/touchfeedback.pro Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,38 @@ +# +############################################################################# +## +## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# +# + +TEMPLATE = app +TARGET = hbconftest_touchfeedback +DEPENDPATH += . +INCLUDEPATH += $${EPOCROOT}epoc32/include/platform/mw \ + $${EPOCROOT}epoc32/include/platform +CONFIG -= qt +CONFIG += no_icon +QMAKE_LIBS = -llibc -llibm -leuser -llibdl + +# Input +SOURCES += main.cpp diff -r 730c025d4b77 -r f378acbc9cfb config.tests/unix/sharedmemory/main.cpp --- a/config.tests/unix/sharedmemory/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/config.tests/unix/sharedmemory/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,9 +33,13 @@ { QCoreApplication app(argc, argv); QSharedMemory sharedMemory("hbconftest_sharedmemory"); - if (!sharedMemory.create(CACHE_SIZE, QSharedMemory::ReadWrite)) { - qWarning() << sharedMemory.errorString(); - return EXIT_FAILURE; + if (sharedMemory.create(CACHE_SIZE)) { + bool attach = sharedMemory.attach(); + Q_UNUSED(attach); + if (sharedMemory.isAttached()) { + return EXIT_SUCCESS; + } } - return EXIT_SUCCESS; + qWarning() << sharedMemory.error() << sharedMemory.errorString(); + return EXIT_FAILURE; } diff -r 730c025d4b77 -r f378acbc9cfb config.tests/unix/sharedmemory/sharedmemory.pro --- a/config.tests/unix/sharedmemory/sharedmemory.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/config.tests/unix/sharedmemory/sharedmemory.pro Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,7 @@ TEMPLATE = app TARGET = hbconftest_sharedmemory +isEmpty(HB_SOURCE_DIR):error(HB_SOURCE_DIR not defined!!!) DEPENDPATH += . $${HB_SOURCE_DIR}/src/hbcore/core INCLUDEPATH += . $${HB_SOURCE_DIR}/src/hbcore/core DEFINES += HB_BOOTSTRAPPED diff -r 730c025d4b77 -r f378acbc9cfb configure.py --- a/configure.py Thu Jul 15 14:03:49 2010 +0100 +++ b/configure.py Thu Jul 22 16:36:53 2010 +0100 @@ -45,6 +45,10 @@ HB_MAKE_PARTS = [ "tutorials" ] HB_NOMAKE_PARTS = [ "tests", "performance", "localization" ] +QMAKE = None +MAKE = None +BUILDENV = None + # ============================================================================ # Utils # ============================================================================ @@ -61,11 +65,37 @@ if not part in HB_NOMAKE_PARTS: HB_NOMAKE_PARTS.append(part) +def run_system(args, cwd=None): + old_epocroot = None + env = os.environ.copy() + if "EPOCROOT" in env: + epocroot = env.get("EPOCROOT") + if not (epocroot.endswith("\\") or epocroot.endswith("/")): + os.putenv("EPOCROOT", "%s/" % epocroot) + old_epocroot = epocroot + + if type(args) is list: + args = " ".join(args) + result = os.system(args) + + if old_epocroot != None: + os.putenv("EPOCROOT", old_epocroot) + + return result + def run_process(args, cwd=None): code = 0 output = "" + + env = os.environ.copy() + if "EPOCROOT" in env: + epocroot = env.get("EPOCROOT") + if not (epocroot.endswith("\\") or epocroot.endswith("/")): + env["EPOCROOT"] = "%s/" % epocroot + if os.name == "nt": args = ["cmd.exe", "/C"] + args + try: if cwd != None: oldcwd = os.getcwd() @@ -75,10 +105,11 @@ code = process.wait() output = process.fromchild.read() else: - process = subprocess.Popen(args, stderr=subprocess.PIPE, stdout=subprocess.PIPE) + process = subprocess.Popen(args, env=env, stderr=subprocess.PIPE, stdout=subprocess.PIPE) (stdout, stderr) = process.communicate() code = process.returncode output = stdout + stderr + if cwd != None: os.chdir(oldcwd) except: @@ -95,6 +126,19 @@ print(e) return content +def write_file(filepath, content): + try: + path = os.path.split(filepath)[0] + if not os.path.exists(path): + os.makedirs(path) + file = open(filepath, "w") + file.write(content) + file.close() + except Exception, e: + print(e) + return False + return True + def grep(path, pattern, include = [], exclude = []): result = {} expr = re.compile(pattern) @@ -121,19 +165,19 @@ # OptionParser # ============================================================================ class OptionParser(optparse.OptionParser): - def __init__(self, platform, make, prefix): + def __init__(self): optparse.OptionParser.__init__(self, formatter=optparse.TitledHelpFormatter()) self.add_option("-v", "--verbose", action="store_true", dest="verbose", help="Print verbose information during the configure.") self.set_defaults(verbose=False) - if platform != "symbian": + if QMAKE.platform() != "symbian": group = optparse.OptionGroup(self, "Installation options") group.add_option("--prefix", dest="prefix", metavar="dir", help="Install everything relative to . The default value is '%s'. " "NOTE: Use '--prefix .' to configure a local setup. A local " "setup will install nothing else than the qmake " - "feature file." % prefix) + "feature file." % BUILDENV.default_prefix()) group.add_option("--bin-dir", dest="bindir", metavar="dir", help="Install executables to . The default value is 'PREFIX/bin'.") group.add_option("--lib-dir", dest="libdir", metavar="dir", @@ -144,19 +188,19 @@ help="Install headers to . The default value is 'PREFIX/include'.") group.add_option("--plugin-dir", dest="plugindir", metavar="dir", help="Install plugins to . The default value is 'PREFIX/plugins'.") - group.add_option("--resource-dir", dest="resourcedir", metavar="dir", + group.add_option("--features-dir", dest="featuresdir", metavar="dir", + help="Install qmake feature files to . The default value is 'QTDIR/mkspecs/features'.") + group.add_option("--resources-dir", dest="resourcesdir", metavar="dir", help="Install resources to . The default value is 'PREFIX/resources'.") - group.add_option("--feature-dir", dest="featuredir", metavar="dir", - help="Install qmake feature files to . The default value is 'QTDIR/mkspecs/features'.") self.add_option_group(group) self.set_defaults(prefix=None) self.set_defaults(bindir=None) self.set_defaults(libdir=None) self.set_defaults(docdir=None) self.set_defaults(includedir=None) - self.set_defaults(plugindir=None) - self.set_defaults(resourcedir=None) - self.set_defaults(featuredir=None) + self.set_defaults(pluginsdir=None) + self.set_defaults(featuresdir=None) + self.set_defaults(resourcesdir=None) group = optparse.OptionGroup(self, "Configure options") group.add_option("--platform", dest="platform", metavar="platform", @@ -166,7 +210,7 @@ group.add_option("--make-bin", dest="makebin", metavar="path", help="Specify the make tool (make, nmake, mingw32-make, gmake...). " "The one detected in PATH is used by default if not specified.") - if platform == "win32" and make == "nmake": + if QMAKE.platform() == "win32" and MAKE.bin() == "nmake": group.add_option("--msvc", action="store_true", dest="msvc", help="Generate a MSVC solution.") group.add_option("--release", action="store_const", dest="config", const="release", @@ -179,7 +223,7 @@ help="Do not suppress debug and warning output (suppressed by default in release mode).") group.add_option("--no-debug-output", action="store_true", dest="no_debug_output", help="Suppress debug and warning output (not supporessed by default in debug mode).") - if platform != "symbian": + if QMAKE.platform() != "symbian": group.add_option("--silent", action="store_true", dest="silent", help="Suppress verbose compiler output.") group.add_option("--fast", action="store_true", dest="fast", @@ -192,6 +236,12 @@ group.add_option("--defines", dest="defines", metavar="defines", help="Define compiler macros for selecting features " "and debugging purposes eg. --defines HB_FOO_DEBUG,HB_BAR_ENABLED") + if QMAKE.platform() == "unix": + group.add_option("--rpath", action="store_true", dest="rpath", + help="Link Hb libraries and executables using the library install " + "path as a runtime library path.") + group.add_option("--no-rpath", action="store_false", dest="rpath", + help="Do not use the library install path as a runtime library path.") self.add_option_group(group) self.set_defaults(platform=None) self.set_defaults(makebin=None) @@ -200,12 +250,14 @@ self.set_defaults(silent=False) self.set_defaults(fast=False) self.set_defaults(defines=None) + self.set_defaults(rpath=None) group = optparse.OptionGroup(self, "Host options") group.add_option("--host-qmake-bin", dest="hostqmakebin", metavar="path", help="Specify the host qmake tool.") group.add_option("--host-make-bin", dest="hostmakebin", metavar="path", help="Specify the host make tool (make, nmake, mingw32-make, gmake...).") + self.add_option_group(group) self.set_defaults(hostqmakebin=None) self.set_defaults(hostmakebin=None) @@ -219,8 +271,6 @@ help="Additional qmake options " "eg. --qmake-options \"CONFIG+=foo DEFINES+=BAR\".") self.add_option_group(group) - self.set_defaults(qmakebin=None) - self.set_defaults(qmakespec=None) self.set_defaults(qmakeopt=None) group = optparse.OptionGroup(self, "Feature options") @@ -234,198 +284,301 @@ help="Do not build gestures.") group.add_option("--no-text-measurement", action="store_false", dest="textMeasurement", help="Do not build text measurement support (needed for localization).") - group.add_option("--no-inputs", action="store_false", dest="inputs", - help="DEPRECATED: Use --nomake hbinput.") - group.add_option("--no-feedback", action="store_false", dest="feedback", - help="DEPRECATED: Use --nomake hbfeedback.") - group.add_option("--no-tutorials", action="store_false", dest="tutorials", - help="DEPRECATED: Use --nomake tutorials.") self.add_option_group(group) self.set_defaults(make=None) self.set_defaults(nomake=None) self.set_defaults(effects=True) self.set_defaults(gestures=True) self.set_defaults(textMeasurement=True) - self.set_defaults(inputs=None) - self.set_defaults(feedback=None) - self.set_defaults(tutorials=None) group = optparse.OptionGroup(self, "Qt options") group.add_option("--qt-mobility", action="store_true", dest="qtmobility", help="Assumes that Qt Mobility is available without performing a compilation test.") group.add_option("--no-qt-mobility", action="store_false", dest="qtmobility", help="Assumes that Qt Mobility is not available without performing a compilation test.") - group.add_option("--qt-animation", action="store_true", dest="qtanimation", - help="DEPRECATED: Qt 4.6 includes the animation framework.") - group.add_option("--no-qt-animation", action="store_false", dest="qtanimation", - help="DEPRECATED: Qt 4.6 includes the animation framework.") - group.add_option("--qt-gestures", action="store_true", dest="qtgestures", - help="DEPRECATED: Qt 4.6 includes the gestures framework.") - group.add_option("--no-qt-gestures", action="store_false", dest="qtgestures", - help="DEPRECATED: Qt 4.6 includes the gestures framework.") - if platform == "symbian" or platform == None: - group.add_option("--qt-symbian-eventfilter", action="store_false", dest="s60eventfilter", - help="DEPRECATED: Qt 4.6 includes QApplication::symbianEventFilter().") - group.add_option("--qt-s60-eventfilter", action="store_true", dest="s60eventfilter", - help="DEPRECATED: Qt 4.6 includes QApplication::symbianEventFilter().") - group.add_option("--dui", action="store_true", dest="dui", - help="Assumes that Maemo Direct UI is available without performing a compilation test.") - group.add_option("--no-dui", action="store_false", dest="dui", - help="Assumes that Maemo Direct UI is not available without performing a compilation test.") + group.add_option("--meegotouch", action="store_true", dest="meegotouch", + help="Assumes that MeeGoTouch UI is available without performing a compilation test.") + group.add_option("--no-meegotouch", action="store_false", dest="meegotouch", + help="Assumes that MeeGoTouch UI is not available without performing a compilation test.") + group.add_option("--qt-openvg", action="store_true", dest="qtopenvg", + help="Assumes that OpenVG is available without performing a compilation test.") + group.add_option("--no-qt-openvg", action="store_false", dest="qtopenvg", + help="Assumes that OpenVG is not available without performing a compilation test.") self.add_option_group(group) self.set_defaults(qtmobility=None) - self.set_defaults(qtanimation=None) - self.set_defaults(qtgestures=None) - self.set_defaults(qts60eventfilter=None) + self.set_defaults(qtopenvg=None) group = optparse.OptionGroup(self, "Developer options") group.add_option("--developer", action="store_true", dest="developer", - help="Enables the developer mode ie. builds tests and exports necessary symbols. " - "NOTE: The developer mode implies a local setup by default.") - if platform != "symbian": + help="Enables the developer mode. The developer mode implies " + "a local setup, enables tests and exports extra symbols for " + "testing purposes. NOTE: this is equal to: --prefix . --make tests " + "--developer-export") + group.add_option("--developer-export", action="store_true", dest="developerexport", + help="Enables developer exports ie. extra symbols for testing purposes.") + if QMAKE.platform() != "symbian": group.add_option("--coverage", action="store_true", dest="coverage", help="Builds with test coverage measurement support. " "This implies the developer mode.") - group.add_option("--tests", action="store_true", dest="tests", - help="DEPRECATED: Use --make tests.") - group.add_option("--performance", action="store_true", dest="performance", - help="DEPRECATED: Use --make performance.") - group.add_option("--localization", action="store_true", dest="localization", - help="DEPRECATED: Use --make localization.") self.add_option_group(group) self.set_defaults(developer=False) + self.set_defaults(developerexport=None) self.set_defaults(coverage=False) - self.set_defaults(tests=None) - self.set_defaults(performance=None) - self.set_defaults(localization=None) # ============================================================================ -# Platform +# Make # ============================================================================ -class Platform: - def __init__(self, qmake): +class Make: + def __init__(self): + self._bin = None + + def init(self, cmdline): + match = re.search("--make-bin[=\s](\S+)", cmdline) + if match: + self._bin = match.group(1) + else: + self._bin = self._detect_make() + + def command(self, target=None): + _args = [self._bin] + if target: + _args += [target] + return _args + + def bin(self): + return self._bin + + def _detect_make(self): + if QMAKE.platform() == "win32" and self._test_make("nmake", "/?"): + return "nmake" + if self._test_make("make", "-v"): + return "make" + if self._test_make("gmake", "-v"): + return "gmake" + if QMAKE.platform() == "win32" and self._test_make("mingw32-make", "-v"): + return "mingw32-make" + return "make" + + def _test_make(self, command, param): + try: + return run_process([command, param])[0] == 0 + except: + return False + +# ============================================================================ +# QMake +# ============================================================================ +class QMake: + def __init__(self): + self._bin = "qmake" self._platform = None - self._make = None self._error = None - self._qmake = qmake self._spec = None - self._version = None self._features = None self._qtdir = None + self._qtversion = None + self._args = [] - def name(self): - if not self._platform: - self._detect_qt() + def init(self, cmdline): + match = re.search("--qmake-bin[=\s](\S+)", cmdline) + if match: + self._bin = match.group(1) + match = re.search("--platform[=\s](\S+)", cmdline) + if match: + self._platform = match.group(1) + match = re.search("--qmake-spec[=\s](\S+)", cmdline) + if match: + self._spec = match.group(1) + return self._run_qmake() + + def command(self, profile=None): + _args = [self._bin] + if self._spec: + _args += ["-spec", self._spec] + if len(self._args): + _args += self._args + if profile: + _args += [profile] + return _args + + def add_args(self, args): + self._args += args + + def platform(self): return self._platform - def make(self): - if not self._make: - self._make = self._detect_make() - return self._make - - def qmake(self): - if not self._qmake: - self._detect_qt() - return self._qmake + def bin(self): + return self._bin def error(self): return self._error def spec(self): - if not self._spec: - self._detect_qt() return self._spec - def version(self): - if not self._version: - self._detect_qt() - return self._version - def features(self): - if not self._features: - self._detect_qt() return self._features def qtdir(self): - if not self._qtdir: - self._detect_qt() return self._qtdir - def _detect_qt(self): - lines = list() - lines.append("symbian:message(platform:symbian)\n") - lines.append("else:macx:message(platform:macx)\n") - lines.append("else:unix:message(platform:unix)\n") - lines.append("else:win32:message(platform:win32)\n") - - lines.append("message(version:$$[QT_VERSION])\n") - lines.append("message(libraries:$$[QT_INSTALL_LIBS])\n") - lines.append("message(features:$$[QMAKE_MKSPECS]/features)\n") + def qtversion(self): + return self._qtversion - try: - if not os.path.exists("tmp"): - os.makedirs("tmp") - fd, filepath = tempfile.mkstemp(dir="tmp", text=True, suffix=".pro") - file = os.fdopen(fd, "w+") - file.writelines(lines) - file.close() - except Exception, e: - print(e) - self._error = "Unable to write a temporary file. Make sure to configure in a writable directory." - return + def _run_qmake(self): + # write .pro + content = """ + symbian:message(platform:symbian) + symbian:message(platform:symbian) + else:macx:message(platform:macx) + else:unix:message(platform:unix) + else:win32:message(platform:win32) + message(features:$$[QMAKE_MKSPECS]/features) + message(qtversion:$$[QT_VERSION]) + message(qtdir:$$[QT_INSTALL_LIBS]) + """ + if not write_file("tmp/qmake.pro", content): + self._error = "Unable to write 'tmp/qmake.pro'. Make sure to configure in a writable directory." + return False - # do not use .qmake.cache when detecting the platform - args = [self._qmake, "-nocache", os.path.split(filepath)[1]] + # run qmake + args = [self._bin, "-nocache", "qmake.pro"] if self._spec: args += ["-spec", self._spec] (code, output) = run_process(args, "tmp") + + # cleanup & check return shutil.rmtree("tmp", ignore_errors=True) if code != 0: - self._error = "Unable to execute %s" % self._qmake - if self._qmake == "qmake": + self._error = "Unable to execute %s" % self._bin + if self._bin == "qmake": self._error += ". Add qmake to PATH or pass --qmake-bin ." + return False + # parse output try: - self._platform = re.search("Project MESSAGE: platform:(\S+)", output).group(1) - self._version = re.search("Project MESSAGE: version:(\S+)", output).group(1) - self._qtdir = re.search("Project MESSAGE: libraries:(\S+)", output).group(1) + if not self._platform: + self._platform = re.search("Project MESSAGE: platform:(\S+)", output).group(1) self._features = re.search("Project MESSAGE: features:(\S+)", output).group(1) + self._qtversion = re.search("Project MESSAGE: qtversion:(\S+)", output).group(1) + self._qtdir = re.search("Project MESSAGE: qtdir:(\S+)", output).group(1) except: self._error = "Unable to parse qmake output (%s)" % output.strip() if output.find("QMAKESPEC") != -1: self._error += ". Set QMAKESPEC environment variable or pass --qmake-spec ." - return None + return False + return True + +# ============================================================================ +# BuildEnvironment +# ============================================================================ +class BuildEnvironment: + def __init__(self): + self._blddir = os.path.abspath(os.getcwd()) + self._srcdir = os.path.abspath(sys.path[0]) + self._prefix = None + self._bindir = None + self._libdir = None + self._docdir = None + self._includedir = None + self._pluginsdir = None + self._featuresdir = None + self._resourcesdir = None + + def init(self, options): + # prefix + if options.prefix: + # explicit + self._prefix = options.prefix + elif options.developer: + # developer mode implies a "local" build + self._prefix = self._blddir + else: + # fall back to default + self._prefix = self.default_prefix() + if QMAKE.platform() != "symbian": + self._prefix = os.path.abspath(self._prefix) + + self._bindir = self._dir_option(options.bindir, self._prefix + "/bin") + self._libdir = self._dir_option(options.libdir, self._prefix + "/lib") + self._docdir = self._dir_option(options.docdir, self._prefix + "/doc") + self._includedir = self._dir_option(options.includedir, self._prefix + "/include") + self._pluginsdir = self._dir_option(options.pluginsdir, self._prefix + "/plugins") + self._featuresdir = self._dir_option(options.featuresdir, QMAKE.features()) + self._resourcesdir = self._dir_option(options.resourcesdir, self._prefix + "/resources") + + # symbian specific adjustments + if QMAKE.platform() == "symbian": + # TODO: fix to "$${EPOCROOT}resource/hb/plugins" + self._pluginsdir = "$${EPOCROOT}resource/qt/plugins/hb" + + if not options.developer: + if os.path.isdir("/s60"): + self._includedir = self._prefix + "/include/hb" + else: + self._includedir = self._prefix + "/include/mw/hb" - def _detect_make(self): - if self.name() == "win32" and Platform._test_make("nmake", "/?"): - return "nmake" - if Platform._test_make("make", "-v"): - return "make" - if Platform._test_make("gmake", "-v"): - return "gmake" - if self.name() == "win32" and Platform._test_make("mingw32-make", "-v"): - return "mingw32-make" - return "(n)make" + def builddir(self): + return self._blddir + + def sourcedir(self): + return self._srcdir + + def prefix(self): + return self._prefix + + def bindir(self): + return self._bindir + + def libdir(self): + return self._libdir + + def docdir(self): + return self._docdir + + def includedir(self): + return self._includedir + + def pluginsdir(self): + return self._pluginsdir + + def featuresdir(self): + return self._featuresdir - def _test_make(command, param): - try: - return run_process([command, param])[0] == 0 - except: - return False + def resourcesdir(self): + return self._resourcesdir + + def exportdir(self, category=None): + if os.path.isdir("/s60"): + if category: + return "hb/%1/" + category + "/%2" + return "hb/%1/%2" + else: + if category: + return "$${EPOCROOT}epoc32/include/mw/hb/%1/" + category + "/%2" + return "$${EPOCROOT}epoc32/include/mw/hb/%1/%2" - _test_make = staticmethod(_test_make) + def default_prefix(self): + prefixes = { "symbian" : "$${EPOCROOT}epoc32", + "unix" : "/usr/local/hb", + "macx" : "/usr/local/hb", + "win32" : "C:/hb" } + return prefixes.get(QMAKE.platform(), self._blddir) + + def local(self): + prefix = self.prefix() + return os.path.isdir(prefix) and (prefix == self._blddir) + + def _dir_option(self, explicit, default): + if explicit: + return explicit + return default # ============================================================================ # ConfigTest # ============================================================================ class ConfigTest: - def __init__(self, platform): - self._make = platform.make() - self._qmake = platform.qmake() - self._platform = platform.name() - self._spec = platform.spec() - - def setup(self, sourcedir, builddir): + def __init__(self, sourcedir=os.getcwd(), builddir=os.getcwd()): self._sourcedir = sourcedir self._builddir = builddir @@ -444,14 +597,11 @@ os.chdir(builddir) # run qmake & make - args = [self._qmake, filepath] - if self._spec: - args += ["-spec", self._spec] - run_process(args) - (code, output) = run_process([self._make]) + run_process(QMAKE.command(filepath)) + (code, output) = run_process(MAKE.command()) # make return value is not reliable - if self._platform == "symbian": + if QMAKE.platform() == "symbian": # on symbian, check that no error patterns such as '***' can be found from build output patterns = ["\\*\\*\\*", "Errors caused tool to abort"] for pattern in patterns: @@ -459,14 +609,19 @@ code = -1 else: # on other platforms, check that the resulting executable exists - executable = os.path.join(builddir, "hbconftest_" + basename) if os.name == "nt": - executable.append(".exe") - if not os.path.exists(executable) or not os.access(executable, os.X_OK): - code = -1 + executable = os.path.join(os.path.join(builddir, "debug"), "hbconftest_" + basename + ".exe") + if not os.path.exists(executable) or not os.access(executable, os.X_OK): + executable = os.path.join(os.path.join(builddir, "release"), "hbconftest_" + basename + ".exe") + if not os.path.exists(executable) or not os.access(executable, os.X_OK): + code = -1 + else: + executable = os.path.join(builddir, "hbconftest_" + basename) + if not os.path.exists(executable) or not os.access(executable, os.X_OK): + code = -1 # clean - run_process([self._make, "clean"]) + run_process(MAKE.command("clean")) except: code = -1 @@ -511,210 +666,96 @@ # main() # ============================================================================ def main(): - global HB_MAKE_PARTS, HB_NOMAKE_PARTS - - qmake = "qmake" - cmdline = " ".join(sys.argv[1:]) - match = re.search("--qmake-bin[=\s](\S+)", cmdline) - if match: - qmake = match.group(1) - - # detect platform - platform = Platform(qmake) - match = re.search("--platform[=\s](\S+)", cmdline) - if match: - platform._platform = match.group(1) - - match = re.search("--qmake-spec[=\s](\S+)", cmdline) - if match: - platform._spec = match.group(1) + global QMAKE, MAKE, BUILDENV, HB_MAKE_PARTS, HB_NOMAKE_PARTS help = False + cmdline = " ".join(sys.argv[1:]) match = re.search("--help\s*", cmdline) if match or re.search("-h\s*", cmdline): help = True - if not help and not platform.name(): - print("ERROR: %s" % platform.error()) - return + QMAKE = QMake() + QMAKE.init(cmdline) - # detect make - match = re.search("--make-bin[=\s](\S+)", cmdline) - if match: - platform._make = match.group(1) - if not platform.make(): - print("ERROR: %s" % platform.error()) + if not help and not QMAKE.platform(): + print("ERROR: %s" % QMAKE.error()) return - currentdir = os.path.abspath(os.getcwd()) - sourcedir = os.path.abspath(sys.path[0]) + MAKE = Make() + MAKE.init(cmdline) - # default prefixes - prefixes = { "symbian" : "$${EPOCROOT}epoc32", - "unix" : "/usr/local/hb", - "macx" : "/usr/local/hb", - "win32" : "C:/hb" } + BUILDENV = BuildEnvironment() # parse command line options - parser = OptionParser(platform.name(), platform.make(), prefixes.get(platform.name(), currentdir)) + parser = OptionParser() (options, args) = parser.parse_args() + BUILDENV.init(options) + # coverage implies developer mode if options.coverage: options.developer = True - print("Configuring Hb...") - print("INFO: Platform: %s" % platform.name()) - print("INFO: Make: %s" % platform.make()) - print("INFO: Qt: %s in %s" % (platform.version(), platform.qtdir())) - - # warn about deprecated options - if options.qtanimation != None: - print("WARNING: --qt-animation and --qt-no-animation are DEPRECATED. Qt 4.6 includes the animation framework.") - if options.qtgestures != None: - print("WARNING: --qt-gestures and --qt-no-gestures are DEPRECATED. Qt 4.6 includes the gestures framework.") - if options.qts60eventfilter != None: - print("WARNING: --qt-symbian-eventfilter and --qt-s60-eventfilter are DEPRECATED. Qt 4.6 includes QApplication::symbianEventFilter().") - if options.inputs != None: - print("WARNING: --no-inputs is DEPRECATED. Use --nomake hbinput.") - add_remove_part("hbinput", options.inputs) - if options.feedback != None: - print("WARNING: --no-feedback is DEPRECATED. Use --nomake hbfeedback.") - add_remove_part("hbfeedback", options.feedback) - if options.tutorials != None: - print("WARNING: --no-tutorials is DEPRECATED. Use --nomake tutorials.") - add_remove_part("tutorials", options.tutorials) - if options.tests != None: - print("WARNING: --tests is DEPRECATED. Use --make tests.") - add_remove_part("tests", options.tests) - if options.performance != None: - print("WARNING: --performance is DEPRECATED. Use --make performance.") - add_remove_part("performance", options.performance) - if options.localization != None: - print("WARNING: --localization is DEPRECATED. Use --make localization.") - add_remove_part("localization", options.localization) + # developer mode implies tests, including perf & loc + if options.developer: + add_remove_part("tests", True) + add_remove_part("performance", True) + add_remove_part("localization", True) - # sort out directories - if not options.prefix: - # developer mode implies local setup - if options.developer: - options.prefix = currentdir - else: - options.prefix = prefixes.get(platform.name(), currentdir) - basedir = options.prefix - if platform.name() != "symbian": - basedir = os.path.abspath(basedir) - - local = os.path.isdir(basedir) and (basedir == currentdir) + # developer mode implies developer exports + if options.developer: + options.developerexport = True - # generate local build wrapper headers - synchb = "bin/synchb.py" - if options.verbose: - synchb = "%s -v" % synchb - print("INFO: Running %s" % synchb) - os.system("python %s/%s -i %s -o %s" % (sourcedir, synchb, sourcedir, currentdir)) - - # generate a qrc for resources - args = [os.path.join(sourcedir, "bin/resourcifier.py")] - args += ["-i", "%s" % os.path.join(sys.path[0], "src/hbcore/resources")] - # TODO: make it currentdir - args += ["-o", "%s" % os.path.join(sourcedir, "src/hbcore/resources/resources.qrc")] - args += ["--exclude", "\"*distribution.policy.s60\""] - args += ["--exclude", "\"*readme.txt\""] - args += ["--exclude", "\"*.pr?\""] - args += ["--exclude", "\"*.qrc\""] - args += ["--exclude", "\"*~\""] - args += ["--exclude", "variant/*"] - if options.verbose: - print("INFO: Running %s" % " ".join(args)) - os.system("python %s" % " ".join(args)) + print("Configuring Hb...") + print("INFO: Platform: %s" % QMAKE.platform()) + print("INFO: Make: %s" % MAKE.bin()) + print("INFO: Qt: %s in %s" % (QMAKE.qtversion(), QMAKE.qtdir())) # compilation tests to detect available features config = ConfigFile() - test = ConfigTest(platform) - test.setup(sourcedir, currentdir) + test = ConfigTest(BUILDENV.sourcedir(), BUILDENV.builddir()) print("\nDetecting available features...") if options.qtmobility == None: options.qtmobility = test.compile("config.tests/all/mobility") if options.qtmobility: config.add_value("DEFINES", "HB_HAVE_QT_MOBILITY") print("INFO: Qt Mobility:\t\t\t%s" % options.qtmobility) - if platform.name() == "symbian": + if options.qtopenvg == None: + options.qtopenvg = test.compile("config.tests/all/openvg") + if options.qtopenvg: + config.add_value("DEFINES", "HB_EFFECTS_OPENVG") + config.add_value("DEFINES", "HB_FILTER_EFFECTS") + print("INFO: OpenVG:\t\t\t\t%s" % options.qtopenvg) + if QMAKE.platform() == "symbian": sgimagelite_result = test.compile("config.tests/symbian/sgimagelite") if sgimagelite_result: config.add_value("CONFIG", "sgimage") print("INFO: SgImage-Lite:\t\t\t%s" % sgimagelite_result) - if options.dui == None: - options.dui = test.compile("config.tests/maemo/dui") - if options.dui: - config.add_value("CONFIG", "hb_maemo_dui") - config.add_value("DEFINES", "HB_MAEMO_DUI") - print("INFO: Direct UI:\t\t\t%s" % options.dui) + tchunkcreateinfo_result = test.compile("config.tests/symbian/tchunkcreateinfo") + if tchunkcreateinfo_result: + config.add_value("DEFINES", "HB_HAVE_PROTECTED_CHUNK") + touchfeedback_result = test.compile("config.tests/symbian/touchfeedback") + if touchfeedback_result: + config.add_value("DEFINES", "HB_TOUCHFEEDBACK_TYPE_IS_LONGPRESS") + print("INFO: ETouchFeedbackLongPress:\t\t%s" % touchfeedback_result) + if options.meegotouch == None: + options.meegotouch = test.compile("config.tests/meego/meegotouch") + if options.meegotouch: + config.add_value("CONFIG", "hb_meegotouch") + config.add_value("DEFINES", "HB_MEEGOTOUCH") + print("INFO: MeeGo Touch:\t\t\t%s" % options.meegotouch) - # directories - if options.bindir == None: - # TODO: symbian - options.bindir = basedir + "/bin" - if options.libdir == None: - # TODO: symbian - options.libdir = basedir + "/lib" - if options.docdir == None: - # TODO: symbian - options.docdir = basedir + "/doc" - if options.includedir == None: - if platform.name() == "symbian" and not options.developer: - if os.path.isdir("/s60"): - options.includedir = basedir + "/include/hb" - else: - options.includedir = basedir + "/include/mw/hb" - else: - options.includedir = basedir + "/include" - if options.plugindir == None: - if platform.name() == "symbian": - # TODO: fix to "$${EPOCROOT}resource/hb/plugins" - options.plugindir = "$${EPOCROOT}resource/qt/plugins/hb" - else: - options.plugindir = basedir + "/plugins" - if options.featuredir == None: - options.featuredir = platform.features() - if options.resourcedir == None: - # TODO: fix this, some components want to write resources... - # thus, cannot point to the source tree! - if not local: - options.resourcedir = basedir + "/resources" - else: - options.resourcedir = sourcedir + "/src/hbcore/resources" - - config.set_value("HB_INSTALL_DIR", ConfigFile.format_dir(basedir)) - config.set_value("HB_BIN_DIR", ConfigFile.format_dir(options.bindir)) - config.set_value("HB_LIB_DIR", ConfigFile.format_dir(options.libdir)) - config.set_value("HB_DOC_DIR", ConfigFile.format_dir(options.docdir)) - config.set_value("HB_INCLUDE_DIR", ConfigFile.format_dir(options.includedir)) - config.set_value("HB_PLUGINS_DIR", ConfigFile.format_dir(options.plugindir)) - config.set_value("HB_RESOURCES_DIR", ConfigFile.format_dir(options.resourcedir)) - config.set_value("HB_FEATURES_DIR", ConfigFile.format_dir(options.featuredir)) - - - if os.name == "posix" or os.name == "mac": - sharedmem = test.compile("config.tests/unix/sharedmemory") - if sharedmem: - (code, output) = run_process(["./hbconftest_sharedmemory"], "config.tests/unix/sharedmemory") - sharedmem = (code == 0) - if not sharedmem: - print("DEBUG:%s" % output) - print("INFO: Shared Memory:\t\t\t%s" % sharedmem) - if not sharedmem: - print("WARNING:The amount of available shared memory is too low!") - print "\tTry adjusting the shared memory configuration", - if os.path.exists("/proc/sys/kernel/shmmax"): - print "(/proc/sys/kernel/shmmax)" - elif os.path.exists("/etc/sysctl.conf"): - print "(/etc/sysctl.conf)" - - + config.set_value("HB_INSTALL_DIR", ConfigFile.format_dir(BUILDENV.prefix())) + config.set_value("HB_BIN_DIR", ConfigFile.format_dir(BUILDENV.bindir())) + config.set_value("HB_LIB_DIR", ConfigFile.format_dir(BUILDENV.libdir())) + config.set_value("HB_DOC_DIR", ConfigFile.format_dir(BUILDENV.docdir())) + config.set_value("HB_INCLUDE_DIR", ConfigFile.format_dir(BUILDENV.includedir())) + config.set_value("HB_PLUGINS_DIR", ConfigFile.format_dir(BUILDENV.pluginsdir())) + config.set_value("HB_FEATURES_DIR", ConfigFile.format_dir(BUILDENV.featuresdir())) + config.set_value("HB_RESOURCES_DIR", ConfigFile.format_dir(BUILDENV.resourcesdir())) # TODO: get rid of this! - if platform.name() == "symbian": + if QMAKE.platform() == "symbian": config.set_value("HB_PLUGINS_EXPORT_DIR", ConfigFile.format_dir("$${EPOCROOT}epoc32/winscw/c/resource/qt/plugins/hb")) if options.gestures: @@ -723,12 +764,14 @@ config.add_value("DEFINES", "HB_EFFECTS") if options.textMeasurement: config.add_value("DEFINES", "HB_TEXT_MEASUREMENT_UTILITY") - if platform.name() != "symbian" and options.developer: - config.add_value("DEFINES", "HB_CSS_INSPECTOR") + if QMAKE.platform() != "symbian" and options.developer: + config.add_value("DEFINES", "HB_CSS_INSPECTOR") if options.defines: config.add_value("DEFINES", " ".join(options.defines.split(","))) - if options.developer: + if options.developerexport: config.add_value("DEFINES", "HB_DEVELOPER") + if options.rpath == None or options.rpath == True: + config.add_value("QMAKE_RPATHDIR", "$${HB_LIB_DIR}") if options.verbose: print("INFO: Writing hb_install.prf") @@ -736,22 +779,11 @@ print("ERROR: Unable to write hb_install_prf.") return - config.set_value("HB_BUILD_DIR", ConfigFile.format_dir(currentdir)) - config.set_value("HB_SOURCE_DIR", ConfigFile.format_dir(sourcedir)) - config.set_value("HB_MKSPECS_DIR", ConfigFile.format_dir(basedir + "/mkspecs")) - - if platform.name() == "symbian": - if os.path.isdir("/s60"): - config.set_value("HB_EXPORT_DIR", "hb/%1/%2") - config.set_value("HB_PRIVATE_EXPORT_DIR", "hb/%1/private/%2") - else: - config.set_value("HB_EXPORT_DIR", "$${EPOCROOT}epoc32/include/mw/hb/%1/%2") - config.set_value("HB_PRIVATE_EXPORT_DIR", "$${EPOCROOT}epoc32/include/mw/hb/%1/private/%2") - - if options.developer: - add_remove_part("tests", True) - add_remove_part("performance", True) - add_remove_part("localization", True) + config.set_value("HB_BUILD_DIR", ConfigFile.format_dir(BUILDENV.builddir())) + config.set_value("HB_SOURCE_DIR", ConfigFile.format_dir(BUILDENV.sourcedir())) + if QMAKE.platform() == "symbian": + config.set_value("HB_EXPORT_DIR", ConfigFile.format_dir(BUILDENV.exportdir())) + config.set_value("HB_RESTRICTED_EXPORT_DIR", ConfigFile.format_dir(BUILDENV.exportdir("restricted"))) if options.make: for part in options.make: @@ -770,7 +802,7 @@ for qmakeopt in options.qmakeopt.split(): config._lines.append(qmakeopt + "\n") - if local: + if BUILDENV.local(): config.add_value("CONFIG", "local") if options.silent: config.add_value("CONFIG", "silent") @@ -798,7 +830,7 @@ # - can be disabled by passing --no_debug_output option config._lines.append("CONFIG(release, debug|release) {\n") config._lines.append(" debug_output|developer {\n") - config._lines.append(" # debug/warning output enabled {\n") + config._lines.append(" # debug/warning output enabled\n") config._lines.append(" } else {\n") config._lines.append(" DEFINES += QT_NO_DEBUG_OUTPUT\n") config._lines.append(" DEFINES += QT_NO_WARNING_OUTPUT\n") @@ -810,8 +842,11 @@ config._lines.append(" }\n") config._lines.append("}\n") + # ensure that no QString(0) -like constructs slip in + config.add_value("DEFINES", "QT_QCHAR_CONSTRUCTOR") + # TODO: is there any better way to expose functions to the whole source tree? - config._lines.append("include(%s)\n" % (os.path.splitdrive(sourcedir)[1] + "/mkspecs/hb_functions.prf")) + config._lines.append("include(%s)\n" % (os.path.splitdrive(BUILDENV.sourcedir())[1] + "/mkspecs/hb_functions.prf")) if options.verbose: print("INFO: Writing .qmake.cache") @@ -819,43 +854,89 @@ print("ERROR: Unable to write .qmake.cache.") return + if os.name == "posix" or os.name == "mac": + sharedmem = test.compile("config.tests/unix/sharedmemory") + if sharedmem: + (code, output) = run_process(["./hbconftest_sharedmemory"], "config.tests/unix/sharedmemory") + sharedmem = (code == 0) + if not sharedmem: + print("DEBUG:%s" % output) + print("INFO: Shared Memory:\t\t\t%s" % sharedmem) + if not sharedmem: + print("WARNING:The amount of available shared memory is too low!") + print "\tTry adjusting the shared memory configuration", + if os.path.exists("/proc/sys/kernel/shmmax"): + print "(/proc/sys/kernel/shmmax)" + elif os.path.exists("/etc/sysctl.conf"): + print "(/etc/sysctl.conf)" + + # generate local build wrapper headers + print("\nGenerating files...") + print("INFO: Wrapper headers") + synchb = "bin/synchb.py" + if options.verbose: + print("INFO: Running %s" % synchb) + synchb = "%s -v" % synchb + os.system("python %s/%s -i %s -o %s" % (BUILDENV.sourcedir(), synchb, BUILDENV.sourcedir(), BUILDENV.builddir())) + + # generate a qrc for resources + print("INFO: Qt resource collection") + args = [os.path.join(BUILDENV.sourcedir(), "bin/resourcifier.py")] + args += ["-i", "%s" % os.path.join(sys.path[0], "src/hbcore/resources")] + # TODO: make it BUILDENV.builddir() + args += ["-o", "%s" % os.path.join(BUILDENV.sourcedir(), "src/hbcore/resources/resources.qrc")] + args += ["--exclude", "\"*distribution.policy.s60\""] + args += ["--exclude", "\"*readme.txt\""] + args += ["--exclude", "\"*.pr?\""] + args += ["--exclude", "\"*.qrc\""] + args += ["--exclude", "\"*~\""] + args += ["--exclude", "variant/*"] + args += ["--exclude", "\"*hbdefault.cssbin\""] + + if QMAKE.platform() != "symbian": + args += ["--exclude", "\"*symbian*\""] + if QMAKE.platform() != "macx": + args += ["--exclude", "\"*macx*\""] + if QMAKE.platform() != "unix": + args += ["--exclude", "\"*unix*\""] + if QMAKE.platform() != "win32": + args += ["--exclude", "\"*win32*\""] + + if options.verbose: + print("INFO: Running %s" % " ".join(args)) + os.system("python %s" % " ".join(args)) + # build host tools - if platform.name() == "symbian" or options.hostqmakebin != None or options.hostmakebin != None: + if QMAKE.platform() == "symbian" or options.hostqmakebin != None or options.hostmakebin != None: print("\nBuilding host tools...") if options.hostqmakebin != None and options.hostmakebin != None: - profile = "%s/src/hbtools/hbtools.pro" % sourcedir + profile = "%s/src/hbtools/hbtools.pro" % BUILDENV.sourcedir() if os.path.exists(profile): - toolsdir = os.path.join(currentdir, "src/hbtools") + toolsdir = os.path.join(BUILDENV.builddir(), "src/hbtools") if not os.path.exists(toolsdir): os.makedirs(toolsdir) os.chdir(toolsdir) os.system("\"%s\" -config silent %s" % (options.hostqmakebin, profile)) os.system("\"%s\"" % (options.hostmakebin)) - os.chdir(currentdir) + os.chdir(BUILDENV.builddir()) else: print("WARNING: Cannot build host tools, because no --host-qmake-bin and/or") print(" --host-make-bin was provided. Hb will attempt to run host") print(" tools from PATH.") # run qmake - if options.qmakebin: - qmake = options.qmakebin - profile = os.path.join(sourcedir, "hb.pro") - cachefile = os.path.join(currentdir, ".qmake.cache") + profile = os.path.join(BUILDENV.sourcedir(), "hb.pro") + QMAKE.add_args(["-cache", os.path.join(BUILDENV.builddir(), ".qmake.cache")]) if options.msvc: - qmake = "%s -tp vc" % qmake + QMAKE.add_args(["-tp", "vc"]) if not options.fast: - qmake = "%s -r" % qmake - if options.qmakespec: - qmake = "%s -spec %s" % (qmake, options.qmakespec) - if options.qmakeopt: - qmake = "%s \\\"%s\\\"" % (qmake, options.qmakeopt) + QMAKE.add_args(["-r"]) if options.verbose: - print("\nRunning %s -cache %s %s" % (qmake, cachefile, profile)) + print("\nRunning %s" % QMAKE.command(profile)) else: print("\nRunning qmake...") try: - ret = os.system("%s -cache %s %s" % (qmake, cachefile, profile)) + ret = run_system(QMAKE.command(profile)) except KeyboardInterrupt: ret = -1 if ret != 0: @@ -866,28 +947,28 @@ if "tests" not in HB_NOMAKE_PARTS: # run qmake for tests - profile = "%s/tsrc/tsrc.pro" % sourcedir + profile = "%s/tsrc/tsrc.pro" % BUILDENV.sourcedir() if os.path.exists(profile): - tsrcdir = os.path.join(currentdir, "tsrc") + tsrcdir = os.path.join(BUILDENV.builddir(), "tsrc") if not os.path.exists(tsrcdir): os.makedirs(tsrcdir) os.chdir(tsrcdir) if options.verbose: - print("\nRunning %s %s" % (qmake, profile)) + print("\nRunning %s" % QMAKE.command(profile)) else: print("\nRunning qmake in tsrc...") - os.system("%s %s" % (qmake, profile)) - os.chdir(currentdir) + run_system(QMAKE.command(profile)) + os.chdir(BUILDENV.builddir()) # create output dirs - outputdir = os.path.join(currentdir, "autotest") + outputdir = os.path.join(BUILDENV.builddir(), "autotest") if not os.path.exists(outputdir): os.makedirs(outputdir) - outputdir = os.path.join(currentdir, "coverage") + outputdir = os.path.join(BUILDENV.builddir(), "coverage") if not os.path.exists(outputdir): os.makedirs(outputdir) # nag about tests that are commented out - result = grep(sourcedir + "/tsrc", "#\s*SUBDIRS\s*\+=\s*(\S+)", ["*.pr?"]) + result = grep(BUILDENV.sourcedir() + "/tsrc", "#\s*SUBDIRS\s*\+=\s*(\S+)", ["*.pr?"]) maxlen = 0 for profile in result: maxlen = max(maxlen, len(profile)) @@ -914,40 +995,37 @@ # print summary print("") - if platform.make() == "nmake" and options.msvc: + if MAKE.bin() == "nmake" and options.msvc: conf = "MSVC" act = "open 'hb.sln'" elif options.coverage: conf = "test coverage measurement" - act = "run '%s coverage'" % platform.make() + act = "run '%s coverage'" % MAKE.bin() elif options.developer: conf = "development" - act = "run '%s'" % platform.make() + act = "run '%s'" % MAKE.bin() else: conf = "building" - act = "run '%s'" % platform.make() + act = "run '%s'" % MAKE.bin() print("Hb is now configured for %s. Just %s." % (conf, act)) if not options.coverage: - if platform.name() == "symbian" or local: - print("You must run '%s install' to copy the .prf file in place." % platform.make()) + if QMAKE.platform() == "symbian" or BUILDENV.local(): + print("You must run '%s install' to copy Hb files in place." % MAKE.bin()) else: - print("Once everything is built, you must run '%s install'." % platform.make()) - if platform != "symbian": - if local: - print("Hb will be used from '%s'." % sourcedir) + print("Once everything is built, you must run '%s install'." % MAKE.bin()) + if QMAKE.platform() != "symbian": + if BUILDENV.local(): + print("Hb will be used from '%s'." % BUILDENV.prefix()) else: - print("Hb will be installed to '%s'." % basedir) - if platform.name() == "win32": - path = os.path.join(basedir, "bin") - if local: - path = os.path.join(currentdir, "bin") - print("NOTE: Make sure that '%s' is in PATH." % path) + print("Hb will be installed to '%s'." % BUILDENV.prefix()) + if QMAKE.platform() == "win32": + print("NOTE: Make sure that '%s' is in PATH." % BUILDENV.bindir()) if options.coverage: print("Test code coverage measurement will FAIL if wrong Hb DLLs are found in PATH before '%s'." % path) print("") - print("To reconfigure, run '%s clean' and '%s'." % (platform.make(), sys.argv[0])) + print("To reconfigure, run '%s clean' and '%s'." % (MAKE.bin(), sys.argv[0])) print("") if __name__ == "__main__": diff -r 730c025d4b77 -r f378acbc9cfb hb.prf --- a/hb.prf Thu Jul 15 14:03:49 2010 +0100 +++ b/hb.prf Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ symbian:CONFIG += symbian_i18n skin_icon include(hb_install.prf) -#include(docml2bin.prf) +include(docml2bin.prf) CONFIG(debug, debug|release) { win32:SUFFIX = d @@ -74,5 +74,4 @@ !isEmpty(LINKAGE) { LIBS += -L$${HB_LIB_DIR} $${LINKAGE} - QMAKE_RPATHDIR *= $${HB_LIB_DIR} } diff -r 730c025d4b77 -r f378acbc9cfb hb.pro --- a/hb.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/hb.pro Thu Jul 22 16:36:53 2010 +0100 @@ -25,6 +25,7 @@ ############################################################################# # + TEMPLATE = subdirs CONFIG += root @@ -34,64 +35,64 @@ SUBDIRS += tutorials } -feature.files += $$HB_SOURCE_DIR/hb.prf -feature.files += $$HB_BUILD_DIR/hb_install.prf -feature.files += $$HB_MKSPECS_DIR/hb_functions.prf -#feature.files += $$HB_MKSPECS_DIR/docml2bin.prf -feature.path = $$HB_FEATURES_DIR -INSTALLS += feature +!symbian { + feature.files += $$HB_SOURCE_DIR/hb.prf + feature.files += $$HB_BUILD_DIR/hb_install.prf + feature.files += $$HB_SOURCE_DIR/mkspecs/hb_functions.prf + feature.files += $$HB_SOURCE_DIR/mkspecs/docml2bin.prf + feature.path = $$HB_FEATURES_DIR + INSTALLS += feature +} +else { + tmp = $$split(HB_FEATURES_DIR, :) + HB_SYMBIAN_PRF_EXPORT_DIR = $$last(tmp) + BLD_INF_RULES.prj_exports += "hb.prf $$HB_SYMBIAN_PRF_EXPORT_DIR/hb.prf" + BLD_INF_RULES.prj_exports += "hb_install.prf $$HB_SYMBIAN_PRF_EXPORT_DIR/hb_install.prf" + BLD_INF_RULES.prj_exports += "mkspecs/hb_functions.prf $$HB_SYMBIAN_PRF_EXPORT_DIR/hb_functions.prf" + BLD_INF_RULES.prj_exports += "mkspecs/docml2bin.prf $$HB_SYMBIAN_PRF_EXPORT_DIR/docml2bin.prf" +} QMAKE_DISTCLEAN += $$hbNativePath($$HB_BUILD_DIR/.qmake.cache) QMAKE_DISTCLEAN += $$hbNativePath($$HB_BUILD_DIR/hb_install.prf) -hbvar.path = . -hbvar.commands += $(QMAKE) -set HB \"hbcore hbwidgets hbutils\" -QMAKE_EXTRA_TARGETS += hbvar -INSTALLS += hbvar symbian { exists(rom):include(rom/rom.pri) - install.depends += index hbvar -# install.depends += cssbinary - install.commands += $$QMAKE_COPY $$hbNativePath($$HB_SOURCE_DIR/hb.prf) $$hbNativePath($$[QMAKE_MKSPECS]/features) - install.commands += && $$QMAKE_COPY $$hbNativePath($$HB_BUILD_DIR/hb_install.prf) $$hbNativePath($$[QMAKE_MKSPECS]/features) + install.depends += cssbinary QMAKE_EXTRA_TARGETS += install } -# theme indexing +# css binary generation +cssbinmaker.input = $$HB_SOURCE_DIR/src/hbcore/resources/themes/style/hbdefault +cssbinmaker.output = $$HB_BUILD_DIR/src/hbcore/resources/themes/hbdefault.cssbin +cssbinmaker.commands = $$hbToolCommand(hbbincssmaker) -i $$cssbinmaker.input -o $$cssbinmaker.output +QMAKE_DISTCLEAN += $$cssbinmaker.output +QMAKE_EXTRA_TARGETS += cssbinmaker -symbian:HB_THEMES_DIR = $${EPOCROOT}epoc32/data/z/resource/hb/themes -else:HB_THEMES_DIR = $(HB_THEMES_DIR)/themes -isEmpty(HB_THEMES_DIR):index.commands += echo HB_THEMES_DIR environment variable not set -else { - index.path = . - index.name = hbdefault - index.source = $$PWD/src/hbcore/resources/themes/icons/hbdefault - index.targets = $$HB_THEMES_DIR - symbian { - index.targets += $${EPOCROOT}epoc32/release/winscw/urel/z/resource/hb/themes - index.targets += $${EPOCROOT}epoc32/release/winscw/udeb/z/resource/hb/themes - } - for(index.target, index.targets) { - !isEmpty(index.commands):index.commands += && - index.commands += $$hbToolCommand(hbthemeindexer) -n $$index.name -s $$index.source -t $$index.target - } - QMAKE_EXTRA_TARGETS += index - INSTALLS += index +cssbinary.depends = cssbinmaker +cssbinary.path = $$HB_RESOURCES_DIR/themes +cssbinary.files = $$cssbinmaker.output +cssbinary.CONFIG += no_check_exist +INSTALLS += cssbinary + +symbian { + cssbinary.commands += $$hbCopyCommand($$cssbinary.files, $${EPOCROOT}epoc32/data/z/resource/hb/themes/) + cssbinary.commands += && $$hbCopyCommand($$cssbinary.files, $${EPOCROOT}epoc32/release/winscw/udeb/z/resource/hb/themes/) + QMAKE_DISTCLEAN += $${EPOCROOT}epoc32/data/z/resource/hb/themes/$$cssbinary.files + QMAKE_DISTCLEAN += $${EPOCROOT}epoc32/release/winscw/udeb/z/resource/hb/themes/$$cssbinary.files + QMAKE_EXTRA_TARGETS += cssbinary } -# css binary generation - - !contains(HB_NOMAKE_PARTS, tests):exists(tsrc) { test.depends = sub-src test.commands += cd tsrc && $(MAKE) test autotest.depends = sub-src autotest.commands += cd tsrc && $(MAKE) autotest - loctest.depends = sub-src - loctest.commands += cd tsrc/loc && $(MAKE) loctest - QMAKE_EXTRA_TARGETS += test autotest loctest + unittest.depends = sub-src + unittest.commands += cd tsrc/unit && $(MAKE) test + QMAKE_EXTRA_TARGETS += test autotest unittest } exists(doc):include(doc/doc.pri) include(src/hbcommon.pri) +#include(src/symbian_installs/symbian_deployment.pri) diff -r 730c025d4b77 -r f378acbc9cfb layers.sysdef.xml --- a/layers.sysdef.xml Thu Jul 15 14:03:49 2010 +0100 +++ b/layers.sysdef.xml Thu Jul 22 16:36:53 2010 +0100 @@ -5,10 +5,18 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb mkspecs/docml2bin.prf --- a/mkspecs/docml2bin.prf Thu Jul 15 14:03:49 2010 +0100 +++ b/mkspecs/docml2bin.prf Thu Jul 22 16:36:53 2010 +0100 @@ -1,7 +1,8 @@ -include(hb_install.prf) +exists(hb_install.prf):include(hb_install.prf) +else:include($${HB_BUILD_DIR}/hb_install.prf) include(hb_functions.prf) -QMAKE_DOCML2BIN = $$hbNativePath($${HB_BIN_DIR}/docml2bin) +QMAKE_DOCML2BIN = $$hbToolCommand(docml2bin) docml2bin.input = DOCML docml2bin.output = ${QMAKE_FILE_IN}.bin @@ -9,11 +10,17 @@ docml2bin.name = DOCML2BIN ${QMAKE_FILE_IN} docml2bin.CONFIG = no_link -rcc.depends += compiler_docml2bin_make_all +for(DOCMLFILE, $$list($$unique(DOCML))) { + DOCMLFILE_PWD = $${_PRO_FILE_PWD_}/$${DOCMLFILE} + rcc.depends += $${DOCMLFILE_PWD}.bin -## how to add ".bin" for each variable? -#rcc.depends += for(DOCMLFILE, $$list(DOCML)) { DOCMLFILE } -#rcc.depends += $${first(DOCML)}.bin -#rcc.depends += $${last(DOCML)}.bin + DOCML2BINEXTENSION = \ + "START EXTENSION qt/qmake_extra_pre_targetdep.export" \ + "OPTION PREDEP_TARGET $${DOCMLFILE_PWD}.bin" \ + "OPTION DEPS $${DOCMLFILE_PWD}" \ + "OPTION COMMAND $${QMAKE_DOCML2BIN} -s $${DOCMLFILE_PWD} -t $${DOCMLFILE_PWD}.bin" \ + "END" + BLD_INF_RULES.prj_extensions += DOCML2BINEXTENSION +} QMAKE_EXTRA_COMPILERS += docml2bin diff -r 730c025d4b77 -r f378acbc9cfb mkspecs/hb_functions.prf --- a/mkspecs/hb_functions.prf Thu Jul 15 14:03:49 2010 +0100 +++ b/mkspecs/hb_functions.prf Thu Jul 22 16:36:53 2010 +0100 @@ -48,25 +48,25 @@ LIBRARY = $$last(PARTS) INCLUDEPATH *= $${HB_BUILD_DIR}/include/$${COLLECTION} + INCLUDEPATH *= $${HB_BUILD_DIR}/include/$${COLLECTION}/restricted INCLUDEPATH *= $${HB_BUILD_DIR}/include/$${COLLECTION}/private DEPENDPATH *= $${HB_BUILD_DIR}/include/$${COLLECTION} + DEPENDPATH *= $${HB_BUILD_DIR}/include/$${COLLECTION}/restricted DEPENDPATH *= $${HB_BUILD_DIR}/include/$${COLLECTION}/private LIBS *= -L$${HB_BUILD_DIR}/lib LIBS *= -l$$hbLibraryTarget($$LIBRARY) - QMAKE_RPATHDIR *= $${HB_BUILD_DIR}/lib unix:HB_COVERAGE_EXCLUDE += \"*/$$COLLECTION/*\" export(LIBS) export(INCLUDEPATH) export(DEPENDPATH) - export(QMAKE_RPATHDIR) export(HB_COVERAGE_EXCLUDE) return(true) } # params: -# NOTE: PUBLIC_HEADERS, INTERNAL_HEADERS, CONVENIENCE_HEADERS +# NOTE: exports PUBLIC_HEADERS, RESTRICTED_HEADERS and CONVENIENCE_HEADERS # eg. hbExportHeaders(hbcore) defineTest(hbExportHeaders) { for(PUBLIC_HEADER, PUBLIC_HEADERS) { @@ -74,12 +74,11 @@ EXPORT_PATH = $$sprintf($$HB_EXPORT_DIR, $$1, $$basename(PUBLIC_HEADER)) BLD_INF_RULES.prj_exports *= "$$PUBLIC_HEADER $$EXPORT_PATH" } - # DO NOT EXPORT PRIVATE HEADERS! - #for(INTERNAL_HEADER, INTERNAL_HEADERS) { - # INTERNAL_HEADER = $$section(INTERNAL_HEADER, ":", 1) - # EXPORT_PATH = $$sprintf($$HB_PRIVATE_EXPORT_DIR, $$1, $$basename(INTERNAL_HEADER)) - # BLD_INF_RULES.prj_exports *= "$$INTERNAL_HEADER $$EXPORT_PATH" - #} + for(RESTRICTED_HEADER, RESTRICTED_HEADERS) { + RESTRICTED_HEADER = $$section(RESTRICTED_HEADER, ":", 1) + EXPORT_PATH = $$sprintf($$HB_RESTRICTED_EXPORT_DIR, $$1, $$basename(RESTRICTED_HEADER)) + BLD_INF_RULES.prj_exports *= "$$RESTRICTED_HEADER $$EXPORT_PATH" + } for(CONVENIENCE_HEADER, CONVENIENCE_HEADERS) { CONVENIENCE_HEADER = $$section(CONVENIENCE_HEADER, ":", 1) EXPORT_PATH = $$sprintf($$HB_EXPORT_DIR, $$1, $$basename(CONVENIENCE_HEADER)) @@ -92,9 +91,7 @@ # params: - # eg. $$hbUnixStyle():CMD=/path/to/cmd else:CMD=\path\to\cmd defineTest(hbUnixStyle) { - symbian|win32:!win32-g++ { - unixstyle = false - } else:win32-g++:isEmpty(QMAKE_SH) { + contains(QMAKE_HOST.os, Windows):isEmpty(QMAKE_SH) { unixstyle = false } else { unixstyle = true @@ -105,29 +102,67 @@ # params: # eg. features.path = $$hbNativePath($$[QMAKE_MKSPECS]/features) defineReplace(hbNativePath) { - hbUnixStyle() { - return($$quote(\"$$replace(1, "\\", "/")\")) + contains(QMAKE_HOST.os, Windows) { + isEmpty(QMAKE_SH) { + 1 = $$replace(1, \\\\, $$QMAKE_DIR_SEP) + 1 = $$replace(1, /, $$QMAKE_DIR_SEP) + } else { + 1 = $$replace(1, \\\\, /) + 1 = $$replace(1, /, /) + } } else { - return($$quote(\"$$replace(1, "/", "\\")\")) + 1 = $$replace(1, \\\\, $$QMAKE_DIR_SEP) + 1 = $$replace(1, /, $$QMAKE_DIR_SEP) } + + return($$quote(\"$$1\")) } # params: # eg. hbfoo.command = $$hbToolCommand(hbfoo) defineReplace(hbToolCommand) { - # tool in PATH? - hbUnixStyle():DEVNULL = /dev/null - else:DEVNULL = nul - system($$1 > $$DEVNULL 2>&1):return($$1) + symbian { + # tool in PATH? + exists(/dev/null) { + DEVNULL = /dev/null + } else { + DEVNULL = nul + } + system($$1 > $$DEVNULL 2>&1):return($$1) - # host build is runnable? - hbtoolcmd = $$hbNativePath($$HB_BUILD_DIR/bin/$$1) - system($$hbtoolcmd > $$DEVNULL 2>&1):return($$hbtoolcmd) + # host build is runnable? + hbtoolcmd = $$hbNativePath($$HB_BUILD_DIR/bin/$$1) + system($$hbtoolcmd > $$DEVNULL 2>&1):return($$hbtoolcmd) - # pre-built tool is runnable? - hbtoolcmd = $$hbNativePath($$sprintf("%1%2", $$HB_SOURCE_DIR/bin/$$1, "_symbian.exe")) - system($$hbtoolcmd > $$DEVNULL 2>&1):return($$hbtoolcmd) + # tool in HB_BIN_DIR? + hbtoolcmd = $$hbNativePath($$HB_BIN_DIR/$$1) + system($$hbtoolcmd > $$DEVNULL 2>&1):return($$hbtoolcmd) + # pre-built tool is runnable? + hbtoolcmd = $$hbNativePath($$sprintf("%1%2", $$HB_SOURCE_DIR/bin/$$1, "_symbian.exe")) + system($$hbtoolcmd > $$DEVNULL 2>&1):return($$hbtoolcmd) + } # fall back to /bin return($$hbNativePath($$HB_BUILD_DIR/bin/$$1)) } + +# params: +defineReplace(hbCopyCommand) { + file = $$hbNativePath($$1) + dir = $$hbNativePath($$2) + + contains(QMAKE_HOST.os, Windows):isEmpty(QMAKE_SH) { + chk_dir_exists = if not exist $$dir + mkdir = mkdir $$dir + copy = copy /y $$file $$dir + } else { + chk_dir_exists = test -d $$dir + mkdir = mkdir -p $$dir + copy = cp $$file $$dir + } + + hbUnixStyle(): chk_dir_exists_mkdir = $$chk_dir_exists || $$mkdir + else:chk_dir_exists_mkdir = $$chk_dir_exists $$mkdir + + return(($$chk_dir_exists_mkdir) && $$copy) +} diff -r 730c025d4b77 -r f378acbc9cfb src/astyle.pri --- a/src/astyle.pri Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -# -############################################################################# -## -## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -## All rights reserved. -## Contact: Nokia Corporation (developer.feedback@nokia.com) -## -## This file is part of the UI Extensions for Mobile. -## -## GNU Lesser General Public License Usage -## This file may be used under the terms of the GNU Lesser General Public -## License version 2.1 as published by the Free Software Foundation and -## appearing in the file LICENSE.LGPL included in the packaging of this file. -## Please review the following information to ensure the GNU Lesser General -## Public License version 2.1 requirements will be met: -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## In addition, as a special exception, Nokia gives you certain additional -## rights. These rights are described in the Nokia Qt LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## If you have questions regarding the use of this file, please contact -## Nokia at developer.feedback@nokia.com. -## -############################################################################# -# - -root { - - style.CONFIG = recursive - style.recurse = src - style.recurse_target = astyle - QMAKE_EXTRA_TARGETS += style - -} else:contains(TEMPLATE, .*subdirs$) { - - astyle.CONFIG += recursive - QMAKE_EXTRA_TARGETS += astyle - -} else { - - astyle.params += --pad=oper - astyle.params += --unpad=paren - astyle.params += --convert-tabs - astyle.params += --brackets=linux - astyle.params += --break-blocks=all - astyle.params += --indent-namespaces - astyle.commands = astyle $$astyle.params $$HEADERS $$SOURCES - QMAKE_EXTRA_TARGETS += astyle - -} diff -r 730c025d4b77 -r f378acbc9cfb src/coverage.pri --- a/src/coverage.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/coverage.pri Thu Jul 22 16:36:53 2010 +0100 @@ -58,7 +58,7 @@ } measure_coverage.depends = pre_coverage - unix:measure_coverage.depends = test + unix:measure_coverage.depends = unittest post_coverage.depends = measure_coverage coverage.depends = post_coverage QMAKE_EXTRA_TARGETS *= coverage pre_coverage measure_coverage post_coverage diff -r 730c025d4b77 -r f378acbc9cfb src/flint.pri --- a/src/flint.pri Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -# -############################################################################# -## -## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -## All rights reserved. -## Contact: Nokia Corporation (developer.feedback@nokia.com) -## -## This file is part of the UI Extensions for Mobile. -## -## GNU Lesser General Public License Usage -## This file may be used under the terms of the GNU Lesser General Public -## License version 2.1 as published by the Free Software Foundation and -## appearing in the file LICENSE.LGPL included in the packaging of this file. -## Please review the following information to ensure the GNU Lesser General -## Public License version 2.1 requirements will be met: -## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -## -## In addition, as a special exception, Nokia gives you certain additional -## rights. These rights are described in the Nokia Qt LGPL Exception -## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -## -## If you have questions regarding the use of this file, please contact -## Nokia at developer.feedback@nokia.com. -## -############################################################################# -# - -root { - - flint.CONFIG = recursive - flint.recurse = src - -} else:contains(TEMPLATE, .*subdirs$) { - - flint.CONFIG += recursive - -} else { - - unix:flint.commands += $(FLINT_BIN) `echo $(DEFINES) | sed s/-D/-d/g` `echo $(INCPATH) | sed s/-I/-i/g` \ - $(FLINT_INDIRECTS) $$SOURCES 2>&1 > $${HB_BUILD_DIR}/\$(QMAKE_TARGET).txt - -} - -QMAKE_EXTRA_TARGETS += flint diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbapps.pro --- a/src/hbapps/hbapps.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbapps/hbapps.pro Thu Jul 22 16:36:53 2010 +0100 @@ -28,10 +28,7 @@ TEMPLATE = subdirs SUBDIRS += hbthemechanger - -symbian { - SUBDIRS += hbiconpreloader -} +#SUBDIRS += hbfeatureconfigapp include($${HB_SOURCE_DIR}/src/hbcommon.pri) diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbiconpreloader/hbiconpreloader.pro --- a/src/hbapps/hbiconpreloader/hbiconpreloader.pro Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -TEMPLATE = app -TARGET = -DEPENDPATH += . -INCLUDEPATH += . - -SOURCES += main.cpp - -symbian { - TARGET.CAPABILITY = CAP_APPLICATION - TARGET.EPOCALLOWDLLDATA = 1 - - LIBS += -lcone - LIBS += -lavkon - LIBS += -leikcore - - myrssrules = \ - "hidden = KAppIsHidden;" \ - "launch = KAppLaunchInBackground;" - - RSS_RULES += myrssrules -} - -hbAddLibrary(hbcore/HbCore) -hbAddLibrary(hbwidgets/HbWidgets) -hbAddLibrary(hbutils/HbUtils) diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbiconpreloader/main.cpp --- a/src/hbapps/hbiconpreloader/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbApps module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include -#include -#include -#include - -#ifdef Q_OS_SYMBIAN -#include -#endif - -/* -* This application exists temporarily to preload some time-consuming graphics -* when theme server is started in order to simulate the real scenario where -* such graphics get loaded in the boot when first app is shown. -* It creates more realistic results for the performance tests. -*/ -int main(int argc, char *argv[]) -{ - HbApplication app(argc, argv, Hb::NoSplash); - // Create a mainwindow so its graphics get cached and next app startup is faster - HbMainWindow window; - window.show(); - - qDebug() << "HB: HbIconPreloader started"; - - // Render the window in a pixmap painter, it does not get drawn and icons do not get loaded - // otherwise because the application runs in background. - QImage image(1, 1, QImage::Format_ARGB32); - QPainter painter(&image); - - window.render(&painter); - -#ifdef Q_OS_SYMBIAN - // To avoid crash in app exit - CCoeEnv::Static()->DisableExitChecks(true); -#endif - - QApplication::processEvents(); // to prevent mysterious deadlocks when destroying the mainwindow - - // Exit the application - return 0; -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/hbthemechanger.pro --- a/src/hbapps/hbthemechanger/hbthemechanger.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbapps/hbthemechanger/hbthemechanger.pro Thu Jul 22 16:36:53 2010 +0100 @@ -30,26 +30,33 @@ QT += network DEFINES += HB_RESOURCES_DIR=\"\\\"$${HB_RESOURCES_DIR}\\\"\" +CONFIG += hb + # directories DESTDIR = $${HB_BUILD_DIR}/bin # dependencies hbAddLibrary(hbcore/HbCore) hbAddLibrary(hbwidgets/HbWidgets) +hbAddLibrary(hbutils/HbUtils) # Input HEADERS += themechangerdefs.h HEADERS += themeselectionlist.h +HEADERS += settingsview.h +HEADERS += resourceview.h SOURCES += themeselectionlist.cpp SOURCES += themechangermain.cpp +SOURCES += settingsview.cpp +SOURCES += resourceview.cpp symbian { TARGET.CAPABILITY += WriteDeviceData - HEADERS += themeclientsymbian.h - SOURCES += themeclientsymbian.cpp -} else { - HEADERS += themeclientqt.h - SOURCES += themeclientqt.cpp + SKINICON = qtg_large_personalization + + myrssrules = \ + "hidden = KAppIsHidden;" + RSS_RULES += myrssrules } # installation diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/resourceview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbapps/hbthemechanger/resourceview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,304 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbApps module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "resourceview.h" +#include +#include +#include +#include +#include +#include + +/** + * Constructor + */ +ResourceView::ResourceView(HbMainWindow *mainWindow, HbView* parent): HbView(parent) +{ + mMainWindow = mainWindow; + mParentView = parent; + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); + + this->setTitle(tr("Resource lookup")); + + HbAction *act = new HbAction(Hb::BackNaviAction); + connect(act, SIGNAL(triggered()), this, SLOT(close())); + + this->setNavigationAction(act); + + act = new HbAction(tr("Icons")); + connect(act, SIGNAL(triggered()), this, SLOT(iconModeSelected())); + this->toolBar()->addAction(act); + + act = new HbAction(tr("Colors")); + connect(act, SIGNAL(triggered()), this, SLOT(colorModeSelected())); + this->toolBar()->addAction(act); + + act = new HbAction(tr("Effects")); + connect(act, SIGNAL(triggered()), this, SLOT(effectModeSelected())); + this->toolBar()->addAction(act); + + act = new HbAction(tr("Animations")); + connect(act, SIGNAL(triggered()), this, SLOT(animationModeSelected())); + this->toolBar()->addAction(act); + + + loadThemedIcons(); + loadThemedColors(); + loadThemedEffects(); + loadThemedAnimations(); + mAnimator = new HbIconAnimator(); + mResourceItem = new HbLabel(this); + mResourceItem->setIcon(HbIcon(mThemedIcons.size()?mThemedIcons[0]:"")); + mResourceItem->setAlignment(Qt::AlignCenter); + mResourceItem->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); + mResourcesList = new HbTumbleView(mThemedIcons, this); + + layout->addItem(mResourceItem); + layout->addItem(mResourcesList); + + mSearchPanel = new HbSearchPanel(this); + mSearchPanel->setCancelEnabled(false); + mSearchPanel->setPlaceholderText(tr("Search")); + layout->addItem(mSearchPanel); + this->setLayout(layout); + + connect(mSearchPanel, SIGNAL(criteriaChanged(const QString &)), this, SLOT(criteriaChanged(const QString &))); + connect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(iconItemSelected(int))); + mMode = iconMode; + + mMainWindow->addView(this); +} + +/** + * Destructor + */ +ResourceView::~ResourceView() +{ + delete mAnimator; +} + +void ResourceView::close() +{ + mMainWindow->setCurrentView(mParentView); +} + +void ResourceView::toggleMode(ListMode mode) +{ + if (mode == mMode) { + return; + } + + switch (mMode) { + case colorMode: + disconnect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(colorItemSelected(int))); + break; + case iconMode: + disconnect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(iconItemSelected(int))); + break; + case effectMode: + mResourcesList->setSelected(0); + disconnect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(effectItemSelected(int))); + break; + case animationMode: + mResourcesList->setSelected(0); + disconnect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(animationItemSelected(int))); + break; + default: + break; + } + + mMode = mode; + switch (mode) { + case colorMode: + connect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(colorItemSelected(int))); + mSearchPanel->setCriteria(""); + mResourcesList->setSelected(0); + break; + case iconMode: + connect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(iconItemSelected(int))); + mSearchPanel->setCriteria(""); + mResourcesList->setSelected(0); + break; + case effectMode: + connect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(effectItemSelected(int))); + mSearchPanel->setCriteria(""); + mResourcesList->setSelected(0); + break; + case animationMode: + connect(mResourcesList, SIGNAL(itemSelected(int)), this, SLOT(animationItemSelected(int))); + mSearchPanel->setCriteria(""); + mResourcesList->setSelected(0); + break; + default: + break; + } +} + +void ResourceView::loadThemedIcons() +{ + mThemedIcons.clear(); + QString basetheme = HbThemeUtils::getThemeSetting(HbThemeUtils::BaseThemeSetting); + QDir scalableIconsDir(basetheme + "/scalable"); + QDir pixmapIconsDir(basetheme + "/pixmap"); + QFileInfoList files = scalableIconsDir.entryInfoList(QDir::Files); + files += pixmapIconsDir.entryInfoList(QDir::Files); + // Strip the file extensions + for (int i=0;iaddDefinitionFile(files[i].fileName()); + mThemedAnimations += files[i].baseName(); + } +} + +void ResourceView::loadThemedColors() +{ + mThemedColors.clear(); + QString basetheme = HbThemeUtils::getThemeSetting(HbThemeUtils::BaseThemeSetting); + basetheme = basetheme.replace("/icons/", "/style/"); + QFile file(basetheme + "/variables/color/hbcolorgroup.css"); + + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream in(&file); + + while(!in.atEnd()) { + QString line = in.readLine().trimmed(); + if (line.startsWith("qtc_")) { + // Extract logical name + mThemedColors += line.mid(0, line.indexOf(':')).trimmed(); + } + } + file.close(); + } +} + +void ResourceView::iconModeSelected() +{ + toggleMode(iconMode); +} + +void ResourceView::colorModeSelected() +{ + toggleMode(colorMode); +} + +void ResourceView::effectModeSelected() +{ + toggleMode(effectMode); +} + +void ResourceView::animationModeSelected() +{ + toggleMode(animationMode); +} + + +void ResourceView::iconItemSelected(int index) +{ + mResourceItem->setIcon(HbIcon(mResourcesList->items()[index])); +} + +void ResourceView::animationItemSelected(int index) +{ + mResourceItem->setIcon(HbIcon(mResourcesList->items()[index])); + mAnimator->setIcon(mResourceItem->icon()); + mAnimator->startAnimation(); +} + + +void ResourceView::colorItemSelected(int index) +{ + QString rgbValue("#"); + rgbValue += QString::number(HbColorScheme::color(mResourcesList->items()[index]).red(), 16); + rgbValue += QString::number(HbColorScheme::color(mResourcesList->items()[index]).green(), 16); + rgbValue += QString::number(HbColorScheme::color(mResourcesList->items()[index]).blue(), 16); + mResourceItem->setPlainText(rgbValue.toUpper()); +} + +void ResourceView::effectItemSelected(int index) +{ + HbEffect::add(mResourceItem,mResourcesList->items()[index],"selected"); + HbEffect::start(mResourceItem,"selected"); +} + + +void ResourceView::criteriaChanged(const QString &criteria) +{ + QStringList filteredItems; + switch (mMode) { + case iconMode: + filteredItems = mThemedIcons.filter(criteria.toLower()); + break; + case colorMode: + filteredItems = mThemedColors.filter(criteria.toLower()); + break; + case effectMode: + filteredItems = mThemedEffects.filter(criteria.toLower()); + break; + case animationMode: + filteredItems = mThemedAnimations.filter(criteria.toLower()); + break; + default: + break; + } + mResourcesList->setItems(filteredItems); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/resourceview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbapps/hbthemechanger/resourceview.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,86 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbApps module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#ifndef RESOURCEVIEW_H +#define RESOURCEVIEW_H + +#include + +class HbMainWindow; +class HbDataForm; +class HbDataFormModelItem; +class HbIconItem; +class HbTumbleView; +class HbSearchPanel; +class HbLabel; +class HbIconAnimator; + +class ResourceView : public HbView +{ +Q_OBJECT +public: + ResourceView(HbMainWindow *mainWindow, HbView* parent=0); + ~ResourceView(); + + enum ListMode { + iconMode, + colorMode, + effectMode, + animationMode + }; + +public slots: + void close(); + void iconModeSelected(); + void colorModeSelected(); + void effectModeSelected(); + void animationModeSelected(); + void iconItemSelected(int index); + void colorItemSelected(int index); + void effectItemSelected(int index); + void animationItemSelected(int index); + void criteriaChanged(const QString &criteria); +private: + HbMainWindow *mMainWindow; + HbView *mParentView; + + QStringList mThemedIcons; + QStringList mThemedColors; + QStringList mThemedEffects; + QStringList mThemedAnimations; + HbLabel *mResourceItem; + HbTumbleView *mResourcesList; + HbSearchPanel *mSearchPanel; + HbIconAnimator *mAnimator; + + ListMode mMode; + void loadThemedIcons(); + void loadThemedColors(); + void loadThemedEffects(); + void loadThemedAnimations(); + void toggleMode(ListMode mode); +}; + + +#endif // RESOURCEVIEW_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/settingsview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbapps/hbthemechanger/settingsview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbApps module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "settingsview.h" + +/** + * Constructor + */ +SettingsView::SettingsView(const QStringList &themes, HbMainWindow *mainWindow, HbView* parent): HbView(parent), + mThemes(themes) +{ + mMainWindow = mainWindow; + mParentView = parent; + + for(int i=0;isetTitle(tr("Settings")); + + mDataForm = new HbDataForm(this); + HbDataFormModel *model = new HbDataFormModel(this); + + mBaseThemeSetting = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, tr("Base Theme")); + mDefaultThemeSetting = model->appendDataFormItem(HbDataFormModelItem::RadioButtonListItem, tr("Default Theme")); + mPriorityThemeSetting = model->appendDataFormItem(HbDataFormModelItem::TextItem, tr("Priority Theme")); + mDataForm->setModel(model); + + loadSettings(); + + layout->addItem(mDataForm); + + HbAction *act = new HbAction(tr("Save")); + connect(act, SIGNAL(triggered()), this, SLOT(saveSettings())); + this->toolBar()->addAction(act); + act = new HbAction(tr("Cancel")); + connect(act, SIGNAL(triggered()), this, SLOT(cancel())); + this->toolBar()->addAction(act); + act = new HbAction(Hb::BackNaviAction); + connect(act, SIGNAL(triggered()), this, SLOT(cancel())); + this->setNavigationAction(act); + + this->setLayout(layout); + + mMainWindow->addView(this); +} + +/** + * Destructor + */ +SettingsView::~SettingsView() +{ + delete mDataForm; +} + +void SettingsView::loadSettings() +{ + mBaseThemeSetting->setContentWidgetData("items",mThemeUiNames); + mBaseThemeSetting->setContentWidgetData("selected", mThemes.indexOf(HbThemeUtils::getThemeSetting(HbThemeUtils::BaseThemeSetting))); + mDefaultThemeSetting->setContentWidgetData("items",mThemeUiNames); + mDefaultThemeSetting->setContentWidgetData("selected", mThemes.indexOf(HbThemeUtils::getThemeSetting(HbThemeUtils::DefaultThemeSetting))); + mPriorityThemeSetting->setContentWidgetData("text",HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting)); +} + +void SettingsView::saveSettings() +{ + HbThemeUtils::setThemeSetting(HbThemeUtils::BaseThemeSetting, mThemes[mBaseThemeSetting->contentWidgetData("selected").toInt()]); + HbThemeUtils::setThemeSetting(HbThemeUtils::DefaultThemeSetting, mThemes[mDefaultThemeSetting->contentWidgetData("selected").toInt()]); + HbThemeUtils::setThemeSetting(HbThemeUtils::OperatorNameSetting, mPriorityThemeSetting->contentWidgetData("text").toString()); + loadSettings(); +#ifdef Q_OS_SYMBIAN + HbMessageBox::information(tr("Please reboot the device to apply the changes.")); +#else + HbMessageBox::information(tr("Please restart the Hb application to apply the changes.")); +#endif + mMainWindow->setCurrentView(mParentView); +} + +void SettingsView::cancel() +{ + loadSettings(); + mMainWindow->setCurrentView(mParentView); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/settingsview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbapps/hbthemechanger/settingsview.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbApps module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#ifndef SETTINGSVIEW_H +#define SETTINGSVIEW_H + +#include + +class HbMainWindow; +class HbDataForm; +class HbDataFormModelItem; + +class SettingsView : public HbView +{ +Q_OBJECT +public: + SettingsView(const QStringList &themes, HbMainWindow *mainWindow, HbView* parent=0); + ~SettingsView(); + +public slots: + void saveSettings(); + void cancel(); +private: + const QStringList &mThemes; + QStringList mThemeUiNames; + HbMainWindow *mMainWindow; + HbView *mParentView; + HbDataForm *mDataForm; + HbDataFormModelItem *mBaseThemeSetting; + HbDataFormModelItem *mDefaultThemeSetting; + HbDataFormModelItem *mPriorityThemeSetting; + + void loadSettings(); +}; + + +#endif // SETTINGSVIEW_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/themechangermain.cpp --- a/src/hbapps/hbthemechanger/themechangermain.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbapps/hbthemechanger/themechangermain.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,11 +28,6 @@ #include "themechangerdefs.h" #include "themeselectionlist.h" #include -#ifdef Q_OS_SYMBIAN -#include "themeclientsymbian.h" -#else -#include "themeclientqt.h" -#endif #ifdef THEME_CHANGER_TIMER_LOG void debugOutput(QtMsgType type, const char *msg) @@ -70,15 +65,8 @@ // Includes decorators such as signal strength and battery life indicator. HbMainWindow mainWindow; -#ifdef Q_OS_SYMBIAN - ThemeClientSymbian* client = new ThemeClientSymbian(); -#else - // Create the theme server that does the notifiation to all the QT apps - ThemeClientQt* client = new ThemeClientQt(); -#endif - // Show the list of themes available - ThemeSelectionList *themelist=new ThemeSelectionList(client); + ThemeSelectionList *themelist=new ThemeSelectionList(&mainWindow); themelist->displayThemes(); mainWindow.addView( themelist ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/themeclientqt.cpp --- a/src/hbapps/hbthemechanger/themeclientqt.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,101 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbApps module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ -#include -#include -#include - -#include "themeclientqt.h" -#include "themechangerdefs.h" -#include "hbthemecommon_p.h" - -/** - * Constructor - */ -ThemeClientQt::ThemeClientQt() -{ -#ifdef THEME_CHANGER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - localSocket = new QLocalSocket(); - connected = false; -} - -bool ThemeClientQt::connectToServer() -{ - localSocket->connectToServer(THEME_SERVER_NAME); - bool success = localSocket->waitForConnected(3000); -#ifdef THEME_CHANGER_TRACES - qDebug() << "ThemeClientQt:: Socket Connect status: " <disconnectFromServer(); - } - delete localSocket; -} - -/** - * changeTheme - */ -void ThemeClientQt::changeTheme(const QString &newtheme) -{ -#ifdef THEME_CHANGER_TRACES - qDebug() <<"ThemeClientQt::changeTheme("<write(outputByteArray); -#ifdef THEME_CHANGER_TRACES - qDebug()<<"ThemeClientQt::ThemeName written to server"; -#endif - localSocket->flush(); -} - - -/** - * isConnected - */ -bool ThemeClientQt::isConnected() -{ - return connected; -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/themeclientqt.h --- a/src/hbapps/hbthemechanger/themeclientqt.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbApps module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ -#ifndef THEMECLIENTQT_H -#define THEMECLIENTQT_H - -#include -#include - -class QLocalSocket; - -class ThemeClientQt : public QObject -{ - - Q_OBJECT - -public: - ThemeClientQt(); - bool connectToServer(); - bool isConnected(); - ~ThemeClientQt(); - -public slots: - void changeTheme(const QString &newtheme); - -private: - QLocalSocket* localSocket; - QString themeName; - bool connected; -}; - - -#endif // THEMECLIENTQT_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/themeclientsymbian.cpp --- a/src/hbapps/hbthemechanger/themeclientsymbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,98 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbApps module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "themeclientsymbian.h" -#include -#include - - -const TUint kDefaultMessageSlots=4; - - -/** - * Constructor - */ -ThemeClientSymbian::ThemeClientSymbian(): connected(false) -{ -} - - -/** - * Connects to the server using 4 message slots. - */ -bool ThemeClientSymbian::connectToServer() -{ - qDebug() << "HbSymbianThemeClient::Connect ++"; - - TInt error = CreateSession(KThemeServerName,Version(),kDefaultMessageSlots); - - if (KErrNone != error) { - qDebug() << "ThemeClientSymbian:: could not create session" << error; - } - connected = (KErrNone == error); - return (KErrNone == error); -} - - -/** - * Returns the earliest version number of the server that we can tal to. - */ -TVersion ThemeClientSymbian::Version(void) const -{ - return(TVersion(KThemeServerMajorVersionNumber,KThemeServerMinorVersionNumber,KThemeServerBuildVersionNumber)); -} - - -/** - * Closing the server and tidying up. - */ -void ThemeClientSymbian::Close() -{ - RSessionBase::Close(); -} - -/** - * changeTheme - */ -TInt ThemeClientSymbian::changeTheme(const QString& aString ) -{ - TInt err = KErrGeneral; - RProperty themeRequestProp; - - User::LeaveIfError( themeRequestProp.Attach( KServerUid3, KNewThemeForThemeChanger ) ); - - TBuf<256> newThemenameChangeRequest; - _LIT(KThemeRequestFormatter, "%d:%S"); - TBuf<256> newThemename(aString.utf16()); - newThemenameChangeRequest.Format( KThemeRequestFormatter, EThemeSelection, &newThemename); - err = themeRequestProp.Set(newThemenameChangeRequest); - themeRequestProp.Close(); - return err; -} - -bool ThemeClientSymbian::isConnected() -{ - return connected; -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/themeclientsymbian.h --- a/src/hbapps/hbthemechanger/themeclientsymbian.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbApps module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef THEMECLIENTSYMBIAN_H -#define THEMECLIENTSYMBIAN_H - -#include -#include -#include "hbthemecommon_symbian_p.h" -#include "hbthemecommon_p.h" - -class ThemeClientSymbian : public RSessionBase -{ -public: - ThemeClientSymbian(); - bool connectToServer(); - TVersion Version() const; - TInt changeTheme(const QString& aString); - void Close(); - bool isConnected(); - bool connected; -}; - -#endif /* THEMECLIENTSYMBIAN_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/themeselectionlist.cpp --- a/src/hbapps/hbthemechanger/themeselectionlist.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbapps/hbthemechanger/themeselectionlist.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,30 +31,110 @@ #include #include #include +#include +#include +#include +#include #include #include #include +#include +#include #include "themeselectionlist.h" #include "themechangerdefs.h" +#include "settingsview.h" +#include "resourceview.h" + +class PreviewView : public HbView +{ +public: + + PreviewView(const QString &name, const QString &theme, QGraphicsItem* parent=0): + HbView(parent), preview(0), themePath(theme) + { + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(Qt::Vertical); + HbLabel *label = new HbLabel(tr("Apply theme %1?").arg(name)); + label->setFontSpec(HbFontSpec(HbFontSpec::Primary)); + label->setElideMode(Qt::ElideNone); + layout->addItem(label); + QString previewPath(""); + if (HbDeviceProfile::profile(this).orientation() == Qt::Horizontal) { + previewPath = themePath + "/scalable/qtg_graf_theme_preview_lsc."; + } else { + previewPath = themePath + "/scalable/qtg_graf_theme_preview_prt."; + } + QString nvgPreview(previewPath + "nvg"); + QString svgPreview(previewPath + "svg"); + + if (QFile::exists(nvgPreview)) { + previewPath = nvgPreview; + } else if (QFile::exists(svgPreview)) { + previewPath = svgPreview; + } else { + previewPath = "qtg_large_corrupted"; + } + preview = new HbIconItem(previewPath); + preview->setAspectRatioMode(Qt::KeepAspectRatio); + QSize s = HbDeviceProfile::profile(this).logicalSize(); + preview->setPreferredSize(s); + layout->addItem(preview); + this->setLayout(layout); + } + + ~PreviewView() + { + delete preview; + } + + void resizeEvent(QGraphicsSceneResizeEvent *event) + { + Q_UNUSED(event); + if (preview) { + QString previewPath(""); + if (HbDeviceProfile::profile(this).orientation() == Qt::Horizontal) { + previewPath = themePath + "/scalable/qtg_graf_theme_preview_lsc."; + } else { + previewPath = themePath + "/scalable/qtg_graf_theme_preview_prt."; + } + QString nvgPreview(previewPath + "nvg"); + QString svgPreview(previewPath + "svg"); + + if (QFile::exists(nvgPreview)) { + previewPath = nvgPreview; + } else if (QFile::exists(svgPreview)) { + previewPath = svgPreview; + } else { + previewPath = "qtg_large_corrupted"; + } + + preview->setIconName(previewPath); + preview->setAspectRatioMode(Qt::KeepAspectRatio); + QSize s = HbDeviceProfile::profile(this).logicalSize(); + preview->setPreferredSize(s); + } + } +private: + HbIconItem *preview; + QString themePath; +}; /** * Constructor */ -ThemeSelectionList::ThemeSelectionList( -#ifdef Q_OS_SYMBIAN - ThemeClientSymbian* client -#else - ThemeClientQt* client -#endif - ): - oldItemIndex(-1), +ThemeSelectionList::ThemeSelectionList(HbMainWindow *mainWindow): themelist(new HbListWidget(this)), rightMark(new HbIcon(QString("qtg_small_tick"))), noMark(new HbIcon(QString(""))), - client(client) + previewView(0), + settingsView(0), + resourceView(0) { + mMainWindow = mainWindow; connect(themelist, SIGNAL(activated(HbListWidgetItem *)),this, SLOT(setChosen(HbListWidgetItem *))); + connect(themelist, SIGNAL(longPressed(HbListWidgetItem*, QPointF)), + this, SLOT(onLongPressed(HbListWidgetItem*, QPointF))); + setWidget(themelist); // Automatic updation of the themelist when some theme is installed or uninstalled @@ -66,11 +146,20 @@ } } connect(watcher,SIGNAL(directoryChanged(const QString &)),this,SLOT(updateThemeList(const QString &))); - QObject::connect(this,SIGNAL(newThemeSelected(QString)),this,SLOT(sendThemeName(QString))); + QObject::connect(this,SIGNAL(newThemeSelected(QString)),this,SLOT(sendThemeName(QString))); + grabGesture(Qt::TapAndHoldGesture); + + HbAction *a = this->toolBar()->addAction(HbIcon("qtg_mono_settings"),tr("Settings")); + connect(a, SIGNAL(triggered()), this, SLOT(showSettingsView())); + + a = this->toolBar()->addAction(HbIcon("qtg_mono_search"),tr("Resources")); + connect(a, SIGNAL(triggered()), this, SLOT(showResourceView())); + + connect(hbInstance->theme(),SIGNAL(changeFinished()), this, SLOT(themeChanged())); + #ifdef THEME_CHANGER_TIMER_LOG idleTimer = new QTimer(this); connect(idleTimer, SIGNAL(timeout()), this, SLOT(processWhenIdle())); - connect(hbInstance->theme(),SIGNAL(changeFinished()), this, SLOT(themeChanged())); idleTimer->start(0); // to make a connection to server #endif } @@ -81,9 +170,7 @@ ThemeSelectionList::~ThemeSelectionList() { // Set the theme to the applied theme before exiting. - setChosen(themelist->item(oldItemIndex)); delete noMark; - noMark=NULL; delete rightMark; rightMark=NULL; @@ -92,6 +179,10 @@ themelist->reset(); delete themelist; themelist=NULL; + + // Delete preview thubnails + qDeleteAll(thumbnails); + thumbnails.clear(); } @@ -100,6 +191,7 @@ */ void ThemeSelectionList::displayThemes() { + rootThemes.clear(); bool entryAdded = false; bool themePresent = false; foreach(const QString &KThemeRootPath, rootPaths()){ @@ -112,15 +204,23 @@ QStringList iconthemeslist=dir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name); foreach(QString themefolder, iconthemeslist) { QDir iconThemePath(root.path()+"/themes/icons/"+themefolder); - if(iconThemePath.exists("index.theme")) { + QFile themeIndexFile(root.path()+"/themes/"+themefolder+".themeindex"); + if(themeIndexFile.exists() && iconThemePath.exists("index.theme")) { QSettings iniSetting(iconThemePath.path()+"/index.theme",QSettings::IniFormat); iniSetting.beginGroup("Icon Theme"); QString hidden = iniSetting.value("Hidden").toString(); - QString name = iniSetting.value("Name").toString(); iniSetting.endGroup(); - if((hidden == "true") ||( hidden == "")||(name!=themefolder) ) { + if((hidden == "true") ||( hidden == "")) { iconthemeslist.removeOne(themefolder); } +#ifdef Q_OS_SYMBIAN + if (KThemeRootPath[0] == 'z') { +#endif + rootThemes.append(iconThemePath.absolutePath()); +#ifdef Q_OS_SYMBIAN + } +#endif + } else { iconthemeslist.removeOne(themefolder); @@ -128,42 +228,89 @@ } if(!entryAdded){ - iconthemeslist.insert(0,"hbdefault"); //adding one default entry + rootThemes.append(":/themes/icons/hbdefault"); + //adding one default entry + HbListWidgetItem *item = new HbListWidgetItem(); + item->setText("hbdefault"); + item->setSecondaryText(":/themes/icons/hbdefault"); + QString thumbPath(":/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_thumbnail.svg"); + if (!QFile::exists(thumbPath)) { + thumbPath = "qtg_large_corrupted"; + } + HbIcon *icon = new HbIcon(thumbPath); + thumbnails.append(icon); + item->setIcon(*icon); + if (HbInstance::instance()->theme()->name() == "hbdefault") { + item->setSecondaryIcon(*rightMark); + themelist->addItem(item); + themelist->setCurrentRow(themelist->count()-1); + } else { + item->setSecondaryIcon(*noMark); + themelist->addItem(item); + } entryAdded = true; } list=iconthemeslist; for (int i=0; i theme()->name())==(list.at(i))) { - themelist->addItem(*rightMark,list.at(i)); - oldItemIndex=themelist->count()-1; - themelist->setCurrentRow(oldItemIndex); + HbListWidgetItem *item = new HbListWidgetItem(); + + QSettings iniSetting(root.path()+"/themes/icons/"+list.at(i)+"/index.theme",QSettings::IniFormat); + iniSetting.beginGroup("Icon Theme"); + QString name = iniSetting.value("Name").toString(); + iniSetting.endGroup(); + item->setText(name); + + item->setSecondaryText(root.path()+"/themes/icons/"+list.at(i)); + QString thumbPath(root.path()+"/themes/icons/"+list.at(i)+"/scalable/qtg_graf_theme_preview_thumbnail."); + QString nvgPath(thumbPath + "nvg"); + QString svgPath(thumbPath + "svg"); + if (QFile::exists(nvgPath)) { + thumbPath = nvgPath; + } else if (QFile::exists(svgPath)) { + thumbPath = svgPath; } else { - themelist->addItem(*noMark,list.at(i)); + thumbPath = "qtg_large_corrupted"; + } + HbIcon *icon = new HbIcon(thumbPath); + thumbnails.append(icon); + item->setIcon(*icon); + + + if (QFileInfo(HbThemeServices::themePath()) == QFileInfo(item->secondaryText())) { + item->setSecondaryIcon(*rightMark); + themelist->addItem(item); + themelist->setCurrentRow(themelist->count()-1); + } + else { + item->setSecondaryIcon(*noMark); + themelist->addItem(item); } } } } // else{//add a case for no theme ,make hbdefault entry if(!themePresent) { - QStringList defaultList; - defaultList.insert(0,"hbdefault"); //adding one default entry - themelist->addItem(*rightMark,defaultList.at(0)); + rootThemes.append(":/themes/icons/hbdefault"); + //adding one default entry + HbListWidgetItem *item = new HbListWidgetItem(); + item->setText("hbdefault"); + item->setSecondaryText(":/themes/icons/hbdefault"); + QString thumbPath(":/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_thumbnail.svg"); + if (!QFile::exists(thumbPath)) { + thumbPath = "qtg_large_corrupted"; + } + HbIcon *icon = new HbIcon(thumbPath); + thumbnails.append(icon); + item->setIcon(*icon); + item->setSecondaryIcon(*rightMark); + themelist->addItem(item); QString themeName=HbInstance::instance()->theme()->name(); if (themeName != "hbdefault") { - if (!client->isConnected()) { - bool success = client->connectToServer(); - if (success) { - emit newThemeSelected("hbdefault"); - } - } - else { - emit newThemeSelected("hbdefault"); - } + emit newThemeSelected(":/themes/icons/hbdefault"); } - } } @@ -172,66 +319,20 @@ */ void ThemeSelectionList::setChosen(HbListWidgetItem *item) { - QString str=item->text(); - #ifdef THEME_CHANGER_TRACES - qDebug() << "ThemeSelectionList::Setchosen with ThemeName: "<secondaryText(); #endif - if(iCurrentTheme != str ) { + if(iCurrentTheme != item->secondaryText()) { #ifdef THEME_CHANGER_TIMER_LOG timer.start(); - qDebug() << "Selected theme: " << str; + qDebug() << "Selected theme: " << item->secondaryText(); #endif - iCurrentTheme = str; - if (!client->isConnected()) { - bool success = client->connectToServer(); - if (success) { - QThread::currentThread()->setPriority(QThread::HighPriority); - emit newThemeSelected(str); - } - } - else { - QThread::currentThread()->setPriority(QThread::HighPriority); - emit newThemeSelected(str); - } - } - else - { - applySelection(); //double tap //put a tick + iCurrentTheme = item->secondaryText(); + QThread::currentThread()->setPriority(QThread::HighPriority); + emit newThemeSelected(item->secondaryText()); } } - -/** - * applySelection - */ -void ThemeSelectionList::applySelection() -{ - if(oldItemIndex!=themelist->currentRow()) { - themelist->setIcon(themelist->currentRow(),*rightMark); - if(oldItemIndex >= 0) { - themelist->setIcon(oldItemIndex,*noMark); - } - oldItemIndex = themelist->currentRow(); - } -} - - -/** - * event - */ -bool ThemeSelectionList::event(QEvent *e) -{ - if((e->type()==QEvent::ShortcutOverride)||(e->type()==QEvent::WindowDeactivate)) { - // save old applied theme - themelist->setCurrentRow(oldItemIndex); - themelist->setFocus(); - setChosen(themelist->item(oldItemIndex)); - return true; - } - return (HbView::event(e)); -} - /** * updateThemeList */ @@ -248,7 +349,7 @@ */ void ThemeSelectionList::sendThemeName(const QString& name) { - client->changeTheme(name); + HbThemeServices::setTheme(name); } /** @@ -258,8 +359,8 @@ { QStringList rootDirs; #if defined(Q_OS_SYMBIAN) - rootDirs << "c:/resource/hb" - << "z:/resource/hb" + rootDirs << "z:/resource/hb" + << "c:/resource/hb" << "e:/resource/hb" << "f:/resource/hb"; #else @@ -275,19 +376,85 @@ return rootDirs; } +void ThemeSelectionList::onLongPressed(HbListWidgetItem* listViewItem, const QPointF& coords) +{ + Q_UNUSED(coords); + if (previewView) { + delete previewView; + previewView = 0; + } + previewItem = listViewItem; + QString theme = listViewItem->secondaryText(); + previewView = new PreviewView(listViewItem->text(), theme, this); + mMainWindow->addView(previewView); + + HbAction *act = new HbAction(tr("Ok")); + connect(act, SIGNAL(triggered()), this, SLOT(applyTheme())); + previewView->toolBar()->addAction(act); + act = new HbAction(tr("Cancel")); + connect(act, SIGNAL(triggered()), this, SLOT(cancel())); + previewView->toolBar()->addAction(act); + act = new HbAction(Hb::BackNaviAction); + connect(act, SIGNAL(triggered()), this, SLOT(cancel())); + previewView->setNavigationAction(act); + + mMainWindow->setCurrentView(previewView); +} + +void ThemeSelectionList::cancel() +{ + mMainWindow->setCurrentView(this); + mMainWindow->removeView(previewView); +} + +void ThemeSelectionList::applyTheme() +{ + if (previewItem) { + setChosen(previewItem); + } + mMainWindow->setCurrentView(this); + mMainWindow->removeView(previewView); +} + +void ThemeSelectionList::showSettingsView() +{ + if (!settingsView) { + settingsView = new SettingsView(rootThemes, mMainWindow, this); + } + mMainWindow->setCurrentView(settingsView); +} + +void ThemeSelectionList::showResourceView() +{ + if (!resourceView) { + resourceView = new ResourceView(mMainWindow, this); + } + mMainWindow->setCurrentView(resourceView); +} + + +void ThemeSelectionList::themeChanged() +{ + QString currentTheme = HbThemeServices::themePath(); + for (int i=0;icount();i++) { + HbListWidgetItem *item = themelist->item(i); + if (item->secondaryText() == currentTheme) { + item->setSecondaryIcon(*rightMark); + } else { + item->setSecondaryIcon(*noMark); + } + } + +#ifdef THEME_CHANGER_TIMER_LOG + idleTimer->start(0); +#endif //THEME_CHANGER_TIMER_LOG +} + #ifdef THEME_CHANGER_TIMER_LOG void ThemeSelectionList::processWhenIdle() { qDebug() << "Theme changed applied in " << timer.elapsed() << " msec"; idleTimer->stop(); QThread::currentThread()->setPriority(QThread::NormalPriority); - if (!client->isConnected()) { - client->connectToServer(); - } -} - -void ThemeSelectionList::themeChanged() -{ - idleTimer->start(0); } #endif //THEME_CHANGER_TIMER_LOG diff -r 730c025d4b77 -r f378acbc9cfb src/hbapps/hbthemechanger/themeselectionlist.h --- a/src/hbapps/hbthemechanger/themeselectionlist.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbapps/hbthemechanger/themeselectionlist.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,11 +33,6 @@ #include #include -#ifdef Q_OS_SYMBIAN -#include "themeclientsymbian.h" -#else -#include "themeclientqt.h" -#endif #include "themechangerdefs.h" class HbIcon; @@ -47,42 +42,43 @@ Q_OBJECT public: -#ifdef Q_OS_SYMBIAN - ThemeSelectionList(ThemeClientSymbian* client); -#else - ThemeSelectionList(ThemeClientQt* client); -#endif - + ThemeSelectionList(HbMainWindow *mainWindow); ~ThemeSelectionList(); signals: void newThemeSelected(const QString &newthemepath); public slots: void displayThemes(); void setChosen(HbListWidgetItem *item); - void applySelection(); + void onLongPressed(HbListWidgetItem* listViewItem, const QPointF& coords); void updateThemeList(const QString &path); void sendThemeName(const QString& name); + void cancel(); + void applyTheme(); + void showSettingsView(); + void showResourceView(); + void themeChanged(); #ifdef THEME_CHANGER_TIMER_LOG void processWhenIdle(); - void themeChanged(); #endif protected: - bool event(QEvent *e); void resizeEvent(QResizeEvent* event); private: static QStringList rootPaths(); + QStringList rootThemes; QDir dir; - int oldItemIndex; HbListWidget *themelist; HbIcon* rightMark; HbIcon* noMark; HbAction *action; -#ifdef Q_OS_SYMBIAN - ThemeClientSymbian* client; -#else - ThemeClientQt* client; -#endif + QList thumbnails; + HbAction* mOkAction; + HbAction* mCancelAction; + HbMainWindow *mMainWindow; + HbListWidgetItem* previewItem; + HbView *previewView; + HbView *settingsView; + HbView *resourceView; QFileSystemWatcher *watcher; QString iCurrentTheme; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcommon.pri --- a/src/hbcommon.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcommon.pri Thu Jul 22 16:36:53 2010 +0100 @@ -54,14 +54,21 @@ # integrity check for public/private headers contains(TEMPLATE, .*lib$) { for(pubheader, $$list($$lower($$unique(PUBLIC_HEADERS)))) { - contains(pubheader, .*_p.h$):warning($$basename(pubheader) is listed in PUBLIC_HEADERS but has a \"_p.h\" suffix.) + contains(pubheader, .*_[pr].h$):warning($$basename(pubheader) is listed in PUBLIC_HEADERS but has a \"_[pr].h\" suffix.) + } + for(restheader, $$list($$lower($$unique(RESTRICTED_HEADERS)))) { + !contains(restheader, .*_r.h$):warning($$basename(restheader) is listed in RESTRICTED_HEADERS but has no \"_r.h\" suffix.) } for(privheader, $$list($$lower($$unique(PRIVATE_HEADERS)))) { !contains(privheader, .*_p.h$):warning($$basename(privheader) is listed in PRIVATE_HEADERS but has no \"_p.h\" suffix.) } + !isEmpty(INTERNAL_HEADERS) { + warning(INTERNAL_HEADERS is obsolete. Use PUBLIC|RESTRICTED|PRIVATE_HEADERS for the following headers:) + for(intheader, $$list($$unique(INTERNAL_HEADERS))) { + warning($$intheader) + } + } } # common extra targets -include(flint.pri) -include(astyle.pri) include(coverage.pri) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/activity/activity.pri --- a/src/hbcore/activity/activity.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/activity/activity.pri Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,8 @@ PUBLIC_HEADERS += $$PWD/hbactivitymanager.h -INTERNAL_HEADERS += $$PWD/hbactivitymanager_p.h \ - $$PWD/hbactivityplugininterface_p.h \ +PRIVATE_HEADERS += $$PWD/hbactivitymanager_p.h + +RESTRICTED_HEADERS += $$PWD/hbactivityplugininterface_r.h SOURCES += $$PWD/hbactivitymanager.cpp \ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/activity/hbactivitymanager.cpp --- a/src/hbcore/activity/hbactivitymanager.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/activity/hbactivitymanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,18 +32,18 @@ #include "hbmainwindow.h" #include "hbinstance.h" -#include "hbactivityplugininterface_p.h" +#include "hbactivityplugininterface_r.h" /*! @stable @hbcore \class HbActivityManager \brief HbActivityManager is an access point for Activities features. - + Activities can be described as stored application states (for example bookmarks in web browser) or actions that can be performed using application (play next song, start new game). - + The HbActivityManager class allows to use Activities features in Hb application. It can be used to access, add, remove and modify activities. It also notifies the application about activity change requests from other applications. @@ -69,27 +69,27 @@ HbActivityPluginInterface *HbActivityManagerPrivate::activityPlugin() const { if (!mActivityPlugin) { - foreach (const QString &path, QCoreApplication::libraryPaths()) { + foreach(const QString & path, QCoreApplication::libraryPaths()) { QString pluginPath; QString libPath = QDir(path).filePath(QLatin1String("hbactivityplugin")); #ifdef Q_OS_SYMBIAN libPath += QLatin1String(".qtplugin"); - QLibrary library(libPath); + QLibrary library(libPath); if (QFile::exists(libPath) && library.load()) { library.unload(); pluginPath = libPath; } #else - QLibrary library(libPath); + QLibrary library(libPath); if (library.load()) { library.unload(); pluginPath = library.fileName(); - } -#endif + } +#endif QPluginLoader loader(pluginPath); QObject *pluginInstance = loader.instance(); if (pluginInstance) { - mActivityPlugin = qobject_cast(pluginInstance); + mActivityPlugin = qobject_cast(pluginInstance); if (mActivityPlugin) { q->connect(pluginInstance, SIGNAL(activityRequested(QString)), q, SIGNAL(activityRequested(QString))); } else { @@ -217,9 +217,9 @@ /*! Allows to save activity. \a activityId. Activity name used as identifier of activities - \a data. Activity data that should be stored. It will allow application to restore its state later + \a data. Activity data that should be stored. It will allow application to restore its state later \a parameters. Activity properties: screenshot, localized name, hidden flag, etc. - Returns true if activity was succesfully saved, otherwise returns false. + Returns true if activity was successfully saved, otherwise returns false. */ bool HbActivityManager::addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) { @@ -230,7 +230,7 @@ /*! Allows to delete activity. \a activityId. Activity name used as identifier of activities - Returns true if activity was succesfully deleted, otherwise returns false. + Returns true if activity was successfully deleted, otherwise returns false. */ bool HbActivityManager::removeActivity(const QString &activityId) { @@ -241,9 +241,9 @@ /*! Allows to update saved activity. \a activityId. Activity name used as identifier of activities - \a data. Activity data that should be stored. It will allow application to restore its state later + \a data. Activity data that should be stored. It will allow application to restore its state later \a parameters. Activity properties: screenshot, localized name, hidden flag, etc. - Returns true if activity was succesfully updated, otherwise returns false. + Returns true if activity was successfully updated, otherwise returns false. */ bool HbActivityManager::updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) { @@ -272,7 +272,7 @@ /*! Subscribes to activity manager */ -bool HbActivityManager::waitActivity() +bool HbActivityManager::waitActivity() { Q_D(HbActivityManager); return d->waitActivity(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/activity/hbactivitymanager.h --- a/src/hbcore/activity/hbactivitymanager.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/activity/hbactivitymanager.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,7 +44,7 @@ public: explicit HbActivityManager(QObject *parent = 0); virtual ~HbActivityManager(); - + bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); bool removeActivity(const QString &activityId); bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters); @@ -54,15 +54,15 @@ void parseCommandLine(const QStringList &commandLineParams, Hb::ActivationReason &reason, QString &id, QVariantHash ¶ms) const; signals: - void activityRequested(const QString &activityId); - + void activityRequested(const QString &activityId); + protected: HbActivityManagerPrivate *d_ptr; - + private: Q_DISABLE_COPY(HbActivityManager) - Q_DECLARE_PRIVATE_D(d_ptr, HbActivityManager) - + Q_DECLARE_PRIVATE_D(d_ptr, HbActivityManager) + }; #endif // HBACTIVITYMANAGER_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/activity/hbactivitymanager_p.h --- a/src/hbcore/activity/hbactivitymanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/activity/hbactivitymanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -46,7 +46,7 @@ private: HbActivityPluginInterface *activityPlugin() const; - + private: HbActivityManager *q; mutable HbActivityPluginInterface *mActivityPlugin; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/activity/hbactivityplugininterface_p.h --- a/src/hbcore/activity/hbactivityplugininterface_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBACTIVITYPLUGININTERFACE_P_H -#define HBACTIVITYPLUGININTERFACE_P_H - -#include -#include -#include -#include -#include - -class HbActivityPluginInterface -{ -public: - virtual ~HbActivityPluginInterface() {} - -public: - virtual bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0; - virtual bool removeActivity(const QString &activityId) = 0; - virtual bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0; - virtual QList activities() = 0; - virtual QVariant activityData(const QString &activityId) = 0; - virtual bool waitActivity() = 0; - virtual QVariantHash parseCommandLine(const QStringList &commandLineParams) = 0; - -signals: - // signal must be re-declared in the plugin implementation - void activityRequested(const QString &activityId); -}; - -Q_DECLARE_INTERFACE(HbActivityPluginInterface, "HbActivityPluginInterface/1.0") - -#endif // HBACTIVITYPLUGININTERFACE_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/activity/hbactivityplugininterface_r.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/activity/hbactivityplugininterface_r.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBACTIVITYPLUGININTERFACE_R_H +#define HBACTIVITYPLUGININTERFACE_R_H + +#include +#include +#include +#include +#include + +class HbActivityPluginInterface +{ +public: + virtual ~HbActivityPluginInterface() {} + +public: + virtual bool addActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0; + virtual bool removeActivity(const QString &activityId) = 0; + virtual bool updateActivity(const QString &activityId, const QVariant &data, const QVariantHash ¶meters) = 0; + virtual QList activities() = 0; + virtual QVariant activityData(const QString &activityId) = 0; + virtual bool waitActivity() = 0; + virtual QVariantHash parseCommandLine(const QStringList &commandLineParams) = 0; + +signals: + // signal must be re-declared in the plugin implementation + void activityRequested(const QString &activityId); +}; + +Q_DECLARE_INTERFACE(HbActivityPluginInterface, "HbActivityPluginInterface/1.0") + +#endif // HBACTIVITYPLUGININTERFACE_R_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/core.pri --- a/src/hbcore/core/core.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/core.pri Thu Jul 22 16:36:53 2010 +0100 @@ -54,7 +54,6 @@ PRIVATE_HEADERS += $$PWD/hbglobal_p.h PRIVATE_HEADERS += $$PWD/hbinstance_p.h PRIVATE_HEADERS += $$PWD/hbnamespace_p.h -PRIVATE_HEADERS += $$PWD/hbstandarddirs_p.h PRIVATE_HEADERS += $$PWD/hbtestabilityinterface_p.h PRIVATE_HEADERS += $$PWD/hbthemeperf_p.h PRIVATE_HEADERS += $$PWD/hbstringdata_p.h @@ -66,10 +65,11 @@ PRIVATE_HEADERS += $$PWD/hblocalechangenotifier_p.h PRIVATE_HEADERS += $$PWD/hbapplication_p.h PRIVATE_HEADERS += $$PWD/hbthemesystemeffect_p.h +PRIVATE_HEADERS += $$PWD/hbthemesystemeffectmap_p.h PRIVATE_HEADERS += $$PWD/hbpluginloader_p.h PRIVATE_HEADERS += $$PWD/hbpluginloader_p_p.h symbian { - PRIVATE_HEADERS += $$PWD/hbcorepskeys_p.h + RESTRICTED_HEADERS += $$PWD/hbcorepskeys_r.h PRIVATE_HEADERS += $$PWD/hbsensornotifyhandler_p.h } @@ -80,7 +80,6 @@ SOURCES += $$PWD/hbgraphicsscene.cpp SOURCES += $$PWD/hbinstance.cpp SOURCES += $$PWD/hbnamespace.cpp -SOURCES += $$PWD/hbstandarddirs.cpp SOURCES += $$PWD/hbmemorymanager_p.cpp SOURCES += $$PWD/hbsharedmemorymanager_p.cpp SOURCES += $$PWD/hbsharedmemorymanagerut_p.cpp @@ -96,6 +95,7 @@ SOURCES += $$PWD/hbsensorlistener.cpp SOURCES += $$PWD/hblocalechangenotifier_p.cpp SOURCES += $$PWD/hbthemesystemeffect.cpp +SOURCES += $$PWD/hbthemesystemeffectmap.cpp SOURCES += $$PWD/hbpluginloader.cpp symbian { SOURCES += $$PWD/hbsensornotifyhandler_p.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbaction.cpp --- a/src/hbcore/core/hbaction.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbaction.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -51,9 +51,9 @@ instance support of gestures. An action may contain a command role. - These command roles are used when action is added through HbView::addAction. - The command role specifies the action container (options menu, toolbar) - to which the action is places and also the position in that container. + These command roles are used when action is added through HbView::addAction. + The command role specifies the action container (options menu, toolbar) + to which the action is places and also the position in that container. \sa QAction::MenuRole \sa HbView::addAction @@ -66,7 +66,7 @@ \internal */ HbActionPrivate::HbActionPrivate() : menu(0), extension(0) -, commandRole(HbAction::NoRole) + , commandRole(HbAction::NoRole) { } @@ -107,26 +107,26 @@ /*! Constructs a new HbAction with the given navigation \a action and \a parent. */ -HbAction::HbAction(Hb::NavigationAction action, QObject* parent) +HbAction::HbAction(Hb::NavigationAction action, QObject *parent) : QAction(parent), d_ptr(new HbActionPrivate) { Q_D(HbAction); switch (action) { - case Hb::QuitNaviAction: - d->icon = HbIcon("qtg_mono_app_exit"); - break; - case Hb::BackNaviAction: - d->icon = HbIcon("qtg_mono_back"); - break; - case Hb::ConfirmNaviAction: - d->icon = HbIcon("qtg_mono_back"); - break; - case Hb::DoneNaviAction: - d->icon = HbIcon("qtg_mono_back"); - break; - default: - qWarning("HbAction: unknown action: %i", action); - break; + case Hb::QuitNaviAction: + d->icon = HbIcon("qtg_mono_app_exit"); + break; + case Hb::BackNaviAction: + d->icon = HbIcon("qtg_mono_back"); + break; + case Hb::ConfirmNaviAction: + d->icon = HbIcon("qtg_mono_back"); + break; + case Hb::DoneNaviAction: + d->icon = HbIcon("qtg_mono_back"); + break; + default: + qWarning("HbAction: unknown action: %i", action); + break; } } @@ -140,7 +140,7 @@ /*! Sets the icon of the action. Note that this icon is different from QIcon - setIcon() and icon(). + setIcon() and icon(). \sa icon() */ @@ -165,7 +165,7 @@ } /*! - Sets the menu of the action. + Sets the menu of the action. \sa menu() */ @@ -196,8 +196,9 @@ void HbAction::setToolTip(const QString &tooltip) { Q_D(HbAction); - if (d->tooltip == tooltip) + if (d->tooltip == tooltip) { return; + } d->tooltip = tooltip; QAction::setToolTip(tooltip); @@ -215,7 +216,7 @@ } /*! - Sets the toolbar extension of the action. + Sets the toolbar extension of the action. \sa menu() */ @@ -242,7 +243,7 @@ } /*! - Sets the command role identifier of the action. + Sets the command role identifier of the action. \sa commandRole() */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbaction.h --- a/src/hbcore/core/hbaction.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbaction.h Thu Jul 22 16:36:53 2010 +0100 @@ -48,7 +48,7 @@ explicit HbAction(QObject *parent = 0); explicit HbAction(const QString &text, QObject *parent = 0); explicit HbAction(const HbIcon &icon, const QString &text, QObject *parent = 0); - explicit HbAction(Hb::NavigationAction action, QObject* parent = 0); + explicit HbAction(Hb::NavigationAction action, QObject *parent = 0); virtual ~HbAction(); using QAction::setIcon; @@ -67,13 +67,14 @@ HbToolBarExtension *toolBarExtension() const; enum CommandRole { NoRole, OptionsRole, OpenRole, NewRole, DeleteRole, ClearRole, - SettingsRole, SendRole, PrintRole, EditRole, CopyRole, PasteRole, - HelpRole, QuitRole, ExitRole, OtherRole }; + SettingsRole, SendRole, PrintRole, EditRole, CopyRole, PasteRole, + HelpRole, QuitRole, ExitRole, OtherRole + }; void setCommandRole(CommandRole commandRole); CommandRole commandRole() const; protected: - HbActionPrivate * const d_ptr; + HbActionPrivate *const d_ptr; HbAction(HbActionPrivate &dd, QObject *parent); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbaction_p.h --- a/src/hbcore/core/hbaction_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbaction_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -35,7 +35,7 @@ HbMenu *menu; HbToolBarExtension *extension; HbAction::CommandRole commandRole; - QString tooltip; + QString tooltip; }; #endif // HBACTION_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbapplication.cpp --- a/src/hbcore/core/hbapplication.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbapplication.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -40,7 +40,7 @@ #endif /*! - @stable + @stable @hbcore \class HbApplication \brief The HbApplication class is a place for common functionality. @@ -70,36 +70,36 @@ Applications that support the 'activities' concept may check the start-up reason like this: - + \code HbApplication app(argc, argv); if(app.activateReason() == HbApplication::activity) { // start-up case } else if (app.activateReason() == HbApplication::service) { - // service lauch + // service launch } else { // normal launch } MyActivitiesEngine logic; // connect to the application signal - QObject::connect(&app, SIGNAL(activate()), &logic, SLOT(openActivity())); + QObject::connect(&app, SIGNAL(activate()), &logic, SLOT(openActivity())); \endcode - - When new activity needs to be activated signal is emited. Application might + + When new activity needs to be activated signal is emitted. Application might observe it and start correct handling to return to saved state. Logic should check what is the activity id and data to return to correct state. - + \sa QApplication */ /*! \fn void HbApplication::activate() - + This signal is emitted when some activity needs to be shown. */ -static int& preInitApp(int &argc) +static int &preInitApp(int &argc) { // This function contains code that needs to be executed before // the QApplication constructor. @@ -211,6 +211,7 @@ #if defined(Q_WS_S60) #include #include +#include #include #include #include @@ -225,7 +226,7 @@ static void forceRefresh() { - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { QEvent event(QEvent::WindowActivate); QApplication::sendEvent(window, &event); } @@ -246,80 +247,79 @@ const TWsEvent *aEvent = event->windowServerEvent(); switch (aEvent->Type()) { - // In case of EEventScreenDeviceChanged-event, the current screen - // ratio is checked and orientation is set accordingly. - case EEventScreenDeviceChanged: - { - QList windows = hbInstance->allMainWindows(); - RWindow *win = static_cast(windows.at(0)->effectiveWinId()->DrawableWindow()); - - TSize rWinSize; - if (win) - rWinSize = win->Size(); - - // fix for emulator / changing modes - QSize nSize( (int)rWinSize.iWidth, (int)rWinSize.iHeight ); - foreach (HbMainWindow* w, windows) { + case EEventScreenDeviceChanged: { + // Resize the mainwindows when the screen device changes. + // This is needed only to support the old S60 emulator. + CWsScreenDevice *screenDevice = CCoeEnv::Static()->ScreenDevice(); + if (screenDevice) { + TPixelsTwipsAndRotation params; + int mode = screenDevice->CurrentScreenMode(); + screenDevice->GetScreenModeSizeAndRotation(mode, params); + QSize nSize(params.iPixelSize.iWidth, params.iPixelSize.iHeight); + QList windows = hbInstance->allMainWindows(); + foreach(HbMainWindow * w, windows) { w->resize(nSize); } } - return false; //continue handling in QApplication::s60ProcessEvent - case KChangeDirection:{ - TUint8* dataptr = aEvent->EventData(); - switch(*dataptr){ - case 0: - HbApplication::setLayoutDirection(Qt::LeftToRight); - break; - case 1: - HbApplication::setLayoutDirection(Qt::RightToLeft); - break; - default: - qWarning("HbApplication::s60EventFilter: Unknown layout direction received"); - break; - } - } - return false; - case KChangeDeviceProfile:{ - TUint8* dataptr = aEvent->EventData(); - QStringList names = HbDeviceProfile::profileNames(); - if(*dataptr > names.count() - 1){ - qWarning("HbApplication::s60EventFilter: Unknown device profile received"); - }else{ - HbDeviceProfile profile(names.value(*dataptr)); - HbDeviceProfileManager::select(profile); - QList windows = hbInstance->allMainWindows(); - HbMainWindow *w = windows.at(0); - w->setOrientation(profile.orientation()); - } - } - return false; - case KChangeTouchAreaVis:{ - TUint8* dataptr = aEvent->EventData(); - HbTouchAreaPrivate::setOutlineDrawing(*dataptr == 1); - forceRefresh(); - } - return false; - case KChangeTextItemVis:{ - TUint8* dataptr = aEvent->EventData(); - HbTextItemPrivate::outlinesEnabled = *dataptr == 1; - forceRefresh(); - } - return false; - case KChangeIconItemVis:{ - TUint8* dataptr = aEvent->EventData(); - HbIconItemPrivate::outlinesEnabled = *dataptr == 1; - forceRefresh(); - } - return false; - case KChangeFpsCounterVis:{ - TUint8* dataptr = aEvent->EventData(); - HbGraphicsScenePrivate::fpsCounterEnabled = *dataptr == 1; - forceRefresh(); - } - return false; + } + return false; //continue handling in QApplication::s60ProcessEvent + + case KChangeDirection: { + TUint8 *dataptr = aEvent->EventData(); + switch (*dataptr) { + case 0: + HbApplication::setLayoutDirection(Qt::LeftToRight); + break; + case 1: + HbApplication::setLayoutDirection(Qt::RightToLeft); + break; default: - return QApplication::symbianEventFilter(event); + qWarning("HbApplication::s60EventFilter: Unknown layout direction received"); + break; + } + } + return false; + case KChangeDeviceProfile: { + TUint8 *dataptr = aEvent->EventData(); + QStringList names = HbDeviceProfile::profileNames(); + if (*dataptr > names.count() - 1) { + qWarning("HbApplication::s60EventFilter: Unknown device profile received"); + } else { + HbDeviceProfile profile(names.value(*dataptr)); + HbDeviceProfileManager::select(profile); + QList windows = hbInstance->allMainWindows(); + HbMainWindow *w = windows.at(0); + w->setOrientation(profile.orientation()); } + } + return false; + case KChangeTouchAreaVis: { + TUint8 *dataptr = aEvent->EventData(); + HbTouchAreaPrivate::setOutlineDrawing(*dataptr == 1); + forceRefresh(); + } + return false; + case KChangeTextItemVis: { + TUint8 *dataptr = aEvent->EventData(); + HbTextItemPrivate::outlinesEnabled = *dataptr == 1; + forceRefresh(); + } + return false; + case KChangeIconItemVis: { + TUint8 *dataptr = aEvent->EventData(); + HbIconItemPrivate::outlinesEnabled = *dataptr == 1; + forceRefresh(); + } + return false; + case KChangeFpsCounterVis: { + TUint8 *dataptr = aEvent->EventData(); + HbGraphicsScenePrivate::fpsCounterEnabled = *dataptr == 1; + forceRefresh(); + } + return false; + default: + return QApplication::symbianEventFilter(event); + } } #endif // Q_WS_S60 @@ -340,7 +340,7 @@ { if (!mActivateId.isNull() && !mActivateData.isValid()) { mActivateData = mActivityManager->activityData(mActivateId); - } + } return mActivateData; } @@ -350,7 +350,7 @@ mActivateId = activityId; mActivateData = QVariant(); mActivateParams = QVariantHash(); - + emit q_ptr->activate(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbapplication.h --- a/src/hbcore/core/hbapplication.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbapplication.h Thu Jul 22 16:36:53 2010 +0100 @@ -62,18 +62,18 @@ HbActivityManager *activityManager(); Hb::ActivationReason activateReason() const; QVariantHash activateParams() const; - QString activateId() const; - QVariant activateData(); + QString activateId() const; + QVariant activateData(); void hideSplash(); protected: HbApplicationPrivate *d_ptr; - + private: Q_DISABLE_COPY(HbApplication) - Q_DECLARE_PRIVATE_D(d_ptr, HbApplication) - + Q_DECLARE_PRIVATE_D(d_ptr, HbApplication) + }; #endif // HBAPPLICATION_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbapplication_p.h --- a/src/hbcore/core/hbapplication_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbapplication_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,17 +40,17 @@ HbApplicationPrivate(HbApplication *parent = 0); ~HbApplicationPrivate(); - QVariant activateData(); + QVariant activateData(); HbApplication *q_ptr; Hb::ActivationReason mActivateReason; QVariantHash mActivateParams; QString mActivateId; HbActivityManager *mActivityManager; - + private slots: void prepareActivityData(const QString &name); - + private: QVariant mActivateData; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbcommoncrkeys.h --- a/src/hbcore/core/hbcommoncrkeys.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbcommoncrkeys.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,7 @@ * Define the status of the sensors * - Off = 0 * - On = 1 - * + * */ const TUint32 KHbSensorCenrepKey = 0x1; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbcorepskeys_p.h --- a/src/hbcore/core/hbcorepskeys_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HB_COREPSKEYS_P_H -#define HB_COREPSKEYS_P_H - -#ifdef Q_OS_SYMBIAN - -#include - -/** - * HbCore internal orientation PS category UID. - * Intended only for orientation setting. - */ -const TUid KHbPsOrientationCategoryUid = {0x20022E82}; // Theme server UID - -/** - * KHbPsOrientationKey - * Current orientation value recieved from sensor. - * Qt::Orientation - */ -const TUint KHbPsOrientationKey = 'Orie'; - -#endif //Q_OS_SYMBIAN - -#endif //HB_COREPSKEYS_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbcorepskeys_r.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/core/hbcorepskeys_r.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,114 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HB_COREPSKEYS_R_H +#define HB_COREPSKEYS_R_H + +#ifdef Q_OS_SYMBIAN + +#include + +/** + * HbCore orientation PS category UID. + */ +const TUid KHbPsHardwareCoarseOrientationCategoryUid = {0x20022E82}; // Theme server UID + +/** + * HbCore internal foreground application orientation PS category UID. + */ +const TUid KHbPsForegroundAppOrientationCategoryUid = {0x20022FC5}; // Device dialog server UID + +/** + * Contains the current orientation value based on the hw sensors and + * other components. + * + * The value is not necessarily based solely on the accelerometer, it + * may be different than that due to the hw keyboard state, lock + * switch, etc. In any case this is the suggested orientation for + * applications and the framework will use this orientation when the + * automatic orientation management is in use by a Hb application + * (i.e. by default). + * + * The sensors are tracked only while the device is not in sleep + * mode. This means that the value is not guaranteed to be immediately + * up-to-date with the current accelerometer orientation after coming + * out of sleep mode. + * + * The value is a TRenderOrientation. + * + * Published by theme server. Used by Hb apps themselves (e.g. when + * showing splash screens) and possibly by wserv. + */ +const TUint KHbPsHardwareCoarseWsOrientationKey = 0x4F726965; + +/** + * Contains the current orientation value based on the hw sensors and + * other components. + * + * The value is not necessarily based solely on the accelerometer, it + * may be different than that due to the hw keyboard state, lock + * switch, etc. In any case this is the suggested orientation for + * applications and the framework will use this orientation when the + * automatic orientation management is in use by a Hb application + * (i.e. by default). + * + * The sensors are tracked only while the device is not in sleep + * mode. This means that the value is not guaranteed to be immediately + * up-to-date with the current accelerometer orientation after coming + * out of sleep mode. + * + * The value is a Qt::Orientation. + * + * Published by theme server. Used by Hb apps themselves (e.g. when + * showing splash screens) and possibly by wserv. + */ +const TUint KHbPsHardwareCoarseQtOrientationKey = 0x4F726966; + +/** + * Current orientation value from the foreground app. + * Applies only to Hb applications, non-Hb apps are not taken into account. + * + * Bits 0-7 contain the Qt::Orientation value. + * If bit 8 is set then the orientation is a fixed (forced) one. + * If bit 8 is not set then the orientation is managed automatically by the framework. + * + * Published by device dialog server. + */ +const TUint KHbPsForegroundAppOrientationKey = 0x46676F72; + +/** + * Mask for the bit that indicates HbMainWindow has fixed orientation + * enabled. + */ +const TUint KHbFixedOrientationMask = 0x100; + +/** + * Used for masking orientation in PS-key. + */ +const TUint KHbOrientationMask = 0xFF; + +#endif //Q_OS_SYMBIAN + +#endif //HB_COREPSKEYS_R_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbevent.cpp --- a/src/hbcore/core/hbevent.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbevent.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,6 +32,11 @@ const int HbEvent::SleepModeEnter = registerEventType(); const int HbEvent::SleepModeExit = registerEventType(); const int HbEvent::WindowLayoutDirectionChanged = registerEventType(); +const int HbEvent::InputMethodFocusIn = registerEventType(); +const int HbEvent::InputMethodFocusOut = registerEventType(); +const int HbEvent::WindowObscuredChanged = registerEventType(); + + /*! @stable @@ -42,25 +47,25 @@ This class supports following extra types of events besides those supported by QEvent - ChildFocusIn - This event is sent from child widget to parent widget to notify that the child - has got the focus. Normally the parent may show some visualization + ChildFocusIn - This event is sent from child widget to parent widget to notify that the child + has got the focus. Normally the parent may show some visualization change when its child gets focus. - ChildFocusOut - This event is sent from child widget to parent widget to notify that the child - has lost the focus. Normally the parent may show some visualization + ChildFocusOut - This event is sent from child widget to parent widget to notify that the child + has lost the focus. Normally the parent may show some visualization change when its child gets focus. - ThemeChanged - This event is sent to all QGraphicsWidget. The widget can handle this event by + ThemeChanged - This event is sent to all QGraphicsWidget. The widget can handle this event by implementing changeEvent() virtual function. - DeviceProfileChanged - This event is sent by the system when device's device profile - (screen resolution) changes. The event causes automatic polish call and - the event can be catched in event(QEvent *event) method. + DeviceProfileChanged - This event is sent by the system when device's device profile + (screen resolution) changes. The event causes automatic polish call and + the event can be caught in event(QEvent *event) method. - SleepModeEnter - This event is sent by the system when the phone enters to the sleep mode. + SleepModeEnter - This event is sent by the system when the phone enters to the sleep mode. If your application/component needs to take some action when entering the sleep mode then you can do it in event(QEvent *event) method. - + SleepModeExit - This event is sent by the system when the phone exist from the sleep mode. If your application/component needs to take some action when exiting the sleep mode then you can do it in event(QEvent *event) method. @@ -69,9 +74,23 @@ window changes. If your application/component needs to take some action upon this event you can do it in event(QEvent *event) method. + InputMethodFocusIn - This event is sent by the input framework to an editor when input method + is connected to the given editor. + The event can be caught in event(QEvent *event) method. + + InputMethodFocusOut - This event is sent by the input framework to an editor + when input method is disconnected from the given editor. + The event can be caught in event(QEvent *event) method. + + WindowObscuredChanged - This event is sent by the system when an HbMainWindow is + either obscured from or revealed to the user. If your + application or component needs to take some action upon this + event you can do it in the event(QEvent *event) method. + + Example of how to send HbEvent \snippet{gui/hbwidget.cpp,1} - + Example of how to receive HbEvent \snippet{gui/hbwidget.cpp,2} */ @@ -81,7 +100,7 @@ \a eventType - type of event */ HbEvent::HbEvent(int eventType) -: QEvent((QEvent::Type)eventType) + : QEvent((QEvent::Type)eventType) { } @@ -124,4 +143,25 @@ Returns the old device profile. */ +/*! + Constructs a window obscured changed event with a pointer to the HbMainWindow + whose obscured state has changed and the obscured state, respectively. +*/ +HbWindowObscuredChangedEvent::HbWindowObscuredChangedEvent(bool obscuredState) + : HbEvent(WindowObscuredChanged), mObscuredState(obscuredState) +{ +} +/*! + \internal +*/ +HbWindowObscuredChangedEvent::~HbWindowObscuredChangedEvent() +{ +} + +/*! + \fn bool HbWindowObscuredChangedEvent::obscuredState() const + + returns the new obscured state for the window. +*/ + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbevent.h --- a/src/hbcore/core/hbevent.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbevent.h Thu Jul 22 16:36:53 2010 +0100 @@ -46,6 +46,9 @@ static const int SleepModeEnter; static const int SleepModeExit; static const int WindowLayoutDirectionChanged; + static const int InputMethodFocusIn; + static const int InputMethodFocusOut; + static const int WindowObscuredChanged; HbEvent(int eventType); }; @@ -56,11 +59,28 @@ HbDeviceProfileChangedEvent(const HbDeviceProfile &profile, const HbDeviceProfile &oldProfile); ~HbDeviceProfileChangedEvent(); - inline const HbDeviceProfile &profile() const { return mProfile; } - inline const HbDeviceProfile &oldProfile()const { return mOldProfile;} + inline const HbDeviceProfile &profile() const { + return mProfile; + } + inline const HbDeviceProfile &oldProfile()const { + return mOldProfile; + } protected: HbDeviceProfile mProfile, mOldProfile; }; +class HB_CORE_EXPORT HbWindowObscuredChangedEvent: public HbEvent +{ +public: + HbWindowObscuredChangedEvent(bool obscuredState); + ~HbWindowObscuredChangedEvent(); + + inline bool obscuredState() const { + return mObscuredState; + } +protected: + bool mObscuredState; +}; + #endif // HB_EVENTS_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbglobal.cpp --- a/src/hbcore/core/hbglobal.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbglobal.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #include #include "hbglobal_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #include #include @@ -37,6 +37,32 @@ */ /*! + \macro HB_VERSION + \relates + + This macro expands a numeric value of the form 0xMMNNPP (MM = + major, NN = minor, PP = patch) that specifies Hb's version + number. For example, if you compile your application against Hb + 1.2.3, the HB_VERSION macro will expand to 0x010203. + + You can use HB_VERSION to use the latest Hb features where + available. + + \sa hbVersion(), HB_VERSION_STR +*/ + +/*! + \macro HB_VERSION_STR + \relates + + This macro expands to a string that specifies Hb's version number + (for example, "1.2.3"). This is the version against which the + application is compiled. + + \sa hbVersionString(), HB_VERSION +*/ + +/*! \macro HB_CORE_EXPORT \relates @@ -52,22 +78,59 @@ and as Q_DECL_IMPORT when using HbWidgets. */ - /*! - \macro HB_AUTOTEST_EXPORT - \relates +/*! + \macro HB_AUTOTEST_EXPORT + \relates - Used for internal exports for testing. + Used for internal exports for testing. */ /*! - Returns the translation text. - \sa QCoreApplication::translate + \relates + + Returns the version number of Hb at run-time (for example, 0x010203). + This may be a different version than the version the application was + compiled against. + + \sa HB_VERSION, hbVersionString() +*/ +uint hbVersion() +{ + return HB_VERSION; +} + +/*! + \relates + + Returns the version number of Hb at run-time as a string (for + example, "1.2.3"). This may be a different version than the + version the application was compiled against. + + \sa HB_VERSION_STR, hbVersion() +*/ +const char *hbVersionString() +{ + return HB_VERSION_STR; +} + +/*! + Returns the translation text from QM file. + + \param id Text ID identifier for translation. Example: txt_common_button_back + \param n Defines numeric argument in case of plural strings. + Note! As second parameter is only for plural strings in normal cases you shouldn't use it. + For non-plural strings use QString::arg() function. + Example: QString text = hbTrId("txt_with_value").arg(value); + + \return Translation if operation was successful, otherwise given \a id. + + \sa QCoreApplication::translate, QString::arg */ QString hbTrId(const char *id, int n) { QString loc = qtTrId(id, n); #ifdef HB_TEXT_MEASUREMENT_UTILITY - if ( HbFeatureManager::instance()->featureStatus( HbFeatureManager::TextMeasurement ) ) { + if (HbFeatureManager::instance()->featureStatus(HbFeatureManager::TextMeasurement)) { loc.append(QChar(LOC_TEST_START)); loc.append(id); loc.append(QChar(LOC_TEST_END)); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbglobal.h --- a/src/hbcore/core/hbglobal.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbglobal.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,9 +30,14 @@ //#pragma hb_header(HbGlobal) +// HB_VERSION_STR="M.N.P-B" (M=major, N=minor, P=patch, B=build=[dev|tag]) +#define HB_VERSION_STR "0.5.0-dev" +// HB_VERSION=0xMMNNPP (MM=major, NN=minor, PP=patch) +#define HB_VERSION 0x000500 + #define HB_EXPORT \ -HB_EXPORT_macro_is_obsolete_Please_use_HB_YOURMODULE_EXPORT_instead \ -{ &HB_EXPORT_macro_is_obsolete_Please_use_HB_YOURMODULE_EXPORT_instead; }; class + HB_EXPORT_macro_is_obsolete_Please_use_HB_YOURMODULE_EXPORT_instead \ + { &HB_EXPORT_macro_is_obsolete_Please_use_HB_YOURMODULE_EXPORT_instead; }; class #define HB_DECL_DEPRECATED Q_DECL_DEPRECATED #define HB_DECL_VARIABLE_DEPRECATED Q_DECL_VARIABLE_DEPRECATED @@ -42,38 +47,52 @@ # ifdef BUILD_HB_CORE # define HB_CORE_EXPORT Q_DECL_EXPORT +# define HB_CORE_RESTRICTED_EXPORT Q_DECL_EXPORT # define HB_CORE_PRIVATE_EXPORT Q_DECL_EXPORT # else # define HB_CORE_EXPORT Q_DECL_IMPORT +# define HB_CORE_RESTRICTED_EXPORT Q_DECL_IMPORT # define HB_CORE_PRIVATE_EXPORT Q_DECL_IMPORT # endif // BUILD_HB_CORE # ifdef BUILD_HB_WIDGETS # define HB_WIDGETS_EXPORT Q_DECL_EXPORT +# define HB_WIDGETS_RESTRICTED_EXPORT Q_DECL_EXPORT # define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_EXPORT # else # define HB_WIDGETS_EXPORT Q_DECL_IMPORT +# define HB_WIDGETS_RESTRICTED_EXPORT Q_DECL_IMPORT # define HB_WIDGETS_PRIVATE_EXPORT Q_DECL_IMPORT # endif // BUILD_HB_WIDGETS -# ifdef BUILD_HB_TOOLS -# define HB_TOOLS_EXPORT Q_DECL_EXPORT +# ifdef BUILD_HB_UTILS +# define HB_UTILS_EXPORT Q_DECL_EXPORT +# define HB_UTILS_RESTRICTED_EXPORT Q_DECL_EXPORT +# define HB_UTILS_PRIVATE_EXPORT Q_DECL_EXPORT # else -# define HB_TOOLS_EXPORT Q_DECL_IMPORT -# endif // BUILD_HB_TOOLS +# define HB_UTILS_EXPORT Q_DECL_IMPORT +# define HB_UTILS_RESTRICTED_EXPORT Q_DECL_IMPORT +# define HB_UTILS_PRIVATE_EXPORT Q_DECL_IMPORT +# endif // BUILD_HB_UTILS # ifdef BUILD_HB_INPUT # define HB_INPUT_EXPORT Q_DECL_EXPORT +# define HB_INPUT_RESTRICTED_EXPORT Q_DECL_EXPORT # define HB_INPUT_PRIVATE_EXPORT Q_DECL_EXPORT # else # define HB_INPUT_EXPORT Q_DECL_IMPORT +# define HB_INPUT_RESTRICTED_EXPORT Q_DECL_IMPORT # define HB_INPUT_PRIVATE_EXPORT Q_DECL_IMPORT # endif // BUILD_HB_INPUT # ifdef BUILD_HB_FEEDBACK # define HB_FEEDBACK_EXPORT Q_DECL_EXPORT +# define HB_FEEDBACK_RESTRICTED_EXPORT Q_DECL_EXPORT +# define HB_FEEDBACK_PRIVATE_EXPORT Q_DECL_EXPORT # else # define HB_FEEDBACK_EXPORT Q_DECL_IMPORT +# define HB_FEEDBACK_RESTRICTED_EXPORT Q_DECL_IMPORT +# define HB_FEEDBACK_PRIVATE_EXPORT Q_DECL_IMPORT # endif // BUILD_HB_FEEDBACK # if defined(HB_DEVELOPER) || defined (Q_OS_SYMBIAN) @@ -89,13 +108,20 @@ #else # define HB_CORE_EXPORT +# define HB_CORE_RESTRICTED_EXPORT # define HB_CORE_PRIVATE_EXPORT # define HB_WIDGETS_EXPORT +# define HB_WIDGETS_RESTRICTED_EXPORT # define HB_WIDGETS_PRIVATE_EXPORT -# define HB_TOOLS_EXPORT +# define HB_UTILS_EXPORT +# define HB_UTILS_RESTRICTED_EXPORT +# define HB_UTILS_PRIVATE_EXPORT # define HB_INPUT_EXPORT +# define HB_INPUT_RESTRICTED_EXPORT # define HB_INPUT_PRIVATE_EXPORT # define HB_FEEDBACK_EXPORT +# define HB_FEEDBACK_RESTRICTED_EXPORT +# define HB_FEEDBACK_PRIVATE_EXPORT # define HB_AUTOTEST_EXPORT #endif // HB_BOOTSTRAPPED @@ -130,6 +156,8 @@ #endif // HB_TEXT_MEASUREMENT_UTILITY +HB_CORE_EXPORT uint hbVersion(); +HB_CORE_EXPORT const char *hbVersionString(); HB_CORE_EXPORT QString hbTrId(const char *id, int n = -1); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbglobal_p.h --- a/src/hbcore/core/hbglobal_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbglobal_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,6 +26,8 @@ #ifndef HBGLOBAL_P_H #define HBGLOBAL_P_H +#include + #ifdef Q_OS_SYMBIAN #define __HB_UHEAP_MARK __UHEAP_MARK #else @@ -40,10 +42,11 @@ // Macros for aiding deprecation -struct HbRecallFlag -{ - HbRecallFlag():oldValue(flag){} - ~HbRecallFlag(){flag = oldValue;} +struct HbRecallFlag { + HbRecallFlag(): oldValue(flag) {} + ~HbRecallFlag() { + flag = oldValue; + } bool oldValue; HB_CORE_EXPORT static bool flag; }; @@ -52,15 +55,15 @@ // This macro ensures that if a deprecated method calls another deprecated // method only one warning msg is shown. #define HB_DEPRECATED(msg)\ -HbRecallFlag recallFlag;\ -if (HbRecallFlag::flag){\ - HbRecallFlag::flag = false;\ - static bool localFlag = true;\ - if(localFlag) {\ - qWarning(msg);\ - localFlag = false;\ - }\ -} + HbRecallFlag recallFlag;\ + if (HbRecallFlag::flag){\ + HbRecallFlag::flag = false;\ + static bool localFlag = true;\ + if(localFlag) {\ + qWarning(msg);\ + localFlag = false;\ + }\ + } // Turns off the deprecation msg #define HB_DEPRECATED_MSG_OFF HbRecallFlag recallFlag; HbRecallFlag::flag = false; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbgraphicsscene.cpp --- a/src/hbcore/core/hbgraphicsscene.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbgraphicsscene.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -42,10 +42,11 @@ #include #include #include +#include bool HbGraphicsScenePrivate::fpsCounterEnabled = false; // Fps counter off by default. -/*! +/*! Define HB_RND_DRAW_ITEM_BORDERS to draw the graphics items' borders CAUTION: clipping and transformations may fail */ @@ -76,6 +77,7 @@ mToolTip(0), mInputFocusSet(0), mPolishWidgets(false), + mRepolishWidgets(false), mDrawCount(0), mFPS(0), mFPSTime(0), @@ -93,11 +95,11 @@ */ void HbGraphicsScenePrivate::clearInputFocus() { - QInputContext* inputContext = qApp->inputContext(); - if (inputContext) { - inputContext->setFocusWidget(0); - } - mInputFocusSet = false; + QInputContext *inputContext = qApp->inputContext(); + if (inputContext) { + inputContext->setFocusWidget(0); + } + mInputFocusSet = false; } //# Focus delegation between focus groups and widgets. Moves focus to next or @@ -120,20 +122,20 @@ while (cont) { result = cont = false; while (widget && !focusGroup) { - focusGroup = widget->d_func()->focusGroup; + focusGroup = widget->d_func()->focusGroup; if (!focusGroup) { item = widget->parentItem(); widget = item ? qobject_cast(item->toGraphicsObject()) : 0; } - } + } if (!focusGroup || !focusGroup->focusParameters().testFlag(HbFocusGroup::AlwaysOn)) { break; } - bool focusNextKey = focusGroup->isFocusNextPrevKey(*event,true); - if (focusNextKey || focusGroup->isFocusNextPrevKey(*event,false)) { + bool focusNextKey = focusGroup->isFocusNextPrevKey(*event, true); + if (focusNextKey || focusGroup->isFocusNextPrevKey(*event, false)) { result = focusGroup->focusNextPrevItem(widget->lastFocusedChild(), focusNextKey); if (result) { @@ -166,11 +168,11 @@ popupManager()->hidePopup(popup); } -HbPopupManager* HbGraphicsScenePrivate::popupManager() +HbPopupManager *HbGraphicsScenePrivate::popupManager() { Q_Q(HbGraphicsScene); if (!mPopupManager) { - mPopupManager = new HbPopupManager(q,q); + mPopupManager = new HbPopupManager(q, q); } return mPopupManager; } @@ -178,19 +180,20 @@ /*! Constructor */ -HbGraphicsScene::HbGraphicsScene(QObject* parent) : QGraphicsScene(parent), -d_ptr(new HbGraphicsScenePrivate) +HbGraphicsScene::HbGraphicsScene(QObject *parent) : QGraphicsScene(parent), + d_ptr(new HbGraphicsScenePrivate) { Q_D(HbGraphicsScene); d->q_ptr = this; #ifdef HB_RND_DRAW_ITEM_BORDERS // see the top of the file - if ( QGraphicsView *view = qobject_cast( parent ) ) { + if (QGraphicsView *view = qobject_cast(parent)) { // set the IndirectPainting flag -> drawItems() is called on paint. - view->setOptimizationFlag( QGraphicsView::IndirectPainting, true ); - } + view->setOptimizationFlag(QGraphicsView::IndirectPainting, true); + } #endif setStickyFocus(true); + d->mPolishItemsIndex = metaObject()->indexOfSlot("_q_polishItems()"); } /*! @@ -206,7 +209,24 @@ \reimp \sa QGraphicsScene */ -void HbGraphicsScene::focusInEvent(QFocusEvent* focusEvent) +QVariant HbGraphicsScene::inputMethodQuery ( Qt::InputMethodQuery query ) const +{ + HbInputMethod* inputMethod = HbInputMethod::activeInputMethod(); + if (inputMethod && inputMethod->focusObject()) { + QGraphicsObject *gObject = qobject_cast(inputMethod->focusObject()->object()); + if (gObject){ + return static_cast(gObject)-> inputMethodQuery(query); + } + } + + return QGraphicsScene::inputMethodQuery(query); +} + +/*! + \reimp + \sa QGraphicsScene + */ +void HbGraphicsScene::focusInEvent(QFocusEvent *focusEvent) { QGraphicsScene::focusInEvent(focusEvent); } @@ -215,7 +235,7 @@ \reimp \sa QGraphicsScene */ -void HbGraphicsScene::focusOutEvent(QFocusEvent* focusEvent) +void HbGraphicsScene::focusOutEvent(QFocusEvent *focusEvent) { QGraphicsScene::focusOutEvent(focusEvent); } @@ -224,24 +244,9 @@ \reimp \sa QGraphicsScene */ -void HbGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent) +void HbGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent) { - QGraphicsScene::mousePressEvent(mouseEvent); - - // If the focused item is not HbWidget (and not an editor) then we send an event to close the input panel - QGraphicsItem* focusedItem = focusItem(); - if(focusedItem) { - QGraphicsObject* focusedObject = focusedItem->toGraphicsObject(); - if(focusedObject && !focusedObject->inherits("HbWidget") && - ((focusedObject->flags() & QGraphicsItem::ItemAcceptsInputMethod) == 0)) { - QInputContext *ic = qApp->inputContext(); - if (ic) { - QEvent *closeEvent = new QEvent(QEvent::CloseSoftwareInputPanel); - ic->filterEvent(closeEvent); - delete closeEvent; - } - } - } + QGraphicsScene::mousePressEvent(mouseEvent); } /*! @@ -260,23 +265,23 @@ painter->setMatrix(items[i]->sceneMatrix(), true); items[i]->paint(painter, &options[i], widget); - const QColor randColor( qrand()%255, qrand()%255, qrand()%255 ); - painter->setPen( randColor ); + const QColor randColor(qrand() % 255, qrand() % 255, qrand() % 255); + painter->setPen(randColor); - painter->drawRect( items[i]->boundingRect() ); + painter->drawRect(items[i]->boundingRect()); painter->restore(); } #else - QGraphicsScene::drawItems( painter, numItems, items, options, widget ); + QGraphicsScene::drawItems(painter, numItems, items, options, widget); #endif // Switch to (1) to draw the borders of the scene #if(0) // Draw the scene rect painter->save(); - const QColor randColor( qrand()%255, qrand()%255, qrand()%255 ); - painter->setPen( randColor ); - painter->drawRect( sceneRect() ); + const QColor randColor(qrand() % 255, qrand() % 255, qrand() % 255); + painter->setPen(randColor); + painter->drawRect(sceneRect()); painter->restore(); #endif } @@ -284,50 +289,71 @@ void HbGraphicsScene::drawBackground(QPainter *painter, const QRectF &rect) { Q_D(HbGraphicsScene); - if (d->mPolishWidgets) { + if (d->mPolishWidgets || d->mRepolishWidgets) { // mPolishWidgets is set to true in HbWidget when a widget's scene has // changed. We invoke polish slot of qgraphicsscene here so that layout // requests resulting from polish can be handled before drawing the // widget. This is done more than once because most widgets try to create their // primitives in polish event. It will also make sure that we do not // have any pending layout requests in event loop. + // It also handles the case when widget layout is changing dynamically after it has been polished and + //visible on screen. + QMetaMethod method = metaObject()->method(d->mPolishItemsIndex); + // As we want to handle all the polish events before handling layout requests, + // we do this in two seperate loops. We handle all the repolish and polish requests first + // and than handle the layout requests. + for (int i = 0; i < 2; ++i) { + //This is run twice so that we handle all polish and itemChangeNotifications of widget + //and if any primitives are created in the polish event. + + //handle any pending repolish requests first.As Widgets could add new child items + // in repolish call. + if (d->mRepolishWidgets) { + d->mRepolishWidgets = false; + QApplication::sendPostedEvents(0, QEvent::Polish); + } + // invoke the slot in graphicsscene.This makes sure we handle the adjustSize() + //in itemChange notification sent by qgraphicsscene.These makes sure all layout requests + //are handled before paint. + method.invoke(this); + } for (int i = 0; i < 3; ++i) { - QMetaObject::invokeMethod(this, "_q_polishItems"); - QApplication::sendPostedEvents(0, QEvent::LayoutRequest); + QApplication::sendPostedEvents(0, QEvent::LayoutRequest); } d->mPolishWidgets = false; } - QGraphicsScene::drawBackground(painter,rect); + QGraphicsScene::drawBackground(painter, rect); } -void HbGraphicsScene::drawForeground ( QPainter * painter, const QRectF & /*rect*/ ) +void HbGraphicsScene::drawForeground(QPainter *painter, const QRectF & /*rect*/) { - Q_D(HbGraphicsScene); + Q_D(HbGraphicsScene); if (!d->mToolTip) { d->mToolTip = new HbToolTipLabel(); addItem(d->mToolTip); } - if(d->fpsCounterEnabled) { - if(!d->mFPSTime) { + if (d->fpsCounterEnabled) { + if (!d->mFPSTime) { d->mFPSTime = new QTime(); d->mFPSTime->start(); } d->mDrawCount++; - if(d->mFPSTime->elapsed() > 500) { + if (d->mFPSTime->elapsed() > 500) { int elapsed = d->mFPSTime->restart(); qreal e = elapsed; - if(d->mDrawCount > 2) { // just to minize problems with idle time - d->mFPS = d->mFPS * 0.5 + 0.5 * (qreal(d->mDrawCount * 1000) / e); + if (d->mDrawCount > 2) { // just to minize problems with idle time + d->mFPS = d->mFPS * 0.5 + 0.5 * (qreal(d->mDrawCount * 1000) / e); } d->mDrawCount = 0; QTimer::singleShot(10, this, SLOT(update())); } - if (d->mFPS > d->mMaxFPS) - d->mMaxFPS = d->mFPS; + if (d->mFPS > d->mMaxFPS) { + d->mMaxFPS = d->mFPS; + } painter->save(); - painter->setFont(QFont("Arial", 12, QFont::Bold )); - painter->setPen(QColor(255,0,0)); - painter->drawText(0,32,QString("FPS: %0 (%1)").arg(int(d->mFPS)).arg(int(d->mMaxFPS))); + painter->setFont(QFont("Arial", 12, QFont::Bold)); + painter->setPen(QColor(255, 0, 0)); + painter->drawText(0, 32, QString("FPS: %0 (%1)").arg(int(d->mFPS)).arg(int(d->mMaxFPS))); painter->restore(); } } @@ -335,7 +361,7 @@ /*! \reimp */ -void HbGraphicsScene::helpEvent ( QGraphicsSceneHelpEvent * helpEvent ) +void HbGraphicsScene::helpEvent(QGraphicsSceneHelpEvent *helpEvent) { Q_UNUSED(helpEvent); // Reimplemented to prevent desktop tool tips to be shown. @@ -344,23 +370,48 @@ /*! \reimp */ -bool HbGraphicsScene::event ( QEvent * event ) +bool HbGraphicsScene::event(QEvent *event) { Q_D(HbGraphicsScene); + if (event->type() == QEvent::InputMethod) { + HbInputMethod* inputMethod = HbInputMethod::activeInputMethod(); + if (inputMethod && inputMethod->focusObject()) { + QGraphicsObject *gObject = qobject_cast(inputMethod->focusObject()->object()); + if (gObject){ + static_cast(gObject)-> + inputMethodEvent(static_cast(event)); + return true; + } + } + } else if (event->type() == QEvent::KeyPress || + event->type() == QEvent::KeyRelease) { + HbInputMethod* inputMethod = HbInputMethod::activeInputMethod(); + if (inputMethod && inputMethod->focusObject()) { + QGraphicsObject *gObject = qobject_cast(inputMethod->focusObject()->object()); + if (gObject){ + bool result = static_cast(gObject)->event(event); + if (result) { + return result; + } + } + } + } + if (d->mToolTip) { d->mToolTip->eventHook(event); } if (d->mPopupManager) { d->mPopupManager->eventHook(event); } + bool result = QGraphicsScene::event(event); if (event->type() == QEvent::KeyPress && !event->isAccepted()) { QKeyEvent *e = static_cast(event); result = d->focusChangeEvent(e); event->accept(); - } + } return result; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbgraphicsscene.h --- a/src/hbcore/core/hbgraphicsscene.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbgraphicsscene.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,7 +34,7 @@ class HbGraphicsScenePrivate; class HbPopup; -class HB_CORE_EXPORT HbGraphicsScene : public QGraphicsScene +class HB_CORE_EXPORT HbGraphicsScene : public QGraphicsScene //krazy:exclude=qclasses { Q_OBJECT @@ -42,19 +42,21 @@ HbGraphicsScene(QObject *parent = 0); ~HbGraphicsScene(); + QVariant inputMethodQuery ( Qt::InputMethodQuery query ) const; + protected: - void focusInEvent(QFocusEvent *focusEvent); + void focusInEvent(QFocusEvent *focusEvent); void focusOutEvent(QFocusEvent *focusEvent); - void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent); + void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent); void drawItems(QPainter *painter, int numItems, - QGraphicsItem *items[], - const QStyleOptionGraphicsItem options[], - QWidget *widget = 0); + QGraphicsItem *items[], + const QStyleOptionGraphicsItem options[], + QWidget *widget = 0); void drawBackground(QPainter *painter, const QRectF &rect); void drawForeground(QPainter *painter, const QRectF &rect); - void helpEvent ( QGraphicsSceneHelpEvent * helpEvent ); - bool event ( QEvent * event ); + void helpEvent(QGraphicsSceneHelpEvent *helpEvent); + bool event(QEvent *event); private: HbGraphicsScenePrivate *const d_ptr; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbgraphicsscene_p.h --- a/src/hbcore/core/hbgraphicsscene_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbgraphicsscene_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,7 +44,7 @@ HbGraphicsScenePrivate(); virtual ~HbGraphicsScenePrivate(); - void setInputFocus(QGraphicsItem* focusingWidget); + void setInputFocus(QGraphicsItem *focusingWidget); void clearInputFocus(); bool focusChangeEvent(const QKeyEvent *event); @@ -52,7 +52,7 @@ void showPopup(HbPopup *popup); void hidePopup(HbPopup *popup); - HbPopupManager* popupManager(); + HbPopupManager *popupManager(); public: HbGraphicsScene *q_ptr; @@ -60,14 +60,24 @@ HbToolTipLabel *mToolTip; bool mInputFocusSet; bool mPolishWidgets; + bool mRepolishWidgets; + int mPolishItemsIndex; // fps counter static bool fpsCounterEnabled; int mDrawCount; qreal mFPS; - QTime *mFPSTime; + QTime *mFPSTime; qreal mMaxFPS; private: + + class GraphicsObject: public QGraphicsObject + { + public: + using QGraphicsObject::inputMethodEvent; + using QGraphicsObject::inputMethodQuery; + }; + static HbGraphicsScenePrivate *d_ptr(HbGraphicsScene *scene) { Q_ASSERT(scene); return scene->d_func(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbinstance.cpp --- a/src/hbcore/core/hbinstance.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbinstance.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -40,7 +40,7 @@ // for testability plugin #ifdef HB_TESTABILITY -#include +#include #include #include #include "hbtestabilityinterface_p.h" @@ -76,7 +76,7 @@ hbInstance). The example below shows how hbInstance global pointer can be used to access theme name: - + \dontinclude ultimatecodesnippet/main.cpp \skip int main( \until setApplicationName @@ -85,7 +85,7 @@ \sa QApplication \sa HbApplication - + */ /*! @@ -106,11 +106,12 @@ mStyle(0), mTheme(HbTheme::instance()), mOrientation(Qt::Vertical), - mLibraryPaths( 0 ) -#ifdef Q_OS_SYMBIAN - ,testabilityEnabled(false) + mLibraryPaths(0) +#ifdef Q_OS_SYMBIAN + , testabilityEnabled(false), + mSts(0) #endif //Q_OS_SYMBIAN - ,mLocaleChangeNotifier(0) + , mLocaleChangeNotifier(0) { // initialization of dynamics parts of feedback manager HbFeedbackManager::instance(); @@ -118,22 +119,22 @@ #ifdef HB_TESTABILITY testabilityInterface = 0; -#ifdef Q_OS_SYMBIAN - TRAPD( err, mRepo = CRepository::NewL( HBTESTABILITY_CREPO_ID ) ); - if( err == KErrNone ) { - TInt value = 0; - err = mRepo->Get( HbTestabilityKey, value ); - if(err == KErrNone && value == 1 ){ - testabilityEnabled = ETrue; - } - } +#ifdef Q_OS_SYMBIAN + TRAPD(err, mRepo = CRepository::NewL(HBTESTABILITY_CREPO_ID)); + if (err == KErrNone) { + TInt value = 0; + err = mRepo->Get(HbTestabilityKey, value); + if (err == KErrNone && value == 1) { + testabilityEnabled = ETrue; + } + } #endif //Q_OS_SYMBIAN #endif //HB_TESTABILITY connect(mTheme, SIGNAL(changeFinished()), this, SLOT(updateScenes())); #ifdef HB_TESTABILITY - // Activate testability plugin if exists + // Activate testability plugin if exists QObject *plugin = 0; #if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN) @@ -152,45 +153,44 @@ #ifdef Q_OS_SYMBIAN //TEMPORARY workaround: - //there is a defect in s60 qt port so that it does not search for plugins + //there is a defect in s60 qt port so that it does not search for plugins //from all possible drives, so check for existence before loading the plugin //issue has been reported to port team and they will fix it at some point - if(testabilityEnabled){ - QString flashDrive = "C:"; - QString romDrive = "Z:"; - - //add drive letter to plugin path and then check c and z for the plugin - if(!testabilityPlugin.startsWith(flashDrive,Qt::CaseInsensitive) && !testabilityPlugin.startsWith(romDrive,Qt::CaseInsensitive)){ - testabilityPlugin = flashDrive + testabilityPlugin; + if (testabilityEnabled) { + QString flashDrive = "C:"; + QString romDrive = "Z:"; + + //add drive letter to plugin path and then check c and z for the plugin + if (!testabilityPlugin.startsWith(flashDrive, Qt::CaseInsensitive) && !testabilityPlugin.startsWith(romDrive, Qt::CaseInsensitive)) { + testabilityPlugin = flashDrive + testabilityPlugin; + } + + QPluginLoader loader(testabilityPlugin.toLatin1().data()); + + plugin = loader.instance(); + + if (!plugin) { + if (testabilityPlugin.startsWith(flashDrive, Qt::CaseInsensitive)) { + testabilityPlugin.replace(flashDrive, romDrive, Qt::CaseInsensitive); + } else { + testabilityPlugin.replace(romDrive, flashDrive, Qt::CaseInsensitive); + } - - QPluginLoader loader(testabilityPlugin.toLatin1().data()); - - plugin = loader.instance(); - - if(!plugin){ - if(testabilityPlugin.startsWith(flashDrive,Qt::CaseInsensitive)){ - testabilityPlugin.replace(flashDrive, romDrive, Qt::CaseInsensitive); - } - else{ - testabilityPlugin.replace(romDrive, flashDrive, Qt::CaseInsensitive); - - } - loader.setFileName(testabilityPlugin.toLatin1().data()); - plugin = loader.instance(); - } + loader.setFileName(testabilityPlugin.toLatin1().data()); + plugin = loader.instance(); } - //if the file is in neither then let failure occur similarly as with other platforms -#else + } + //if the file is in neither then let failure occur similarly as with other platforms +#else QPluginLoader loader(testabilityPlugin.toLatin1().data()); plugin = loader.instance(); #endif //Q_OS_SYMBIAN if (plugin) { - testabilityInterface = qobject_cast(plugin); - if (testabilityInterface) { - testabilityInterface->Initialize(); - } + testabilityInterface = qobject_cast(plugin); + if (testabilityInterface) { + testabilityInterface->Initialize(); + } } #endif //end testability mLocaleChangeNotifier = q_check_ptr(new HbLocaleChangeNotifier()); @@ -215,28 +215,34 @@ */ HbInstancePrivate::~HbInstancePrivate() { - delete mTypefaceInfo; - delete mStyle; + delete mTypefaceInfo; + delete mStyle; delete mLibraryPaths; - + delete mLocaleChangeNotifier; mLocaleChangeNotifier = 0; - + #ifdef HB_TESTABILITY //remove the testability plugin if it exists //makes sure that all resources used by the plugin //are free when the application exists - if (testabilityInterface){ + if (testabilityInterface) { delete testabilityInterface; testabilityInterface = 0; } #endif //HB_TESTABILITY #ifdef Q_OS_SYMBIAN - if(mRepo){ + if (mRepo) { delete mRepo; mRepo = 0; } + + if (mSts) { + CSystemToneService::Delete(mSts); + mSts=0; + } + #endif //Q_OS_SYMBIAN } @@ -263,6 +269,25 @@ /*! \internal */ + +/*! +\internal +*/ +CSystemToneService* HbInstancePrivate::systemTone() +{ + #ifdef Q_OS_SYMBIAN + + if(mSts == 0) { + mSts = CSystemToneService::Create(); + } + return mSts; + + #else + return 0; + #endif + +} + bool HbInstancePrivate::removeWindow(HbMainWindow *window) { bool result = mWindows.removeOne(window); @@ -289,8 +314,8 @@ { HbDeviceProfile oldProfile = mCurrentProfile; mCurrentProfile = profile; - - QListIterator iterator(mWindows); + + QListIterator iterator(mWindows); while (iterator.hasNext()) { HbMainWindow *window = iterator.next(); @@ -312,7 +337,7 @@ QGraphicsScene *updatedScene = 0; //krazy:exclude=qclasses // Update graphics scenes - Q_FOREACH(HbMainWindow *window, mWindows) { + Q_FOREACH(HbMainWindow * window, mWindows) { QGraphicsScene *scene = window->scene(); //krazy:exclude=qclasses if (scene && scene != updatedScene) { scene->update(); @@ -360,7 +385,7 @@ */ void HbInstancePrivate::initLibraryPaths() { - if ( !mLibraryPaths ) { + if (!mLibraryPaths) { mLibraryPaths = new QStringList; #if defined(Q_OS_SYMBIAN) @@ -368,7 +393,7 @@ QFileInfoList driveInfoList = QDir::drives(); - foreach (const QFileInfo &driveInfo, driveInfoList) { + foreach(const QFileInfo & driveInfo, driveInfoList) { QFileInfo pathInfo(driveInfo.absolutePath() + pluginRelativePath); if (pathInfo.exists()) { *mLibraryPaths << pathInfo.absolutePath(); @@ -405,11 +430,14 @@ /*! Returns static instance */ -HbInstance* HbInstance::instance() +HbInstance *HbInstance::instance() { +#ifndef Q_OS_SYMBIAN if (!QCoreApplication::instance()) { qWarning("HbInstance: No application instance present."); } +#endif // Q_OS_SYMBIAN + static HbInstance theInstance; return &theInstance; } @@ -423,26 +451,26 @@ \sa HbWidget::mainWindow() */ -QList HbInstance::allMainWindows() const +QList HbInstance::allMainWindows() const { return d->mWindows; } /*! - Returns the platform style object. Note that widgets can use HbWidget's style()-method to get the - style without using HbInstance. + Returns the platform style object. Note that widgets can use HbWidget's style()-method to get the + style without using HbInstance. */ HbStyle *HbInstance::style() const { - if( !d->mStyle ){ - d->mStyle = new HbStyle(); + if (!d->mStyle) { + d->mStyle = new HbStyle(); } return d->mStyle; } /*! - Returns the platform theme object. + Returns the platform theme object. */ HbTheme *HbInstance::theme() const { @@ -460,7 +488,7 @@ */ void HbInstance::setLibraryPaths(const QStringList &paths) { - if ( !d->mLibraryPaths ) { + if (!d->mLibraryPaths) { d->mLibraryPaths = new QStringList; } *d->mLibraryPaths = paths; @@ -468,15 +496,15 @@ /*! Prepends \a path to the beginning of the library path list. The paths - will be search in order, so the \a path is the first. + will be search in order, so the \a path is the first. The default path list consists of - \li desktop environments: the installation directory for plugins - and application execution directory. The default installation - directory for plugins is INSTALL/plugins, where INSTALL is the + \li desktop environments: the installation directory for plugins + and application execution directory. The default installation + directory for plugins is INSTALL/plugins, where INSTALL is the directory where Hb was installed. - \li Symbian: \c resource/plugins/ directory on each drive found + \li Symbian: \c resource/plugins/ directory on each drive found from the device \sa HbInstance::removeLibraryPath() @@ -485,8 +513,9 @@ */ void HbInstance::addLibraryPath(const QString &path) { - if (path.isEmpty()) + if (path.isEmpty()) { return; + } d->initLibraryPaths(); @@ -497,7 +526,7 @@ } /*! - Removes path from the library path list. If path is empty or not in the path list, + Removes path from the library path list. If path is empty or not in the path list, the list is not changed. See also addLibraryPath(), libraryPaths(), and setLibraryPaths(). @@ -516,7 +545,7 @@ /*! - Returns a list of paths that the application will search when dynamically + Returns a list of paths that the application will search when dynamically loading libraries. \sa HbInstance::removeLibraryPath() diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbinstance.h --- a/src/hbcore/core/hbinstance.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbinstance.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,7 @@ { public: static HbInstance *instance(); - + QList allMainWindows() const; HbStyle *style() const; @@ -62,7 +62,7 @@ ~HbInstance(); friend class HbInstancePrivate; - HbInstancePrivate * const d; + HbInstancePrivate *const d; }; #endif // HBINSTANCE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbinstance_p.h --- a/src/hbcore/core/hbinstance_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbinstance_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,11 +37,14 @@ #ifdef Q_OS_SYMBIAN #include +#include + const TUid HBTESTABILITY_CREPO_ID = {0x2002C3AE}; -const TUint32 HbTestabilityKey = 0x1; +const TUint32 HbTestabilityKey = 0x1; #endif class HbLocaleChangeNotifier; +class CSystemToneService; class HbInstancePrivate : public QObject { @@ -54,7 +57,7 @@ bool removeWindow(HbMainWindow *window); void select(const HbDeviceProfile &display); HbDeviceProfile profile(); - + CSystemToneService *systemTone(); void initLibraryPaths(); public slots: @@ -85,14 +88,15 @@ private: #ifdef HB_TESTABILITY TestabilityInterface *testabilityInterface; -#ifdef Q_OS_SYMBIAN - CRepository *mRepo; - bool testabilityEnabled; +#ifdef Q_OS_SYMBIAN + CRepository *mRepo; + bool testabilityEnabled; + CSystemToneService *mSts; #endif //Q_OS_SYMBIAN #endif //HB_TESTABILITY - HbLocaleChangeNotifier* mLocaleChangeNotifier; - + HbLocaleChangeNotifier *mLocaleChangeNotifier; + // Provided for HbMainWindow & friends who have to access // HbInstancePrivate in order to add/remove windows. // NOTE: Still kept as private to track dependencies... @@ -108,6 +112,7 @@ friend class HbEffectPrivate; friend class HbMainWindowOrientation; friend class HbWidgetStyleLoader; + friend class HbPopupPrivate; }; #endif // HBINSTANCE_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hblocalechangenotifier_p.cpp --- a/src/hbcore/core/hblocalechangenotifier_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hblocalechangenotifier_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ #endif // Q_OS_SYMBIAN #include "hblocalechangenotifier_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #ifdef Q_OS_SYMBIAN diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbmainwindoworientation.cpp --- a/src/hbcore/core/hbmainwindoworientation.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbmainwindoworientation.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,10 +23,10 @@ ** ****************************************************************************/ +#include "hbmainwindoworientation_p.h" #include "hbmainwindow_p.h" #include "hbinstance_p.h" #include "hbforegroundwatcher_p.h" -#include "hbmainwindoworientation_p.h" #include HbMainWindowOrientation *HbMainWindowOrientation::instance() @@ -65,26 +65,25 @@ #ifndef Q_OS_SYMBIAN void HbMainWindowOrientation::forceSensorOrientationValue(Qt::Orientation orientation) { - QSettings mSettings("Nokia", "HbStartUpDeskTopSensors"); + QSettings mSettings("Nokia", "HbStartUpDeskTopSensors"); mSensorListener->setSensorOrientation(orientation); - switch(orientation) { - case Qt::Vertical: - mSettings.setValue("Orientation", 2); - break; - case Qt::Horizontal: - mSettings.setValue("Orientation", 1); - break; - default: - break; + switch (orientation) { + case Qt::Vertical: + mSettings.setValue("Orientation", 2); + break; + case Qt::Horizontal: + mSettings.setValue("Orientation", 1); + break; + default: + break; } } -#endif +#endif void HbMainWindowOrientation::handleForegroundGained() { mForeground = true; - notifyOrientationChange(false, true); } void HbMainWindowOrientation::handleForegroundLost() @@ -92,27 +91,28 @@ mForeground = false; } -void HbMainWindowOrientation::handleWindowAdded(HbMainWindow *window) +void HbMainWindowOrientation::handleWindowAdded(HbMainWindow *window) { mWindowList.append(window); - if (isEnabled()) + if (isEnabled()) { mDefaultOrientation = HbMainWindowPrivate::d_ptr(window)->mDefaultOrientation; + } } -void HbMainWindowOrientation::handleWindowRemoved(HbMainWindow *window) +void HbMainWindowOrientation::handleWindowRemoved(HbMainWindow *window) { - mWindowList.removeOne(window); + mWindowList.removeOne(window); } HbMainWindowOrientation::HbMainWindowOrientation(QObject *parent) : QObject(parent), - mSensorListener(0), - mFixedOrientation(false) + mSensorListener(0), + mFixedOrientation(false) { //Get mainwindows from instance. Can't use mainWindow() method from HbWidget, //because this class is not inherited from it mWindowList = hbInstance->allMainWindows(); - + mForeground = true; //Get a current device profile @@ -121,10 +121,11 @@ QSize pSize(profile.logicalSize()); //Determine the default orientation width < height -> portrait - if (pSize.width() < pSize.height()) + if (pSize.width() < pSize.height()) { mDefaultOrientation = Qt::Vertical; - else + } else { mDefaultOrientation = Qt::Horizontal; + } mOrientation = mDefaultOrientation; mSensorListener = new HbSensorListener(*this, mDefaultOrientation); @@ -136,8 +137,8 @@ connect(mForegroundWatcher, SIGNAL(foregroundLost()), SLOT(handleForegroundLost())); // Need a notification when a mainwindow is added or removed in the future. - connect(HbInstancePrivate::d_ptr(), SIGNAL(windowAdded(HbMainWindow*)), SLOT(handleWindowAdded(HbMainWindow*))); - connect(HbInstancePrivate::d_ptr(), SIGNAL(windowRemoved(HbMainWindow*)), SLOT(handleWindowRemoved(HbMainWindow*))); + connect(HbInstancePrivate::d_ptr(), SIGNAL(windowAdded(HbMainWindow *)), SLOT(handleWindowAdded(HbMainWindow *))); + connect(HbInstancePrivate::d_ptr(), SIGNAL(windowRemoved(HbMainWindow *)), SLOT(handleWindowRemoved(HbMainWindow *))); // Update current orientation if sensors are enabled if (isEnabled()) { @@ -154,7 +155,7 @@ void HbMainWindowOrientation::sensorStatusChanged(bool status, bool notify) { if (status) { - foreach(HbMainWindow *window, mWindowList) { + foreach(HbMainWindow * window, mWindowList) { if (!mFixedOrientation && !HbMainWindowPrivate::d_ptr(window)->mUserOrientationSwitch) { HbMainWindowPrivate::d_ptr(window)->mAutomaticOrientationSwitch = true; } @@ -165,9 +166,7 @@ // Notifies orientation change only if // 1) automatic orientation change is enabled -// 2) application is in foreground -// 3) application has not set fixed orientation for the main window -// 4) mainwindow's windowSurface exists +// 2) application has not set fixed orientation for the main window void HbMainWindowOrientation::notifyOrientationChange(bool animate, bool notifyWhenDisabled) { Qt::Orientation newOrientation = mOrientation; @@ -175,16 +174,17 @@ if (!isEnabled() && notifyWhenDisabled) { newOrientation = mDefaultOrientation; } - foreach(HbMainWindow *window, mWindowList) { - void *surface(0); - if (window) - surface = (void*)window->windowSurface(); - if (!HbMainWindowPrivate::d_ptr(window)->mAutomaticOrientationChangeAnimation) + foreach(HbMainWindow * window, mWindowList) { + if (!HbMainWindowPrivate::d_ptr(window)->mAutomaticOrientationChangeAnimation) { animate = false; - - if ((isEnabled() || notifyWhenDisabled) && (mForeground || surface) - && HbMainWindowPrivate::d_ptr(window)->mAutomaticOrientationSwitch) { + } + if ((isEnabled() || notifyWhenDisabled) + && HbMainWindowPrivate::d_ptr(window)->mAutomaticOrientationSwitch) { + if (mForeground){ HbMainWindowPrivate::d_ptr(window)->setTransformedOrientation(newOrientation, animate); + } else { + HbMainWindowPrivate::d_ptr(window)->setTransformedOrientation(newOrientation, false); + } } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbmainwindoworientation_p.h --- a/src/hbcore/core/hbmainwindoworientation_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbmainwindoworientation_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,9 +32,8 @@ class HbMainWindow; class HbForegroundWatcher; -class HbSleepModeListener; -class HB_AUTOTEST_EXPORT HbMainWindowOrientation : public QObject, +class HB_AUTOTEST_EXPORT HbMainWindowOrientation : public QObject, public HbSensorListenerObserver { Q_OBJECT @@ -54,12 +53,12 @@ void handleForegroundGained(); void handleForegroundLost(); void handleWindowAdded(HbMainWindow *window); - void handleWindowRemoved(HbMainWindow *window); + void handleWindowRemoved(HbMainWindow *window); -private: +private: HbMainWindowOrientation(QObject *parent = 0); void sensorOrientationChanged(Qt::Orientation newOrientation); - void sensorStatusChanged(bool status, bool notify); + void sensorStatusChanged(bool status, bool notify); void notifyOrientationChange(bool animate, bool notifyWhenDisabled = false); private: @@ -79,4 +78,3 @@ }; #endif //HBMAINWINDOWORIENTATION_P_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbmemorymanager_p.cpp --- a/src/hbcore/core/hbmemorymanager_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbmemorymanager_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ #include "hbmemoryutils_p.h" #define SHARED_CONTAINER_UNITTEST_PREFIX "unittest_hbsharedcontainer_" -#define SHARED_MEMORYMANAGER_UNITTEST_PREFIX "unittest_hbmemorymanager" +#define SHARED_MEMORYMANAGER_UNITTEST_PREFIX "unittest_hbsharedmemory" /** * helper function to know whether process is a shared container unittest diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbmemorymanager_p.h --- a/src/hbcore/core/hbmemorymanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbmemorymanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,6 @@ //in 4.6. #define HB_CHECK_PTR(ptr) if(!ptr) throw std::bad_alloc(); - class HB_CORE_PRIVATE_EXPORT HbMemoryManager { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbmemoryutils_p.h --- a/src/hbcore/core/hbmemoryutils_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbmemoryutils_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -56,7 +56,7 @@ static T * create(HbMemoryManager::MemoryType memType) { GET_MEMORY_MANAGER(memType); - T* temp = 0; + T *temp = 0; if (manager->isWritable()) { HbSmartOffset offset(manager->alloc(sizeof(T)), memType); temp = new((char*)manager->base() + offset.get()) T(memType); @@ -75,7 +75,7 @@ static T * create(const T &other, HbMemoryManager::MemoryType memType) { GET_MEMORY_MANAGER(memType); - T* temp = 0; + T *temp = 0; if (manager->isWritable()) { HbSmartOffset offset(manager->alloc(sizeof(T)),memType); temp = new((char*)manager->base() + offset.get()) T(other, memType); @@ -126,7 +126,8 @@ template static T * getAddress(HbMemoryManager::MemoryType type, int offset) { - if (offset == -1 || offset == -2 ) { + // Do not change the condition to (<0), valid address can be negative. + if (offset == -1) { return 0; } GET_MEMORY_MANAGER(type) @@ -136,7 +137,7 @@ /* * returns application file name without extension. */ - static const QString& getCleanAppName() + static const QString &getCleanAppName() { // making static to avoid string multiple string operation on each call.. static QString cleanAppName; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbmultisegmentallocator_p.cpp --- a/src/hbcore/core/hbmultisegmentallocator_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbmultisegmentallocator_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -68,7 +68,7 @@ * This allocates memory from main allocator and won't block main allocator's * OOM exception. */ -void HbMultiSegmentAllocator::initialize(QSharedMemory *sharedChunk, +void HbMultiSegmentAllocator::initialize(HbSharedMemoryWrapper *sharedChunk, const unsigned int offset, HbSharedMemoryAllocator *mainAllocator) { @@ -85,7 +85,7 @@ } while (index <= limit); } - header = (MultiAllocatorHeader*)((unsigned char*)(chunk->data()) + offset); + header = address(offset); if (header->identifier == INITIALIZED_MULTISEGMENTALLOCATOR_IDENTIFIER) { return; // already initialized } @@ -93,12 +93,14 @@ // every chunk list have space for 512 chunks ChunkListHeader *listHeader; for (int i = 0; i < AMOUNT_OF_DIFFERENT_CHUNK_SIZES; i++) { - header->offsetsToChunkLists[i] = mainAllocator->alloc(sizeof(ChunkListHeader) + (sizeof(int)+ChunkSizes[i])*CHUNKS_IN_ONE_LIST); + header->offsetsToChunkLists[i] = mainAllocator->alloc(sizeof(ChunkListHeader) + + (sizeof(int) + ChunkSizes[i]) + * CHUNKS_IN_ONE_LIST); header->offsetsToFreeChunkLists[i] = header->offsetsToChunkLists[i]; - listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + header->offsetsToChunkLists[i]); + listHeader = address(header->offsetsToChunkLists[i]); listHeader->chunkListIndex = i; listHeader->freedChunkCursor = -1; - listHeader->allocCursor = header->offsetsToChunkLists[i]+sizeof(ChunkListHeader); + listHeader->allocCursor = header->offsetsToChunkLists[i] + sizeof(ChunkListHeader); listHeader->previousListOffset = -1; listHeader->nextListOffset = -1; listHeader->allocatedChunks = 0; @@ -135,23 +137,20 @@ // first find out correct list of chunks int i = indexTable[size]; - - // qDebug() << "HbMultiSegmentAllocator::alloc, with size " << size << " chunkList " << i << " used\n"; - int dataOffset = -1; int *metaData = 0; // this should always point to list with free chunks - ChunkListHeader *listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + header->offsetsToFreeChunkLists[i]); + ChunkListHeader *listHeader = address(header->offsetsToFreeChunkLists[i]); if (listHeader->freedChunkCursor >= 0) { // freedChunkCursor points to freed chunk dataOffset = listHeader->freedChunkCursor + sizeof(int); - metaData = (int*)((unsigned char*)(chunk->data())+listHeader->freedChunkCursor); + metaData = address(listHeader->freedChunkCursor); listHeader->freedChunkCursor = *metaData; // point to next freed chunk } else { // no chunks freed -> allocate in order dataOffset = listHeader->allocCursor + sizeof(int); - metaData = (int*)((unsigned char*)(chunk->data())+listHeader->allocCursor); + metaData = address(listHeader->allocCursor); // we will never allocate from full list, so allocCursor is always valid - listHeader->allocCursor += ChunkSizes[listHeader->chunkListIndex]+sizeof(int); + listHeader->allocCursor += ChunkSizes[listHeader->chunkListIndex] + sizeof(int); } // for allocated chunks metadata is: @@ -163,7 +162,9 @@ if (!setFreeList(listHeader->chunkListIndex)) { // there is no list(s) with free chunks, so add new list addList(listHeader->chunkListIndex, - mainAllocator->alloc((sizeof(ChunkListHeader)+sizeof(int)+ChunkSizes[listHeader->chunkListIndex])*CHUNKS_IN_ONE_LIST)); + mainAllocator->alloc((sizeof(ChunkListHeader) + sizeof(int) + + ChunkSizes[listHeader->chunkListIndex]) + * CHUNKS_IN_ONE_LIST)); } } @@ -176,19 +177,19 @@ void HbMultiSegmentAllocator::free(int offset) { // metadata has offset to list's header - int *metaData = (int*)((unsigned char*)(chunk->data())+offset-sizeof(int)); + int *metaData = address(offset - sizeof(int)); int listHeaderOffset = *metaData; - ChunkListHeader *listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + listHeaderOffset); + ChunkListHeader *listHeader = address(listHeaderOffset); listHeader->allocatedChunks--; if (listHeader->allocatedChunks == 0) { // if there are multiple lists, this list could be released ChunkListHeader *previous = 0; if (listHeader->previousListOffset > -1) { - previous = (ChunkListHeader*)((unsigned char*)(chunk->data()) + listHeader->previousListOffset); + previous = address(listHeader->previousListOffset); } ChunkListHeader *next = 0; if (listHeader->nextListOffset > -1) { - next = (ChunkListHeader*)((unsigned char*)(chunk->data()) + listHeader->nextListOffset); + next = address(listHeader->nextListOffset); } if (previous || next) { @@ -212,12 +213,12 @@ } else { // only list can't be freed *metaData = listHeader->freedChunkCursor; - listHeader->freedChunkCursor = offset-sizeof(int); + listHeader->freedChunkCursor = offset - sizeof(int); } } else { // this list is not yet empty *metaData = listHeader->freedChunkCursor; - listHeader->freedChunkCursor = offset-sizeof(int); + listHeader->freedChunkCursor = offset - sizeof(int); } } @@ -229,8 +230,8 @@ */ int HbMultiSegmentAllocator::allocatedSize(int offset) { - int *metaData = (int*)((unsigned char*)(chunk->data())+offset-sizeof(int)); - ChunkListHeader *listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + *metaData); + int *metaData = address(offset - sizeof(int)); + ChunkListHeader *listHeader = address(*metaData); // not actual size in alloc(), but the size of chunk, where this data is stored return ChunkSizes[listHeader->chunkListIndex]; } @@ -241,12 +242,12 @@ */ void HbMultiSegmentAllocator::addList(int index, int offset) { - ChunkListHeader *newListHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + offset); - ChunkListHeader *oldListHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + header->offsetsToChunkLists[index]); + ChunkListHeader *newListHeader = address(offset); + ChunkListHeader *oldListHeader = address(header->offsetsToChunkLists[index]); // when this method is called, there will be at least one list, // so oldListHeader is valid and also all the lists are full newListHeader->allocatedChunks = 0; - newListHeader->allocCursor = offset+sizeof(ChunkListHeader); + newListHeader->allocCursor = offset + sizeof(ChunkListHeader); newListHeader->chunkListIndex = index; newListHeader->freedChunkCursor = -1; newListHeader->previousListOffset = -1; @@ -263,11 +264,12 @@ bool HbMultiSegmentAllocator::setFreeList(int index) { ChunkListHeader *listHeader; - listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + header->offsetsToChunkLists[index]); + listHeader = address(header->offsetsToChunkLists[index]); bool retVal = false; for (;;) { if (listHeader->allocatedChunks < CHUNKS_IN_ONE_LIST) { - int offset = (int)((char*)(listHeader)-(char*)(chunk->data())); + int offset = static_cast(reinterpret_cast(listHeader) + - reinterpret_cast(chunk->data())); header->offsetsToFreeChunkLists[index] = offset; retVal = true; break; @@ -275,9 +277,8 @@ if (listHeader->nextListOffset == -1) { break; } - listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + listHeader->nextListOffset); + listHeader = address(listHeader->nextListOffset); } - return retVal; } @@ -285,7 +286,8 @@ void HbMultiSegmentAllocator::writeReport(QTextStream &reportWriter) { reportWriter << "***** (Sub)HbMultiSegmentAllocator report *****\n\n"; - reportWriter << SPACE_NEEDED_FOR_MULTISEGMENT_ALLOCATOR << " bytes allocated for internal bookkeeping\n"; + reportWriter << SPACE_NEEDED_FOR_MULTISEGMENT_ALLOCATOR + << " bytes allocated for internal bookkeeping\n"; reportWriter << AMOUNT_OF_DIFFERENT_CHUNK_SIZES << " different chunk sizes ("; for (int i = 0; i < AMOUNT_OF_DIFFERENT_CHUNK_SIZES-1; i++) { reportWriter << ChunkSizes[i] << ", "; @@ -301,36 +303,47 @@ int allocations = 0; int listCount = 0; ChunkListHeader *listHeader; - listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + header->offsetsToChunkLists[i]); + listHeader = address(header->offsetsToChunkLists[i]); for (;;) { allocations += listHeader->allocatedChunks; listCount++; if (listHeader->nextListOffset != -1) { - listHeader = (ChunkListHeader*)((unsigned char*)(chunk->data()) + listHeader->nextListOffset); + listHeader = address(listHeader->nextListOffset); } else { break; } } - reportWriter << "for chunk size " << ChunkSizes[i] << ", " << listCount << " list(s) used\n"; + reportWriter << "for chunk size " << ChunkSizes[i] << ", " + << listCount << " list(s) used\n"; reportWriter << "and in these lists " << allocations << " chunks are allocated\n"; - int totalSize = listCount * (sizeof(ChunkListHeader) + (sizeof(int)+ChunkSizes[i])*CHUNKS_IN_ONE_LIST); + int totalSize = listCount * (sizeof(ChunkListHeader) + (sizeof(int) + ChunkSizes[i]) + * CHUNKS_IN_ONE_LIST); totalMemoryReserved += totalSize; - reportWriter << "Total size reserved from shared chunk for these list(s): " << totalSize << " bytes\n"; - int bookKeeping = listCount * (sizeof(ChunkListHeader) + sizeof(int)*CHUNKS_IN_ONE_LIST); + reportWriter << "Total size reserved from shared chunk for these list(s): " + << totalSize << " bytes\n"; + int bookKeeping = listCount * (sizeof(ChunkListHeader) + sizeof(int) * CHUNKS_IN_ONE_LIST); totalBookkeepingMemory += bookKeeping; reportWriter << " - bytes used for bookkeeping: " << bookKeeping << "\n"; - reportWriter << " - actual allocated bytes (in chunks, not in actual data, which might be less than chunk size): " << allocations*ChunkSizes[i] << "\n\n"; + reportWriter << " - actual allocated bytes (in chunks, not in actual data, which might be less than chunk size): " + << allocations * ChunkSizes[i] << "\n\n"; totalAllocatedMemory += allocations*ChunkSizes[i]; } reportWriter << "*** HbMultiSegmentAllocator summary ***\n"; - reportWriter << "Total memory reserved from shared chunk: " << totalMemoryReserved << " bytes\n"; + reportWriter << "Total memory reserved from shared chunk: " + << totalMemoryReserved << " bytes\n"; reportWriter << " - internal bookkeeping uses " << totalBookkeepingMemory << " bytes\n"; - reportWriter << " - actual memory allocated by clients: " << totalAllocatedMemory << " bytes\n"; - int totalFragmentationPercent = (int)((float)(totalAllocatedMemory)/(float)(totalMemoryReserved)*100); - int usableFragmentationPercent = (int)((float)(totalAllocatedMemory)/(float)(totalMemoryReserved-totalBookkeepingMemory)*100); - reportWriter << "allocated memory / all memory reserved from shared chunk = " << totalFragmentationPercent << "%\n"; - reportWriter << "allocated memory / all usable memory for client data = " << usableFragmentationPercent << "%\n"; + reportWriter << " - actual memory allocated by clients: " + << totalAllocatedMemory << " bytes\n"; + int totalFragmentationPercent = int(float(totalAllocatedMemory) + / float(totalMemoryReserved) * 100); + int usableFragmentationPercent = int(float(totalAllocatedMemory) + / float(totalMemoryReserved - totalBookkeepingMemory) + * 100); + reportWriter << "allocated memory / all memory reserved from shared chunk = " + << totalFragmentationPercent << "%\n"; + reportWriter << "allocated memory / all usable memory for client data = " + << usableFragmentationPercent << "%\n"; } #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbnamespace.cpp --- a/src/hbcore/core/hbnamespace.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbnamespace.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,7 +26,7 @@ #include /*! - @beta + @stable @hbcore \namespace Hb \brief The Hb namespace contains miscellaneous identifiers used throughout the Hb library. @@ -42,7 +42,7 @@ Navigation action for quitting the application. */ -/*! \var Hb::NavigationAction Hb::BackNaviAction +/*! \var Hb::NavigationAction Hb::BackNaviAction Navigation action for back. */ @@ -80,7 +80,7 @@ */ /*! \var Hb::UiAttribute Hb::Ui_NoAttributes - No UI attributes. + No UI attributes. */ /*! \var Hb::UiAttribute Hb::Ui_VisibleInTouch @@ -90,10 +90,10 @@ /*! \var Hb::UiAttribute Hb::Ui_VisibleInNonTouch The visibility of an UI component in non-touch device. */ - - /*! - \enum TouchGesture - Enum that for different touch gestures. + +/*! + \enum TouchGesture + Enum that for different touch gestures. */ /*! \var Hb::TouchGesture Hb::Tap @@ -103,10 +103,10 @@ Long press. */ /*! \var Hb::TouchGesture Hb::Pan - Panning gesture. + Panning gesture. */ /*! \var Hb::TouchGesture Hb::Flick - Flicking gesture. + Flicking gesture. */ /*! @@ -115,11 +115,11 @@ This enum describes the item data roles in LibHb. */ /*! \var Hb::ItemDataRole Hb::ItemTypeRole - This role specifies the type of the model item. If no type is specified StandardItem type is + This role specifies the type of the model item. If no type is specified StandardItem type is used. */ /*! \var Hb::ItemDataRole Hb::UserRole - The first role that can be used for application-specific purposes. + The first role that can be used for application-specific purposes. */ /*! @@ -135,7 +135,7 @@ This is the parent item type. Parent item is an item that has or can have child items. */ /*! \var Hb::ModelItemType Hb::UserItem - The first item type that can be used for application-specific purposes. + The first item type that can be used for application-specific purposes. */ /*! @@ -161,17 +161,24 @@ Indicates whether widget and its children (classes derived from HbWidgetBase) are inside popup. */ -/*! \var Hb::WidgetAttribute Hb::InputMethodNeutral +/*! \deprecated + + \var Hb::WidgetAttribute Hb::InputMethodNeutral Indicates that the widget does not want to change the state of the input method. In practice this means that virtual keyboard is not closed if focus is changed from editor to this widget. */ - /*! - \enum ListContentType - LibHb's predefined (list) item content types. +/*! \var Hb::WidgetAttribute Hb::Widget + + Indicates that a HbWidgetBase derived item is Hb widget. Constructors of HbWidget set this flag on. +*/ - This enum describes the (list) item content types available in LibHb. - */ +/*! + \enum ListContentType + LibHb's predefined (list) item content types. + + This enum describes the (list) item content types available in LibHb. + */ /*! \enum ListItemColumn @@ -187,24 +194,24 @@ This enum describes the (list) item content visibility values available in LibHb. */ - /*! - \enum SceneItem - LibHb's built-in scene items. +/*! + \enum SceneItem + LibHb's built-in scene items. - This enum describes the scene items available in LibHb. - */ + This enum describes the scene items available in LibHb. + */ - /*! - \enum ResourceType - Resource types. +/*! + \enum ResourceType + Resource types. - This enum describes the available types of resources in LibHb. - */ + This enum describes the available types of resources in LibHb. + */ /*! \enum WindowFlag HbMainWindow's window flags. - + This enum describes the window flags which could be set to HbMainWindow. */ @@ -213,10 +220,10 @@ */ /*! \var Hb::WindowFlag Hb::WindowFlagTransparent - Indicates that HbMainWindow should use alpha blending for composition. + Indicates that HbMainWindow should use alpha blending for composition. With this flag you can have transparent areas in UI. Setting this flag will cause HbMainWindow to set Qt::FramelessWindowHint to it's flags and - Qt::WA_TranslucentBackground to it's attributes. + Qt::WA_TranslucentBackground to it's attributes. */ /*! \var Hb::WindowFlag Hb::WindowFlagNoBackground @@ -225,13 +232,13 @@ */ /*! \var Hb::WindowFlag Hb::WindowFlagFixedVertical - Indicates that the application uses vertical orientation at startup. If flag is not + Indicates that the application uses vertical orientation at startup. If flag is not used or both WindowFlagFixedVertical and WindowFlagFixedHorizontal are used at the same time, both flags are ignored and the orientation is managed automatically based on hw sensors. */ /*! \var Hb::WindowFlag Hb::WindowFlagFixedHorizontal - Indicates that the application uses horizontal orientation at startup. If flag is not + Indicates that the application uses horizontal orientation at startup. If flag is not used or both WindowFlagFixedVertical and WindowFlagFixedHorizontal are used at the same time, both flags are ignored and the orientation is managed automatically based on hw sensors. */ @@ -300,7 +307,7 @@ The view switch effect is applied not just to the view's content but also other decorators, e.g. the titlebar, the toolbar, etc. The background is not included. - + This flag automatically implies ViewSwitchSequential. */ @@ -324,11 +331,11 @@ Forces the usage of the "show_alt" and "hide_alt" (also "show_alt_back" and "hide_alt_back") events instead of "show" and "hide" (even when combined with other flags). - + This flag is typically used when the alternative default effect is wanted, which is typically a flip effect (although it is not guaranteed to be that for every theme). - The alternative effects can be overriden using HbEffect::add() just like the normal ones. + The alternative effects can be overridden using HbEffect::add() just like the normal ones. This flag automatically implies ViewSwitchSequential. (the default effect is parallel, the alternative is sequential) */ @@ -568,10 +575,63 @@ \var Hb::ActivationReason Hb::ActivationReasonService Application was started as QtHighway service. */ - + /*! \var Hb::ActivationReason Hb::ActivationReasonNormal Application was started by other means. - */ + */ + +/*! + \enum Hb::BackgroundImageMode + + Controls how the background image is drawn. +*/ + +/*! + \var Hb::BackgroundImageMode Hb::ScaleBackgroundToFit + + The background image is scaled to cover the entire available area. The + aspect ratio is kept (by expanding the size if needed). The image is + centered in the available area. + */ + +/*! + \var Hb::BackgroundImageMode Hb::ScaleBackgroundToFitWithoutExpanding + + The background image is scaled to cover most of the available area. The + aspect ratio is kept (without expanding) so the image may not occupy the + entire available area. The image is centered in the available area. + */ + +/*! + \var Hb::BackgroundImageMode Hb::StretchBackgroundToFit + The background image is stretched to cover the entire available area. + */ +/*! + \var Hb::BackgroundImageMode Hb::KeepOriginalBackgroundSize + + Keeps the original size of the image, no up or downscaling occurs. The image + is centered in the available area. + */ + +/*! + \var Hb::BackgroundImageMode Hb::KeepOriginalBackgroundSizeIfSmaller + + Keeps the original size of the image only when the size is smaller than the + available area (i.e. dynamically switches between Hb::ScaleBackgroundToFit + and Hb::KeepOriginalBackgroundSize depending on the size of the source + image). + */ + +/*! + \var Hb::BackgroundImageMode Hb::DoNotDrawBackground + + Does not draw the background, i.e. the paint() function of the background + item will not do anything when this mode is set. Use this only to + temporarily prevent the background from showing. If you need to hide the + background item permanently then pass Hb::WindowFlagNoBackground to the + HbMainWindow constructor because that is more efficient. +*/ + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbnamespace.h --- a/src/hbcore/core/hbnamespace.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbnamespace.h Thu Jul 22 16:36:53 2010 +0100 @@ -35,13 +35,13 @@ class HB_CORE_EXPORT Hb { Q_GADGET - Q_ENUMS( NavigationAction UiAttribute TouchGesture - ItemDataRole GraphicsItemType SceneItem - InstantInteraction ContinuousInteraction InteractionModifier - TextCursorVisibility SliderTickPosition ModelItemType TextWrapping - ActivationReason ) - Q_FLAGS( UiAttributes TouchGestures SceneItems SliderTickPositions - TextContextMenuFlags ) + Q_ENUMS(NavigationAction UiAttribute TouchGesture + ItemDataRole GraphicsItemType SceneItem + InstantInteraction ContinuousInteraction InteractionModifier + TextCursorVisibility SliderTickPosition ModelItemType TextWrapping + ActivationReason) + Q_FLAGS(UiAttributes TouchGestures SceneItems SliderTickPositions + TextContextMenuFlags) public: #else @@ -54,24 +54,21 @@ static const int Key_SoftKeySecondary = Qt::Key_Launch1; static const int Key_SoftKeyMiddle = Qt::Key_Launch2; - enum NavigationAction - { + enum NavigationAction { QuitNaviAction, BackNaviAction, ConfirmNaviAction, DoneNaviAction }; - - enum EffectEvent - { + + enum EffectEvent { EffectFinished = 1, EffectCancelled = 2, EffectNotStarted = 3 }; - - enum UiAttribute - { + + enum UiAttribute { Ui_NoAttributes = 0x0000, Ui_VisibleInTouch = 0x0001, Ui_VisibleInNonTouch = 0x0002 @@ -82,8 +79,7 @@ /*! Gesture types. */ - enum TouchGesture - { + enum TouchGesture { TapGesture = 0x0000001, LongPressGesture = 0x0000002, PanGesture = 0x0000004, @@ -92,25 +88,22 @@ Q_DECLARE_FLAGS(TouchGestures, TouchGesture) - - enum ItemDataRole - { + + enum ItemDataRole { ItemTypeRole = 1001, - IndexFeedbackRole, + IndexFeedbackRole, UserRole = 1500 }; - enum ModelItemType - { + enum ModelItemType { StandardItem, ParentItem, SeparatorItem, UserItem = 1000 }; - - enum GraphicsItemType - { - ItemType_NotificationDialog = QGraphicsItem::UserType+10000, + + enum GraphicsItemType { + ItemType_NotificationDialog = QGraphicsItem::UserType + 10000, ItemType_FrameItem, ItemType_GraphicsPixmapItem, ItemType_AbstractItemView, @@ -147,7 +140,7 @@ ItemType_ToolBarExtension, ItemType_ToolButton, ItemType_Widget, - ItemType_View, + ItemType_View, ItemType_ConfirmationQuery, ItemType_CheckBox, ItemType_MessageQuery, @@ -191,11 +184,11 @@ ItemType_Last = QGraphicsItem::UserType + 20000 }; - enum WidgetAttribute - { + enum WidgetAttribute { InteractionDisabled = 0x00000001, InsidePopup = 0x00000002, - InputMethodNeutral = 0x00000004 + InputMethodNeutral = 0x00000004, + Widget = 0x00000008 }; Q_DECLARE_FLAGS(WidgetAttributes, WidgetAttribute) @@ -208,7 +201,7 @@ StatusBarItem = 0x00000040, AllItems = 0xFFFFFFFF }; - + /*! Anchor edges. */ @@ -230,7 +223,7 @@ }; Q_DECLARE_FLAGS(SceneItems, SceneItem) - + enum WindowFlag { WindowFlagNone = 0x00000000, WindowFlagTransparent = 0x00000001, @@ -261,14 +254,12 @@ Q_DECLARE_FLAGS(ViewSwitchFlags, ViewSwitchFlag) - enum TextCursorVisibility - { + enum TextCursorVisibility { TextCursorHidden = 0, TextCursorVisible }; - enum SliderTickPosition - { + enum SliderTickPosition { NoSliderTicks = 0, SliderTicksAbove = 1, SliderTicksLeft = SliderTicksAbove, @@ -285,17 +276,16 @@ ShowTextContextMenuOnLongPress = 4 }; Q_DECLARE_FLAGS(TextContextMenuFlags , TextContextMenuFlag) - + /*! A type definition for text wrapping */ - enum TextWrapping - { + enum TextWrapping { TextNoWrap = 0, TextWordWrap = 1, TextWrapAnywhere = 3 }; - + enum InstantInteraction { InstantPressed = 0, InstantReleased, @@ -334,19 +324,30 @@ ModifierSliderElement = 0x2, ModifierExpandedItem = 0x4, ModifierCollapsedItem = 0x8, - ModifierScrolling = 0x10 + ModifierScrolling = 0x10, + ModifierInputFunctionButton = 0x20 }; - + Q_DECLARE_FLAGS(InteractionModifiers, InteractionModifier) - + enum ActivationReason { ActivationReasonActivity = 0, ActivationReasonService, ActivationReasonNormal }; - + + enum BackgroundImageMode { + ScaleBackgroundToFit = 0, + ScaleBackgroundToFitWithoutExpanding, + StretchBackgroundToFit, + KeepOriginalBackgroundSize, + KeepOriginalBackgroundSizeIfSmaller, + DoNotDrawBackground, + NBackgroundImageModes + }; }; + Q_DECLARE_METATYPE(Hb::GraphicsItemType) Q_DECLARE_OPERATORS_FOR_FLAGS(Hb::UiAttributes) @@ -360,4 +361,3 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Hb::InteractionModifiers) #endif // HBNAMESPACE_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbnamespace_p.h --- a/src/hbcore/core/hbnamespace_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbnamespace_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,124 +33,142 @@ */ namespace HbPrivate { - // The following values are defined in units and used by HbTextItem - // and HbMarqueeItem - static const qreal TextTruncationFadeWidth = 6.0; //un - static const qreal TextTruncationFadeHeight = 5.0; //un +// The following values are defined in units and used by HbTextItem +// and HbMarqueeItem +static const qreal TextTruncationFadeWidth = 6.0; //un +static const qreal TextTruncationFadeHeight = 5.0; //un - enum GraphicsItemType - { - ItemType_PopupBackGround = QGraphicsItem::UserType+1, - ItemType_FadeItem, - ItemType_LongPressVisualizer, - ItemType_BatteryIndicator, - ItemType_IndicatorGroup, - ItemType_IndicatorMenu, - ItemType_SignalIndicator, - ItemType_NavigationButton, - ItemType_IndicatorButton, - ItemType_TitlePane, - ItemType_MessageBoxContentWidget, - ItemType_MessageNoteContentWidget, - ItemType_ProgressDialogContentWidget, - ItemType_GraphicsItemGroup, - ItemType_BackgroundItem, - ItemType_MenuWidget, - ItemType_MenuItem, - ItemType_MenuListView, - ItemType_ProgressSliderHandle, - ItemType_SliderPopupContentWidget, - ItemType_SliderControl, - ItemType_ProgressSliderControl, - ItemType_SliderElement, - ItemType_SliderHandle, - ItemType_SliderTickmarks, - ItemType_SliderTickmarksLabel, - ItemType_ToolTipLabel, - ItemType_ColorDialogContentWidget, - ItemType_CQContentWidget, - ItemType_HbInputDialogContentWidget, - ItemType_ConfirmationQueryContentWidget, - ItemType_ListQueryContentWidget, - ItemType_ListDialogContentWidget, - ItemType_ColorGridViewItem, - ItemType_MessageQueryContentWidget, - ItemType_SettingFormHeadingWidget, - ItemType_SettingItem, - ItemType_SettingGroupHeadingWidget, - ItemType_SettingGroup, - ItemType_DataFormHeadingWidget, - ItemType_DataItem, - ItemType_DataGroupHeadingWidget, - ItemType_DataGroup, - ItemType_GroupBoxHeadingWidget, - ItemType_GroupBoxContentWidget, - ItemType_TitleBar, - ItemType_TitleBarHandle, - ItemType_StatusBar, - ItemType_VolumeSlider, - ItemType_ZoomSlider, - ItemType_EndPrivate +enum GraphicsItemType { + ItemType_PopupBackGround = QGraphicsItem::UserType + 1, + ItemType_FadeItem, + ItemType_LongPressVisualizer, + ItemType_BatteryIndicator, + ItemType_IndicatorGroup, + ItemType_IndicatorMenu, + ItemType_SignalIndicator, + ItemType_NavigationButton, + ItemType_IndicatorButton, + ItemType_TitlePane, + ItemType_MessageBoxContentWidget, + ItemType_MessageNoteContentWidget, + ItemType_ProgressDialogContentWidget, + ItemType_GraphicsItemGroup, + ItemType_BackgroundItem, + ItemType_MenuWidget, + ItemType_MenuItem, + ItemType_MenuListView, + ItemType_ProgressSliderHandle, + ItemType_SliderPopupContentWidget, + ItemType_SliderControl, + ItemType_ProgressSliderControl, + ItemType_SliderElement, + ItemType_SliderHandle, + ItemType_SliderTickmarks, + ItemType_SliderTickmarksLabel, + ItemType_ToolTipLabel, + ItemType_ColorDialogContentWidget, + ItemType_CQContentWidget, + ItemType_HbInputDialogContentWidget, + ItemType_ConfirmationQueryContentWidget, + ItemType_ListQueryContentWidget, + ItemType_ListDialogContentWidget, + ItemType_ColorGridViewItem, + ItemType_MessageQueryContentWidget, + ItemType_SettingFormHeadingWidget, + ItemType_SettingItem, + ItemType_SettingGroupHeadingWidget, + ItemType_SettingGroup, + ItemType_DataFormHeadingWidget, + ItemType_DataItem, + ItemType_DataGroupHeadingWidget, + ItemType_DataGroup, + ItemType_GroupBoxHeadingWidget, + ItemType_GroupBoxContentWidget, + ItemType_TitleBar, + ItemType_TitleBarHandle, + ItemType_StatusBar, + ItemType_VolumeSlider, + ItemType_ZoomSlider, + ItemType_EndPrivate - }; +}; - /* - LibHb's predefined Z values. +/* + LibHb's predefined Z values. - This enum describes the Z values available in LibHb. - */ - enum HbZValues - { - RootItemZValue, /* Z value of the root parent item */ - BackgroundZValue, /* Z value of the background layer. */ - ContentZValue, /* Z value of the content layer. */ - TitleBarZValue, /* Z value of the titlebar. */ - StatusBarZValue, /* Z value of the statusbar. */ - ToolBarZValue, /* Z value of the toolbar. */ - DockWidgetZValue, /* Z value of the dockwidget item. */ - TitlePaneZValue, /* Z value of the title pane. */ - NaviPaneZValue, /* Z value of the navi pane. */ - SoftKeyZValue, /* Z value of the soft keys. */ - IndicatorGroupZValue, /* Z value of the indicator group. */ - FadingItemZValue, /* Z value of the fading item. */ + This enum describes the Z values available in LibHb. + */ +enum HbZValues { + RootItemZValue, /* Z value of the root parent item */ + BackgroundZValue, /* Z value of the background layer. */ + ContentZValue, /* Z value of the content layer. */ + StatusBarZValue, /* Z value of the statusbar. */ + TitleBarZValue, /* Z value of the titlebar. */ + ToolBarZValue, /* Z value of the toolbar. */ + DockWidgetZValue, /* Z value of the dockwidget item. */ + TitlePaneZValue, /* Z value of the title pane. */ + NaviPaneZValue, /* Z value of the navi pane. */ + SoftKeyZValue, /* Z value of the soft keys. */ + IndicatorGroupZValue, /* Z value of the indicator group. */ + FadingItemZValue, /* Z value of the fading item. */ - PopupZValueRangeStart = 0x00004000, /* Z value range start of the popup layer */ - PopupZValueDefaultOffset = 0x00044000, /* Default Z value offset for popup layer */ - PopupZValueRangeEnd = 0x00084000 /* Z value range end of the popup layer */ - }; + PopupZValueRangeStart = 0x00004000, /* Z value range start of the popup layer */ + PopupZValueDefaultOffset = 0x00044000, /* Default Z value offset for popup layer */ + PopupZValueRangeEnd = 0x00084000 /* Z value range end of the popup layer */ +}; + +/* + LibHb's predefined item change values. + + This enum describes the item change values available in LibHb. + */ +enum HbItemChangeValues { + ItemOrientationChange = 10000 +}; - /* - LibHb's predefined item change values. +// +// Note: qreal type is used as zValue of graphics items including HbDialog objects. In some certain platforms (like in ARM) +// qreal is defined as float. For a 32 bits float the number of significant digits is about 7. +// It means that the Hb can have +// at most 7 digits precision using qreal. So, the constants below has to be chosen so that the precision of Z values +// used in popup is within the 7 digits range. +// - This enum describes the item change values available in LibHb. - */ - enum HbItemChangeValues - { - ItemOrientationChange = 10000 - }; +// The number of different priorities currently equals the max number can be represented on quint8 + 1 +static const int PopupPriorityCount = 256; + +// The number of popups that can have the same priority +static const int PopupCountWithSamePriority = 64; - // - // Note: qreal type is used as zValue of graphics items including HbDialog objects. In some certain platforms (like in ARM) - // qreal is defined as float. For a 32 bits float the number of significant digits is about 7. - // It means that the Hb can have - // at most 7 digits precision using qreal. So, the constants below has to be chosen so that the precision of Z values - // used in popup is within the 7 digits range. - // +static const qreal PopupWithDifferentPriorityZValueUnit = (PopupZValueRangeEnd - PopupZValueDefaultOffset) / PopupPriorityCount; +static const qreal PopupWithSamePriorityZValueUnit = PopupWithDifferentPriorityZValueUnit / PopupCountWithSamePriority; +static const qreal PopupBackgroundItemZValueUnit = PopupWithSamePriorityZValueUnit / 2; +static const qreal FadingItemZValueUnit = PopupBackgroundItemZValueUnit / 2; +static const qreal VKBValueUnit = FadingItemZValueUnit / 2; +static const qreal SelectionControlHandlesValueUnit = VKBValueUnit / 2; + + + // Dynamic properties to control gestures: - // The number of different priorities currently equals the max number can be represented on quint8 + 1 - static const int PopupPriorityCount = 256; - - // The number of popups that can have the same priority - static const int PopupCountWithSamePriority = 64; + // Tap gesture threshold rect can be defined as restricted to default radius. + // Used in case the widget is inside scroll area which is scrollable to given direction. + // Both take boolean value. + static const QLatin1String VerticallyRestricted("verticallyRestricted"); + static const QLatin1String HorizontallyRestricted("horizontallyRestricted"); - static const qreal PopupWithDifferentPriorityZValueUnit = (PopupZValueRangeEnd-PopupZValueDefaultOffset)/PopupPriorityCount; - static const qreal PopupWithSamePriorityZValueUnit = PopupWithDifferentPriorityZValueUnit / PopupCountWithSamePriority; - static const qreal PopupBackgroundItemZValueUnit = PopupWithSamePriorityZValueUnit / 2; - static const qreal FadingItemZValueUnit = PopupBackgroundItemZValueUnit / 2; - static const qreal VKBValueUnit = FadingItemZValueUnit / 2; - static const qreal SelectionControlHandlesValueUnit = VKBValueUnit / 2; + // Widget can give custom threshold for tap gesture as rect or radius. + // Default tap radius is added to thresholdRect to ensure succefull taps. + // Radius is taken in int and threshold rect is taken in QRect. + static const QLatin1String TapRadius("tapRadius"); + static const QLatin1String ThresholdRect("thresholdRect"); + + // set Qt::GestureType to scene to have a gesture to suppress other gestures. + // It's used to have the pan gesture to wait for tap gesture to cancel before + // it's allowed to start. Used in combination with vertically and horizontally + // restricted dynamic properties. + static const QLatin1String OverridingGesture("overridingGesture"); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hborientationstatus.cpp --- a/src/hbcore/core/hborientationstatus.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hborientationstatus.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,11 +25,11 @@ #include "hborientationstatus_p.h" #ifdef Q_OS_SYMBIAN -#include "hbcorepskeys_p.h" +#include "hbcorepskeys_r.h" #include "hbforegroundwatcher_p.h" // UID for process checking (write orientation value only when in theme server) -const TUid KWriterServerUid = KHbPsOrientationCategoryUid; +const TUid KWriterServerUid = KHbPsHardwareCoarseOrientationCategoryUid; // PS related constants _LIT_SECURITY_POLICY_PASS(KRdPolicy); // all pass @@ -49,8 +49,9 @@ if (process.SecureId().iId == KWriterServerUid.iUid) { orientationStatus = new HbOrientationStatus(parent, defaultOrientation); } + process.Close(); } -#else +#else Q_UNUSED(parent); Q_UNUSED(defaultOrientation); orientationStatus = 0; @@ -71,7 +72,8 @@ #ifdef Q_OS_SYMBIAN if (!orientationStatus) { int currentOrientation = Qt::Vertical; - if (RProperty::Get(KHbPsOrientationCategoryUid, KHbPsOrientationKey, currentOrientation) == KErrNone) { + if (RProperty::Get(KHbPsHardwareCoarseOrientationCategoryUid, + KHbPsHardwareCoarseQtOrientationKey, currentOrientation) == KErrNone) { orientation = (Qt::Orientation)currentOrientation; success = true; } @@ -82,8 +84,7 @@ if (settings.value("Orientation").toInt() == 1) { orientation = Qt::Horizontal; success = true; - } - else if (settings.value("Orientation").toInt() == 2) { + } else if (settings.value("Orientation").toInt() == 2) { orientation = Qt::Vertical; success = true; } @@ -92,22 +93,22 @@ } HbOrientationStatus::HbOrientationStatus(QObject *parent, Qt::Orientation defaultOrientation) -: QObject(parent) -#ifdef Q_OS_SYMBIAN -,mSensorListener(new HbSensorListener(*this, defaultOrientation, false)) -,mDefaultOrientation(defaultOrientation) + : QObject(parent) +#ifdef Q_OS_SYMBIAN + , mSensorListener(new HbSensorListener(*this, defaultOrientation, false)) + , mDefaultOrientation(defaultOrientation) #endif { #ifdef Q_OS_SYMBIAN HbForegroundWatcher::instance()->setSensorListener(mSensorListener); // Create orientation property - RProperty::Define( - KHbPsOrientationCategoryUid, KHbPsOrientationKey, RProperty::EInt, KRdPolicy, KWrPolicy); - mProperty.Attach(KHbPsOrientationCategoryUid, KHbPsOrientationKey); + RProperty::Define(KHbPsHardwareCoarseOrientationCategoryUid, KHbPsHardwareCoarseQtOrientationKey, + RProperty::EInt, KRdPolicy, KWrPolicy); + mProperty.Attach(KHbPsHardwareCoarseOrientationCategoryUid, KHbPsHardwareCoarseQtOrientationKey); storeOrientation(defaultOrientation); #else - Q_UNUSED(parent); - Q_UNUSED(defaultOrientation); + Q_UNUSED(parent); + Q_UNUSED(defaultOrientation); #endif } @@ -120,9 +121,10 @@ { Q_UNUSED(notify) #ifdef Q_OS_SYMBIAN - if (status == false) + if (status == false) { storeOrientation(mDefaultOrientation); -#else + } +#else Q_UNUSED(status) #endif } @@ -131,8 +133,7 @@ { #ifdef Q_OS_SYMBIAN mProperty.Set(orientation); -#else +#else Q_UNUSED(orientation); #endif } - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hborientationstatus_p.h --- a/src/hbcore/core/hborientationstatus_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hborientationstatus_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBORIENTATIONSSTATUS_P_H -#define HBORIENTATIONSSTATUS_P_H +#ifndef HBORIENTATIONSTATUS_P_H +#define HBORIENTATIONSTATUS_P_H #include #include "hbsensorlistener_p.h" @@ -56,4 +56,4 @@ #endif }; -#endif // HBORIENTATIONSSTATUS_P_H +#endif // HBORIENTATIONSTATUS_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsensorlistener.cpp --- a/src/hbcore/core/hbsensorlistener.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsensorlistener.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,15 +23,15 @@ ** ****************************************************************************/ +#include "hbsensorlistener_p.h" #include "hborientationstatus_p.h" -#include "hbsensorlistener_p.h" #ifdef Q_OS_SYMBIAN -#include -#include +#include +#include #include #include -#include +#include #include "hbcommoncrkeys.h" #include "hbsensornotifyhandler_p.h" #else @@ -43,16 +43,16 @@ HbSensorListener::HbSensorListener(HbSensorListenerObserver &observer, Qt::Orientation defaultOrientation, bool updateOrientation) -: -mObserver(observer), -mDefaultOrientation(defaultOrientation), -mOrientation(mDefaultOrientation), -mEnabled(false), -mSettingsEnabled(false) + : + mObserver(observer), + mDefaultOrientation(defaultOrientation), + mOrientation(mDefaultOrientation), + mEnabled(false), + mSettingsEnabled(false) #ifdef Q_OS_SYMBIAN -, -mNotifyHandler(0), -mSensrvChannel(0) + , + mNotifyHandler(0), + mSensrvChannel(0) #endif { checkCenrepValue(); @@ -70,6 +70,9 @@ mSensrvChannel->CloseChannel(); delete mSensrvChannel; } + if (mNotifyHandler) { + delete mNotifyHandler; + } #endif } @@ -89,26 +92,28 @@ void HbSensorListener::checkCenrepValue() { #ifdef Q_OS_SYMBIAN - CRepository* repository = 0; - TRAPD( err, repository = CRepository::NewL(KHbSensorCenrepUid)); - if ( err ) { - qWarning( "HbSensorListener::checkCenrepValue; repository->NewL fails, error code = %d", err ); + CRepository *repository = 0; + TRAPD(err, repository = CRepository::NewL(KHbSensorCenrepUid)); + if (err) { + qWarning("HbSensorListener::checkCenrepValue; repository->NewL fails, error code = %d", err); } else { TInt value = 0; TInt err = repository->Get(KHbSensorCenrepKey, value); - if (err == KErrNone) + if (err == KErrNone) { cenrepValueChanged(value, false); - else - qWarning( "HbSensorListener::checkCenrepValue: repository->Get fails, error code = %d", err ); + } else { + qWarning("HbSensorListener::checkCenrepValue: repository->Get fails, error code = %d", err); + } + delete repository; } if (!mNotifyHandler) { TRAPD(err, mNotifyHandler = HbSensorNotifyHandler::NewL(*this)); if (err) { - qWarning( "HbSensorListener::HbSensorListener: HbSensorNotifyHandler::NewL failed = %d", err ); + qWarning("HbSensorListener::HbSensorListener: HbSensorNotifyHandler::NewL failed = %d", err); } else { - TRAPD( err, mNotifyHandler->startObservingL()); + TRAPD(err, mNotifyHandler->startObservingL()); if (err) { - qWarning( "HbSensorListener::HbSensorListener: mNotifyHandler->startObservingL failed = %d", err ); + qWarning("HbSensorListener::HbSensorListener: mNotifyHandler->startObservingL failed = %d", err); } } } @@ -123,11 +128,11 @@ void HbSensorListener::enableSensors(bool enable, bool notify) { mEnabled = enable; -#ifdef Q_OS_SYMBIAN +#ifdef Q_OS_SYMBIAN enableSensorListening(enable); #else mSettingsEnabled = enable; -#endif +#endif if (notify) { mObserver.sensorStatusChanged(enable, true); } @@ -156,7 +161,7 @@ void HbSensorListener::cenrepValueChanged(TInt aValue, bool notify) { - bool enable = (aValue == 0)? false : true; + bool enable = (aValue == 0) ? false : true; mSettingsEnabled = enable; enableSensors(enable, notify); } @@ -165,33 +170,33 @@ void HbSensorListener::startSensorChannel() { #ifdef Q_OS_SYMBIAN - CSensrvChannelFinder* sensrvChannelFinder = CSensrvChannelFinder::NewLC(); + CSensrvChannelFinder *sensrvChannelFinder = CSensrvChannelFinder::NewLC(); RSensrvChannelInfoList channelInfoList; CleanupClosePushL(channelInfoList); TSensrvChannelInfo mySearchConditions; - + //Search only Orientation events. - mySearchConditions.iChannelType = KSensrvChannelTypeIdOrientationData; - - TRAPD( err, sensrvChannelFinder->FindChannelsL(channelInfoList,mySearchConditions)); + mySearchConditions.iChannelType = KSensrvChannelTypeIdOrientationData; + + TRAPD(err, sensrvChannelFinder->FindChannelsL(channelInfoList, mySearchConditions)); if (!err) { if (channelInfoList.Count()) { - TRAP( err, mSensrvChannel = CSensrvChannel::NewL(channelInfoList[0])); + TRAP(err, mSensrvChannel = CSensrvChannel::NewL(channelInfoList[0])); + if (!err) { + TRAP(err, mSensrvChannel->OpenChannelL()); if (!err) { - TRAP( err, mSensrvChannel->OpenChannelL()); - if (!err) { - TRAP_IGNORE(mSensrvChannel->StartDataListeningL(this, 1,1,0)); - } else { - qWarning("HbSensorListener::startSensorChannel fails, error code = %d", err); - } + TRAP_IGNORE(mSensrvChannel->StartDataListeningL(this, 1, 1, 0)); + } else { + qWarning("HbSensorListener::startSensorChannel fails, error code = %d", err); } } - + } + channelInfoList.Close(); - CleanupStack::Pop( &channelInfoList ); - CleanupStack::PopAndDestroy( sensrvChannelFinder ); + CleanupStack::Pop(&channelInfoList); + CleanupStack::PopAndDestroy(sensrvChannelFinder); } else { qWarning("HbSensorListener::startSensorChannel fails, error code = %d", err); } @@ -199,14 +204,14 @@ } #ifdef Q_OS_SYMBIAN -Qt::Orientation HbSensorListener::orientationFromData(CSensrvChannel& aChannel, TInt aCount) +Qt::Orientation HbSensorListener::orientationFromData(CSensrvChannel &aChannel, TInt aCount) { Qt::Orientation orientation = mOrientation; - if (aChannel.GetChannelInfo().iChannelType == KSensrvChannelTypeIdOrientationData ) { + if (aChannel.GetChannelInfo().iChannelType == KSensrvChannelTypeIdOrientationData) { TSensrvOrientationData data; - for ( TInt i = 0; i < aCount; i++ ) { + for (TInt i = 0; i < aCount; ++i) { TPckgBuf dataBuf; - aChannel.GetData( dataBuf ); + aChannel.GetData(dataBuf); data = dataBuf(); orientation = sensorOrientationToQtOrientation(data.iDeviceOrientation); } @@ -218,9 +223,9 @@ //Supported orientations form sensors are EOrientationDisplayRightUp and EOrientationDisplayUp. Qt::Orientation HbSensorListener::sensorOrientationToQtOrientation(TSensrvOrientationData::TSensrvDeviceOrientation sensorOrientation) const { - if (mDefaultOrientation == Qt::Vertical || mDefaultOrientation == Qt::Horizontal ) { + if (mDefaultOrientation == Qt::Vertical || mDefaultOrientation == Qt::Horizontal) { if (sensorOrientation == TSensrvOrientationData::EOrientationDisplayRightUp) { - return Qt::Horizontal; + return Qt::Horizontal; } else if (sensorOrientation == TSensrvOrientationData::EOrientationDisplayUp) { return Qt::Vertical; } else { @@ -234,7 +239,7 @@ } // From MSensrvDataListener -void HbSensorListener::DataReceived(CSensrvChannel& aChannel, TInt aCount, TInt aDataLost) +void HbSensorListener::DataReceived(CSensrvChannel &aChannel, TInt aCount, TInt aDataLost) { Q_UNUSED(aDataLost); Qt::Orientation dataOrientation = orientationFromData(aChannel, aCount); @@ -242,23 +247,16 @@ } // From MSensrvDataListener - void HbSensorListener::DataError( CSensrvChannel& aChannel, TSensrvErrorSeverity aError ) +void HbSensorListener::DataError(CSensrvChannel &aChannel, TSensrvErrorSeverity aError) { Q_UNUSED(aChannel); Q_UNUSED(aError); } -// From MSensrvDataListener - void HbSensorListener::GetDataListenerInterfaceL( TUid aInterfaceUid, TAny*& aInterface) +// From MSensrvDataListener +void HbSensorListener::GetDataListenerInterfaceL(TUid aInterfaceUid, TAny*& aInterface) { Q_UNUSED(aInterfaceUid); Q_UNUSED(aInterface); } #endif - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsensorlistener_p.h --- a/src/hbcore/core/hbsensorlistener_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsensorlistener_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,14 +40,15 @@ #endif class HbSensorNotifyHandler; -class HbSensorListenerObserver { +class HbSensorListenerObserver +{ public: virtual void sensorOrientationChanged(Qt::Orientation newOrientation) = 0; virtual void sensorStatusChanged(bool status, bool notify) = 0; virtual ~HbSensorListenerObserver() {} }; -class HB_AUTOTEST_EXPORT HbSensorListener +class HB_AUTOTEST_EXPORT HbSensorListener #ifdef Q_OS_SYMBIAN : public MSensrvDataListener #endif @@ -64,37 +65,37 @@ void setSensorOrientation(Qt::Orientation dataOrientation); void enableSensors(bool enable, bool notify); bool isEnabled() const; - + #ifdef Q_OS_SYMBIAN void cenrepValueChanged(TInt aValue, bool notify = true); #endif - + private: void checkCenrepValue(); void startSensorChannel(); #ifdef Q_OS_SYMBIAN - Qt::Orientation orientationFromData(CSensrvChannel& aChannel, TInt aCount); - Qt::Orientation sensorOrientationToQtOrientation(TSensrvOrientationData::TSensrvDeviceOrientation - sensorOrientation) const; + Qt::Orientation orientationFromData(CSensrvChannel &aChannel, TInt aCount); + Qt::Orientation sensorOrientationToQtOrientation(TSensrvOrientationData::TSensrvDeviceOrientation + sensorOrientation) const; void enableSensorListening(bool enable); //From MSensrvDataListener - void DataReceived(CSensrvChannel& aChannel, TInt aCount, TInt aDataLost); - void DataError(CSensrvChannel& aChannel, TSensrvErrorSeverity aError); + void DataReceived(CSensrvChannel &aChannel, TInt aCount, TInt aDataLost); + void DataError(CSensrvChannel &aChannel, TSensrvErrorSeverity aError); void GetDataListenerInterfaceL(TUid aInterfaceUid, TAny*& aInterface); #endif - + private: - HbSensorListenerObserver& mObserver; + HbSensorListenerObserver &mObserver; Qt::Orientation mDefaultOrientation; Qt::Orientation mOrientation; bool mEnabled; bool mSettingsEnabled; #ifdef Q_OS_SYMBIAN - HbSensorNotifyHandler* mNotifyHandler; - CSensrvChannel* mSensrvChannel; + HbSensorNotifyHandler *mNotifyHandler; + CSensrvChannel *mSensrvChannel; friend class TestHbSensorOrientation; #endif }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsensornotifyhandler_p.cpp --- a/src/hbcore/core/hbsensornotifyhandler_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsensornotifyhandler_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,73 +23,73 @@ ** ****************************************************************************/ -//These active objects observe the changing of the sensor cenrep value -//and notify the sensorlistener when the change has occured +// These active objects observe the changing of the sensor cenrep value +// and notify the sensorlistener when the change has ocurred. #include "hbsensornotifyhandler_p.h" #include "hbcommoncrkeys.h" #include #include - HbSensorNotifyHandler* HbSensorNotifyHandler::NewL(HbSensorListener& aObserver) - { - HbSensorNotifyHandler* self = new (ELeave) HbSensorNotifyHandler(aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } +HbSensorNotifyHandler *HbSensorNotifyHandler::NewL(HbSensorListener &aObserver) +{ + HbSensorNotifyHandler *self = new(ELeave) HbSensorNotifyHandler(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(); + return self; +} - HbSensorNotifyHandler::HbSensorNotifyHandler(HbSensorListener& aObserver) - : CActive(EPriorityStandard), mObserver(aObserver) - { - } +HbSensorNotifyHandler::HbSensorNotifyHandler(HbSensorListener &aObserver) + : CActive(EPriorityStandard), mObserver(aObserver) +{ +} - void HbSensorNotifyHandler::ConstructL() - { - TRAPD(err, mRepository = CRepository::NewL(KHbSensorCenrepUid)); - if (err) { - qWarning( "mRepository::NewL fails, error code = %d", err ); - } - CActiveScheduler::Add(this); - } +void HbSensorNotifyHandler::ConstructL() +{ + TRAPD(err, mRepository = CRepository::NewL(KHbSensorCenrepUid)); + if (err) { + qWarning("mRepository::NewL fails, error code = %d", err); + } + CActiveScheduler::Add(this); +} - HbSensorNotifyHandler::~HbSensorNotifyHandler() - { - Cancel(); //first cancel because iRepository is used there - delete mRepository; - } +HbSensorNotifyHandler::~HbSensorNotifyHandler() +{ + Cancel(); //first cancel because iRepository is used there + delete mRepository; +} - void HbSensorNotifyHandler::startObservingL() - { - if (IsActive()) { - return; //do nothing if allready observing - } - User::LeaveIfError(mRepository->NotifyRequest(KHbSensorCenrepKey, iStatus)); - SetActive(); - } - - void HbSensorNotifyHandler::stopObserving() - { - Cancel(); - } +void HbSensorNotifyHandler::startObservingL() +{ + if (IsActive()) { + return; // do nothing if already observing + } + User::LeaveIfError(mRepository->NotifyRequest(KHbSensorCenrepKey, iStatus)); + SetActive(); +} + +void HbSensorNotifyHandler::stopObserving() +{ + Cancel(); +} - void HbSensorNotifyHandler::DoCancel() - { - mRepository->NotifyCancel(KHbSensorCenrepKey); - } +void HbSensorNotifyHandler::DoCancel() +{ + mRepository->NotifyCancel(KHbSensorCenrepKey); +} - void HbSensorNotifyHandler::RunL() - { - TInt value = 0; - TInt error = mRepository->Get(KHbSensorCenrepKey, value); - if (error == KErrNone) { +void HbSensorNotifyHandler::RunL() +{ + TInt value = 0; + TInt error = mRepository->Get(KHbSensorCenrepKey, value); + if (error == KErrNone) { mObserver.cenrepValueChanged(value); - } - // Re-subscribe - error = mRepository->NotifyRequest(KHbSensorCenrepKey, iStatus); - if (error == KErrNone) { - SetActive(); - } - } - + } + // Re-subscribe + error = mRepository->NotifyRequest(KHbSensorCenrepKey, iStatus); + if (error == KErrNone) { + SetActive(); + } +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsensornotifyhandler_p.h --- a/src/hbcore/core/hbsensornotifyhandler_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsensornotifyhandler_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,31 +27,32 @@ #define HB_SENSOR_NOTIFY_HANDLER_H #include "hbsensorlistener_p.h" -#include +#include class CRepository; class HbSensorListener; -class HbSensorNotifyHandler : public CActive { +class HbSensorNotifyHandler : public CActive +{ public: - static HbSensorNotifyHandler* NewL(HbSensorListener& aObserver); + static HbSensorNotifyHandler *NewL(HbSensorListener &aObserver); virtual ~HbSensorNotifyHandler(); void startObservingL(); void stopObserving(); - + protected: // From CActive void RunL(); void DoCancel(); - + private: - HbSensorNotifyHandler(HbSensorListener& aObserver); + HbSensorNotifyHandler(HbSensorListener &aObserver); void ConstructL(); private: - CRepository* mRepository; - HbSensorListener& mObserver; + CRepository *mRepository; + HbSensorListener &mObserver; }; #endif //HB_SENSOR_NOTIFY_HANDLER_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsharedcache.cpp --- a/src/hbcore/core/hbsharedcache.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsharedcache.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,10 +25,15 @@ #include -static QSystemSemaphore *Semaphore; +static QSystemSemaphore *Semaphore = 0; static QLatin1String SemaphoreName("hbsharedcache_semaphore"); +static const QString ColorCSSEnding = "_color.css"; +static const QString CSSFileExtension = ".css"; +static const QString WidgetMLFileExtension = ".widgetml"; +static const QChar KeySeparator('\0'); + #include "hbsharedcache_p.h" #include "hbsharedmemorymanager_p.h" @@ -36,6 +41,9 @@ #include "hbcssconverterutils_p.h" #endif +/*! + Helper class for locking the cache. +*/ class HbCacheLocker { public: @@ -50,48 +58,55 @@ QSystemSemaphore &semaphore; }; -const HbOffsetItem *binaryFind(const QStringRef &key, const HbOffsetItem *itemArray, int count) -{ - int begin = 0; - int end = count - 1; - - // binary search - while (begin <= end) { - int mid = begin + (end-begin)/2; - // Fast string comparison, no unnecessary mem copy - QLatin1String offsetName(reinterpret_cast(itemArray) - + itemArray[mid].nameOffset); - int comparison = key.compare(offsetName); - // If the item was found, we're done. - if (!comparison) { - return &itemArray[mid]; - } - - // Is the target in lower or upper half? - else if (comparison < 0) { - end = mid - 1; - } else { - begin = mid + 1; - } - } - - // Did not find the target, return 0. - return 0; -} - +/*! + return the singleton instance. +*/ HbSharedCache *HbSharedCache::instance() { GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - return static_cast(manager)->cache(); + HbSharedCache *ptr = 0; + if (manager) { + ptr = static_cast(manager)->cache(); + } + return ptr; } -//doesn't check, if the item is already in the cache. +/*! + return hash value for \a string. +*/ +quint32 HbSharedCache::hash(const QStringRef &string) +{ + quint32 hashValue = 0; + const QChar *data = string.unicode(); + int size = string.size(); + while (size--) { + hashValue = data->unicode() + (hashValue << 6) + (hashValue << 16) - hashValue; + ++data; + } + return hashValue; +} + +/*! + adds \a offset using key \a key. \a itemType is the type of the structure, + where offset points to. + Only acceptable separator for key is '/'. + + doesn't check, if the item is already in the cache. +*/ bool HbSharedCache::add(ItemType itemType, const QString &key, int offset) { bool added = false; if (offset >= 0) { + QString cacheKey(key); + if (cacheKey.at(0) == ':') { + //use only filename as a key. + int index = cacheKey.lastIndexOf('/'); + if (index >= 0) { + cacheKey = cacheKey.right((cacheKey.size() - 1) - index); + } + } try { - CacheItem cacheItem(key, offset); + CacheItem cacheItem(cacheKey, offset); HbVector &vector = itemCache(itemType); HbCacheLocker locker(*Semaphore); vector.append(cacheItem); @@ -103,39 +118,132 @@ return added; } -int HbSharedCache::offset(ItemType itemType, const QString &key) const +/*! + adds layout definition \a offset for a path \a filePath, \a layout, \a section. + + doesn't check, if the item is already in the cache. + Only acceptable separator for filePath is '/'. +*/ +bool HbSharedCache::addLayoutDefinition(const QString &filePath, + const QString &layout, + const QString §ion, + int offset) +{ + return add(LayoutDefinition, layoutDefinitionKey(filePath, layout, section), offset); +} + +/*! + return layout offset for a \a filePath, \a layout, \a section. + + Only acceptable separator for filePath is '/'. +*/ +int HbSharedCache::layoutDefinitionOffset(const QString &filePath, + const QString &layout, + const QString §ion) const { int offset = -1; - if (itemType == Stylesheet && mOffsetItemCount > 0) { - //try first in offset map. - QStringRef cacheKey(&key); - if (key.at(0) == ':') { - //resource css use only filename as a key. - int index = key.lastIndexOf('/'); - if (index >= 0) { - cacheKey = key.rightRef((key.size() - 1) - index); + int position = 0; + int length = filePath.length(); + if (filePath.at(0) == ':') { + //resource css use only file name as a key. + int index = filePath.lastIndexOf('/'); + if (index >= 0) { + position = index + 1; + length = filePath.length() - position; + } + } + if (mOffsetItemCount > 0) { + //try first in prebuilt offset map. + length -= WidgetMLFileExtension.length(); + QStringRef widgetname(&filePath, position, length); + HbOffsetItem find(hash(widgetname)); + const HbOffsetItem *end = mOffsetItems + mOffsetItemCount; + const HbOffsetItem *offsetItem = qBinaryFind(mOffsetItems, end, find); + if (offsetItem != end) { +#ifdef CSSBIN_TRACES + qDebug() << "Offset item found from static cache map for widget: " << widgetname; +#endif + int tableSize = 0; + const HbLayoutIndexItem *begin = layoutIndexItemBegin( + offsetItem->offsetLayoutIndexTable, &tableSize); + if (begin) { + const HbLayoutIndexItem *end = begin + tableSize; + HbLayoutIndexItem find(hash(QStringRef(&layout)), hash(QStringRef(§ion))); + const HbLayoutIndexItem *item = qBinaryFind(begin, end, find); + if (item != end) { +#ifdef CSSBIN_TRACES + qDebug() << "Layout definition offset found for layout: " << layout; +#endif + offset = item->offset; + } } } - const HbOffsetItem *offsetItem = binaryFind(cacheKey, mOffsetItems, mOffsetItemCount); - if (offsetItem) { -#ifdef CSSBIN_TRACES - qDebug() << "Css offset found from static map for key: " << cacheKey; -#endif - offset = offsetItem->offset; - return offset; - } } - const HbVector &cacheVector = itemCache(itemType); - HbCacheLocker locker(*Semaphore); - Q_FOREACH(const CacheItem &item, cacheVector) { - if (item.key == key) { - offset = item.offset; - break; - } + if (offset == -1) { + QStringRef filePathRef(&filePath, position, filePath.length() - position); + QString key; + key.reserve(filePathRef.length() + 2 //key separators + + layout.length() + section.length()); + key.append(filePathRef) + .append(KeySeparator) + .append(layout) + .append(KeySeparator) + .append(section); + offset = findOffsetFromDynamicMap(LayoutDefinition, QStringRef(&key)); } return offset; } +/*! + return offset for a key \a key. \a itemType is the type of the structure, + where offset points to. + + Only acceptable separator for key is '/'. +*/ +int HbSharedCache::offset(ItemType itemType, const QString &key) const +{ + int offset = -1; + int position = 0; + int length = key.length(); + if (key.at(0) == ':') { + //resource css use only filename as a key. + int index = key.lastIndexOf('/'); + if (index >= 0) { + position = index + 1; + length = key.length() - position; + } + } + if (itemType == Stylesheet && mOffsetItemCount > 0) { + //try first in prebuilt offset map. + int isColorCSS = false; + if (key.endsWith(ColorCSSEnding)) { + length -= ColorCSSEnding.length(); + isColorCSS = true; + } else { + length -= CSSFileExtension.length(); + } + QStringRef widgetname(&key, position, length); + HbOffsetItem find(hash(widgetname)); + const HbOffsetItem *end = mOffsetItems + mOffsetItemCount; + const HbOffsetItem *offsetItem = qBinaryFind(mOffsetItems, end, find); + if (offsetItem != end) { +#ifdef CSSBIN_TRACES + qDebug() << "Offset item found from static cache map for widget: " << widgetname; +#endif + offset = (isColorCSS) ? offsetItem->offsetColorCSS : offsetItem->offsetCSS; + } + } + if (offset == -1) { + QStringRef keyRef(&key, position, key.length() - position); + offset = findOffsetFromDynamicMap(itemType, keyRef); + } + return offset; +} + +/*! + remove offset for a key \a key. \a itemType is the type of the structure, + where offset points to. +*/ bool HbSharedCache::remove(ItemType itemType, const QString &key) { bool removed = false; @@ -153,14 +261,34 @@ return removed; } +/*! + remove layout definition offset. +*/ +bool HbSharedCache::removeLayoutDefinition(const QString &filePath, + const QString &layout, + const QString §ion) +{ + return remove(LayoutDefinition, layoutDefinitionKey(filePath, layout, section)); +} + +/*! + add static offset map. +*/ void HbSharedCache::addOffsetMap(const char *offsetMapData, int size, int offsetItemCount) { if (offsetMapData) { memcpy(mOffsetItems, offsetMapData, size); mOffsetItemCount = offsetItemCount; #ifdef HB_BIN_CSS - for (int i=0; i 0; --size, ++layoutItem) { + HbCssConverterUtils::registerOffsetHolder(&(layoutItem->offset)); + } } #endif } else { @@ -175,30 +303,99 @@ { } +int HbSharedCache::findOffsetFromDynamicMap(ItemType itemType, const QStringRef &key) const +{ + int offset = -1; + const HbVector &cacheVector = itemCache(itemType); + HbCacheLocker locker(*Semaphore); + Q_FOREACH(const CacheItem &item, cacheVector) { + if (item.key == key) { + offset = item.offset; + break; + } + } + return offset; +} + +/*! + return the first layoutindextitem and size in offset \a offset. + \a offset is a value in HbOffsetItem::offsetLayoutIndexTable. +*/ +HbLayoutIndexItem *HbSharedCache::layoutIndexItemBegin(int offset, int *size) +{ + HbLayoutIndexItem *begin = 0; + *size = 0; + if (offset >= 0) { + void *layoutIndexBase = mOffsetItems; + int *sizePtr = reinterpret_cast( + static_cast(layoutIndexBase) + offset); + *size = *sizePtr; + begin = reinterpret_cast(sizePtr + 1); + } + return begin; +} + +/*! + build a layoutdefinition key. +*/ +QString HbSharedCache::layoutDefinitionKey(const QString &filePath, + const QString &layout, + const QString §ion) +{ + QStringRef nameKey(&filePath); + if (nameKey.at(0) == ':') { + //use only filename as a key. + int index = filePath.lastIndexOf('/'); + if (index >= 0) { + nameKey = filePath.rightRef((filePath.size() - 1) - index); + } + } + QString key; + key.append(nameKey) += KeySeparator + layout + KeySeparator + section; + return key; +} + +void HbSharedCache::freeResources() +{ + delete Semaphore; + Semaphore = 0; +} + +/*! + themeserver initialization function. +*/ void HbSharedCache::initServer() { - mLayoutDefCache.reserve(20); mEffectCache.reserve(20); //server creates the semaphore. Semaphore = new QSystemSemaphore(SemaphoreName, 1, QSystemSemaphore::Create); #ifdef CSSBIN_TRACES - qDebug() << "css offsets total: " << mOffsetItemCount; + qDebug() << "css offset items total: " << mOffsetItemCount; #endif } +/*! + client side initialization function. +*/ void HbSharedCache::initClient() { //client opens the semaphore created by the server. Semaphore = new QSystemSemaphore(SemaphoreName, 1, QSystemSemaphore::Open); } +/*! + return the cache for a cache item type. +*/ HbVector &HbSharedCache::itemCache(ItemType type) { const HbVector &items = const_cast(this)->itemCache(type); return const_cast&>(items); } +/*! + return the cache for a cache item type. +*/ const HbVector &HbSharedCache::itemCache(ItemType type) const { const HbVector *items = 0; @@ -218,4 +415,3 @@ } return *items; } - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsharedcache_p.h --- a/src/hbcore/core/hbsharedcache_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsharedcache_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,13 +31,49 @@ struct HbOffsetItem { - HbOffsetItem() : nameOffset(-1), offset(-1) {} - HbOffsetItem(int nameOffset, int offset) - : nameOffset(nameOffset), offset(offset) {} - int nameOffset; - int offset; + explicit HbOffsetItem(quint32 widgetHash = 0) : + widgetHash(widgetHash), + offsetCSS(-1), + offsetColorCSS(-1), + offsetLayoutIndexTable(-1) {} + + quint32 widgetHash; + qint32 offsetCSS; + qint32 offsetColorCSS; + qint32 offsetLayoutIndexTable; }; +inline +bool operator < (const HbOffsetItem &offsetItem1, + const HbOffsetItem &offsetItem2) +{ + return offsetItem1.widgetHash < offsetItem2.widgetHash; +} + +struct HbLayoutIndexItem +{ + explicit HbLayoutIndexItem(quint32 layoutNameHash = 0, quint32 sectionNameHash = 0) : + layoutNameHash(layoutNameHash), + sectionNameHash(sectionNameHash), + offset(-1) {} + quint32 layoutNameHash; + quint32 sectionNameHash; + qint32 offset; +}; + +inline +bool operator < (const HbLayoutIndexItem &layoutIndexItem1, + const HbLayoutIndexItem &layoutIndexItem2) +{ + if (layoutIndexItem1.layoutNameHash < layoutIndexItem2.layoutNameHash) { + return true; + } + if (layoutIndexItem1.layoutNameHash > layoutIndexItem2.layoutNameHash) { + return false; + } + return (layoutIndexItem1.sectionNameHash < layoutIndexItem2.sectionNameHash); +} + class HB_CORE_PRIVATE_EXPORT HbSharedCache { private: @@ -61,26 +97,49 @@ Effect }; static HbSharedCache *instance(); + static quint32 hash(const QStringRef &string); bool add(ItemType itemType, const QString &key, int offset); + bool addLayoutDefinition(const QString &filePath, + const QString &layout, + const QString §ion, + int offset); + int layoutDefinitionOffset(const QString &filePath, + const QString &layout, + const QString §ion) const; int offset(ItemType itemType, const QString &key) const; bool remove(ItemType itemType, const QString &key); + bool removeLayoutDefinition(const QString &filePath, + const QString &layout, + const QString §ion); private: HbSharedCache(); void initServer(); void initClient(); + void freeResources(); HbVector &itemCache(ItemType type); const HbVector &itemCache(ItemType type) const; void addOffsetMap(const char *offsetMapData, int size, int offsetItemCount); + int findOffsetFromDynamicMap(ItemType itemType, const QStringRef &key) const; + const HbLayoutIndexItem *layoutIndexItemBegin(int offset, int *size) const + { + return const_cast(this)->layoutIndexItemBegin(offset, size); + } + HbLayoutIndexItem *layoutIndexItemBegin(int offset, int *size); + static QString layoutDefinitionKey(const QString &filePath, + const QString &layout, + const QString §ion); + friend class HbSharedMemoryManager; + friend class HbSharedMemoryManagerUt; private: - friend bool writeCssBinary(const QStringList &, const QString &); + friend bool testCss(); HbVector mLayoutDefCache; HbVector mStylesheetCache; HbVector mEffectCache; int mOffsetItemCount; - HbOffsetItem mOffsetItems[1]; //actual size or array is mOffsetItemCount + HbOffsetItem mOffsetItems[1]; //actual size of array is mOffsetItemCount }; #endif // HBSHAREDCACHE_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsharedmemoryallocators_p.h --- a/src/hbcore/core/hbsharedmemoryallocators_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsharedmemoryallocators_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,8 +27,9 @@ #define HBSHAREDMEMORYALLOCATORS_P_H #include "hbthemecommon_p.h" +#include -#define ALIGN_SIZE 4 +static const int ALIGN_SIZE = 4; #define ALIGN(x) ((x + ALIGN_SIZE - 1) & ~(ALIGN_SIZE - 1)) // space for multisegment allocator bookkeeping - to be allocated from shared memory @@ -46,12 +47,41 @@ // max. amount of different chunk sizes in multisegment allocator static const int AMOUNT_OF_DIFFERENT_CHUNK_SIZES = 8; -class QSharedMemory; -class HB_CORE_PRIVATE_EXPORT HbSharedMemoryAllocator +// wrapper for hiding Symbian specific protected chunk +class HbSharedMemoryWrapper { public: - virtual void initialize(QSharedMemory *sharedChunk, + HbSharedMemoryWrapper(const QString &key, QObject *parent = 0); + ~HbSharedMemoryWrapper(); + + bool create(int size, QSharedMemory::AccessMode mode = QSharedMemory::ReadWrite); + QSharedMemory::SharedMemoryError error() const; + bool attach(QSharedMemory::AccessMode mode = QSharedMemory::ReadWrite); + void *data(); + int size() const; + +#ifdef HB_HAVE_PROTECTED_CHUNK + void setErrorString(const QString &function, TInt errorCode); +#endif +private: +#ifdef HB_HAVE_PROTECTED_CHUNK + QSharedMemory::SharedMemoryError wrapperError; + QString errorString; + const QString key; + RChunk chunk; + int memorySize; + void *memory; +#else + QSharedMemory *chunk; +#endif +}; + + +class HbSharedMemoryAllocator +{ +public: + virtual void initialize(HbSharedMemoryWrapper *sharedChunk, const unsigned int offset = 0, HbSharedMemoryAllocator *mainAllocator = 0) = 0; virtual int alloc(int size) = 0; @@ -64,8 +94,7 @@ }; - -class HB_CORE_PRIVATE_EXPORT HbSplayTreeAllocator : public HbSharedMemoryAllocator +class HbSplayTreeAllocator : public HbSharedMemoryAllocator { public: HbSplayTreeAllocator(); @@ -74,7 +103,7 @@ int alloc(int size); int allocatedSize(int offset); void free(int offset); - void initialize(QSharedMemory *sharedChunk, + void initialize(HbSharedMemoryWrapper *sharedChunk, const unsigned int offset = 0, HbSharedMemoryAllocator *mainAllocator = 0); int size(); @@ -122,16 +151,21 @@ void deleteLengthNode(unsigned int *root, TreeNode *node, bool splayed); void *toPointer(unsigned int offset) const; + template + inline T *address(int offset) + { + return reinterpret_cast(static_cast(chunk->data()) + offset); + } private: - QSharedMemory *chunk; + HbSharedMemoryWrapper *chunk; unsigned int offset; HeapHeader *header; }; -class HB_CORE_PRIVATE_EXPORT HbMultiSegmentAllocator : public HbSharedMemoryAllocator +class HbMultiSegmentAllocator : public HbSharedMemoryAllocator { public: HbMultiSegmentAllocator(); @@ -140,7 +174,7 @@ int alloc(int size); int allocatedSize(int offset); void free(int offset); - void initialize(QSharedMemory *sharedChunk, + void initialize(HbSharedMemoryWrapper *sharedChunk, const unsigned int offset = 0, HbSharedMemoryAllocator *mainAllocator = 0); #ifdef HB_THEME_SERVER_MEMORY_REPORT @@ -171,9 +205,14 @@ // helper methods void addList(int index, int offset); bool setFreeList(int index); + template + inline T *address(int offset) + { + return reinterpret_cast(static_cast(chunk->data()) + offset); + } private: - QSharedMemory *chunk; + HbSharedMemoryWrapper *chunk; unsigned int offset; HbSharedMemoryAllocator *mainAllocator; MultiAllocatorHeader *header; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsharedmemorymanager_p.cpp --- a/src/hbcore/core/hbsharedmemorymanager_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsharedmemorymanager_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -52,6 +52,172 @@ HbSharedMemoryManager *HbSharedMemoryManager::memManager = 0; +#ifdef HB_HAVE_PROTECTED_CHUNK // Symbian, protected chunk +HbSharedMemoryWrapper::HbSharedMemoryWrapper(const QString &key, QObject *parent) : + wrapperError(QSharedMemory::NoError), + key(key), + memorySize(0), + memory(0) +{ + Q_UNUSED(parent); +} + +HbSharedMemoryWrapper::~HbSharedMemoryWrapper() +{ + chunk.Close(); + + memory = 0; + memorySize = 0; + +} + +void HbSharedMemoryWrapper::setErrorString(const QString &function, TInt errorCode) +{ + if (errorCode == KErrNone) + return; + switch (errorCode) { + case KErrAlreadyExists: + wrapperError = QSharedMemory::AlreadyExists; + errorString = QSharedMemory::tr("%1: already exists").arg(function); + break; + case KErrNotFound: + wrapperError = QSharedMemory::NotFound; + errorString = QSharedMemory::tr("%1: doesn't exists").arg(function); + break; + case KErrArgument: + wrapperError = QSharedMemory::InvalidSize; + errorString = QSharedMemory::tr("%1: invalid size").arg(function); + break; + case KErrNoMemory: + wrapperError = QSharedMemory::OutOfResources; + errorString = QSharedMemory::tr("%1: out of resources").arg(function); + break; + case KErrPermissionDenied: + wrapperError = QSharedMemory::PermissionDenied; + errorString = QSharedMemory::tr("%1: permission denied").arg(function); + break; + default: + errorString = QSharedMemory::tr("%1: unknown error %2").arg(function).arg(errorCode); + wrapperError = QSharedMemory::UnknownError; + } +} + +bool HbSharedMemoryWrapper::create(int size, QSharedMemory::AccessMode mode) +{ + Q_UNUSED(mode); + TPtrC ptr(TPtrC16(static_cast(key.utf16()), key.length())); + + TChunkCreateInfo info; + info.SetReadOnly(); + info.SetGlobal(ptr); + info.SetNormal(size, size); + + //TInt err = chunk.CreateGlobal(ptr, size, size); // Original Qt version + TInt err = chunk.Create(info); + + QString function = QLatin1String("HbSharedMemoryWrapper::create"); + setErrorString(function, err); + + if (err != KErrNone) + return false; + + // Zero out the created chunk + Mem::FillZ(chunk.Base(), chunk.Size()); + + memorySize = chunk.Size(); + memory = chunk.Base(); + + return true; +} + +QSharedMemory::SharedMemoryError HbSharedMemoryWrapper::error() const +{ + return wrapperError; +} + +bool HbSharedMemoryWrapper::attach(QSharedMemory::AccessMode mode) +{ + Q_UNUSED(mode); + // Grab a pointer to the memory block + if (!chunk.Handle()) { + TPtrC ptr(TPtrC16(static_cast(key.utf16()), key.length())); + + TInt err = KErrNoMemory; + + err = chunk.OpenGlobal(ptr, false); + + if (err != KErrNone) { + QString function = QLatin1String("HbSharedMemoryWrapper::attach"); + setErrorString(function, err); + return false; + } + } + + memorySize = chunk.Size(); + memory = chunk.Base(); + + return true; +} + +void *HbSharedMemoryWrapper::data() +{ + return memory; +} + +int HbSharedMemoryWrapper::size() const +{ + return memorySize; +} +#else // use QSharedMemory +HbSharedMemoryWrapper::HbSharedMemoryWrapper(const QString &key, QObject *parent) +{ + chunk = new QSharedMemory(key, parent); +} + +HbSharedMemoryWrapper::~HbSharedMemoryWrapper() +{ + delete chunk; + chunk = 0; +} + +bool HbSharedMemoryWrapper::create(int size, QSharedMemory::AccessMode mode) +{ + if (chunk) { + return chunk->create(size, mode); + } + return false; +} + +QSharedMemory::SharedMemoryError HbSharedMemoryWrapper::error() const +{ + return chunk->error(); +} + +bool HbSharedMemoryWrapper::attach(QSharedMemory::AccessMode mode) +{ + if (chunk) { + return chunk->attach(mode); + } + return false; +} + +void *HbSharedMemoryWrapper::data() +{ + if (chunk) { + return chunk->data(); + } + return 0; +} + +int HbSharedMemoryWrapper::size() const +{ + if (chunk) { + return chunk->size(); + } + return 0; +} +#endif + /* Functions implementation of HbSharedMemoryManager class */ /** @@ -66,14 +232,15 @@ return true; } bool success = false; - chunk = new QSharedMemory(HB_THEME_SHARED_PIXMAP_CHUNK); + chunk = new HbSharedMemoryWrapper(HB_THEME_SHARED_PIXMAP_CHUNK); // check if app filename is same as server filename .. // ToDo: improve server identification logic.. UID on symbian? const QString &appName = HbMemoryUtils::getCleanAppName(); bool binCSSConverterApp = (appName == BIN_CSS_APP || appName == BIN_CSS_APP_SYMBIAN); - if (appName == THEME_SERVER_NAME || binCSSConverterApp) { + // Testability support: allowing unit test to write to shared chunk also + if (appName == THEME_SERVER_NAME || appName == SHARED_MEMORY_MANAGER_UNIT_TEST || binCSSConverterApp) { // This is server, create shared memory chunk - success = chunk->create( CACHE_SIZE, QSharedMemory::ReadWrite ); + success = chunk->create(CACHE_SIZE, QSharedMemory::ReadWrite); // If sharedMemory already exists. // (This can happpen if ThemeServer crashed without releasing QSharedMemory) if (!success && QSharedMemory::AlreadyExists == chunk->error()) { @@ -82,7 +249,7 @@ writable = true; } else { // this is not server so just attach to shared memory chunk in ReadOnly mode - success = chunk->attach( QSharedMemory::ReadOnly ); + success = chunk->attach(QSharedMemory::ReadOnly); writable = false; } if ( !success ) { @@ -92,51 +259,56 @@ delete chunk; chunk = 0; } - if (success && isWritable()) { // if we are recovering from theme server crash, shared chunk may // already be ready - bool enableRecovery = true; + bool enableRecovery = false; if (binCSSConverterApp) { enableRecovery = false; } HbSharedChunkHeader *chunkHeader = static_cast(chunk->data()); + HbSharedCache *cachePtr = 0; if (enableRecovery && chunkHeader->identifier == INITIALIZED_CHUNK_IDENTIFIER) { // just reconnect allocators to the shared chunk mainAllocator->initialize(chunk, chunkHeader->mainAllocatorOffset); subAllocator->initialize(chunk, chunkHeader->subAllocatorOffset, mainAllocator); } else { + memset(chunkHeader, 0, sizeof(HbSharedChunkHeader)); // Load memory file in the beginning of the chunk first. - HbSharedCache *cachePtr = 0; int memoryFileSize = 0; - chunkHeader->sharedCacheOffset = 0; - if (!binCSSConverterApp) { #ifdef Q_OS_SYMBIAN - QString memoryFile("z:/resource/hb/themes/css.bin"); + if (!binCSSConverterApp) { + QString memoryFile("z:/resource/hb/themes/hbdefault.cssbin"); memoryFileSize = loadMemoryFile(memoryFile); -#endif } - +#endif // Put main allocator after the memory file or if memory file was not loaded, after chunk header. - chunkHeader->mainAllocatorOffset = memoryFileSize ? ALIGN(memoryFileSize) : sizeof(HbSharedChunkHeader); + chunkHeader->mainAllocatorOffset = memoryFileSize ? ALIGN(memoryFileSize) + : sizeof(HbSharedChunkHeader); + // Clear also allocator identifier so that they will not try to re-connect + int *mainAllocatorIdentifier = address(chunkHeader->mainAllocatorOffset); + *mainAllocatorIdentifier = 0; mainAllocator->initialize(chunk, chunkHeader->mainAllocatorOffset); chunkHeader->subAllocatorOffset = alloc(SPACE_NEEDED_FOR_MULTISEGMENT_ALLOCATOR); + int *subAllocatorIdentifier = address(chunkHeader->subAllocatorOffset); + *subAllocatorIdentifier = 0; subAllocator->initialize(chunk, chunkHeader->subAllocatorOffset, mainAllocator); chunkHeader->identifier = INITIALIZED_CHUNK_IDENTIFIER; if (!binCSSConverterApp) { - if (memoryFileSize > 0) { - cachePtr = cache(); - } else { + if (memoryFileSize == 0) { cachePtr = createSharedCache(0, 0, 0); } - - if (cachePtr) { - cachePtr->initServer(); - } } } + if (!cachePtr) { + cachePtr = cache(); + } + if (cachePtr && !binCSSConverterApp) { + cachePtr->initServer(); + } + success = true; } else { HbSharedCache *cachePtr = cache(); @@ -199,7 +371,7 @@ if (allocations.contains(size)) { allocations[size].first++; } else { - allocations.insert(size, QPair(1,0)); + allocations.insert(size, QPair(1,0)); } #else // normal alloc without reporting @@ -221,11 +393,11 @@ #endif // HB_THEME_SERVER_MEMORY_REPORT #ifdef HB_THEME_SERVER_FULL_MEMORY_REPORT - fullAllocationHistory.append(QPair(size | allocIdentifier, offset)); + fullAllocationHistory.append(QPair(size | allocIdentifier, offset)); #endif #ifdef HB_BIN_CSS - HbCssConverterUtils::cellAllocated(offset, size); + HbCssConverterUtils::cellAllocated(offset, size); #endif return offset; } else { @@ -241,7 +413,7 @@ { // don't do anything when freeing NULL (pointer)offset if (isWritable() && (offset > 0)) { - int metaData = *(int*)((unsigned char*)(base())+offset-sizeof(int)); + int metaData = *address(offset - sizeof(int)); #ifdef HB_THEME_SERVER_MEMORY_REPORT int size = 0; if (metaData & MAIN_ALLOCATOR_IDENTIFIER) { @@ -257,13 +429,12 @@ fullAllocationHistory.append(QPair(size | freeIdentifier, offset)); #endif -#endif +#endif //HB_THEME_SERVER_MEMORY_REPORT if (metaData & MAIN_ALLOCATOR_IDENTIFIER) { mainAllocator->free(offset); } else { subAllocator->free(offset); } - #ifdef HB_BIN_CSS HbCssConverterUtils::cellFreed(offset); #endif @@ -281,7 +452,7 @@ if (isWritable()) { #ifdef HB_THEME_SERVER_FULL_MEMORY_REPORT if (offset > 0) { // if offset == -1, just do normal alloc and not report realloc - fullAllocationHistory.append(QPair(newSize | reallocIdentifier, offset)); + fullAllocationHistory.append(QPair(newSize | reallocIdentifier, offset)); } #endif newOffset = alloc(newSize); @@ -290,11 +461,11 @@ #ifdef HB_BIN_CSS HbCssConverterUtils::cellMoved(offset, newOffset); #endif - unsigned char *scrPtr = (unsigned char*)(base())+offset; - int metaData = *(int*)((unsigned char*)(base())+offset-sizeof(int)); + unsigned char *scrPtr = address(offset); + int metaData = *address(offset - sizeof(int)); if (metaData & MAIN_ALLOCATOR_IDENTIFIER) { int oldSize = mainAllocator->allocatedSize(offset); - memcpy((unsigned char*)(base())+newOffset, scrPtr, qMin(oldSize, allocatedSize)); + memcpy(address(newOffset), scrPtr, qMin(oldSize, allocatedSize)); #ifdef HB_THEME_SERVER_MEMORY_REPORT free(offset); #else @@ -302,14 +473,13 @@ #endif } else { int oldSize = subAllocator->allocatedSize(offset); - memcpy((unsigned char*)(base())+newOffset, scrPtr, qMin(oldSize, allocatedSize)); + memcpy(address(newOffset), scrPtr, qMin(oldSize, allocatedSize)); #ifdef HB_THEME_SERVER_MEMORY_REPORT free(offset); #else subAllocator->free(offset); #endif } - #if HB_BIN_CSS // Does not matter if already called when calling free() above. HbCssConverterUtils::cellFreed(offset); @@ -328,7 +498,7 @@ */ void *HbSharedMemoryManager::base() { - return chunk->data(); + return chunk->data(); } /** @@ -368,7 +538,7 @@ } if (sharedCacheOffset >= 0) { - cache = new (static_cast(base()) + sharedCacheOffset) HbSharedCache(); + cache = new (address(sharedCacheOffset)) HbSharedCache(); cache->addOffsetMap(offsetMapData, size, offsetItemCount); chunkHeader->sharedCacheOffset = sharedCacheOffset; } @@ -378,15 +548,20 @@ int HbSharedMemoryManager::size() { if(mainAllocator) { - return (dynamic_cast(mainAllocator))->size(); + return (static_cast(mainAllocator))->size(); } return -1; } HbSharedCache *HbSharedMemoryManager::cache() { - const HbSharedChunkHeader *chunkHeader = static_cast(chunk->data()); - return reinterpret_cast((char*)base() + chunkHeader->sharedCacheOffset); + HbSharedCache *cachePtr = 0; + if (chunk) { + const HbSharedChunkHeader *chunkHeader = + static_cast(chunk->data()); + cachePtr = address(chunkHeader->sharedCacheOffset); + } + return cachePtr; } /** @@ -397,6 +572,14 @@ #ifdef HB_THEME_SERVER_MEMORY_REPORT allocations.clear(); #endif + if (chunk) { + const HbSharedChunkHeader *chunkHeader = + static_cast(chunk->data()); + if (chunkHeader->sharedCacheOffset > 0) { + HbSharedCache *cachePtr = address(chunkHeader->sharedCacheOffset); + cachePtr->freeResources(); + } + } delete subAllocator; delete mainAllocator; delete chunk; @@ -410,7 +593,9 @@ if (!memManager) { memManager = new HbSharedMemoryManager(); if (!memManager->initialize()) { +#ifdef THEME_SERVER_TRACES qWarning( "HbSharedMemoryManager:Could not initialize shared memory" ); +#endif delete memManager; memManager = 0; } @@ -427,7 +612,6 @@ memManager = 0; } - /** * gets the free memory reported by main allocator */ @@ -461,13 +645,14 @@ loadedSize = (int)fileSize; } #ifdef CSSBIN_TRACES - qDebug() << "Loading memory file status: " << (ok ? "no error" : file.errorString()); + qDebug() << "Loading memory file status: " << (loadedSize > 0 ? "no error" : file.errorString()); #endif return loadedSize; } #ifdef HB_THEME_SERVER_MEMORY_REPORT -bool pairGreaterThan(const QPair > &p1, const QPair > &p2) +bool pairGreaterThan(const QPair > &p1, + const QPair > &p2) { return p1.first > p2.first; } @@ -511,10 +696,11 @@ reportWriter << "********************************************************************************\n\n"; // list for sorting allocations and frees - QList > > valueList; - QMap >::const_iterator i; // size, + QList > > valueList; + QMap >::const_iterator i; // size, for (i = allocations.constBegin(); i != allocations.constEnd(); ++i) { - valueList.append(QPair >(i.value().first, QPair(i.key(), i.value().second))); + valueList.append(QPair > + (i.value().first, QPair(i.key(), i.value().second))); } qSort(valueList.begin(), valueList.end(), pairGreaterThan); @@ -523,29 +709,35 @@ reportWriter << "times allocated - times released - size\n"; int count = 0; for (int i = 0; i < valueList.size(); i++) { - if (count > 30) break; // only report top 30 sizes - reportWriter << valueList.at(i).first << " - " << valueList.at(i).second.second << " - " << valueList.at(i).second.first << "\n"; + if (count > 30) { + break; // only report top 30 sizes + } + reportWriter << valueList.at(i).first << " - " + << valueList.at(i).second.second << " - " + << valueList.at(i).second.first << "\n"; count++; } reportWriter << "\n"; valueList.clear(); for (i = allocations.constBegin(); i != allocations.constEnd(); ++i) { - valueList.append(QPair >(i.key(), QPair(i.value().first, i.value().second))); + valueList.append(QPair > + (i.key(), QPair(i.value().first, i.value().second))); } qSort(valueList.begin(), valueList.end(), pairGreaterThan); reportWriter << "Top 30 allocated sizes:\n"; reportWriter << "size - times allocated - times released\n"; count = 0; for (int i = 0; i < valueList.size(); i++) { - if (count > 30) break; // only report top 30 sizes - reportWriter << valueList.at(i).first << " - " << valueList.at(i).second.first << " - " << valueList.at(i).second.second << "\n"; + if (count > 30) { + break; // only report top 30 sizes + } + reportWriter << valueList.at(i).first << " - " << valueList.at(i).second.first << " - " + << valueList.at(i).second.second << "\n"; count++; } reportWriter << "\n"; - - mainAllocator->writeReport(reportWriter); #ifdef USE_SUBALLOCATOR subAllocator->writeReport(reportWriter); @@ -565,14 +757,16 @@ reportWriter << "freed " << size << " bytes from offset " << offset << "\n"; break; case reallocIdentifier: - reportWriter << "reallocation from offset " << offset << " with " << size << " bytes" << "\n"; + reportWriter << "reallocation from offset " << offset << " with " + << size << " bytes" << "\n"; i++; if (i <= fullAllocationHistory.size()) { size = fullAllocationHistory.at(i).first & 0x3FFFFFFF; identifier = fullAllocationHistory.at(i).first & 0xC0000000; offset = fullAllocationHistory.at(i).second; if (identifier == allocIdentifier) { // should come right after realloc - reportWriter << " from realloc: allocated " << size << " bytes from offset " << offset << "\n"; + reportWriter << " from realloc: allocated " << size + << " bytes from offset " << offset << "\n"; } else { reportWriter << "ERROR: no alloc after realloc! How is this possible?\n"; } @@ -583,7 +777,8 @@ identifier = fullAllocationHistory.at(i).first & 0xC0000000; offset = fullAllocationHistory.at(i).second; if (identifier == freeIdentifier) { // should come right after realloc and alloc - reportWriter << " from realloc: freed " << size << " bytes from offset " << offset << "\n"; + reportWriter << " from realloc: freed " << size + << " bytes from offset " << offset << "\n"; } else { reportWriter << "ERROR: no free after realloc and alloc! How is this possible?\n"; } @@ -592,7 +787,6 @@ default: break; } - } #endif file.close(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsharedmemorymanager_p.h --- a/src/hbcore/core/hbsharedmemorymanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsharedmemorymanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,6 +41,7 @@ #if !defined(HB_BOOTSTRAPPED) || defined(HB_BIN_CSS) class QSharedMemory; +class HbSharedMemoryWrapper; class HbSharedMemoryAllocator; class HbSharedCache; @@ -77,12 +78,17 @@ private: bool initialize(); int loadMemoryFile(const QString &filePath); + template + inline T *address(int offset) + { + return reinterpret_cast(static_cast(base()) + offset); + } protected: bool writable; HbSharedMemoryAllocator *mainAllocator; HbSharedMemoryAllocator *subAllocator; - QSharedMemory *chunk; + HbSharedMemoryWrapper *chunk; private: static HbSharedMemoryManager *memManager; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsharedmemorymanagerut_p.cpp --- a/src/hbcore/core/hbsharedmemorymanagerut_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsharedmemorymanagerut_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,8 +28,8 @@ #include #include - #include "hbthemecommon_p.h" +#include "hbsharedcache_p.h" #define HB_THEME_SHARED_AUTOTEST_CHUNK "hbthemesharedautotest" @@ -43,7 +43,7 @@ bool success = false; if ( !chunk ) { - chunk = new QSharedMemory(HB_THEME_SHARED_AUTOTEST_CHUNK); + chunk = new HbSharedMemoryWrapper(HB_THEME_SHARED_AUTOTEST_CHUNK); success = chunk->create( CACHE_SIZE, QSharedMemory::ReadWrite ); // If SharedMemory Already Exists. // (This can happpen if ThemeServer crashed without releasing QSharedMemory) @@ -63,17 +63,34 @@ if (success) { // if we are recovering from theme server crash, shared chunk may // already be ready + bool enableRecovery = false; HbSharedChunkHeader *chunkHeader = (HbSharedChunkHeader*)(chunk->data()); - if (chunkHeader->identifier == INITIALIZED_CHUNK_IDENTIFIER) { + if (enableRecovery && chunkHeader->identifier == INITIALIZED_CHUNK_IDENTIFIER) { // just reconnect allocators to the shared chunk mainAllocator->initialize(chunk, chunkHeader->mainAllocatorOffset); subAllocator->initialize(chunk, chunkHeader->subAllocatorOffset, mainAllocator); } else { chunkHeader->mainAllocatorOffset = sizeof(HbSharedChunkHeader); + // Clear also allocator identifier so that they will not try to re-connect + int *mainAllocatorIdentifier = reinterpret_cast(static_cast(base()) + chunkHeader->mainAllocatorOffset); + *mainAllocatorIdentifier = 0; mainAllocator->initialize(chunk, chunkHeader->mainAllocatorOffset); chunkHeader->subAllocatorOffset = alloc(SPACE_NEEDED_FOR_MULTISEGMENT_ALLOCATOR); + int *subAllocatorIdentifier = reinterpret_cast(static_cast(base()) + chunkHeader->subAllocatorOffset); + *subAllocatorIdentifier = 0; subAllocator->initialize(chunk, chunkHeader->subAllocatorOffset, mainAllocator); chunkHeader->identifier = INITIALIZED_CHUNK_IDENTIFIER; + + // Create empty shared cache for unit test purposes + HbSharedCache *cachePtr = createSharedCache(0, 0, 0); + if (cachePtr) { + const QString &appName = HbMemoryUtils::getCleanAppName(); + if (appName == THEME_SERVER_NAME) { + cachePtr->initServer(); + } else { + cachePtr->initClient(); + } + } } success = true; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsmartoffset_p.h --- a/src/hbcore/core/hbsmartoffset_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsmartoffset_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ class HB_CORE_PRIVATE_EXPORT HbSmartOffset { public: - HbSmartOffset(int offset = -1, HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) + explicit HbSmartOffset(int offset = -1, HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) :mOffset(offset), mType(type) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsmartpointer_p.h --- a/src/hbcore/core/hbsmartpointer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsmartpointer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef SMARTPOINTER_P_H -#define SMARTPOINTER_P_H +#ifndef HBSMARTPOINTER_P_H +#define HBSMARTPOINTER_P_H #include "hbmemoryutils_p.h" @@ -44,7 +44,7 @@ smart_ptr( pointer ptr = 0, HbMemoryManager::MemoryType type = HbMemoryManager::InvalidMemory ) { mType = type; - this->setOffset(ptr); + setOffset(ptr); } /* @@ -54,9 +54,9 @@ smart_ptr( U *ptr, HbMemoryManager::MemoryType type ) { mType = type; - pointer p (ptr); + pointer p(ptr); (void)p; - this->setOffset(p); + setOffset(p); } /* @@ -65,7 +65,7 @@ smart_ptr( const smart_ptr &other ) { mType = other.mType; - this->setOffset( other.get() ); + setOffset(other.get()); } /* @@ -75,15 +75,14 @@ template smart_ptr( const smart_ptr &other ) { - this->mType = other.memoryType(); - pointer p( other.get() ); - (void)p; - this->setOffset(p); + mType = other.memoryType(); + pointer p(other.get()); + setOffset(p); } smart_ptr operator+( difference_type offset ) { - return smart_ptr( get() + offset, this->mType ); + return smart_ptr(get() + offset, mType); } reference operator*() const @@ -93,7 +92,7 @@ reference operator[]( difference_type idx ) const { - return this->get()[idx]; + return get()[idx]; } smart_ptr & operator++( void ) @@ -111,7 +110,7 @@ smart_ptr & operator-- (void) { - this->decOffset(sizeof (T)); + decOffset(sizeof(T)); return *this; } @@ -124,17 +123,17 @@ bool operator == ( const smart_ptr &other ) { - return ( get() == other.get() && mType == other.mType ); + return (get() == other.get() && mType == other.mType); } bool operator != ( const smart_ptr &other ) { - return ( get() != other.get() && mType == other.mType ); + return (get() != other.get() && mType == other.mType); } bool operator! () const { - return this->get() == 0; + return get() == 0; } pointer get() const @@ -154,12 +153,12 @@ mOffset = offset; } - // This function is here for being able to modify offset when - // cells in shared memory are moved. - difference_type *offsetPtr() - { - return &mOffset; - } + // This function is here for being able to modify offset when + // cells in shared memory are moved. + difference_type *offsetPtr() + { + return &mOffset; + } HbMemoryManager::MemoryType memoryType() const { @@ -168,14 +167,13 @@ pointer operator->() const { - return this->get(); + return get(); } - smart_ptr & operator= ( const smart_ptr &other ) + smart_ptr & operator = ( const smart_ptr &other ) { mType = other.mType; - pointer p( other.get() ); - (void)p; + pointer p(other.get()); this->setOffset(p); return *this; } @@ -184,50 +182,50 @@ * Assignment From other smart_ptr */ template - smart_ptr & operator= ( const smart_ptr & other ) + smart_ptr & operator = ( const smart_ptr & other ) { mType = other.memoryType(); - pointer p( other.get() ); - this->setOffset(p); + pointer p(other.get()); + setOffset(p); return *this; } - smart_ptr & operator= ( pointer from ) + smart_ptr & operator = ( pointer from ) { - this->setOffset(from); + setOffset(from); return *this; } smart_ptr operator+ ( difference_type offset ) const { - return smart_ptr( this->get() + offset, this->mType ); + return smart_ptr(get() + offset, mType); } smart_ptr operator- ( difference_type offset ) const { - return smart_ptr( this->get() - offset, this->mType ); + return smart_ptr(get() - offset, mType); } - smart_ptr &operator+= ( difference_type offset ) + smart_ptr &operator += ( difference_type offset ) { - this->incOffset( offset * sizeof (T) ); + incOffset(offset * sizeof(T)); return *this; } smart_ptr &operator-= ( difference_type offset ) { - this->decOffset( offset * sizeof (T) ); + decOffset(offset * sizeof(T)); return *this; } operator void *() { - return (void*)this->get(); + return (void*)get(); } private: - typedef smart_ptr self_t; + typedef smart_ptr self_t; void unspecified_bool_type_func() const {} typedef void ( self_t::*unspecified_bool_type )() const; @@ -301,4 +299,4 @@ inline int operator- ( const smart_ptr &pt, const smart_ptr &pt2 ) { return pt.get() - pt2.get(); } -#endif // SMARTPOINTER_P_H +#endif // HBSMARTPOINTER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbsplaytreeallocator_p.cpp --- a/src/hbcore/core/hbsplaytreeallocator_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbsplaytreeallocator_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,11 +28,11 @@ #include #include -#define TO_PTR(x) ((char*)(toPointer(x))) -#define TO_NODE_POINTER(x) ((TreeNode*)(toPointer(x))) -#define TO_BLOCK_POINTER(x) ((MemoryBlock*)(toPointer(x))) -#define TO_NODE_OFFSET(x) ((int)((char*)(x)-(char*)(chunk->data()))) -#define TO_OFFSET(x) ((int)((char*)(x)-(char*)(chunk->data()))) +#define TO_PTR(x) ((char *)(toPointer(x))) +#define TO_NODE_POINTER(x) ((TreeNode *)(toPointer(x))) +#define TO_BLOCK_POINTER(x) ((MemoryBlock *)(toPointer(x))) +#define TO_NODE_OFFSET(x) ((int)((char *)(x)-(char *)(chunk->data()))) +#define TO_OFFSET(x) ((int)((char *)(x)-(char *)(chunk->data()))) // this identifier is used to check, if the splay tree is already // initialized in given shared chunk @@ -44,7 +44,7 @@ * Initializes splay tree and internal variables. * This can't fail if sharedChunk is valid. */ -void HbSplayTreeAllocator::initialize(QSharedMemory *sharedChunk, +void HbSplayTreeAllocator::initialize(HbSharedMemoryWrapper *sharedChunk, const unsigned int offset, HbSharedMemoryAllocator *mainAllocator) { @@ -52,19 +52,19 @@ chunk = sharedChunk; this->offset = offset; - header = (HeapHeader*)(static_cast(chunk->data()) + offset); + header = address(offset); if (header->identifier == INITIALIZED_ALLOCATOR_IDENTIFIER) { return; // already initialized } memset(header, 0, sizeof(HeapHeader)); - header->freeBytes = chunk->size()-offset-sizeof(HeapHeader)-sizeof(MemoryBlock); + header->freeBytes = chunk->size() - offset - sizeof(HeapHeader) - sizeof(MemoryBlock); // insert first memory block in chunk - MemoryBlock *block = (MemoryBlock*)&header[1]; + MemoryBlock *block = reinterpret_cast(&header[1]); block->pointerNode.key = TO_OFFSET(block); - block->lengthNode.key = (unsigned int)header->freeBytes; + block->lengthNode.key = static_cast(header->freeBytes); insertLengthNode(&header->lengthNode, &block->lengthNode); insertNode(&header->pointerNode, &block->pointerNode); @@ -94,7 +94,7 @@ void *HbSplayTreeAllocator::toPointer(unsigned int offset) const { if (offset >= sizeof(HeapHeader)) { - unsigned char *base = (unsigned char*)(chunk->data()); + unsigned char *base = static_cast(chunk->data()); return (&base[offset]); } return 0; @@ -115,15 +115,15 @@ size = ALIGN(size); - if (size > (int)(header->freeBytes-sizeof(MemoryBlock))) { + if (size > int(header->freeBytes - sizeof(MemoryBlock))) { throw std::bad_alloc(); } // splay the 'length' tree to obtain the best match - TreeNode *node = TO_NODE_POINTER(splay(&header->lengthNode, (unsigned int)size)); + TreeNode *node = TO_NODE_POINTER(splay(&header->lengthNode, static_cast(size))); bool splayed = true; - if (node && (node->key < (unsigned int)size)) { + if (node && (node->key < static_cast(size))) { splayed = false; node = TO_NODE_POINTER(node->rightNode); if (node) { @@ -140,10 +140,10 @@ // 'length' node is the first attribute of the MemoryBlock, therefore every // 'length' node is also a MemoryBlock. - MemoryBlock *block = (MemoryBlock*)node; + MemoryBlock *block = reinterpret_cast(node); int totalSize = size + sizeof(MemoryBlock); - int remainingSize = (int)node->key - totalSize; - unsigned char *ptr = (unsigned char*)&block[1]; + int remainingSize = int(node->key) - totalSize; + unsigned char *ptr = reinterpret_cast(&block[1]); // Remove current block from the trees deleteLengthNode(&header->lengthNode, node, splayed); @@ -151,18 +151,20 @@ // If the block is larger than the requested size, split the block and // insert the second block into the trees - MemoryBlock *secondBlock = (MemoryBlock*)&ptr[size]; - if ((remainingSize >= (int)(ALIGN_SIZE)) && ((unsigned char*)secondBlock < ((unsigned char*)(chunk->data())+chunk->size()-sizeof(MemoryBlock)))) { + MemoryBlock *secondBlock = reinterpret_cast(&ptr[size]); + if (remainingSize >= ALIGN_SIZE + && reinterpret_cast(secondBlock) + < address(chunk->size() - sizeof(MemoryBlock))) { - block->lengthNode.key = (unsigned int)size; - secondBlock->lengthNode.key = (unsigned int)remainingSize; + block->lengthNode.key = static_cast(size); + secondBlock->lengthNode.key = static_cast(remainingSize); secondBlock->pointerNode.key = TO_NODE_OFFSET(secondBlock); // Insert the second block into the trees insertLengthNode(&header->lengthNode, &secondBlock->lengthNode); insertNode(&header->pointerNode, &secondBlock->pointerNode); } else { - totalSize = (int)node->key; + totalSize = int(node->key); } // Adjust the allocation size @@ -178,7 +180,7 @@ block->prev = 0; block->allocatorIdentifier = MAIN_ALLOCATOR_IDENTIFIER; - return TO_OFFSET(ptr); + return TO_OFFSET(ptr); } /** @@ -191,9 +193,9 @@ { int size = 0; if (offset > 0) { - char *srcPtr = TO_PTR(offset); - MemoryBlock *block = (MemoryBlock*)(srcPtr - sizeof(MemoryBlock)); - size = block->lengthNode.key; + char *srcPtr = TO_PTR(offset); + MemoryBlock *block = reinterpret_cast(srcPtr - sizeof(MemoryBlock)); + size = block->lengthNode.key; } return size; } @@ -211,7 +213,7 @@ } MemoryBlock *block = TO_BLOCK_POINTER(offset - sizeof(MemoryBlock)); - MemoryBlock *nextBlock = (MemoryBlock*)((unsigned char*)&block[1] + block->lengthNode.key); + MemoryBlock *nextBlock = reinterpret_cast(reinterpret_cast(&block[1]) + block->lengthNode.key); // Adjust the free bytes header->freeBytes += block->lengthNode.key; @@ -219,12 +221,13 @@ TreeNode *node = 0; unsigned int predecessor = 0; - if ((char*)nextBlock > (char*)chunk->data() && (char*)nextBlock < ((char*)chunk->data()+chunk->size())) { + if (reinterpret_cast(nextBlock) > reinterpret_cast(chunk->data()) + && reinterpret_cast(nextBlock) < address(chunk->size())) { node = TO_NODE_POINTER(splay(&header->pointerNode, nextBlock->pointerNode.key)); } if (node) { - // Find previous block + // Find previous block if (node->key < nextBlock->pointerNode.key) { predecessor = TO_NODE_OFFSET(node); } else if ((predecessor = node->leftNode) > 0) { @@ -248,7 +251,8 @@ // See if the block can be merged with the predecessor if (predecessor) { MemoryBlock *b = TO_BLOCK_POINTER(TO_NODE_POINTER(predecessor)->key); - MemoryBlock *t = (MemoryBlock*)((unsigned char*)&b[1] + b->lengthNode.key); + MemoryBlock *t = reinterpret_cast( + reinterpret_cast(&b[1]) + b->lengthNode.key); // Merge with the predecessor if (t->pointerNode.key == block->pointerNode.key) { @@ -256,13 +260,12 @@ deleteLengthNode(&header->lengthNode, &b->lengthNode, false); // Adjust the size - b->lengthNode.key += (block->lengthNode.key + sizeof(MemoryBlock)); - header->freeBytes += (int)sizeof(MemoryBlock); - header->allocatedBytes -= (int)sizeof(MemoryBlock); + b->lengthNode.key += block->lengthNode.key + sizeof(MemoryBlock); + header->freeBytes += sizeof(MemoryBlock); + header->allocatedBytes -= sizeof(MemoryBlock); // Re-insert the node in 'length' tree insertLengthNode(&header->lengthNode, &b->lengthNode); - block = 0; // We don't have to insert the node } } @@ -419,7 +422,7 @@ */ void HbSplayTreeAllocator::deleteLengthNode(unsigned int *root, TreeNode *node, bool splayed) { - MemoryBlock *block = (MemoryBlock*)node; + MemoryBlock *block = reinterpret_cast(node); // If the node is not the first node in the linked list, // simply de-link node from the linked list. @@ -446,7 +449,7 @@ t->lengthNode.leftNode = TO_NODE_POINTER(x)->leftNode; t->lengthNode.rightNode = TO_NODE_POINTER(x)->rightNode; t->prev = 0; - *root = (unsigned int)block->next; + *root = static_cast(block->next); } } else { deleteNode(root, node, false); @@ -465,13 +468,13 @@ // Length TreeNode is the first entry in the MemoryBlock. Therefore, // we can safely typecast TreeNode to a MemoryBlock. MemoryBlock *t = TO_BLOCK_POINTER(splay(root, node->key)); - MemoryBlock *p = (MemoryBlock*)node; + MemoryBlock *p = reinterpret_cast(node); if (!t || (t->lengthNode.key != node->key)) { // Insert into the tree p->prev = 0; p->next = 0; - insertNode(root, node, (TreeNode*)t); + insertNode(root, node, reinterpret_cast(t)); } else { // Link to the existing tree node p->next = t->next; @@ -492,18 +495,19 @@ int HbSplayTreeAllocator::size() { // splay the 'pointer' tree to obtain last pointer - TreeNode *node = TO_NODE_POINTER(splay(&header->pointerNode, (unsigned int)((char*)chunk->data()+chunk->size()))); + unsigned int last_offset = static_cast(chunk->size()); + TreeNode *node = TO_NODE_POINTER(splay(&header->pointerNode, last_offset)); if (node) { TreeNode *right = TO_NODE_POINTER(node->rightNode); if (right) { node = right; } - MemoryBlock *block = reinterpret_cast(reinterpret_cast(node) - sizeof(TreeNode)); - int lastUsedOffset = TO_OFFSET(block)+sizeof(MemoryBlock)-1; // this is not aligned to 4!!! but actual last byte allocated - return lastUsedOffset; + MemoryBlock *block = reinterpret_cast(reinterpret_cast(node) + - sizeof(TreeNode)); + return TO_OFFSET(block) + sizeof(MemoryBlock) - 1; // not aligned, but actual last byte allocated.; } - return -1; // couldn't found last used offset + return -1; } int HbSplayTreeAllocator::freeBytes() @@ -520,9 +524,9 @@ void HbSplayTreeAllocator::writeReport(QTextStream &reportWriter) { reportWriter << "***** (Main)HbSplayTreeAllocator report *****\n\n"; - reportWriter << "Allocated memory (including memory allocated by multisegment allocator): " << header->allocatedBytes << " bytes\n"; + reportWriter << "Allocated memory (including memory allocated by multisegment allocator): " + << header->allocatedBytes << " bytes\n"; reportWriter << "Free memory: " << header->freeBytes << " bytes\n"; reportWriter << "Splaytree allocator is best fit allocator, so there is really no point to calculate fragmentation\n\n"; - } #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbstandarddirs.cpp --- a/src/hbcore/core/hbstandarddirs.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,445 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbstandarddirs_p.h" -#include "hbicontheme_p.h" -#include "hblayeredstyleloader_p.h" -#include "hbthemeutils_p.h" -#include -#include -#include -#include -#include -#include -#include - -// Standard theme root dirs -const char *coreResourcesRootDir = ":"; - -// Private API -// WARNING: This API is at prototype level and shouldn't be used before -// the resource fetching with theming is fully implemented -class HbStandardDirsInstance -{ -public: - HbStandardDirsInstance(); - ~HbStandardDirsInstance(); - - void clearIconDirs(); - - // Explicitly add/remove dir in cached dir contents - void addIconDir( const QString &dir ); - void removeIconDir( const QString &dir ); - - // Return icon filename if it exists in file system, - // otherwise return empty string. - QString findIcon( const QString &fullFileName ); - QStringList rootPaths() const { return rootPathList; } -private: - // Root Directory Path sepecific to the Platform - void constructRootPathList(); - QStringList additionalRootPath(); - int fileSize(QByteArray fileName); -private: - // Cached contents of icon directories - QMap iconDirs; - QStringList rootPathList; - QStringList extList; -}; - -// Static instance -static HbStandardDirsInstance instance; - -class HbResource : public QResource -{ -public: - HbResource( const QString &dir ):QResource( dir ){} - QStringList entryList() { - return children(); - } -}; - -HbStandardDirsInstance::HbStandardDirsInstance() -{ - constructRootPathList(); -#ifdef HB_NVG_CS_ICON - extList << ".nvg"; -#endif - extList << ".svg" << ".qpic" << ".png" << ".mng" << ".gif" << ".xpm" << ".jpg"; -} - -HbStandardDirsInstance::~HbStandardDirsInstance() -{ -} - -void HbStandardDirsInstance::clearIconDirs() -{ - iconDirs.clear(); -} - -void HbStandardDirsInstance::addIconDir( const QString &dir ) -{ - QStringList list; - if (dir.startsWith(QLatin1Char( ':' ))) { - // try to find all files assuming its a resource directory - HbResource resource(dir); - if (resource.isValid()) { - list = resource.entryList(); - } - } - else { - - QDir directory(dir); - // File list is sorted by filename so binary search used in findIcon function works. - // The sorting of QDirSortItems is slow, so we sort the resulting strings instead: - // QStringList list = directory.entryList(QDir::Files, QDir::Name | QDir::IgnoreCase); - list = directory.entryList(QDir::Files, QDir::Unsorted); - } - list.sort(); - - iconDirs.insert( dir, list ); -} - -void HbStandardDirsInstance::removeIconDir( const QString &dir ) -{ - iconDirs.remove(dir); -} - -QString HbStandardDirsInstance::findIcon( const QString &fullFileName ) -{ - // Enable this for profiling memory consumption. - // It counts how many characters are stored in the directory contents cache. -#if 0 - int charSize = 0; - - for (QMap::const_iterator z = iconDirs.constBegin(); z != iconDirs.constEnd(); ++z) { - QStringList list = z.value(); - charSize += iconDirs.key(list).length(); - - for (int zz=0; zz index2 ? index1 : index2; - if (index > 0) { - QString dir = fullFileNameLocal.left(index); - - // Try to fetch the dir from the cached dir contents - QMap::const_iterator i = iconDirs.find(dir); - // Dir not found, add it - if (i == iconDirs.constEnd()) { - QDir LocalDir(dir) ; - if(LocalDir.exists()) { - addIconDir(dir); - i = iconDirs.find(dir); - } - } - if(i != iconDirs.constEnd()) { - QStringList list = i.value(); - // Search for the file from the cached dir contents - if (!list.isEmpty()) { - QString file = fullFileNameLocal.right(fullFileNameLocal.length() - index - 1); - // Remove extension - int extensionIndex = file.lastIndexOf('.'); - int extensionLength = 0; - bool searchAllIconExtensions = true; - if (extensionIndex > 0) { - searchAllIconExtensions = false; - } - // If no extension was given or given extension is one of the supported ones, search - // for icons with all the supported icon file extensions - if (searchAllIconExtensions) { - foreach (const QString &extension, extList) { - if (qBinaryFind(list, file + extension) != list.constEnd()) { - // Icon found, return its full path with the correct extension - if (extensionLength) { - return fullFileName.left(fullFileName.length() - extensionLength) + extension; - } - else { - return fullFileName + extension; - } - } - } - } else { - // Some other extension was given (e.g. ".theme"), search only for that file. - if (qBinaryFind(list, file) != list.constEnd()) { - return fullFileName; - } - } - } - } - } - return QString(); -} - -void HbStandardDirsInstance::constructRootPathList() -{ -#if defined(Q_OS_SYMBIAN) - rootPathList << QLatin1String("z:/resource/hb") - << QLatin1String("c:/resource/hb") - << QLatin1String("e:/resource/hb") - << QLatin1String("f:/resource/hb"); -#else - const QString &mainThemesDir = HbStandardDirs::themesDir(); - if (!mainThemesDir.isEmpty()) { - rootPathList << mainThemesDir; - } -#endif -#if defined(Q_OS_MAC) - rootPathList << QDir::homePath() + QLatin1String("/Library/UI Extensions for Mobile"); -#endif - - // Add core resource dir as well - rootPathList << coreResourcesRootDir; -} - -int HbStandardDirsInstance::fileSize( QByteArray fileName ) -{ - struct stat fileStat; - const char *fname = fileName.data(); - int err = stat( fname, &fileStat ); - if (0 != err) return 0; - return fileStat.st_size; -} - -QStringList HbStandardDirsInstance::additionalRootPath() -{ - QFile rootPathFile(rootPathsFile); - static QStringList rootpaths; - - QByteArray filePath = rootPathsFile.toLatin1().constData(); - int size = fileSize(filePath); - - if(size > 0) { - if (rootPathFile.open(QIODevice::ReadOnly | QIODevice::Text)) { - QTextStream in(&rootPathFile); - rootpaths.clear(); - while (!in.atEnd()) { - QString line = in.readLine(); - QDir rootdir(line); - if (rootdir.exists()) { - rootpaths.append(line); - } - } - } - } - return rootpaths; -} - -/* - typeOfResource - 1. "icons" - only one supported right now - -// Important: This function should just return a directory if the resource was found. Otherwise -// return empty string! Calling functions will trust it!! - -*/ -QString HbStandardDirs::findResource(const QString &name, Hb::ResourceType resType) -{ - if (resType == Hb::IconResource || - resType == Hb::ThemeResource || - resType == Hb::EffectResource) - { - QString absolutePath; - - QStringList rootDirs; - - if (QDir::isRelativePath(name)) { -#ifdef HB_TOOL_INTERFACE - // Additional root directory support Currently used by tools only. - // This may not be needed if themes tool start using HB_THEMES_DIR to set their - // root dir - rootDirs << instance.additionalRootPath(); -#endif - rootDirs << instance.rootPaths(); - } else { - // Given filename has an absolute path, use that. - absolutePath = name; - } - if (resType == Hb::IconResource ) { - // Relative path was given, search in the standard icon folders - if (absolutePath.isEmpty()) { - foreach ( const QString &prefix, rootDirs) { - absolutePath = prefix + '/' + name; - // Check file existence from instance, it caches directory contents - // to speed up the lookup - QString ret = instance.findIcon(absolutePath); - if (!ret.isEmpty()) { - return ret; - } - } - } else { - // Absolute path was given, only search in that folder - return instance.findIcon(absolutePath); - } - } - else if (resType == Hb::ThemeResource) { - QFile file; - bool fileExists = false; - foreach ( const QString &prefix, rootDirs ) { - if (absolutePath.isEmpty()) { - absolutePath = prefix + '/' + name; - } - // Check for the availability of the file, as QFile::Exists takes more - // time this method is used - file.setFileName(absolutePath); - fileExists = file.open(QIODevice::ReadOnly); - file.close(); - return absolutePath; - } - } - else if (resType == Hb::EffectResource) { - QFile file; - bool fileExists = false; - foreach ( const QString &prefix, rootDirs ) { - if (absolutePath.isEmpty()) { - absolutePath = prefix + '/' + name; - } - // Check for the availability of the file, as QFile::Exists takes more - // time this method is used - file.setFileName(absolutePath); - fileExists = file.open(QIODevice::ReadOnly); - file.close(); - if( fileExists ) { - return absolutePath; - } - } - } - } - return QString(); -} - -/* @param pathList. List of paths, relative or absolute. Modified to absolute paths. - * @param typeOfResource Type of Resource, can be Hb::StyleSheetResource or Hb::EffectResource. - * - */ -void HbStandardDirs::findResourceList(QMap &pathList, - Hb::ResourceType resType, bool assumeAbsolutesExists) -{ - QString absolutePath; - QString path; - if (resType == Hb::StyleSheetResource || resType == Hb::EffectResource) { - QStringList rootDirs; - QMutableMapIterator i(pathList); - rootDirs -#ifdef HB_TOOL_INTERFACE - // Additional root directory support Currently used by tools only. - // This may not be needed if themes tool start using HB_THEMES_DIR to set their - // root dir - << instance.additionalRootPath() -#endif - << instance.rootPaths(); - QFile file; - bool fileExists = false; - while (i.hasNext()) { - i.next(); - if (QDir::isAbsolutePath(i.value())) { - fileExists = (assumeAbsolutesExists) ? true : QFile::exists(i.value()); - } else { - fileExists = false; - foreach ( const QString &prefix, rootDirs ) { - absolutePath = prefix + '/' + i.value(); - // Check for the availability of the file, as QFile::Exists takes more - // time this method is used - file.setFileName(absolutePath); - fileExists = file.open(QIODevice::ReadOnly); - file.close(); - if (fileExists) { - i.setValue(absolutePath); - break; - } - } - } - if (!fileExists) { - i.remove(); - } - } - } -} - -QStringList HbStandardDirs::findExistingFolderList(const QStringList &relativeFolderPaths, - const QString ¤tThemeName, - Hb::ResourceType resType) -{ - QString absolutePath; - QStringList existingPaths; - - QStringList rootDirs; - rootDirs -#ifdef HB_TOOL_INTERFACE - // Additional root directory support Currently used by tools only. - // This may not be needed if themes tool start using HB_THEMES_DIR to set their - // root dir - << instance.additionalRootPath() -#endif - << instance.rootPaths(); - - foreach (const QString &path, relativeFolderPaths) { - if (QDir::isAbsolutePath(path)) { - if(QFile::exists(path)) { - existingPaths.append(path); - } - } else { - foreach( const QString &prefix, rootDirs) { - absolutePath = prefix + '/' + path; - // Check for the availability of the file - if( QFile::exists(absolutePath) ) { - existingPaths.append(absolutePath); - // Assuming each path will be there only in one root directory - // (not supporting a single theme scattered in multiple root dirs) - break; - } - } - } - } - // Appending base theme folder - const HbThemeInfo &themeInfo = HbThemeUtils::baseTheme(); - if (themeInfo.name != currentThemeName && resType == Hb::EffectResource) { - existingPaths.append(themeInfo.rootDir + '/' + HbThemeUtils::platformHierarchy + '/' + HbThemeUtils::effectsResourceFolder + '/' + themeInfo.name + '/'); - } - - return existingPaths; -} - -const QString &HbStandardDirs::themesDir() -{ -#ifdef Q_OS_SYMBIAN - static QString mainThemesDir("Z:\\resource\\hb\\"); -#else - static QString mainThemesDir = QDir::fromNativeSeparators(qgetenv("HB_THEMES_DIR")); -#endif - return mainThemesDir; -} - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbstandarddirs_p.h --- a/src/hbcore/core/hbstandarddirs_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,66 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBSTANDARDDIRS_P_H -#define HBSTANDARDDIRS_P_H - -#include -#include -#include - -// The theme root path is platform-dependent -#if defined(Q_OS_WIN) -const QString rootPathsFile = "c:/theme/themerootsdir.txt"; -#elif defined(Q_OS_SYMBIAN) -const QString rootPathsFile = "c:/data/theme/themerootsdir.txt"; -#elif defined(Q_OS_MAC) -const QString rootPathsFile = QDir::homePath() + QString( "Library/UI Extensions for Mobile/themes/themerootsdir.txt" ); -#elif defined(Q_OS_UNIX) -const QString rootPathsFile = "/usr/local/hb/theme/themerootsdir.txt"; -#endif - -// Standard theme root dirs -extern const char *coreResourcesRootDir; -// WARNING: This API is at prototype level and shouldn't be used before -// the resource fetching with theming is fully implemented -class HbStandardDirs -{ -public: - static QString findResource( - const QString &name, - Hb::ResourceType resType ); - - static void findResourceList( - QMap &pathList, - Hb::ResourceType resType, bool assumeAbsolutesExists = false); - - static QStringList findExistingFolderList( - const QStringList &relativeFolderPaths, - const QString ¤tThemeName, Hb::ResourceType resType); - - static const QString &themesDir(); -}; - -#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbstring_p.cpp --- a/src/hbcore/core/hbstring_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbstring_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,8 +35,14 @@ #include "hbcssconverterutils_p.h" #endif -static const int shared_null_offset = -2; -static HbStringData *shared_null = 0; +static int createNullOffset(HbMemoryManager::MemoryType type) +{ + GET_MEMORY_MANAGER(type); + int nullOffset(manager->alloc(sizeof(HbStringData))); + HbStringData* data = HbMemoryUtils::getAddress(type, nullOffset); + new(data) HbStringData(); + return nullOffset; +} HbStringData::HbStringData() : mStartOffset(-1), @@ -56,15 +62,6 @@ #endif } -HbStringData *getStringData(HbMemoryManager::MemoryType type, int offset, bool shared = false) -{ - if (offset == shared_null_offset) { - return shared_null; - } else { - return getAddress(type, offset, shared); - } -} - /* Constructs a new HbString with \a MemoryType (SharedMemory/HeapMemory). */ @@ -72,26 +69,26 @@ : mMemoryType(type), mShared(false), mDataOffset(-1) { if (type == HbMemoryManager::HeapMemory) { - // Set offset to point to default NULL instance of HbStringData to - // avoid unnecessary heap allocation when constructing HbString instances. - mDataOffset = shared_null_offset; - if (!shared_null) { - shared_null = new HbStringData; - } - shared_null->mRef.ref(); - return; - } + static int heapNullOffset(createNullOffset(HbMemoryManager::HeapMemory)); + mDataOffset = heapNullOffset; + HbStringData* data = HbMemoryUtils::getAddress(type, mDataOffset); + data->mRef.ref(); + } else if (type == HbMemoryManager::SharedMemory) { + static int sharedNullOffset(createNullOffset(HbMemoryManager::SharedMemory)); + mDataOffset = sharedNullOffset; + HbStringData* data = HbMemoryUtils::getAddress(type, mDataOffset); + data->mRef.ref(); +#ifdef HB_BIN_CSS + HbCssConverterUtils::registerOffsetHolder(&mDataOffset); +#endif + } else { + GET_MEMORY_MANAGER(type) + RETURN_IF_READONLY(manager) - GET_MEMORY_MANAGER(type) - RETURN_IF_READONLY(manager) - - mDataOffset = manager->alloc(sizeof(HbStringData)); - HbStringData* data = HbMemoryUtils::getAddress(mMemoryType, mDataOffset); - new(data) HbStringData(); - -#ifdef HB_BIN_CSS - HbCssConverterUtils::registerOffsetHolder(&mDataOffset); -#endif + mDataOffset = manager->alloc(sizeof(HbStringData)); + HbStringData* data = HbMemoryUtils::getAddress(mMemoryType, mDataOffset); + new(data) HbStringData(); + } } /* @@ -104,17 +101,9 @@ RETURN_IF_READONLY(manager) HbSmartOffset dataOffset(manager->alloc(sizeof(HbStringData)), type); - int length = str.length(); - HbStringData* data = getStringData(mMemoryType, dataOffset.get()); + HbStringData *data = getStringData(mMemoryType, dataOffset.get()); new(data) HbStringData(); - if (length) { - data->mStartOffset = manager->alloc(length*sizeof(QChar)); - ::memcpy((char*) manager->base() + data->mStartOffset, str.constData(), length*sizeof(QChar)); - } else { - data->mStartOffset = -1; - } - data->mLength = length; - data->mCapacity = length; + copyString(str.constData(), str.length(), dataOffset.get()); mDataOffset = dataOffset.release(); #ifdef HB_BIN_CSS @@ -130,10 +119,10 @@ mMemoryType = other.mMemoryType; GET_MEMORY_MANAGER(other.mMemoryType) - HbStringData* data = getStringData(mMemoryType, other.mDataOffset); + HbStringData *data = getStringData(mMemoryType, other.mDataOffset); mDataOffset = other.mDataOffset; - if(!manager->isWritable() || other.mShared == true) { + if(!manager->isWritable() || other.mShared) { mShared = true; mMemoryType = HbMemoryManager::HeapMemory; } else { @@ -157,12 +146,12 @@ GET_MEMORY_MANAGER(mMemoryType); // if the memory where the string is not writable it means it's client process, so do nothing - if (!manager->isWritable() || mDataOffset == shared_null_offset) + if (!manager->isWritable()) return; - HbStringData* data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData *data = getStringData(mMemoryType, mDataOffset, mShared); - if (mShared != true && !data->mRef.deref()) { + if (!mShared && !data->mRef.deref()) { clear(); data->~HbStringData(); HbMemoryUtils::freeMemory(mMemoryType, mDataOffset); @@ -257,21 +246,27 @@ return -1; } } - return *uc - *c; } - - /* Private Utility function that copies the const char* to the HbString */ -void HbString::copyString(const QChar *arr, int size) +void HbString::copyString(const QChar *arr, int size, int dataOffset) { GET_MEMORY_MANAGER(mMemoryType) RETURN_IF_READONLY(manager) +#ifdef HB_BIN_CSS + if (mMemoryType == HbMemoryManager::SharedMemory) { + HbString *str = HbCssConverterUtils::sharedStringData(QString(arr, size)); + if (str) { + *this = *str; + return; + } + } +#endif - HbStringData* data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData *data = getStringData(mMemoryType, dataOffset, mShared); // If source string is empty, simply make the destination string's length // as zero and keep the capacity as same for future use. if (size == 0){ @@ -295,6 +290,11 @@ data->mLength = size; data->mCapacity = size; } +#ifdef HB_BIN_CSS + if (mMemoryType == HbMemoryManager::SharedMemory) { + HbCssConverterUtils::addSharedStringData(QString(arr, size), *this); + } +#endif } /* @@ -321,35 +321,34 @@ */ void HbString::detach(int size) { - HbStringData* data = getStringData(mMemoryType, mDataOffset, mShared); - if(data->mRef > 1 || mShared == true) { + if(data->mRef > 1 || mShared) { if(data->mRef > 1) { data->mRef.deref(); } GET_MEMORY_MANAGER(mMemoryType); HbSmartOffset dataOffset(manager->alloc(sizeof(HbStringData)), mMemoryType); - HbStringData* newData = 0; - newData = getStringData(mMemoryType,dataOffset.get()); + HbStringData* newData = + getStringData(mMemoryType, dataOffset.get()); new(newData) HbStringData(); - // Allocate new string buffer if given size is greater than zero - if (size > 0) { - newData->mStartOffset = manager->alloc(size*sizeof(QChar)); - newData->mLength = qMin(data->mLength, size); - // copy old string data contents in the new string data - ::memcpy(HbMemoryUtils::getAddress(mMemoryType, newData->mStartOffset), - getAddress(mMemoryType, data->mStartOffset, mShared), - newData->mLength * sizeof(QChar)); - } + // Allocate new string buffer if given size is greater than zero + if (size > 0) { + newData->mStartOffset = manager->alloc(size*sizeof(QChar)); + newData->mLength = qMin(data->mLength, size); + // copy old string data contents in the new string data + ::memcpy(HbMemoryUtils::getAddress(mMemoryType, newData->mStartOffset), + getAddress(mMemoryType, data->mStartOffset, mShared), + newData->mLength * sizeof(QChar)); + } newData->mCapacity = size; mShared = false; mDataOffset = dataOffset.release(); } else if (size > data->mCapacity) { // no need to detach, but make sure there is capacity for the new size GET_MEMORY_MANAGER(mMemoryType); - data->mStartOffset = manager->realloc(data->mStartOffset, size*sizeof(QChar)); + data->mStartOffset = manager->realloc(data->mStartOffset, size * sizeof(QChar)); data->mCapacity = size; } } @@ -364,7 +363,7 @@ if(ptr) return QString(ptr, data->mLength); else { - // TODO: this should return QString() but currently it causes wierd behaviour. + // TODO: this should return QString() but currently it causes weird behaviour. // Seems some clients assume it returns "". return QString(""); } @@ -382,10 +381,10 @@ if(!manager->isWritable()) Q_ASSERT(HbMemoryManager::HeapMemory == mMemoryType); - HbStringData* otherData = 0; - otherData = getStringData(other.mMemoryType, other.mDataOffset, other.mShared); - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* otherData = + getStringData(other.mMemoryType, other.mDataOffset, other.mShared); + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); if(other.mMemoryType != mMemoryType || other.mShared == true) { if(mShared != true && data->mRef == 1) { @@ -433,7 +432,7 @@ // If both strings are not equal, then assigns QLatin1String to HbString if (!result) { detach(len); - copyString(tempStr.constData(), len); + copyString(tempStr.constData(), len, mDataOffset); } return *this; @@ -452,7 +451,7 @@ // If both strings are not equal, then assigns QString to HbString if(!compareString(ptr, len)) { detach(len); - copyString(ptr, len); + copyString(ptr, len, mDataOffset); } } return *this; @@ -469,7 +468,7 @@ } HbStringData* data = getStringData(mMemoryType, mDataOffset, mShared); - HbStringData* otherData = getStringData(other.mMemoryType, other.mDataOffset, other.mShared);; + HbStringData* otherData = getStringData(other.mMemoryType, other.mDataOffset, other.mShared); if (data->mLength != otherData->mLength) { return false; @@ -515,6 +514,15 @@ } /* + Overloaded "==" operator that takes QStringRef as + argument and returns boolean value. +*/ +bool HbString::operator==(const QStringRef &strRef) const +{ + return compareString(strRef.constData(), strRef.length()); +} + +/* Overloaded "!=" operator that takes HbString as argument and returns boolean value */ @@ -546,22 +554,20 @@ */ void HbString::clear() { - // No need to clear null string - if (mDataOffset == shared_null_offset) { - return; - } - - detach(0); // This will update the new mDataOffset. HbStringData* data = getStringData(mMemoryType, mDataOffset, mShared); + if (data->mStartOffset != -1) { + detach(0); // This will update the new mDataOffset. + data = getStringData(mMemoryType, mDataOffset, mShared); - if (data->mStartOffset != -1) { - GET_MEMORY_MANAGER(mMemoryType) - RETURN_IF_READONLY(manager); + if (data->mStartOffset != -1) { + GET_MEMORY_MANAGER(mMemoryType) + RETURN_IF_READONLY(manager); - manager->free(data->mStartOffset); - data->mStartOffset = -1; - data->mLength = 0; - data->mCapacity = 0; + manager->free(data->mStartOffset); + data->mStartOffset = -1; + data->mLength = 0; + data->mCapacity = 0; + } } } @@ -573,12 +579,12 @@ GET_MEMORY_MANAGER(mMemoryType) RETURN_IF_READONLY(manager); - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); detach(data->mLength); - HbStringData* newData = 0; - newData = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* newData = + getStringData(mMemoryType, mDataOffset, mShared); if (n > 0) { if(newData->mStartOffset != -1 && newData->mLength > n){ @@ -598,14 +604,13 @@ GET_MEMORY_MANAGER(mMemoryType) RETURN_OBJECT_IF_READONLY(manager, *this) - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); detach(data->mLength); HbStringData* newData = getStringData(mMemoryType, mDataOffset, mShared); - QChar *ptr = 0; - ptr = getAddress(mMemoryType, newData->mStartOffset, mShared); + QChar *ptr = getAddress(mMemoryType, newData->mStartOffset, mShared); int i = position; if(ptr){ if(n > (newData->mLength - position)){ @@ -627,9 +632,9 @@ */ bool HbString::isEmpty() const { - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); - return (data->mLength == 0)? true:false; + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); + return (data->mLength == 0); } /* @@ -639,8 +644,8 @@ */ bool HbString::startsWith ( const QLatin1Char &s, Qt::CaseSensitivity cs ) const { - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); if (data->mStartOffset == -1) { return false; @@ -665,23 +670,23 @@ GET_MEMORY_MANAGER(mMemoryType) RETURN_OBJECT_IF_READONLY(manager, *this) - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); int size = data->mLength + str.length(); detach(size); - HbStringData* newData = 0; - newData = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* newData = + getStringData(mMemoryType, mDataOffset, mShared); if(size > newData->mCapacity ) { - newData->mStartOffset = manager->realloc(newData->mStartOffset, size*sizeof(QChar)); + newData->mStartOffset = manager->realloc(newData->mStartOffset, size * sizeof(QChar)); newData->mCapacity = size; } if(newData->mStartOffset != -1) { char *dest = getAddress(mMemoryType, newData->mStartOffset, mShared); - memmove(dest + str.length() * sizeof(QChar), dest, newData->mLength*sizeof(QChar)); + memmove(dest + str.length() * sizeof(QChar), dest, newData->mLength * sizeof(QChar)); memcpy(dest, str.constData(), str.length() * sizeof(QChar)); newData->mLength = size; } @@ -696,24 +701,24 @@ GET_MEMORY_MANAGER(mMemoryType) RETURN_OBJECT_IF_READONLY(manager, *this) - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); int size = data->mLength + str.length(); detach(size); - HbStringData* newData = 0; - newData = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* newData = + getStringData(mMemoryType, mDataOffset, mShared); if(size > newData->mCapacity ) { - newData->mStartOffset = manager->realloc(newData->mStartOffset, size*sizeof(QChar)); + newData->mStartOffset = manager->realloc(newData->mStartOffset, size * sizeof(QChar)); newData->mCapacity = size; } if(newData->mStartOffset != -1) { char *dest = getAddress(mMemoryType, newData->mStartOffset, mShared); - memcpy(dest + newData->mLength*sizeof(QChar), str.constData(), str.length()*sizeof(QChar)); + memcpy(dest + newData->mLength * sizeof(QChar), str.constData(), str.length() * sizeof(QChar)); newData->mLength = size; } return *this; @@ -726,8 +731,8 @@ HbString HbString::toLower() const { GET_MEMORY_MANAGER(mMemoryType) - HbStringData* data = 0; - data = getStringData(mMemoryType, mDataOffset, mShared); + HbStringData* data = + getStringData(mMemoryType, mDataOffset, mShared); // If the string is empty, a copy of it can be returned directly. if (!data->mLength) { @@ -747,8 +752,7 @@ // Detach allocates data with new capacity copy.detach(data->mLength); HbStringData *newData = getStringData(copy.mMemoryType, copy.mDataOffset, copy.mShared); - - QChar *dest = getAddress(copyMemoryType, newData->mStartOffset, copy.mShared); + QChar *dest = getAddress(copyMemoryType, newData->mStartOffset, copy.mShared); int count = data->mLength; for (int i = 0; imLength, other); } +#ifdef CSS_PARSER_TRACES +/* +* Debugging support +*/ +void HbString::print() const +{ + if (mDataOffset != -1) { + GET_MEMORY_MANAGER(mMemoryType) + HbStringData * mData = HbMemoryUtils::getAddress( mMemoryType, mDataOffset); + qDebug() << QString::fromRawData( (QChar*)((char*)manager->base() + + mData->mStartOffset), mData->mLength ); + } +} +#endif // CSS_PARSER_TRACES + /* Reads a HbString from the QDataStream */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbstring_p.h --- a/src/hbcore/core/hbstring_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbstring_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,7 +44,7 @@ friend class TestHbString; public: - HbString( HbMemoryManager::MemoryType type = HbMemoryManager::InvalidMemory ); + explicit HbString( HbMemoryManager::MemoryType type = HbMemoryManager::InvalidMemory ); HbString( const QString &str, HbMemoryManager::MemoryType type ); HbString( const HbString &Other ); ~HbString(); @@ -61,6 +61,7 @@ bool operator==( const HbString &str ) const; bool operator==( const QLatin1String &str ) const; bool operator==( const QString &str ) const; + bool operator==( const QStringRef &strRef ) const; bool operator!=( const HbString &str ) const; bool operator!=( const QLatin1String &str ) const; bool operator!=( const QString &str ) const; @@ -80,23 +81,11 @@ int compare( const QLatin1String &other ) const; #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const - { - return true; - } - void print() const - { - if (mDataOffset != -1 && mDataOffset != -2) { - GET_MEMORY_MANAGER(mMemoryType) - HbStringData * mData = HbMemoryUtils::getAddress( mMemoryType, mDataOffset); - qDebug() << QString::fromRawData( (QChar*)((char*)manager->base() - + mData->mStartOffset), mData->mLength ); - } - } -#endif //CSS_PARSER_TRACES + void print() const; +#endif private: - void copyString( const QChar *arr, int size ); + void copyString( const QChar *arr, int size, int dataOffset ); bool compareString( const QChar *rhs, int len ) const; void detach( int size ); @@ -104,7 +93,6 @@ HbMemoryManager::MemoryType mMemoryType; bool mShared; - int mDataOffset; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbstringdata_p.h --- a/src/hbcore/core/hbstringdata_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbstringdata_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,14 +30,13 @@ #include "hbmemorymanager_p.h" template +inline T * getAddress(HbMemoryManager::MemoryType type, int offset, bool shared) { - T * data = 0; - if( shared == true ) - data = HbMemoryUtils::getAddress( HbMemoryManager::SharedMemory, offset ); - else - data = HbMemoryUtils::getAddress( type, offset ); - return data; + if(shared) { + type = HbMemoryManager::SharedMemory; + } + return HbMemoryUtils::getAddress(type, offset); } class HB_AUTOTEST_EXPORT HbStringData @@ -52,4 +51,10 @@ QAtomicInt mRef; }; +inline +HbStringData *getStringData(HbMemoryManager::MemoryType type, int offset, bool shared = false) +{ + return getAddress(type, offset, shared); +} + #endif // HBSTRINGDATA_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbstringvector_p.h --- a/src/hbcore/core/hbstringvector_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbstringvector_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,7 +34,7 @@ class HB_CORE_PRIVATE_EXPORT HbStringVector : public HbVector { public: - HbStringVector( HbMemoryManager::MemoryType memoryType ): HbVector( memoryType ) + HbStringVector( HbMemoryManager::MemoryType memoryType ): HbVector(memoryType) { } @@ -46,6 +46,7 @@ if ( QString(*iter).compare(str, cs) == 0 ) { return true; } + iter++; } return false; } @@ -64,8 +65,7 @@ } ++index; } - } - else{ + } else { return true; } return ( index != this->size() ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbthemeindex.cpp --- a/src/hbcore/core/hbthemeindex.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbthemeindex.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ +#include "hbthemeindex_p.h" #include -#include "hbthemeindex_p.h" #ifndef HB_BOOTSTRAPPED #include "hbthemeclient_p.h" #include "hbinstance.h" @@ -44,7 +44,7 @@ { #ifndef HB_BOOTSTRAPPED #ifdef THEME_INDEX_TRACES - qDebug() << "HbThemeIndexResource::getResourceData(: get item for" << resourceName.toUtf8(); + qDebug() << "HbThemeIndexResource::getResourceData(), resourceName: " << resourceName; #endif // Theme index tables are always valid in shared memory @@ -64,16 +64,20 @@ // First check base theme, which should be always valid HbThemeIndexInfo info = HbThemeUtils::getThemeIndexInfo(BaseTheme); - if (info.themeIndexOffset == 0) { // This shouldn't happen, as there must be valid base theme + if (!info.address) { // This shouldn't happen, as there must be valid base theme +#ifdef THEME_INDEX_TRACES + qDebug("HbThemeUtils::getThemeIndexInfo(BaseTheme) returned null address"); +#endif return; // Data will be 0 } - const char *baseAddress = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - info.themeIndexOffset); - HbThemeIndex baseIndex(baseAddress); + HbThemeIndex baseIndex(info.address); const HbThemeIndexItemData *baseItemData = baseIndex.getItemData(resourceName); if (!baseItemData) { // If the item is not found from base theme, it can't be found elsewhere +#ifdef THEME_INDEX_TRACES + qDebug("HbThemeIndex::getItemData(%s) returned null data", qPrintable(resourceName)); +#endif return; // Data will be 0 } @@ -86,10 +90,8 @@ // Base wasn't locked, next check operator theme in C-drive info = HbThemeUtils::getThemeIndexInfo(OperatorC); - if (info.themeIndexOffset > 0) { - const char *operatorCAddress = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - info.themeIndexOffset); - HbThemeIndex operatorCIndex(operatorCAddress); + if (info.address) { + HbThemeIndex operatorCIndex(info.address); const HbThemeIndexItemData *operatorCItemData = operatorCIndex.getItemData(resourceName); if (operatorCItemData) { // Found, use it @@ -103,10 +105,8 @@ // Not found from operator theme in C-drive, next check operator theme in ROM info = HbThemeUtils::getThemeIndexInfo(OperatorROM); - if (info.themeIndexOffset > 0) { - const char *operatorZAddress = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - info.themeIndexOffset); - HbThemeIndex operatorZIndex(operatorZAddress); + if (info.address) { + HbThemeIndex operatorZIndex(info.address); const HbThemeIndexItemData *operatorZItemData = operatorZIndex.getItemData(resourceName); if (operatorZItemData) { // Found, use it @@ -120,11 +120,10 @@ // Not found from operator themes, try active theme info = HbThemeUtils::getThemeIndexInfo(ActiveTheme); - if (info.themeIndexOffset > 0) { - const char *activeThemeAddress = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - info.themeIndexOffset); - HbThemeIndex activeThemeIndex(activeThemeAddress); - const HbThemeIndexItemData *activeThemeItemData = activeThemeIndex.getItemData(resourceName); + if (info.address) { + HbThemeIndex activeThemeIndex(info.address); + const HbThemeIndexItemData *activeThemeItemData = + activeThemeIndex.getItemData(resourceName); if (activeThemeItemData) { // Found, use it type = ActiveTheme; @@ -151,6 +150,12 @@ bool HbThemeIndexResource::isValid() { + if (data && data->itemType == HbThemeIndexItemData::ColorItem) { + Q_ASSERT_X(!(data->flags & HbThemeIndexItemData::Reference), + "HbThemeIndexResource::isValid()", + "Reference to another color variable not supported"); + } + if (data) { return true; } @@ -244,12 +249,12 @@ } case HbThemeIndexItemData::AxmlItem: { - fullName = fullName + "/animations/" + themeName + "/" + resourceName; + fullName = fullName + "/animations/" + themeName + '/' + resourceName; break; } case HbThemeIndexItemData::FxmlItem: { - fullName = fullName + "/effects/" + themeName + "/" + resourceName; + fullName = fullName + "/effects/" + themeName + '/' + resourceName; break; } default: @@ -271,59 +276,80 @@ switch (data->mirroredItemType) { case HbThemeIndexItemData::SvgItem: { - fullName = fullName + "/icons/" + themeName + "/scalable/mirrored/" + resourceName + ".svg"; + fullName = fullName + "/icons/" + themeName + "/scalable/mirrored/" + + resourceName + ".svg"; break; } case HbThemeIndexItemData::PngItem: { - fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + resourceName + ".png"; + fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + + resourceName + ".png"; break; } case HbThemeIndexItemData::MngItem: { - fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + resourceName + ".mng"; + fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + + resourceName + ".mng"; break; } case HbThemeIndexItemData::GifItem: { - fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + resourceName + ".gif"; + fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + + resourceName + ".gif"; break; } case HbThemeIndexItemData::XpmItem: { - fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + resourceName + ".xpm"; + fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + + resourceName + ".xpm"; break; } case HbThemeIndexItemData::JpgItem: { - fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + resourceName + ".jpg"; + fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + + resourceName + ".jpg"; break; } case HbThemeIndexItemData::NvgItem: { - fullName = fullName + "/icons/" + themeName + "/scalable/mirrored/" + resourceName + ".nvg"; + fullName = fullName + "/icons/" + themeName + "/scalable/mirrored/" + + resourceName + ".nvg"; break; } case HbThemeIndexItemData::SvgzItem: { - fullName = fullName + "/icons/" + themeName + "/scalable/mirrored/" + resourceName + ".svgz"; + fullName = fullName + "/icons/" + themeName + "/scalable/mirrored/" + + resourceName + ".svgz"; break; } case HbThemeIndexItemData::QpicItem: { - fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + resourceName + ".qpic"; + fullName = fullName + "/icons/" + themeName + "/pixmap/mirrored/" + + resourceName + ".qpic"; break; } default: { return fullFileName(); // There was no mirrored icon, return normal icon - break; } } return fullName; } +QColor HbThemeIndexResource::colorValue() +{ + if (!data || data->itemType != HbThemeIndexItemData::ColorItem) { + qWarning("HbThemeIndexResource::colorValue(): cannot fetch color for 0x%x::%i", + qptrdiff(data), data ? data->itemType : (uint) -1); + return QColor(); + } +#ifdef THEME_INDEX_TRACES + qDebug("HbThemeIndexResource::colorValue(): constructing QColor(%x)", data->colorValue); +#endif // THEME_INDEX_TRACES + return QColor(data->colorValue); +} + // Class HbThemeIndex has the logic of handling different versions of // the theme index file formats. @@ -344,9 +370,11 @@ { //int version = *(reinterpret_cast(mBaseAddress)); // Assumes version 1 for now - const HbThemeIndexHeaderV1 *header = reinterpret_cast(mBaseAddress); + const HbThemeIndexHeaderV1 *header = + reinterpret_cast(mBaseAddress); mItemCount = header->itemCount; - mThemeItemDataArray = reinterpret_cast(mBaseAddress + sizeof(HbThemeIndexHeaderV1)); + mThemeItemDataArray = reinterpret_cast + (mBaseAddress + sizeof(HbThemeIndexHeaderV1)); initialized = true; } @@ -381,7 +409,7 @@ // binary search while (begin <= end) { - int mid = begin + (end-begin)/2; + int mid = begin + (end - begin) / 2; if (mThemeItemDataArray[mid].itemNameHash == hashValue) { retItem = &mThemeItemDataArray[mid]; @@ -414,38 +442,18 @@ bool indexOK = false; - if (sizeof(HbThemeIndexHeaderV1) - + (mItemCount * sizeof(HbThemeIndexItemData)) == byteSize) { + qint64 indexCalculatedSize = (qint64)(sizeof(HbThemeIndexHeaderV1) + + (mItemCount * sizeof(HbThemeIndexItemData))); + + if (indexCalculatedSize == byteSize) { indexOK = true; } #ifdef THEME_INDEX_TRACES if (!indexOK) { - qDebug() << "ThemeIndex: Index file corrupted!"; + qDebug() << "ThemeIndex: Index file corrupted (index size is wrong)!"; } #endif - /* Todo: fix - // Validate items - for (int i = 0; i < mItemCount; i++) { - const HbThemeIndexItem *item = mThemeItemArray++; - if (!item || - item->itemNameOffset < stringAreaStart || item->itemNameOffset >= byteSize || - item->itemFolderOffset < stringAreaStart || item->itemFolderOffset >= byteSize || - item->extOffset < stringAreaStart || item->extOffset >= byteSize || - (item->mirroredExtOffset != -1 && - (item->mirroredExtOffset < stringAreaStart || item->mirroredExtOffset >= byteSize))) { - - indexOK = false; - break; - } - } -*/ - #ifdef THEME_INDEX_TRACES - if (!indexOK) { - qDebug() << "ThemeIndex: Icons NOK! Stopping validation."; - } - #endif - return indexOK; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbthemeindex_p.h --- a/src/hbcore/core/hbthemeindex_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbthemeindex_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -63,56 +63,60 @@ bool initialized; }; - struct HbThemeIndexItemData - { - enum Flag { - Default = 0x00, - Mirrorable = 0x01, - Locked = 0x02 - }; +{ + enum Flag { + Default = 0x00, + Mirrorable = 0x01, + Locked = 0x02, + Reference = 0x04 + }; - enum Type { - NotDefined = 0, - SvgItem = 1, // .svg - PngItem = 2, // .png - MngItem = 3, // .mng - GifItem = 4, // .gif - XpmItem = 5, // .xpm - JpgItem = 6, // .jpg - NvgItem = 7, // .nvg - SvgzItem = 8, // .svgz - QpicItem = 9, // .qpic - FxmlItem = 10, // .fxml - AxmlItem = 11 // .axml - }; - - HbThemeIndexItemData() : - itemType(NotDefined), - itemNameHash(0), - flags(Default), - mirroredItemType(NotDefined), - defaultWidth(-1), - defaultHeight(-1), - mirroredWidth(-1), - mirroredHeight(-1) {} - - quint32 itemType; // from enum Type - quint32 itemNameHash; - quint32 flags; // from enum Flag - - // These will go to every themable item, but overhead is still small - // because most of the items are icons - quint32 mirroredItemType; // from enum Type - qint32 defaultWidth; - qint32 defaultHeight; - qint32 mirroredWidth; - qint32 mirroredHeight; + enum Type { + NotDefined = 0, + SvgItem = 1, // .svg + PngItem = 2, // .png + MngItem = 3, // .mng + GifItem = 4, // .gif + XpmItem = 5, // .xpm + JpgItem = 6, // .jpg + NvgItem = 7, // .nvg + SvgzItem = 8, // .svgz + QpicItem = 9, // .qpic + FxmlItem = 10, // .fxml + AxmlItem = 11, // .axml + ColorItem = 12 // color variable }; + HbThemeIndexItemData() : + itemType(NotDefined), + itemNameHash(0), + flags(Default), + mirroredItemType(NotDefined), + defaultWidth(-1), + defaultHeight(-1), + mirroredWidth(-1), + mirroredHeight(-1) {} + + quint32 itemType; // from enum Type + quint32 itemNameHash; + quint32 flags; // from enum Flag + + // These will go to every themable item, but overhead is still small + // because most of the items are icons + union + { + quint32 mirroredItemType; // from enum Type + quint32 colorValue; + }; + qint32 defaultWidth; + qint32 defaultHeight; + qint32 mirroredWidth; + qint32 mirroredHeight; +}; // Helper class for getting data out of HbThemeIndexItemData -class HbThemeIndexResource +class HB_AUTOTEST_EXPORT HbThemeIndexResource { public: HbThemeIndexResource(const QString &resourceName); @@ -125,6 +129,7 @@ bool isLocked(); QString fullFileName(); QString fullMirroredFileName(); + QColor colorValue(); private: void getResourceData(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbthemeperf_p.h --- a/src/hbcore/core/hbthemeperf_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbthemeperf_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,10 +36,10 @@ #else #include #define HB_START_SHAREDMEMORY_PRINT(str) unsigned int startMemory = manager->memoryConsumed(); \ - qDebug() << str << "SharedMemory Consumed" << "In" << Q_FUNC_INFO << startMemory; + qDebug() << str << "SharedMemory Consumed" << "In" << Q_FUNC_INFO << startMemory; #define HB_END_SHAREDMEMORY_PRINT(str) unsigned int endMemory = manager->memoryConsumed(); \ - qDebug() << str << "SharedMemory Consumed" << "In" << Q_FUNC_INFO << endMemory; \ - qDebug() << " Difference : " << endMemory - startMemory; + qDebug() << str << "SharedMemory Consumed" << "In" << Q_FUNC_INFO << endMemory; \ + qDebug() << " Difference : " << endMemory - startMemory; #endif // HB_PERF_MEM @@ -69,9 +69,9 @@ #else #include #include -#define HB_START_TIME() QTime time; \ - time.start(); -#define HB_END_TIME(str,val) qDebug() << str << val << " time in ms: " << time.elapsed() << "ms"; +#define HB_START_TIME() QTime time; \ + time.start(); +#define HB_END_TIME(str,val) qDebug() << str << val << " time in ms: " << time.elapsed() << "ms"; #endif //HB_PERF_TIME diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbthemesystemeffect.cpp --- a/src/hbcore/core/hbthemesystemeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbthemesystemeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,9 +23,9 @@ ** ****************************************************************************/ - -#include "hbstandarddirs_p.h" #include "hbthemesystemeffect_p.h" +#include "hbthemesystemeffectmap_p.h" +#include "hbthemeutils_p.h" #include #include @@ -33,13 +33,10 @@ #include #include #ifdef Q_OS_SYMBIAN -#include #include -#include #endif //Q_OS_SYMBIAN -// Define this to enable debug traces -//#define HBTHEMESYSTEMEFFECT_DEBUG +const char *confFilePath = "conf/system_effects_configuration.xml"; // Configuration XML elements const QLatin1String mainElement("effects_configuration"); @@ -55,33 +52,30 @@ const QLatin1String appSwitchEffectId("app_switch"); // Helper class for storing effect info -class EffectInfoEntry { +class EffectInfoEntry +{ public: - HbThemeSystemEffect::SystemEffectId mEffectId; + HbThemeSystemEffectMap::SystemEffectId mEffectId; QLatin1String mEffectIdStr; }; // Effect info array const EffectInfoEntry effectInfoArray[] = { - { HbThemeSystemEffect::AppStart, appStartEffectId }, - { HbThemeSystemEffect::AppExit, appEndEffectId }, - { HbThemeSystemEffect::AppSwitch, appSwitchEffectId } + { HbThemeSystemEffectMap::AppStart, appStartEffectId }, + { HbThemeSystemEffectMap::AppExit, appEndEffectId }, + { HbThemeSystemEffectMap::AppSwitch, appSwitchEffectId } }; const int effectInfoCount = sizeof(effectInfoArray) / sizeof(EffectInfoEntry); -#ifdef Q_OS_SYMBIAN -//const TInt tfxPurpose = Qt::Window; -#endif //Q_OS_SYMBIAN - - static HbThemeSystemEffect *systemEffect = 0; HbThemeSystemEffect::~HbThemeSystemEffect() { + delete mBaseEffects; } -void HbThemeSystemEffect::handleThemeChange(const QString& themeName) +void HbThemeSystemEffect::handleThemeChange(const QString &themeName) { HbThemeSystemEffect *effect = instance(); if (effect) { @@ -89,6 +83,136 @@ } } +HbThemeSystemEffect::HbThemeSystemEffect(QObject *parent) + : QObject(parent), + mBaseEffects(0), + mBaseEffectsRegistered(false) +#ifdef Q_OS_SYMBIAN + , mWsSession(CCoeEnv::Static()->WsSession()) +#endif //Q_OS_SYMBIAN +{ +} + +void HbThemeSystemEffect::setCurrentTheme(const QString &themeName) +{ +#ifdef HBTHEMESYSTEMEFFECT_DEBUG + qDebug() << "HbThemeSystemEffect::setCurrentTheme:" << themeName; +#endif //HBTHEMESYSTEMEFFECT_DEBUG + + if (!themeName.isEmpty()) { + + bool registeringOk = false; + QString confPath; + + // Try registering the theme specific effects + if (getThemeEffectFolder(confPath)) { + HbThemeSystemEffectMap *themeEffects = parseConfigurationFile(confPath); + if (themeEffects->entryCount()) { + verifyAllEffectsFound(*themeEffects); + registerEffects(themeEffects); + registeringOk = true; + } + delete themeEffects; + themeEffects = 0; + } + // Theme specific effects registration failed + // Try registering the base theme effects + if (!registeringOk) { + // If base theme configuration does not exist, all effects are unregistered + registerEffects(baseThemeEffects()); + } + } +} + +bool HbThemeSystemEffect::getThemeEffectFolder(QString &path) +{ + bool pathFound = false; + + HbThemeIndexInfo info = HbThemeUtils::getThemeIndexInfo(ActiveTheme); + // QT resource filenames cannot be used because filenames are passed + // to native Symbian component, which does not read QT resources. + if (!info.path.startsWith(':')) { + pathFound = true; + path = info.path; + path.append("/effects/"); + path.append(info.name); + path.append('/'); + } + + // Get also base theme effects folder - todo: should operator theme layer be looked up as well? + if (mBaseEffectsFolder.isEmpty()) { + info = HbThemeUtils::getThemeIndexInfo(BaseTheme); + if (!info.path.startsWith(':')) { + mBaseEffectsFolder = info.path; + mBaseEffectsFolder.append("/effects/"); + mBaseEffectsFolder.append(info.name); + mBaseEffectsFolder.append('/'); + mBaseEffectsFolder = QDir::toNativeSeparators(mBaseEffectsFolder); + } + } + + return pathFound; +} + +void HbThemeSystemEffect::verifyAllEffectsFound(HbThemeSystemEffectMap &effects) +{ + if (effects.entryCount()) { + for (int i = 0; i < effectInfoCount; i++) { + HbThemeSystemEffectMap::SystemEffectId id = effectInfoArray[i].mEffectId; + if (!effects.defaultEntryFound(id)) { + if (mBaseEffects || baseThemeEffects()) { + effects.addDefaultEntry(id, mBaseEffects); + } else { + break; + } + } + } + } +} + +void HbThemeSystemEffect::registerEffects(const HbThemeSystemEffectMap *effects) +{ + if (effects == mBaseEffects && mBaseEffectsRegistered) { +#ifdef HBTHEMESYSTEMEFFECT_DEBUG + qDebug() << "HbThemeSystemEffect::registerEffects: not registering base theme effects" + << "since already registered!"; +#endif //HBTHEMESYSTEMEFFECT_DEBUG + return; + } + mBaseEffectsRegistered = false; + if (effects && effects->entryCount()) { + mBaseEffectsRegistered = effects == mBaseEffects; +#ifdef HBTHEMESYSTEMEFFECT_DEBUG + if (mBaseEffectsRegistered) { + qDebug() << "HbThemeSystemEffect::registerEffects: registering base theme effects"; + } else { + qDebug() << "HbThemeSystemEffect::registerEffects: registering theme specific effects"; + } + effects->traceEffects(); +#endif //HBTHEMESYSTEMEFFECT_DEBUG +#ifdef Q_OS_SYMBIAN + effects->registerEffects(mWsSession, mBaseEffectsFolder); +#endif //Q_OS_SYMBIAN + } else { +#ifdef HBTHEMESYSTEMEFFECT_DEBUG + qDebug() << "HbThemeSystemEffect::registerEffects: no system effects configuration" + << "found - unregistering all system effects."; +#endif //HBTHEMESYSTEMEFFECT_DEBUG +#ifdef Q_OS_SYMBIAN + effects->unregisterAllEffects(mWsSession); +#endif //Q_OS_SYMBIAN + } +} + +HbThemeSystemEffectMap *HbThemeSystemEffect::baseThemeEffects() +{ + // Base theme effects haven't been parsed yet + if (!mBaseEffects && !mBaseEffectsFolder.isEmpty()) { + mBaseEffects = parseConfigurationFile(mBaseEffectsFolder); + } + return mBaseEffects; +} + HbThemeSystemEffect *HbThemeSystemEffect::instance() { if (!systemEffect) { @@ -97,152 +221,74 @@ return systemEffect; } -HbThemeSystemEffect::HbThemeSystemEffect(QObject *parent) - : QObject(parent) -#ifdef Q_OS_SYMBIAN - , mWsSession(CCoeEnv::Static()->WsSession()) -#endif //Q_OS_SYMBIAN -{ -} - -void HbThemeSystemEffect::setCurrentTheme(const QString& themeName) -{ -#ifdef HBTHEMESYSTEMEFFECT_DEBUG - qDebug() << "HbThemeSystemEffect::setCurrentTheme:" << themeName; -#endif //HBTHEMESYSTEMEFFECT_DEBUG - if (!themeName.isEmpty()) { - QString confPath; - if (getThemeEffectFolder(confPath, themeName)) { - mThemeEffectFolder = QDir::toNativeSeparators(confPath); - confPath += "conf/system_effects_configuration.xml"; -#ifdef HBTHEMESYSTEMEFFECT_DEBUG - qDebug() << "HbThemeSystemEffect::setCurrentTheme trying to parse file" << confPath; -#endif //HBTHEMESYSTEMEFFECT_DEBUG - bool parsingOk = parseConfigurationFile(confPath); -#ifdef HBTHEMESYSTEMEFFECT_DEBUG - QMapIterator mapIt(mSystemEffects); - while (mapIt.hasNext()) { - mapIt.next(); - qDebug() << "HbThemeSystemEffect::setCurrentTheme appUid:" - << mapIt.key().mAppUid << "effect id:" << mapIt.key().mEffectId - << "outgoing effect file:" << mapIt.value().mOutgoingFile - << "incoming effect file:" << mapIt.value().mIncomingFile; - } -#endif //HBTHEMESYSTEMEFFECT_DEBUG - // Register effects - // TODO: what to do if conf file not found (or some effect file not found)? - if (parsingOk) { - registerEffects(); - } - } - } -} - -void HbThemeSystemEffect::registerEffects() +HbThemeSystemEffectMap *HbThemeSystemEffect::parseConfigurationFile(const QString &effectsFolder) { -#ifdef Q_OS_SYMBIAN - // Unregister all previous theme effects - //mWsSession.UnregisterAllEffects(); -#endif //Q_OS_SYMBIAN - QMapIterator mapIt(mSystemEffects); -#ifdef Q_OS_SYMBIAN - TPtrC resourceDir = mThemeEffectFolder.utf16(); -#endif //Q_OS_SYMBIAN - while (mapIt.hasNext()) { - mapIt.next(); - // Register entry + HbThemeSystemEffectMap *effects = new HbThemeSystemEffectMap; + effects->setEffectsFolder(QDir::toNativeSeparators(effectsFolder)); + QString filePath = effectsFolder + confFilePath; #ifdef HBTHEMESYSTEMEFFECT_DEBUG - if (!mapIt.key().mAppUid) { - qDebug() << "HbThemeSystemEffect: Registering default system effect:" - << mapIt.key().mEffectId << mapIt.value().mOutgoingFile << mapIt.value().mIncomingFile; - } else { - qDebug() << "HbThemeSystemEffect: Registering application (" << mapIt.key().mAppUid - << ") specific system effect:" << mapIt.key().mEffectId - << mapIt.value().mOutgoingFile << mapIt.value().mIncomingFile; - } + qDebug() << "HbThemeSystemEffect::parseConfigurationFile trying to parse file" << filePath; #endif //HBTHEMESYSTEMEFFECT_DEBUG -#ifdef Q_OS_SYMBIAN - TInt tfxAction = tfxTransitionAction(mapIt.key().mEffectId); - // If no effect files defined, unregister effect - if (mapIt.value().mOutgoingFile.isEmpty() - && mapIt.value().mIncomingFile.isEmpty()) { -// mWsSession.UnregisterEffect(tfxAction, tfxPurpose, mapIt.key().mAppUid); - } else { - TPtrC outgoingEffect = mapIt.value().mOutgoingFile.utf16(); - TPtrC incomingEffect = mapIt.value().mIncomingFile.utf16(); - TBitFlags effectFlags; - if (mapIt.value().mIncomingHasPriority) { -// effectFlags.Set(TTfxFlags::ETfxIncomingTakesPriority); - } -// mWsSession.RegisterEffect(tfxAction, -// tfxPurpose, -// resourceDir, -// outgoingEffect, -// incomingEffect, -// mapIt.key().mAppUid, -// effectFlags); - } -#endif //Q_OS_SYMBIAN - } -} - -bool HbThemeSystemEffect::parseConfigurationFile(const QString& filePath) -{ bool success = true; - mSystemEffects.clear(); QFile confFile(filePath); success = confFile.open(QIODevice::ReadOnly); if (success) { QXmlStreamReader xml(&confFile); success = checkStartElement(xml, mainElement); if (success) { - parseEffects(xml); + parseEffects(xml, effects); if (xml.error()) { - qWarning() << "HbThemeSystemEffect::parseConfigurationFile: Error when parsing xml " << xml.errorString(); + qWarning() << "HbThemeSystemEffect::parseConfigurationFile: Error when parsing xml " + << xml.errorString(); success = false; } } confFile.close(); } else { - qWarning() << "HbThemeSystemEffect::parseConfigurationFile:" << filePath << "not found."; +#ifdef HBTHEMESYSTEMEFFECT_DEBUG + qDebug() << "HbThemeSystemEffect::parseConfigurationFile:" + << confFile.fileName() << "not found."; +#endif //HBTHEMESYSTEMEFFECT_DEBUG } - return success; + return effects; } -void HbThemeSystemEffect::parseEffects(QXmlStreamReader &xml) +void HbThemeSystemEffect::parseEffects(QXmlStreamReader &xml, HbThemeSystemEffectMap *effects) { // Go through effects section while (!xml.atEnd()) { if (checkStartElement(xml, effectElement)) { - SystemEffectId effectId = Invalid; + HbThemeSystemEffectMap::SystemEffectId effectId = HbThemeSystemEffectMap::Invalid; uint appId = 0; QString incomingFile; QString outgoingFile; bool incomingHasPriority = false; bool validEntry = true; bool effectFileEntryFound = false; + bool fromBaseTheme = false; // Single effect entry while (validEntry && xml.readNextStartElement()) { // Effect id if (xml.name() == effectIdElement) { - effectId = (SystemEffectId)idFromEffectIdString(xml.readElementText()); - validEntry = !(effectId == Invalid); - // App id + effectId = (HbThemeSystemEffectMap::SystemEffectId) + idFromEffectIdString(xml.readElementText()); + validEntry = !(effectId == HbThemeSystemEffectMap::Invalid); + // App id } else if (xml.name() == appIdElement) { appId = validApplicationUid(xml.readElementText()); - // Outgoing effect file + // Outgoing effect file } else if (xml.name() == outgoingFileElement) { effectFileEntryFound = true; outgoingFile = xml.readElementText(); - validEntry = validEffectFile(outgoingFile); - // Incoming effect file + validEntry = validEffectFile(outgoingFile, effects, fromBaseTheme); + // Incoming effect file } else if (xml.name() == incomingFileElement) { effectFileEntryFound = true; incomingFile = xml.readElementText(); - validEntry = validEffectFile(incomingFile); - // If incoming file has the priority + validEntry = validEffectFile(incomingFile, effects, fromBaseTheme); + // If incoming file has the priority } else if (xml.name() == incomingPriorityElement) { incomingHasPriority = booleanFromString(xml.readElementText()); } @@ -254,13 +300,19 @@ } // If valid entry was found, store it to system effects map if (validEntry) { - addEntryToEffectMap(appId, effectId, incomingFile, outgoingFile, incomingHasPriority); + effects->addEntry(appId, + effectId, + incomingFile, + outgoingFile, + incomingHasPriority, + fromBaseTheme); } } } } -bool HbThemeSystemEffect::checkStartElement(QXmlStreamReader &xml, const QLatin1String &startElement) const +bool HbThemeSystemEffect::checkStartElement(QXmlStreamReader &xml, + const QLatin1String &startElement) { xml.readNext(); while (!xml.isStartElement() && !xml.atEnd()) { @@ -270,41 +322,48 @@ if (success && xml.name() != startElement) { success = false; } else if (xml.error()) { - qWarning() - << "HbThemeSystemEffect::checkStartElement: Error when parsing system effect configuration : " - << xml.errorString(); + qWarning() << "HbThemeSystemEffect::checkStartElement:" + << " Error when parsing system effect configuration : " << xml.errorString(); } else if (!success && !xml.name().isEmpty()) { - qWarning() - << "HbThemeSystemEffect::checkStartElement: Error when parsing system effect configuration with element: " - << xml.name(); + qWarning() << "HbThemeSystemEffect::checkStartElement: " + << "Error when parsing system effect configuration with element: " << xml.name(); } return success; } -int HbThemeSystemEffect::idFromEffectIdString(const QString &effectIdString) const +int HbThemeSystemEffect::idFromEffectIdString(const QString &effectIdString) { - for (int i=0; ieffectsFolder() + effectFile); + // Not found -> Check if file is found in base theme effect folder + if (!validFile && !instance()->mBaseEffectsFolder.isEmpty() + && instance()->mBaseEffectsFolder != effects->effectsFolder()) { + validFile = QFile::exists(instance()->mBaseEffectsFolder + effectFile); + if (validFile) { + fromBaseTheme = true; + } } + // Other entry files found in base theme -> this should be found there too + } else { + validFile = QFile::exists(instance()->mBaseEffectsFolder + effectFile); } return validFile; } -uint HbThemeSystemEffect::validApplicationUid(const QString &appUid) const +uint HbThemeSystemEffect::validApplicationUid(const QString &appUid) { bool ok = false; int base = 10; @@ -315,7 +374,7 @@ return uid; } -bool HbThemeSystemEffect::booleanFromString(const QString &boolAttribute) const +bool HbThemeSystemEffect::booleanFromString(const QString &boolAttribute) { bool value = false; if (boolAttribute == QLatin1String("true") || boolAttribute == QLatin1String("1")) { @@ -324,62 +383,3 @@ return value; } -bool HbThemeSystemEffect::getThemeEffectFolder(QString &path, const QString &themeName) const -{ - bool pathFound = false; - QString effectDir = "themes/effects/" + themeName + "/"; - QStringList queryList; - queryList.append(effectDir); - QStringList folderList = HbStandardDirs::findExistingFolderList(queryList, - themeName, - Hb::EffectResource); - QString pathCandidate; - for (int i=0; i -#include #include #include +#include +class HbThemeSystemEffectMap; #ifdef Q_OS_SYMBIAN class RWsSession; #endif //Q_OS_SYMBIAN @@ -40,72 +40,33 @@ Q_OBJECT public: - enum SystemEffectId { - Invalid = 0, - AppStart, - AppExit, - AppSwitch - }; - ~HbThemeSystemEffect(); static void handleThemeChange(const QString &themeName); private: - static HbThemeSystemEffect *instance(); HbThemeSystemEffect(QObject *parent); void setCurrentTheme(const QString &themeName); - void registerEffects(); - bool parseConfigurationFile(const QString& filePath); - void parseEffects(QXmlStreamReader &xml); - bool checkStartElement(QXmlStreamReader &xml, const QLatin1String &startElement) const; - int idFromEffectIdString(const QString &effectIdString) const; - bool validEffectFile(const QString &effectFile) const; - uint validApplicationUid(const QString &appUid) const; - bool booleanFromString(const QString &boolAttribute) const; - bool getThemeEffectFolder(QString &path, const QString &themeName) const; - void addEntryToEffectMap(uint appUid, - SystemEffectId id, - const QString &incomingFile, - const QString &outgoingFile, - bool incomingHasPriority); + bool getThemeEffectFolder(QString &path); + void verifyAllEffectsFound(HbThemeSystemEffectMap &effects); + void registerEffects(const HbThemeSystemEffectMap *effects); + HbThemeSystemEffectMap *parseBaseThemeEffects(); + HbThemeSystemEffectMap *baseThemeEffects(); -#ifdef Q_OS_SYMBIAN - TInt tfxTransitionAction(const SystemEffectId id) const; -#endif //Q_OS_SYMBIAN + static HbThemeSystemEffect *instance(); + static HbThemeSystemEffectMap *parseConfigurationFile(const QString &effectsFolder); + static void parseEffects(QXmlStreamReader &xml, HbThemeSystemEffectMap *effects); + static bool checkStartElement(QXmlStreamReader &xml, const QLatin1String &startElement); + static int idFromEffectIdString(const QString &effectIdString); + static bool validEffectFile(const QString &effectFile, + HbThemeSystemEffectMap *effects, + bool &fromBaseTheme); + static uint validApplicationUid(const QString &appUid); + static bool booleanFromString(const QString &boolAttribute); private: - class SystemEffectKey { - public: - inline SystemEffectKey(SystemEffectId effectId, uint appUid) - : mEffectId(effectId), mAppUid(appUid){} - - inline bool operator<(const SystemEffectKey &other) const { - return other.mAppUid == mAppUid ? other.mEffectId > mEffectId : other.mAppUid > mAppUid; - } - - public: - SystemEffectId mEffectId; - uint mAppUid; - }; - - class SystemEffectValue { - public: - inline SystemEffectValue(const QString &incomingFile, - const QString &outgoingFile, - bool incomingHasPriority) - : mIncomingFile(incomingFile), - mOutgoingFile(outgoingFile), - mIncomingHasPriority(incomingHasPriority) {} - - public: - QString mIncomingFile; - QString mOutgoingFile; - bool mIncomingHasPriority; - }; - - typedef QMap SystemEffectMap; - SystemEffectMap mSystemEffects; - QString mThemeEffectFolder; + HbThemeSystemEffectMap *mBaseEffects; + QString mBaseEffectsFolder; + bool mBaseEffectsRegistered; #ifdef Q_OS_SYMBIAN RWsSession &mWsSession; #endif //Q_OS_SYMBIAN diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbthemesystemeffectmap.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/core/hbthemesystemeffectmap.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,215 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + + +#include +#include "hbthemesystemeffectmap_p.h" + +#ifdef Q_OS_SYMBIAN +#include +#include +#include + +const TInt tfxPurpose = Qt::Window; +#endif //Q_OS_SYMBIAN + +#ifdef HBTHEMESYSTEMEFFECT_DEBUG +const char *dbgRegister = "REGISTER "; +const char *dbgUnregister = "UNREGISTER "; +const char *dbgDefault = "Default effect "; +const char *dbgAppSpecific = "App specific effect "; +const char *dbgAppStart = "AppStart "; +const char *dbgAppExit = "AppExit "; +const char *dbgAppSwitch = "AppSwitch "; +const char *dbgInvalid = "Invalid "; +const char *dbgIncomingPrio = "Incoming has priority "; +const char *dgbFromBaseTheme = "From base theme "; +const char *dbgIn = " In: "; +const char *dbgOut = "Out: "; +#endif //HBTHEMESYSTEMEFFECT_DEBUG + +HbThemeSystemEffectMap::HbThemeSystemEffectMap() +{ +} + +HbThemeSystemEffectMap::~HbThemeSystemEffectMap() +{ +} + +void HbThemeSystemEffectMap::setEffectsFolder(const QString &effectsFolder) +{ + mEffectsFolder = effectsFolder; +} + +const QString &HbThemeSystemEffectMap::effectsFolder() const +{ + return mEffectsFolder; +} + +void HbThemeSystemEffectMap::addEntry(uint appUid, + SystemEffectId id, + const QString &incomingFile, + const QString &outgoingFile, + bool incomingHasPriority, + bool fromBaseTheme) +{ + SystemEffectKey key(id, appUid); + SystemEffectValue value(incomingFile, outgoingFile, incomingHasPriority, fromBaseTheme); + SystemEffectMap::iterator i = mSystemEffects.find(key); + if (i == mSystemEffects.end()) { + i = mSystemEffects.insert(key, value); + } +} + +int HbThemeSystemEffectMap::entryCount() const +{ + return mSystemEffects.count(); +} + +bool HbThemeSystemEffectMap::defaultEntryFound(SystemEffectId id) const +{ + SystemEffectKey key(id, 0); + return mSystemEffects.find(key) != mSystemEffects.end(); +} + +void HbThemeSystemEffectMap::addDefaultEntry(SystemEffectId id, HbThemeSystemEffectMap *effects) +{ + SystemEffectKey key(id, 0); + SystemEffectMap::iterator i = effects->mSystemEffects.find(key); + if (i != effects->mSystemEffects.end()) { + SystemEffectValue value = i.value(); + value.mFromBaseTheme = true; + mSystemEffects.insert(key, value); + } +} + +#ifdef HBTHEMESYSTEMEFFECT_DEBUG +void HbThemeSystemEffectMap::traceEffects() const +{ + QString dbgString; + QMapIterator mapIt(mSystemEffects); + while (mapIt.hasNext()) { + mapIt.next(); + bool unregister = mapIt.value().mIncomingFile.isEmpty() + && mapIt.value().mOutgoingFile.isEmpty(); + if (unregister) { + dbgString = dbgUnregister; + } else { + dbgString = dbgRegister; + } + if (!mapIt.key().mAppUid) { + dbgString += dbgDefault; + } else { + dbgString += dbgAppSpecific + QString::number(mapIt.key().mAppUid) + " "; + } + if (mapIt.key().mEffectId == AppStart) { + dbgString += dbgAppStart; + } else if (mapIt.key().mEffectId == AppExit) { + dbgString += dbgAppExit; + } else if (mapIt.key().mEffectId == AppSwitch) { + dbgString += dbgAppSwitch; + } else { + dbgString += dbgInvalid; + } + if (mapIt.value().mIncomingHasPriority) { + dbgString += dbgIncomingPrio; + } + if (mapIt.value().mFromBaseTheme) { + dbgString += dgbFromBaseTheme; + } + if (!unregister) { + dbgString += dbgOut + mapIt.value().mOutgoingFile; + dbgString += dbgIn + mapIt.value().mIncomingFile; + } + qDebug() << "HbThemeSystemEffectMap::traceEffects" << dbgString; + } +} +#endif //HBTHEMESYSTEMEFFECT_DEBUG + +#ifdef Q_OS_SYMBIAN +void HbThemeSystemEffectMap::unregisterAllEffects(RWsSession &wsSession) const +{ + // Unregister all previous theme effects + wsSession.UnregisterAllEffects(); +} + +void HbThemeSystemEffectMap::registerEffects(RWsSession &wsSession, + const QString &baseEffectsFolder) const +{ + unregisterAllEffects(wsSession); + QMapIterator mapIt(mSystemEffects); + TPtrC themeResourceDir = mEffectsFolder.utf16(); + TPtrC baseResourceDir = baseEffectsFolder.utf16(); +#ifdef HBTHEMESYSTEMEFFECT_DEBUG + qDebug() << "HbThemeSystemEffectMap::registerEffects effect folder:" << mEffectsFolder + << "base theme effect folder:" << baseEffectsFolder; +#endif //HBTHEMESYSTEMEFFECT_DEBUG + while (mapIt.hasNext()) { + mapIt.next(); + // Register entry + TInt tfxAction = tfxTransitionAction(mapIt.key().mEffectId); + // If no effect files defined, unregister effect + if (mapIt.value().mOutgoingFile.isEmpty() + && mapIt.value().mIncomingFile.isEmpty()) { + wsSession.UnregisterEffect(tfxAction, tfxPurpose, mapIt.key().mAppUid); + } else { + TPtrC outgoingEffect = mapIt.value().mOutgoingFile.utf16(); + TPtrC incomingEffect = mapIt.value().mIncomingFile.utf16(); + TPtrC resourceDir = mapIt.value().mFromBaseTheme ? baseResourceDir : themeResourceDir; + TBitFlags effectFlags; + if (mapIt.value().mIncomingHasPriority) { + effectFlags.Set(ETfxIncomingTakesPriority); + } + wsSession.RegisterEffect(tfxAction, + tfxPurpose, + resourceDir, + outgoingEffect, + incomingEffect, + mapIt.key().mAppUid, + effectFlags); + } + } +} + +TInt HbThemeSystemEffectMap::tfxTransitionAction(SystemEffectId id) const +{ + TInt tfxTransitionAction = 0; + switch (id) { + case(AppStart) : + tfxTransitionAction = ETfxActionStart; + break; + case(AppExit) : + tfxTransitionAction = ETfxActionShutDown; + break; + case(AppSwitch) : + tfxTransitionAction = ETfxActionSwitching; + break; + default: + break; + } + return tfxTransitionAction; +} +#endif //Q_OS_SYMBIAN + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbthemesystemeffectmap_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/core/hbthemesystemeffectmap_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,116 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBTHEMESYSTEMEFFECTMAP_P_H +#define HBTHEMESYSTEMEFFECTMAP_P_H + +#include +#include +#ifdef Q_OS_SYMBIAN +class RWsSession; +#endif //Q_OS_SYMBIAN + +// Define this to enable debug traces +#undef HBTHEMESYSTEMEFFECT_DEBUG + + +class HbThemeSystemEffectMap +{ +public: + enum SystemEffectId { + Invalid = 0, + AppStart, + AppExit, + AppSwitch + }; + + HbThemeSystemEffectMap(); + virtual ~HbThemeSystemEffectMap(); + + void setEffectsFolder(const QString &effectsFolder); + const QString &effectsFolder() const; + void addEntry(uint appUid, + SystemEffectId id, + const QString &incomingFile, + const QString &outgoingFile, + bool incomingHasPriority, + bool fromBaseTheme); + + int entryCount() const; + bool defaultEntryFound(SystemEffectId id) const; + void addDefaultEntry(SystemEffectId id, HbThemeSystemEffectMap *effects); +#ifdef HBTHEMESYSTEMEFFECT_DEBUG + void traceEffects() const; +#endif //HBTHEMESYSTEMEFFECT_DEBUG + +#ifdef Q_OS_SYMBIAN + void unregisterAllEffects(RWsSession &wsSession) const; + void registerEffects(RWsSession &wsSession, const QString &baseEffectsFolder) const; + TInt tfxTransitionAction(SystemEffectId id) const; +#endif //Q_OS_SYMBIAN + +private: + class SystemEffectKey + { + public: + inline SystemEffectKey(SystemEffectId effectId, uint appUid) + : mEffectId(effectId), mAppUid(appUid) {} + + inline bool operator<(const SystemEffectKey &other) const { + return other.mAppUid == mAppUid ? other.mEffectId > mEffectId : other.mAppUid > mAppUid; + } + + public: + SystemEffectId mEffectId; + uint mAppUid; + }; + + class SystemEffectValue + { + public: + inline SystemEffectValue(const QString &incomingFile, + const QString &outgoingFile, + bool incomingHasPriority, + bool fromBaseTheme) + : mIncomingFile(incomingFile), + mOutgoingFile(outgoingFile), + mIncomingHasPriority(incomingHasPriority), + mFromBaseTheme(fromBaseTheme) {} + + public: + QString mIncomingFile; + QString mOutgoingFile; + bool mIncomingHasPriority; + bool mFromBaseTheme; + }; + + typedef QMap SystemEffectMap; + SystemEffectMap mSystemEffects; + QString mEffectsFolder; + + friend class TestHbThemeSystemEffect; +}; + +#endif // HBTHEMESYSTEMEFFECTMAP_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbvariant_p.cpp --- a/src/hbcore/core/hbvariant_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbvariant_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,10 +36,11 @@ #include "hbcssconverterutils_p.h" #endif -HbVariant::HbVariantData::HbVariantData() - :stringSize(0), - mRef(1), - mDataType(Invalid) +HbVariant::HbVariantData::HbVariantData() : + stringSize(0), + stringListCount(0), + mRef(1), + mDataType(Invalid) { } @@ -85,7 +86,7 @@ newData->setDataType(data->dataType()); if ( data->dataType() == String ) { - HbSmartOffset dataOffset(manager->alloc( data->stringSize*sizeof(QChar))); + HbSmartOffset dataOffset(manager->alloc(data->stringSize * sizeof(QChar))); #ifdef HB_BIN_CSS HbCssConverterUtils::registerOffsetHolder(&(newData->mData.offset)); #endif @@ -108,7 +109,6 @@ } } - /* * C'tor */ @@ -185,6 +185,19 @@ #endif } +/* +* C'tor taking stringlist +*/ +HbVariant::HbVariant(const QStringList &val, HbMemoryManager::MemoryType type) + : mMemoryType( type ), mShared( false ) +{ + initializeData(); + fillStringListData(val); + +#ifdef HB_BIN_CSS + HbCssConverterUtils::registerOffsetHolder(&mDataOffset); +#endif +} /* * C'tor taking QColor @@ -203,14 +216,13 @@ /* * copy C'tor */ - HbVariant::HbVariant( const HbVariant &other ) { - mMemoryType = other.mMemoryType; GET_MEMORY_MANAGER(other.mMemoryType) - HbVariantData* data = HbMemoryUtils::getAddress( mMemoryType, other.mDataOffset ); + HbVariantData *data = HbMemoryUtils::getAddress(mMemoryType, + other.mDataOffset); mDataOffset = other.mDataOffset; if ( !manager->isWritable() || other.mShared == true ) { @@ -235,13 +247,14 @@ { GET_MEMORY_MANAGER(mMemoryType); // if the memory where the variant is not writable it means it's client process, so do nothing - if( !manager->isWritable() ) + if(!manager->isWritable() ) { return; - HbVariantData *data= getAddress( mMemoryType, mDataOffset, mShared ); - if( mShared != true && !data->mRef.deref() ) { + } + HbVariantData *data = getAddress(mMemoryType, mDataOffset, mShared); + if(!mShared&& !data->mRef.deref()) { clear(); data->~HbVariantData(); - HbMemoryUtils::freeMemory( mMemoryType, mDataOffset ); + HbMemoryUtils::freeMemory(mMemoryType, mDataOffset); } #ifdef HB_BIN_CSS @@ -288,6 +301,12 @@ case HbVariant::Color: return getColor().name(); case HbVariant::StringList: + if (data->stringListCount == 1) { + const char *address = getAddress(mMemoryType, data->mData.offset, mShared); + int length = *((int*)address); + return QString((const QChar *)(address + sizeof(int)), length); + } + return QString(); default: return QString(); @@ -299,11 +318,11 @@ */ QString HbVariant::getString() const { - HbVariantData *data = getAddress( mMemoryType, mDataOffset, mShared ); + HbVariantData *data = getAddress(mMemoryType, mDataOffset, mShared); if (data->mData.offset != -1) { - QChar* dataPtr = getAddress( mMemoryType, data->mData.offset, mShared ); - return QString::fromRawData( dataPtr, data->stringSize ); + QChar *dataPtr = getAddress(mMemoryType, data->mData.offset, mShared); + return QString::fromRawData(dataPtr, data->stringSize); } else { // data->mData.offset == -1 is empty String Variant. return QString(""); } @@ -346,10 +365,31 @@ /* * to get stringlist */ -QStringList HbVariant::toStringList () const +QStringList HbVariant::toStringList() const { - // ToDo: Implement it - return QStringList(); + HbVariantData *data = getAddress(mMemoryType, mDataOffset, mShared); + QStringList list; + + if (data) { + if (data->dataType() == HbVariant::StringList) { + const char *address = getAddress(mMemoryType, data->mData.offset, mShared); + const char *end = address + data->stringSize; + + // Append strings to stringlist + while (address < end) { + int length = *(int *)address; + address += sizeof(int); + + QString string((const QChar *)address, length); + list.append(string); + address += sizeof(QChar) * length; + } + } else { + list.append(toString()); + } + } + + return list; } /* @@ -413,6 +453,52 @@ } /* +* fillStringListData +*/ +void HbVariant::fillStringListData(const QStringList &stringList) +{ + GET_MEMORY_MANAGER(mMemoryType); + HbVariantData *data = getAddress(mMemoryType, mDataOffset, mShared); + int oldOffset = reservesMemory(data) ? data->mData.offset : -1; + int allocBytes = 0; + + if (stringList.isEmpty()) { + data->mData.offset = -1; + } else { + // allocate memory and copy data. + for (int i=0; imData.offset = manager->alloc(allocBytes); + char *address = getAddress(mMemoryType, data->mData.offset, mShared); + + for (int j=0; jstringSize = allocBytes; + data->stringListCount = stringList.count(); + + data->setDataType(StringList); + if (oldOffset != -1) { + // Free old memory block + HbMemoryUtils::freeMemory(mMemoryType, oldOffset); + } +} + + +/* * fillColorData */ void HbVariant::fillColorData( const QColor &col ) @@ -436,7 +522,7 @@ /* * = operator taking int */ -HbVariant& HbVariant::operator=(int val) +HbVariant & HbVariant::operator=(int val) { detach(); // This will update the mDataOffset to new location if ref > 1. @@ -450,7 +536,7 @@ /* * = operator taking double */ -HbVariant& HbVariant::operator=(double val) +HbVariant & HbVariant::operator=(double val) { detach(); // This will update the mDataOffset to new location if ref > 1. @@ -464,7 +550,7 @@ /* * = operator taking QString */ -HbVariant& HbVariant::operator=(const QString& val) +HbVariant & HbVariant::operator=(const QString &val) { detach(); // This will update the mDataOffset to new location if ref > 1. fillStringData(val.constData(), val.length()); @@ -474,7 +560,7 @@ /* * = operator taking HbString */ -HbVariant& HbVariant::operator=(const HbString& val) +HbVariant & HbVariant::operator=(const HbString &val) { detach(); // This will update the mDataOffset to new location if ref > 1. fillStringData(val.constData(), val.length()); @@ -484,7 +570,7 @@ /* * = operator taking QColor */ -HbVariant& HbVariant::operator=(const QColor& col) +HbVariant &HbVariant::operator=(const QColor &col) { detach(); // This will update the mDataOffset to new location if ref > 1. fillColorData(col); @@ -492,42 +578,39 @@ } /* -* = operator taking QStringList +* = operator taking QStringList */ -HbVariant& HbVariant::operator=(const QStringList& /*strList*/) +HbVariant& HbVariant::operator=(const QStringList& strList) { - // ToDo: Implement it + fillStringListData(strList); return *this; } /* * = operator taking HbVariant */ -HbVariant& HbVariant::operator=(const HbVariant &other) +HbVariant &HbVariant::operator=(const HbVariant &other) { GET_MEMORY_MANAGER(mMemoryType) if(!manager->isWritable()) { Q_ASSERT(false); } - HbVariantData *otherData = getAddress(other.mMemoryType, other.mDataOffset, other.mShared); + HbVariantData *otherData = getAddress(other.mMemoryType, other.mDataOffset, + other.mShared); HbVariantData *data = getAddress(mMemoryType, mDataOffset, mShared); if(other.mMemoryType != mMemoryType || other.mShared == true) { - if(mShared != true) { - if(data->mRef == 1) { - clear(); - data->~HbVariantData(); - HbMemoryUtils::freeMemory(mMemoryType, mDataOffset); - }else { - data->mRef.deref(); - } + if(!mShared && !data->mRef.deref()) { + clear(); + data->~HbVariantData(); + HbMemoryUtils::freeMemory(mMemoryType, mDataOffset); } mShared = true; mMemoryType = HbMemoryManager::HeapMemory; } else { otherData->mRef.ref(); - if(mShared != true && !data->mRef.deref() ) { + if(!mShared&& !data->mRef.deref()) { clear(); data->~HbVariantData(); HbMemoryUtils::freeMemory(mMemoryType, mDataOffset); @@ -536,7 +619,8 @@ mMemoryType = other.mMemoryType; } mDataOffset = other.mDataOffset; - Q_ASSERT(mMemoryType == HbMemoryManager::SharedMemory || mMemoryType == HbMemoryManager::HeapMemory); + Q_ASSERT(mMemoryType == HbMemoryManager::SharedMemory + || mMemoryType == HbMemoryManager::HeapMemory); return *this; } @@ -558,10 +642,13 @@ return data->dataType() == HbVariant::Int || data->dataType() == HbVariant::String; case HbVariant::String: - return data->dataType() == HbVariant::Int - || data->dataType() == HbVariant::StringList - || data->dataType() == HbVariant::Double - || data->dataType() == HbVariant::Color; + if (data->dataType() == HbVariant::StringList) { + return data->stringListCount <= 1; + } else { + return data->dataType() == HbVariant::Int + || data->dataType() == HbVariant::Double + || data->dataType() == HbVariant::Color; + } case HbVariant::StringList: case HbVariant::Color: return data->dataType() == HbVariant::String; @@ -582,6 +669,8 @@ int tempOffset = -1; QColor col; QString str; + QStringList strList; + if(data->dataType() == t) { return true; } @@ -638,8 +727,14 @@ return true; } case HbVariant::StringList: - // ToDo: Handle it - return false; + // canConvert checks that there is max 1 string in the stringlist + if (data->stringListCount == 0) { + fillStringData(0, 0); + } else { + QString string = toString(); + fillStringData(string.constData(), string.length()); + } + return true; case HbVariant::Color: { QString colName = getColor().name(); fillStringData(colName.constData(), colName.length()); @@ -663,7 +758,14 @@ } case HbVariant::StringList: - return false; + switch(data->dataType()) { + case HbVariant::String: + strList.append(getString()); + fillStringListData(strList); + return true; + default: + return false; + } default: return false; @@ -685,7 +787,7 @@ case HbVariant::String : return QVariant(getString()); case HbVariant::StringList : - return QVariant(QVariant::StringList); + return QVariant(toStringList()); case HbVariant::Color : { QVariant var = getColor(); return var; @@ -695,9 +797,8 @@ } } - /* -* clears the variant, frees any alocated memory +* clears the variant, frees any allocated memory */ void HbVariant::clear() { @@ -713,11 +814,9 @@ break; case HbVariant::String : case HbVariant::Color : + case HbVariant::StringList : HbMemoryUtils::freeMemory(mMemoryType, data->mData.offset); - break; - case HbVariant::StringList : - // ToDo: Handle it - break; + break; default: break; } @@ -727,13 +826,8 @@ #ifdef CSS_PARSER_TRACES /* -* These routines are there to support debugging +* Debugging support */ -bool HbVariant::supportsPrinting() const -{ - return true; -} - void HbVariant::print() const { HbVariantData * data = getAddress( mMemoryType, mDataOffset, mShared); @@ -752,9 +846,9 @@ qDebug() << getColor(); break; case HbVariant::StringList: + qDebug() << toStringList(); default: qDebug() << "Invalid Type"; } } - -#endif +#endif // CSS_PARSER_TRACES diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbvariant_p.h --- a/src/hbcore/core/hbvariant_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbvariant_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -68,6 +68,7 @@ } mData; int stringSize; + int stringListCount; QAtomicInt mRef; private: Type mDataType; @@ -80,6 +81,7 @@ HbVariant(double val, HbMemoryManager::MemoryType type); HbVariant(const QString &str, HbMemoryManager::MemoryType type); HbVariant(const char *val, HbMemoryManager::MemoryType type); + HbVariant(const QStringList &val, HbMemoryManager::MemoryType type); HbVariant(const QColor &col, HbMemoryManager::MemoryType type); ~HbVariant(); @@ -95,14 +97,13 @@ } #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const; void print() const; #endif int toInt() const; QString toString() const; QColor toColor() const; - QStringList toStringList () const; + QStringList toStringList() const; double toDouble() const; HbVariant & operator=( int val ); @@ -110,7 +111,7 @@ HbVariant & operator=( const QString& val ); HbVariant & operator=( const HbString& val ); HbVariant & operator=( const QColor& col ); - HbVariant & operator=( const QStringList& /*strList*/ ); + HbVariant & operator=( const QStringList& strList ); HbVariant & operator=( const HbVariant& other ); bool canConvert ( HbVariant::Type t ) const; @@ -122,6 +123,7 @@ private: HbVariantData * initializeData(); void fillStringData(const QChar *str, int size); + void fillStringListData(const QStringList &stringList); void fillColorData(const QColor &col); QString getString() const; QColor getColor() const; @@ -144,7 +146,8 @@ static bool reservesMemory(const HbVariantData *data) { return data->dataType() == HbVariant::String - || data->dataType() == HbVariant::Color; + || data->dataType() == HbVariant::Color + || data->dataType() == HbVariant::StringList; } void freeMemory(HbVariantData *data) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/core/hbvector_p.h --- a/src/hbcore/core/hbvector_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/core/hbvector_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -130,9 +130,9 @@ : public const_vector_iterator { public: - typedef T value_type; - typedef value_type & reference; - typedef int difference_type; + typedef T value_type; + typedef value_type & reference; + typedef int difference_type; public: vector_iterator() @@ -232,38 +232,37 @@ //Owing to OOM condition, the ctor of HbVector can throw, the exception is // propagated to the caller. HbVector(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) - : mData(0,type), - mMemoryType(type), + : mData(0, type), mShared(false) { - GET_MEMORY_MANAGER(type); - HbSmartOffset smartOffset(manager->alloc(sizeof(HbVectorData)), type ); - mData = new((char*)manager->base() + smartOffset.get()) HbVectorData(type); - smartOffset.release(); - + if (type == HbMemoryManager::HeapMemory) { + static int heapNullOffset(createNullOffset(HbMemoryManager::HeapMemory)); + mData.setOffset(heapNullOffset); + mData->mRef.ref(); + } else if (type == HbMemoryManager::SharedMemory) { + static int sharedNullOffset(createNullOffset(HbMemoryManager::SharedMemory)); + mData.setOffset(sharedNullOffset); + mData->mRef.ref(); #ifdef HB_BIN_CSS - HbCssConverterUtils::registerOffsetHolder(mData.offsetPtr()); + HbCssConverterUtils::registerOffsetHolder(mData.offsetPtr()); #endif + } else { + HbMemoryManager *manager = memoryManager(); + HbSmartOffset smartOffset(manager->alloc(sizeof(HbVectorData)), type ); + mData = new((char*)manager->base() + smartOffset.get()) HbVectorData(type); + smartOffset.release(); + } } - HbVector(const HbVector &other) - { - mMemoryType = other.mMemoryType; - GET_MEMORY_MANAGER(other.mMemoryType) - // Deep copy , if current vector is in client side and it copies data which is in shared memory. - // else Do normal Implicit sharing. - mData = other.mData; - - if(!manager->isWritable() || other.mShared == true){ + HbVector(const HbVector &other) : mData(other.mData), mShared(other.mShared) + { + HbMemoryManager *manager = memoryManager(); + if(!manager->isWritable()){ mShared = true; - mMemoryType = HbMemoryManager::HeapMemory; - } else { - mShared = false; + } + if (!mShared) { mData->mRef.ref(); } - Q_ASSERT(mMemoryType == HbMemoryManager::SharedMemory - || mMemoryType == HbMemoryManager::HeapMemory); - #ifdef HB_BIN_CSS HbCssConverterUtils::registerOffsetHolder(mData.offsetPtr()); #endif @@ -271,11 +270,11 @@ ~HbVector() { - GET_MEMORY_MANAGER(mMemoryType); + HbMemoryManager *manager = memoryManager(); // if the memory where the vector is not writable it means it's client process, so do nothing if(!mData || !manager->isWritable()) return; - if(mShared != true && !mData->mRef.deref()) { + if(!mShared && !mData->mRef.deref()) { destroyData(); } @@ -286,7 +285,7 @@ HbMemoryManager::MemoryType memoryType() const { - return mMemoryType; + return mShared ? HbMemoryManager::HeapMemory : mData.memoryType(); } #ifdef CSS_PARSER_TRACES @@ -297,7 +296,6 @@ { const_iterator iter = begin(); while(iter != end()) { - if(iter->supportsPrinting()) iter->print(); iter++; } @@ -400,8 +398,9 @@ // reserve() can throw owing to OOM void reserve(int newSize) { - if( mShared || newSize > mData->mCapacity || mData->mRef != 1) { - GET_MEMORY_MANAGER(mMemoryType); + if( newSize > 0 + && (mShared || newSize > mData->mCapacity || mData->mRef != 1)) { + HbMemoryManager *manager = memoryManager(); int offset = (char*)mData->mStart.get() - (char*)manager->base(); int newOffset = -1; if(newSize > mData->mCapacity) @@ -543,44 +542,31 @@ HbVector & operator=(const HbVector &other) { - GET_MEMORY_MANAGER(mMemoryType); - if(!manager->isWritable()) - Q_ASSERT(mMemoryType != HbMemoryManager::SharedMemory); - + Q_ASSERT(memoryType() == HbMemoryManager::SharedMemory + || memoryType() == HbMemoryManager::HeapMemory); // if the Current vector and other Vector memory type is not same then do Deep Copy. //To Do: mShared == true is just Quick fix for unit-test where the other vector is in heap but // its data shared to shared memory also the current vector is same state. this needs to fix // and decision making is required very clear for all the scenarios. - if (other.mMemoryType != mMemoryType || other.mShared == true || mShared == true ) + if (other.memoryType() != memoryType() || other.mShared || mShared) { - if(mShared != true) { - if(mData->mRef == 1) { - destroyData(); - }else { - mData->mRef.deref(); - } + if(!mShared && !mData->mRef.deref()) { + destroyData(); } mShared = true; - // Here assumption is that two memory type will be different in - // client side. so this code will not be execute in the server side so - // memoryType will be heap but data still shared to Shared memory. - mMemoryType = HbMemoryManager::HeapMemory; } else { if(!mData->mRef.deref() ) { destroyData(); } other.mData->mRef.ref(); - mMemoryType = other.mMemoryType; mShared = other.mShared; } mData = other.mData; - Q_ASSERT(mMemoryType == HbMemoryManager::SharedMemory || mMemoryType == HbMemoryManager::HeapMemory); return *this; } HbVector & operator=(const QVector &other) { - Q_ASSERT(mMemoryType == HbMemoryManager::SharedMemory || mMemoryType == HbMemoryManager::HeapMemory); clear(); foreach (T obj, other) { append(obj); @@ -598,12 +584,11 @@ private: void detach() { - if(mData->mRef != 1 || mShared == true) { + if(mData->mRef != 1 || mShared) { copyData(size(), size()); // Here assumption is the new copy of data is created in heap. // so disabling the shared flag. - if(mShared) - mShared = false; + mShared = false; } } @@ -619,16 +604,17 @@ // mData is not freed, because it is assumed, that it is owned by another HbVector (mData->mRef > 1) void copyData(int newSize, int oldSize) { + HbMemoryManager::MemoryType memType = memoryType(); DataPointer tempData(mData); - DataPointer newData(0, mMemoryType); - GET_MEMORY_MANAGER(mMemoryType) - HbSmartOffset offset(manager->alloc(sizeof(HbVectorData)), mMemoryType); + DataPointer newData(0, memType); + HbMemoryManager *manager = memoryManager(); + HbSmartOffset offset(manager->alloc(sizeof(HbVectorData)), memType); newData = new ((char*)manager->base() + offset.get()) - HbVectorData(mMemoryType, oldSize, newSize); + HbVectorData(memType, oldSize, newSize); mData = newData; offset.release(); - if(!mShared) { - tempData->mRef.deref(); + if(!mShared && !tempData->mRef.deref()) { + destroyData(); } if(QTypeInfo::isComplex) { @@ -648,13 +634,12 @@ // the exception is propagated to the caller int reAlloc(int oldOffset, int newSize , int oldSize) { - GET_MEMORY_MANAGER(mMemoryType); - if(mData->mRef != 1 || mShared == true) { + HbMemoryManager *manager = memoryManager(); + if(mData->mRef != 1 || mShared) { copyData( newSize, oldSize ); // Here assumption is the new copy of data is created in heap. // so disabling the shared flag. - if(mShared) - mShared = false; + mShared = false; return (char*)mData->mStart.get() - (char*)manager->base(); } else { // this statement can throw @@ -676,19 +661,34 @@ } private : // Data - void deAllocateData() - { - GET_MEMORY_MANAGER(mMemoryType); - mData->deAllocateAll(mMemoryType); + static int createNullOffset(HbMemoryManager::MemoryType type) + { + GET_MEMORY_MANAGER(type); + int nullOffset(manager->alloc(sizeof(HbVectorData))); + HbVectorData* data = HbMemoryUtils::getAddress(type, nullOffset); + new(data) HbVectorData(type); + return nullOffset; + } + void deAllocateData() + { + HbMemoryManager *manager = memoryManager(); + mData->deAllocateAll(manager); int dataOffset = (char*) mData.get() - (char*)manager->base(); manager->free(dataOffset); mData = 0; - } + } + HbMemoryManager *memoryManager() + { + Q_ASSERT(memoryType() == HbMemoryManager::SharedMemory + || memoryType() == HbMemoryManager::HeapMemory); + return HbMemoryManager::instance(memoryType()); + } + struct HbVectorData { // The ctor of HbVectorData can throw owing to manager->alloc, we're not catching the exception // if any and simply allow to propagate it to caller. - HbVectorData(HbMemoryManager::MemoryType type, unsigned int size=0, unsigned int capacity = 0) + HbVectorData(HbMemoryManager::MemoryType type, unsigned int size = 0, unsigned int capacity = 0) : mStart(0,type), mSize(size), mCapacity(capacity), @@ -707,16 +707,15 @@ ~HbVectorData() { #ifdef HB_BIN_CSS - HbCssConverterUtils::unregisterOffsetHolder(mStart.offsetPtr()); + HbCssConverterUtils::unregisterOffsetHolder(mStart.offsetPtr()); #endif //HB_BIN_CSS - destroyAll(); + destroyAll(); } - void deAllocateAll(HbMemoryManager::MemoryType type) + void deAllocateAll(HbMemoryManager *manager) { if(!mCapacity) return; - GET_MEMORY_MANAGER(type); - int offset = (char*)mStart.get() - (char*)manager->base(); + int offset = (char*) mStart.get() - (char*) manager->base(); manager->free(offset); mStart = 0; mSize = 0; @@ -771,7 +770,6 @@ }; typedef smart_ptr DataPointer; DataPointer mData; - HbMemoryManager::MemoryType mMemoryType; bool mShared; }; @@ -783,8 +781,8 @@ { int offset = before - mData->mStart; if(count != 0) { - if(mShared || mData->mRef !=1 || mData->mSize + count > mData->mCapacity) { - GET_MEMORY_MANAGER(mMemoryType); + if(mShared || mData->mRef != 1 || mData->mSize + count > mData->mCapacity) { + HbMemoryManager *manager = memoryManager(); int offset = (char*)mData->mStart.get() - (char*)manager->base(); int newCapacity = mData->mSize + count; if(newCapacity < mData->mCapacity) { @@ -796,8 +794,9 @@ if(QTypeInfo::isStatic) { pointer b = mData->mStart + mData->mSize; pointer i = b + count; + HbMemoryManager::MemoryType memType = memoryType(); while(i != b) - new(--i) T(mMemoryType); + new(--i) T(memType); i = mData->mStart + mData->mSize; pointer j = i + count; b = mData->mStart + offset; @@ -833,7 +832,7 @@ mData->mStart[mData->mSize] = value; } } else { - GET_MEMORY_MANAGER(mMemoryType); + HbMemoryManager *manager = memoryManager(); int offset = (char*)mData->mStart.get() - (char*)manager->base(); #ifdef HB_BIN_CSS int capacity = (mData->mCapacity == 0) ? HbVectorDefaultCapacity : mData->mCapacity + 1; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbcssformatter_p.cpp --- a/src/hbcore/cssparser/hbcssformatter_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbcssformatter_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -66,7 +66,8 @@ /*! @internal */ -QString HbCssFormatter::weightedDeclarationsToString(const HbVector &decls) +QString HbCssFormatter::weightedDeclarationsToString( + const HbVector &decls) { QString str; #ifdef HB_DEVELOPER @@ -198,7 +199,10 @@ // Worker function -QString HbCssFormatter::styleRuleToHtml(const HbCss::StyleRule &rule, QVector usedDecls, int specificity) +QString HbCssFormatter::styleRuleToHtml( + const HbCss::StyleRule &rule, + QVector usedDecls, + int specificity) { QString str; #ifdef HB_DEVELOPER @@ -237,7 +241,10 @@ // Worker function -QString HbCssFormatter::selectorsToString(const HbVector &selectors, int specificity, bool html) +QString HbCssFormatter::selectorsToString( + const HbVector &selectors, + int specificity, + bool html) { QString str; #ifdef HB_DEVELOPER diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbcssformatter_p.h --- a/src/hbcore/cssparser/hbcssformatter_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbcssformatter_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,9 +39,13 @@ private: static QString styleRuleToString(const HbCss::StyleRule &rule, int specificity=-1); - static QString styleRuleToHtml(const HbCss::StyleRule &rule, QVector usedDecls, int specificity=-1); + static QString styleRuleToHtml( + const HbCss::StyleRule &rule, + QVector usedDecls, + int specificity=-1); static QString declarationToString(const HbCss::Declaration &decl, bool html=false); - static QString selectorsToString(const HbVector &selectors, int specificity=-1, bool html=false); + static QString selectorsToString( + const HbVector &selectors, int specificity=-1, bool html=false); static QString selectorToString(const HbCss::Selector &sel, bool html=false); }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbcssparser_p.cpp --- a/src/hbcore/cssparser/hbcssparser_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbcssparser_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -42,51 +42,12 @@ #include "hbcssscanner_p.cpp" #include "hbmemoryutils_p.h" #include "hblayeredstyleloader_p.h" +#include "hbthemeindex_p.h" using namespace HbCss; const QString GLOBAL_CSS_SELECTOR = "*"; -const char *Scanner::tokenName(HbCss::TokenType t) -{ - switch (t) { - case NONE: return "NONE"; - case S: return "S"; - case CDO: return "CDO"; - case CDC: return "CDC"; - case INCLUDES: return "INCLUDES"; - case DASHMATCH: return "DASHMATCH"; - case LBRACE: return "LBRACE"; - case PLUS: return "PLUS"; - case GREATER: return "GREATER"; - case COMMA: return "COMMA"; - case STRING: return "STRING"; - case INVALID: return "INVALID"; - case IDENT: return "IDENT"; - case HASH: return "HASH"; - case ATKEYWORD_SYM: return "ATKEYWORD_SYM"; - case EXCLAMATION_SYM: return "EXCLAMATION_SYM"; - case LENGTH: return "LENGTH"; - case PERCENTAGE: return "PERCENTAGE"; - case NUMBER: return "NUMBER"; - case FUNCTION: return "FUNCTION"; - case COLON: return "COLON"; - case SEMICOLON: return "SEMICOLON"; - case RBRACE: return "RBRACE"; - case SLASH: return "SLASH"; - case MINUS: return "MINUS"; - case DOT: return "DOT"; - case STAR: return "STAR"; - case LBRACKET: return "LBRACKET"; - case RBRACKET: return "RBRACKET"; - case EQUAL: return "EQUAL"; - case LPAREN: return "LPAREN"; - case RPAREN: return "RPAREN"; - case OR: return "OR"; - } - return ""; -} - struct HbCssKnownValue { const char *name; @@ -94,320 +55,107 @@ }; static const HbCssKnownValue properties[NumProperties - 1] = { - { "-qt-background-role", QtBackgroundRole }, - { "-qt-block-indent", QtBlockIndent }, - { "-qt-list-indent", QtListIndent }, - { "-qt-paragraph-type", QtParagraphType }, - { "-qt-style-features", QtStyleFeatures }, - { "-qt-table-type", QtTableType }, - { "-qt-user-state", QtUserState }, - { "alternate-background-color", QtAlternateBackground }, - { "aspect-ratio", HbAspectRatio }, - { "background", Background }, - { "background-attachment", BackgroundAttachment }, - { "background-clip", BackgroundClip }, - { "background-color", BackgroundColor }, - { "background-image", BackgroundImage }, - { "background-origin", BackgroundOrigin }, - { "background-position", BackgroundPosition }, - { "background-repeat", BackgroundRepeat }, - { "border", Border }, - { "border-bottom", BorderBottom }, - { "border-bottom-color", BorderBottomColor }, - { "border-bottom-left-radius", BorderBottomLeftRadius }, - { "border-bottom-right-radius", BorderBottomRightRadius }, - { "border-bottom-style", BorderBottomStyle }, - { "border-bottom-width", BorderBottomWidth }, - { "border-color", BorderColor }, - { "border-image", BorderImage }, - { "border-left", BorderLeft }, - { "border-left-color", BorderLeftColor }, - { "border-left-style", BorderLeftStyle }, - { "border-left-width", BorderLeftWidth }, - { "border-radius", BorderRadius }, - { "border-right", BorderRight }, - { "border-right-color", BorderRightColor }, - { "border-right-style", BorderRightStyle }, - { "border-right-width", BorderRightWidth }, - { "border-style", BorderStyles }, - { "border-top", BorderTop }, - { "border-top-color", BorderTopColor }, - { "border-top-left-radius", BorderTopLeftRadius }, - { "border-top-right-radius", BorderTopRightRadius }, - { "border-top-style", BorderTopStyle }, - { "border-top-width", BorderTopWidth }, - { "border-width", BorderWidth }, - { "bottom", Bottom }, - { "center-horizontal", HbCenterHorizontal }, - { "center-vertical", HbCenterVertical }, - { "color", Color }, - { "column-narrow-width", HbColumnNarrowWidth }, - { "column-wide-width", HbColumnWideWidth }, - { "fixed-height", HbFixedHeight }, - { "fixed-size", HbFixedSize }, - { "fixed-width", HbFixedWidth }, - { "float", Float }, - { "font", Font }, - { "font-family", FontFamily }, - { "font-size", FontSize }, - { "font-style", FontStyle }, - { "font-variant", FontVariant }, - { "font-weight", FontWeight }, - { "height", Height }, - { "icon-left-alignment-weight", HbIconLeftAlignmentWeight }, - { "image", QtImage }, - { "image-position", QtImageAlignment }, - { "indent", HbIndent }, - { "large-icon-size", HbLargeIconSize }, - { "layout", HbLayout }, - { "layout-direction", HbLayoutDirection }, - { "left", Left }, - { "list-style", ListStyle }, - { "list-style-type", ListStyleType }, - { "margin" , Margin }, - { "margin-bottom", MarginBottom }, - { "margin-left", MarginLeft }, - { "margin-right", MarginRight }, - { "margin-top", MarginTop }, - { "margin-top-weight", HbTopMarginWeight }, - { "max-height", MaximumHeight }, - { "max-size", HbMaximumSize }, - { "max-width", MaximumWidth }, - { "min-height", MinimumHeight }, - { "min-size", HbMinimumSize }, - { "min-width", MinimumWidth }, - { "mirroring", Mirroring }, // deprecated - { "outline", Outline }, - { "outline-bottom-left-radius", OutlineBottomLeftRadius }, - { "outline-bottom-right-radius", OutlineBottomRightRadius }, - { "outline-color", OutlineColor }, - { "outline-offset", OutlineOffset }, - { "outline-radius", OutlineRadius }, - { "outline-style", OutlineStyle }, - { "outline-top-left-radius", OutlineTopLeftRadius }, - { "outline-top-right-radius", OutlineTopRightRadius }, - { "outline-width", OutlineWidth }, - { "padding", Padding }, - { "padding-bottom", PaddingBottom }, - { "padding-left", PaddingLeft }, - { "padding-right", PaddingRight }, - { "padding-top", PaddingTop }, - { "page-break-after", PageBreakAfter }, - { "page-break-before", PageBreakBefore }, - { "position", Position }, - { "pref-height", HbPreferredHeight }, - { "pref-size", HbPreferredSize }, - { "pref-width", HbPreferredWidth }, - { "right", Right }, - { "section", HbSection }, - { "selection-background-color", QtSelectionBackground }, - { "selection-color", QtSelectionForeground }, - { "size-policy", HbSizePolicy }, - { "size-policy-horizontal", HbSizePolicyHorizontal }, - { "size-policy-vertical", HbSizePolicyVertical }, - { "small-icon-size", HbSmallIconSize }, - { "spacing", QtSpacing }, - { "spacing-horizontal", HbSpacingHorizontal }, - { "spacing-vertical", HbSpacingVertical }, - { "stretchable", HbStretchable }, - { "subcontrol-origin", QtOrigin }, - { "subcontrol-position", QtPosition }, - { "text-align", TextAlignment }, - { "text-decoration", TextDecoration }, - { "text-height", HbTextHeight }, - { "text-indent", TextIndent }, - { "text-line-count-max", HbTextLineCountMax }, - { "text-line-count-min", HbTextLineCountMin }, - { "text-transform", TextTransform }, - { "text-underline-style", TextUnderlineStyle }, - { "text-wrap-mode", HbTextWrapMode }, - { "top", Top }, - { "vertical-align", VerticalAlignment }, - { "white-space", Whitespace }, - { "width", Width }, - { "zvalue", ZValue } + { "alignment", Property_Alignment }, + { "anchor-direction", Property_AnchorDirection }, + { "aspect-ratio", Property_AspectRatio }, + { "border-width", Property_BorderWidth }, + { "border-width-bottom", Property_BorderWidthBottom }, + { "border-width-left", Property_BorderWidthLeft }, + { "border-width-right", Property_BorderWidthRight }, + { "border-width-top", Property_BorderWidthTop }, + { "bottom", Property_Bottom }, + { "center-horizontal", Property_CenterHorizontal }, + { "center-vertical", Property_CenterVertical }, + { "color", Property_Color }, + { "fixed-height", Property_FixedHeight }, + { "fixed-length", Property_FixedLength }, + { "fixed-size", Property_FixedSize }, + { "fixed-width", Property_FixedWidth }, + { "font", Property_Font }, + { "font-family", Property_FontFamily }, + { "font-size", Property_FontSize }, + { "font-style", Property_FontStyle }, + { "font-variant", Property_FontVariant }, + { "font-weight", Property_FontWeight }, + { "layout", Property_Layout }, + { "layout-direction", Property_LayoutDirection }, + { "left", Property_Left }, + { "max-height", Property_MaximumHeight }, + { "max-length", Property_MaximumLength }, + { "max-size", Property_MaximumSize }, + { "max-width", Property_MaximumWidth }, + { "min-height", Property_MinimumHeight }, + { "min-length", Property_MinimumLength }, + { "min-size", Property_MinimumSize }, + { "min-width", Property_MinimumWidth }, + { "pref-height", Property_PreferredHeight }, + { "pref-length", Property_PreferredLength }, + { "pref-size", Property_PreferredSize }, + { "pref-width", Property_PreferredWidth }, + { "right", Property_Right }, + { "section", Property_Section }, + { "size-policy", Property_SizePolicy }, + { "size-policy-horizontal", Property_SizePolicyHorizontal }, + { "size-policy-vertical", Property_SizePolicyVertical }, + { "text-align", Property_TextAlignment }, + { "text-decoration", Property_TextDecoration }, + { "text-height", Property_TextHeight }, + { "text-line-count-max", Property_TextLineCountMax }, + { "text-line-count-min", Property_TextLineCountMin }, + { "text-transform", Property_TextTransform }, + { "text-wrap-mode", Property_TextWrapMode }, + { "top", Property_Top }, + { "zvalue", Property_ZValue } }; static const HbCssKnownValue values[NumKnownValues - 1] = { - { "active", Value_Active }, - { "alternate-base", Value_AlternateBase }, - { "always", Value_Always }, - { "auto", Value_Auto }, - { "base", Value_Base }, { "bold", Value_Bold }, { "bottom", Value_Bottom }, - { "bright-text", Value_BrightText }, - { "button", Value_Button }, - { "button-text", Value_ButtonText }, { "center", Value_Center }, - { "circle", Value_Circle }, - { "dark", Value_Dark }, - { "dashed", Value_Dashed }, - { "decimal", Value_Decimal }, { "digital", Value_Digital }, - { "disabled", Value_Disabled }, - { "disc", Value_Disc }, - { "dot-dash", Value_DotDash }, - { "dot-dot-dash", Value_DotDotDash }, - { "dotted", Value_Dotted }, - { "double", Value_Double }, { "expanding", Value_Expanding }, { "fixed", Value_Fixed }, - { "groove", Value_Groove }, - { "highlight", Value_Highlight }, - { "highlighted-text", Value_HighlightedText }, { "ignore", Value_Ignore }, { "ignored", Value_Ignored }, - { "inset", Value_Inset }, { "italic", Value_Italic }, { "keep", Value_Keep }, { "keep-expand", Value_KeepExpand }, - { "large", Value_Large }, { "left", Value_Left }, { "left-to-right", Value_LeftToRight }, - { "light", Value_Light }, { "line-through", Value_LineThrough }, - { "link", Value_Link }, - { "link-visited", Value_LinkVisited }, - { "lower-alpha", Value_LowerAlpha }, { "lowercase", Value_Lowercase }, { "maximum", Value_Maximum }, - { "medium", Value_Medium }, - { "mid", Value_Mid }, - { "middle", Value_Middle }, - { "midlight", Value_Midlight }, { "minimum", Value_Minimum }, { "minimum-expanding", Value_MinimumExpanding }, - { "mirrored", Value_Mirrored }, // deprecated - { "native", Value_Native }, + { "negative", Value_Negative }, { "no-wrap", Value_NoWrap }, { "none", Value_None }, { "normal", Value_Normal }, { "oblique", Value_Oblique }, - { "off", Value_Off }, - { "on", Value_On }, - { "outset", Value_Outset }, { "overline", Value_Overline }, { "parent", Value_Parent }, - { "pre", Value_Pre }, + { "positive", Value_Positive }, { "preferred", Value_Preferred }, { "primary", Value_Primary }, { "primary-small", Value_PrimarySmall }, - { "ridge", Value_Ridge }, { "right", Value_Right }, { "right-to-left", Value_RightToLeft }, { "secondary", Value_Secondary }, - { "selected", Value_Selected }, - { "shadow", Value_Shadow }, - { "small" , Value_Small }, { "small-caps", Value_SmallCaps }, - { "solid", Value_Solid }, - { "square", Value_Square }, - { "sub", Value_Sub }, - { "super", Value_Super }, - { "text", Value_Text }, { "title", Value_Title }, { "top", Value_Top }, { "transparent", Value_Transparent }, { "underline", Value_Underline }, - { "upper-alpha", Value_UpperAlpha }, { "uppercase", Value_Uppercase }, - { "wave", Value_Wave }, - { "window", Value_Window }, - { "window-text", Value_WindowText }, { "word-wrap", Value_WordWrap }, - { "wrap-anywhere", Value_WrapAnywhere }, - { "x-large", Value_XLarge }, - { "xx-large", Value_XXLarge } + { "wrap-anywhere", Value_WrapAnywhere } }; static const HbCssKnownValue pseudos[NumPseudos - 1] = { - { "active", PseudoClass_Active }, - { "adjoins-item", PseudoClass_Item }, - { "alternate", PseudoClass_Alternate }, - { "bottom", PseudoClass_Bottom }, - { "checked", PseudoClass_Checked }, - { "closable", PseudoClass_Closable }, - { "closed", PseudoClass_Closed }, - { "default", PseudoClass_Default }, - { "disabled", PseudoClass_Disabled }, - { "edit-focus", PseudoClass_EditFocus }, - { "editable", PseudoClass_Editable }, - { "enabled", PseudoClass_Enabled }, - { "exclusive", PseudoClass_Exclusive }, - { "first", PseudoClass_First }, - { "flat", PseudoClass_Flat }, - { "floatable", PseudoClass_Floatable }, - { "focus", PseudoClass_Focus }, - { "has-children", PseudoClass_Children }, - { "has-siblings", PseudoClass_Sibling }, - { "horizontal", PseudoClass_Horizontal }, - { "hover", PseudoClass_Hover }, - { "indeterminate" , PseudoClass_Indeterminate }, { "landscape", PseudoClass_Landscape }, - { "last", PseudoClass_Last }, - { "left", PseudoClass_Left }, { "left-to-right", PseudoClass_LeftToRight }, - { "maximized", PseudoClass_Maximized }, - { "middle", PseudoClass_Middle }, - { "minimized", PseudoClass_Minimized }, - { "movable", PseudoClass_Movable }, - { "next-selected", PseudoClass_NextSelected }, - { "no-frame", PseudoClass_Frameless }, - { "non-exclusive", PseudoClass_NonExclusive }, - { "off", PseudoClass_Unchecked }, - { "on", PseudoClass_Checked }, - { "only-one", PseudoClass_OnlyOne }, - { "open", PseudoClass_Open }, { "portrait", PseudoClass_Portrait }, - { "pressed", PseudoClass_Pressed }, - { "previous-selected", PseudoClass_PreviousSelected }, - { "read-only", PseudoClass_ReadOnly }, - { "right", PseudoClass_Right }, - { "right-to-left", PseudoClass_RightToLeft }, - { "selected", PseudoClass_Selected }, - { "top", PseudoClass_Top }, - { "unchecked" , PseudoClass_Unchecked }, - { "vertical", PseudoClass_Vertical }, - { "window", PseudoClass_Window } -}; - -static const HbCssKnownValue origins[NumKnownOrigins - 1] = { - { "border", Origin_Border }, - { "content", Origin_Content }, - { "margin", Origin_Margin }, // not in css - { "padding", Origin_Padding } -}; - -static const HbCssKnownValue repeats[NumKnownRepeats - 1] = { - { "no-repeat", Repeat_None }, - { "repeat-x", Repeat_X }, - { "repeat-xy", Repeat_XY }, - { "repeat-y", Repeat_Y } -}; - -static const HbCssKnownValue tileModes[NumKnownTileModes - 1] = { - { "repeat", TileMode_Repeat }, - { "round", TileMode_Round }, - { "stretch", TileMode_Stretch }, -}; - -static const HbCssKnownValue positions[NumKnownPositionModes - 1] = { - { "absolute", PositionMode_Absolute }, - { "fixed", PositionMode_Fixed }, - { "relative", PositionMode_Relative }, - { "static", PositionMode_Static } -}; - -static const HbCssKnownValue attachments[NumKnownAttachments - 1] = { - { "fixed", Attachment_Fixed }, - { "scroll", Attachment_Scroll } -}; - -static const HbCssKnownValue styleFeatures[NumKnownStyleFeatures - 1] = { - { "background-color", StyleFeature_BackgroundColor }, - { "background-gradient", StyleFeature_BackgroundGradient }, - { "none", StyleFeature_None } + { "right-to-left", PseudoClass_RightToLeft } }; inline bool operator<(const QString &name, const HbCssKnownValue &prop) @@ -432,19 +180,24 @@ #ifndef HB_BIN_CSS /////////////////////////////////////////////////////////////////////////////// // Value Extractor -ValueExtractor::ValueExtractor(const HbVector &decls, const HbDeviceProfile &profile, const QPalette &pal) -: declarations(decls), adjustment(0), fontExtracted(false), pal(pal), currentProfile(profile) +ValueExtractor::ValueExtractor(const HbVector &decls, const HbDeviceProfile &profile) +: declarations(decls), currentProfile(profile) { } -ValueExtractor::ValueExtractor(const HbVector &decls, const QHash &varDeclarations, - const HbDeviceProfile &profile, const QPalette &pal) -: declarations(decls), variableDeclarationsHash(varDeclarations), adjustment(0), - fontExtracted(false), pal(pal), currentProfile(profile) +ValueExtractor::ValueExtractor( + const HbVector &decls, + const QHash &varDeclarations, + const HbDeviceProfile &profile) +: declarations(decls), variableDeclarationsHash(varDeclarations), currentProfile(profile) { } -ValueExtractor::ValueExtractor(const HbVector &varDecls, bool isVariable, const HbDeviceProfile &profile) -: variableDeclarations(varDecls), adjustment(0), fontExtracted(false), currentProfile(profile) +ValueExtractor::ValueExtractor( + const HbVector &varDecls, + bool isVariable, + const HbDeviceProfile &profile) +: variableDeclarations(varDecls), currentProfile(profile) { Q_UNUSED(isVariable) // Initialize to some profile. @@ -453,8 +206,12 @@ } } -ValueExtractor::ValueExtractor(const QHash &varDecls, bool isVariable, const HbDeviceProfile &profile) -: variableDeclarationsHash(varDecls), adjustment(0), fontExtracted(false), currentProfile(profile) +ValueExtractor::ValueExtractor( + const QHash &varDecls, + bool isVariable, + const HbDeviceProfile &profile) +: variableDeclarationsHash(varDecls), currentProfile(profile) { Q_UNUSED(isVariable) // Initialize to some profile. @@ -463,12 +220,7 @@ } } -int ValueExtractor::lengthValue(const Value& v) -{ - return qRound(asReal(v)); -} - -qreal ValueExtractor::asReal(const Value& v) +qreal ValueExtractor::asReal(const Value& v, bool *ok) { QString s = v.variant.toString(); s.reserve(s.length()); @@ -479,19 +231,32 @@ extractExpressionValue(s, value); return factor * value; } - - return asReal(s, v.type); + return asReal(s, v.type, ok); } -qreal ValueExtractor::asReal(QString &s, Value::Type type) +qreal ValueExtractor::asReal(QString &s, Value::Type type, bool *ok) { + if (ok) { + *ok = true; + } + if (type == Value::Variable || type == Value::VariableNegative) { qreal factor = (type == Value::Variable) ? 1.0 : -1.0; HbVector values; - if (extractValue(s, values)) - return factor * asReal(values.first()); + if (extractVariableValue(s, values)) + return factor * asReal(values.first(), ok); else + if (ok) { + *ok = false; + } return 0; + } else if (type == Value::Percentage) { + qreal result = s.toDouble(ok) /100.0; + if (ok && !(*ok)) { + return 0; + } else { + return result; + } } enum { None, Px, Un, Mm } unit = None; @@ -508,9 +273,8 @@ s.chop(2); } - bool ok; - qreal result = s.toDouble(&ok); - if (!ok) { + qreal result = s.toDouble(ok); + if (ok && !(*ok)) { return 0; } @@ -522,76 +286,37 @@ return result; } -bool ValueExtractor::asReal(QString &s, qreal &value) +qreal ValueExtractor::asReal(const Declaration &decl, bool *ok) { - enum { None, Px, Un, Mm } unit = None; - if (s.endsWith(QLatin1String("un"), Qt::CaseInsensitive)) { - unit = Un; - } else if (s.endsWith(QLatin1String("px"), Qt::CaseInsensitive)) { - unit = Px; - } else if (s.endsWith(QLatin1String("mm"), Qt::CaseInsensitive)) { - unit = Mm; + if (decl.values.count() < 1) { + if (ok) { + *ok = false; + } + return 0; } - - if (unit != None) { - // Assuming all unit identifiers have two characters - s.chop(2); - } - - bool ok; - value = s.toDouble(&ok); - if (!ok) { - return false; - } - - if (unit == Un) { - value = currentProfile.unitValue() * value; - } else if (unit == Mm) { - value = currentProfile.ppmValue() * value; - } // else -> already in pixels - return true; + return asReal(decl.values.first(), ok); } -qreal ValueExtractor::asReal(const Declaration &decl) +bool ValueExtractor::asReals(const Declaration &decl, qreal *m) { - if (decl.values.count() < 1) - return 0; - return asReal(decl.values.first()); -} - - -void ValueExtractor::asReals(const Declaration &decl, qreal *m) -{ + bool ok = true; int i; - for (i = 0; i < qMin(decl.values.count(), 4); i++) - m[i] = asReal(decl.values[i]); + for (i = 0; i < qMin(decl.values.count(), 4); i++) { + m[i] = asReal(decl.values[i], &ok); + if (!ok) { + return false; + } + } if (i == 0) m[0] = m[1] = m[2] = m[3] = 0; else if (i == 1) m[3] = m[2] = m[1] = m[0]; else if (i == 2) m[2] = m[0], m[3] = m[1]; else if (i == 3) m[3] = m[1]; -} -bool ValueExtractor::asBool(const Declaration &decl) -{ - if (decl.values.size()) { - bool result = (decl.values.at(0).variant.toString() == QString("true")); - return result; - } - return false; + return true; } -QSizePolicy ValueExtractor::asSizePolicy(const Declaration &decl) -{ - QSizePolicy pol; - if (decl.values.count() > 0) - pol.setHorizontalPolicy(asPolicy(decl.values.at(0))); - if (decl.values.count() > 1) - pol.setHorizontalPolicy(asPolicy(decl.values.at(1))); - return pol; -} - -QSizePolicy::Policy ValueExtractor::asPolicy(const Value& v) +static QSizePolicy::Policy parseSizePolicy(const Value& v) { QSizePolicy::Policy pol(QSizePolicy::Preferred); switch (v.variant.toInt()) @@ -608,101 +333,6 @@ return pol; } -int ValueExtractor::lengthValue(const Declaration &decl) -{ - if (decl.values.count() < 1) - return 0; - return lengthValue(decl.values.first()); -} - -void ValueExtractor::lengthValues(const Declaration &decl, int *m) -{ - int i; - for (i = 0; i < qMin(decl.values.count(), 4); i++) - m[i] = lengthValue(decl.values[i]); - - if (i == 0) m[0] = m[1] = m[2] = m[3] = 0; - else if (i == 1) m[3] = m[2] = m[1] = m[0]; - else if (i == 2) m[2] = m[0], m[3] = m[1]; - else if (i == 3) m[3] = m[1]; -} - -bool ValueExtractor::extractGeometry(GeometryValues &geomValues) -{ - GeometryValueFlags flags(0); - extractFont(); - bool hit = false; - for (int i = 0; i < declarations.count(); i++) { - const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case MinimumWidth: geomValues.mMinW = asReal(decl); flags|=ExtractedMinW; break; - case MinimumHeight: geomValues.mMinH = asReal(decl); flags|=ExtractedMinH; break; - case MaximumWidth: geomValues.mMaxW = asReal(decl); flags|=ExtractedMaxW; break; - case MaximumHeight: geomValues.mMaxH = asReal(decl); flags|=ExtractedMaxH; break; - case HbPreferredWidth: geomValues.mPrefW = asReal(decl); flags|=ExtractedPrefW; break; - case HbPreferredHeight: geomValues.mPrefH = asReal(decl); flags|=ExtractedPrefH; break; - case HbFixedWidth: - geomValues.mPrefW = asReal(decl); flags|=ExtractedPrefW; - geomValues.mSizePolicy.setHorizontalPolicy(QSizePolicy::Fixed); flags|=ExtractedPolHor; - break; - case HbFixedHeight: - geomValues.mPrefH = asReal(decl); flags|=ExtractedPrefH; - geomValues.mSizePolicy.setVerticalPolicy(QSizePolicy::Fixed); flags|=ExtractedPolVer; - break; - case HbSizePolicy: - geomValues.mSizePolicy.setHorizontalPolicy(asPolicy(decl.values.at(0))); - if (decl.values.count() > 1) { - geomValues.mSizePolicy.setVerticalPolicy(asPolicy(decl.values.at(1))); - } else { - geomValues.mSizePolicy.setVerticalPolicy(asPolicy(decl.values.at(0))); - } - flags|=ExtractedPolHor; - flags|=ExtractedPolVer; - break; - case HbSizePolicyHorizontal: - geomValues.mSizePolicy.setHorizontalPolicy(asPolicy(decl.values.at(0))); - flags|=ExtractedPolHor; - break; - case HbSizePolicyVertical: - geomValues.mSizePolicy.setVerticalPolicy(asPolicy(decl.values.at(0))); - flags|=ExtractedPolVer; - break; - case HbMinimumSize: - geomValues.mMinW = asReal(decl.values.at(0)); - geomValues.mMinH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : geomValues.mMinW; - flags|=ExtractedMinW; - flags|=ExtractedMinH; - break; - case HbMaximumSize: - geomValues.mMaxW = asReal(decl.values.at(0)); - geomValues.mMaxH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : geomValues.mMaxW; - flags|=ExtractedMaxW; - flags|=ExtractedMaxH; - break; - case HbPreferredSize: - geomValues.mPrefW = asReal(decl.values.at(0)); - geomValues.mPrefH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : geomValues.mPrefW; - flags|=ExtractedPrefW; - flags|=ExtractedPrefH; - break; - case HbFixedSize: - geomValues.mPrefW = asReal(decl.values.at(0)); - geomValues.mPrefH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : geomValues.mPrefW; - geomValues.mSizePolicy.setHorizontalPolicy(QSizePolicy::Fixed); - geomValues.mSizePolicy.setVerticalPolicy(QSizePolicy::Fixed); - flags|=ExtractedPrefW; - flags|=ExtractedPrefH; - flags|=ExtractedPolHor; - flags|=ExtractedPolVer; - break; - default: continue; - } - hit = true; - } - geomValues.mFlags = flags; - return hit; -} - static HbCss::LayoutDirection parseLayoutDirectionValue(const Value v) { HbCss::LayoutDirection retVal(HbCss::LayoutDirection_Parent); // Parent as default @@ -712,11 +342,9 @@ retVal = HbCss::LayoutDirection_RightToLeft; break; case Value_LeftToRight: - case Value_Disabled: // legacy support retVal = HbCss::LayoutDirection_LeftToRight; break; case Value_Parent: - case Value_Mirrored: // legacy support default: break; } @@ -724,213 +352,47 @@ return retVal; } -bool ValueExtractor::extractPosition(PositionValues &posValues) +static Qt::AspectRatioMode parseAspectRatioMode(const Value& v) { - PositionValueFlags flags(0); - extractFont(); - bool hit = false; - for (int i = 0; i < declarations.count(); i++) { - const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case Left: posValues.mLeft = asReal(decl); flags|=ExtractedLeft; break; - case Top: posValues.mTop = asReal(decl); flags|=ExtractedTop; break; - case Right: posValues.mRight = asReal(decl); flags|=ExtractedRight; break; - case Bottom: posValues.mBottom = asReal(decl); flags|=ExtractedBottom; break; - case HbCenterHorizontal: posValues.mCenterH = asReal(decl); flags|=ExtractedCenterH; break; - case HbCenterVertical: posValues.mCenterV = asReal(decl); flags|=ExtractedCenterV; break; - case QtOrigin: posValues.mOrigin = decl.originValue(); flags|=ExtractedOrigin; break; - case QtPosition: posValues.mPosition = decl.alignmentValue(); flags|=ExtractedAlign; break; - case TextAlignment: posValues.mTextAlignment = decl.alignmentValue(); flags|=ExtractedTextAlign; break; - case Position: posValues.mPositionMode = decl.positionValue(); flags|=ExtractedMode; break; - case HbLayoutDirection: - case Mirroring: - posValues.mLayoutDirection = parseLayoutDirectionValue(decl.values.at(0)); - flags|=ExtractedLayoutDirection; - break; - case ZValue: posValues.mZ = asReal(decl); flags|=ExtractedZValue; break; - case HbTextWrapMode: posValues.mTextWrapMode = decl.wrapModeValue(); flags|=ExtractedWrapMode; break; - default: continue; - } - hit = true; - } - posValues.mFlags = flags; - return hit; -} - -bool ValueExtractor::extractTextValues( TextValues &textValues ) -{ - textValues.mFlags = 0; - bool hit = false; - for (int i = 0; i < declarations.count(); i++) { - const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case HbTextLineCountMin: textValues.mLineCountMin = decl.values.first().variant.toInt(); textValues.mFlags|=ExtractedLineCountMin; break; - case HbTextLineCountMax: textValues.mLineCountMax = decl.values.first().variant.toInt(); textValues.mFlags|=ExtractedLineCountMax; break; - default: continue; - } - hit = true; + Qt::AspectRatioMode mode = Qt::KeepAspectRatio; + switch (v.variant.toInt()) { + case Value_Ignore: + mode = Qt::IgnoreAspectRatio; + break; + case Value_KeepExpand: + mode = Qt::KeepAspectRatioByExpanding; + break; + case Value_Keep: + default: + break; } - return hit; -} - -bool ValueExtractor::extractBox(qreal *margins, qreal *paddings, qreal *spacing) -{ - extractFont(); - bool hit = false; - for (int i = 0; i < declarations.count(); i++) { - const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case PaddingLeft: paddings[LeftEdge] = asReal(decl); break; - case PaddingRight: paddings[RightEdge] = asReal(decl); break; - case PaddingTop: paddings[TopEdge] = asReal(decl); break; - case PaddingBottom: paddings[BottomEdge] = asReal(decl); break; - case Padding: asReals(decl, paddings); break; - - case MarginLeft: margins[LeftEdge] = asReal(decl); break; - case MarginRight: margins[RightEdge] = asReal(decl); break; - case MarginTop: margins[TopEdge] = asReal(decl); break; - case MarginBottom: margins[BottomEdge] = asReal(decl); break; - case Margin: asReals(decl, margins); break; - case QtSpacing: if (spacing) *spacing = asReal(decl); break; - - default: continue; - } - hit = true; - } - - return hit; -} - -int ValueExtractor::extractStyleFeatures() -{ - int features = StyleFeature_None; - for (int i = 0; i < declarations.count(); i++) { - const Declaration &decl = declarations.at(i); - if (decl.propertyId == QtStyleFeatures) - features = decl.styleFeaturesValue(); - } - return features; -} - -QSize ValueExtractor::sizeValue(const Declaration &decl) -{ - int x[2] = { 0, 0 }; - if (decl.values.count() > 0) - x[0] = lengthValue(decl.values.at(0)); - if (decl.values.count() > 1) - x[1] = lengthValue(decl.values.at(1)); - else - x[1] = x[0]; - return QSize(x[0], x[1]); + return mode; } -void ValueExtractor::sizeValues(const Declaration &decl, QSize *radii) +static HbAnchor::Direction parseAnchorDirection(const Value& v) { - radii[0] = sizeValue(decl); - for (int i = 1; i < 4; i++) - radii[i] = radii[0]; + HbAnchor::Direction dir = HbAnchor::Positive; + switch (v.variant.toInt()) { + case Value_Negative: + dir = HbAnchor::Negative; + break; + case Value_Positive: + default: + break; + } + return dir; } -bool ValueExtractor::extractBorder(qreal *borders, QBrush *colors, BorderStyle *styles, - QSize *radii) +static Qt::Alignment parseAlignment(const Declaration &decl) { - extractFont(); - bool hit = false; - for (int i = 0; i < declarations.count(); i++) { - const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case BorderLeftWidth: borders[LeftEdge] = asReal(decl); break; - case BorderRightWidth: borders[RightEdge] = asReal(decl); break; - case BorderTopWidth: borders[TopEdge] = asReal(decl); break; - case BorderBottomWidth: borders[BottomEdge] = asReal(decl); break; - case BorderWidth: asReals(decl, borders); break; - - case BorderLeftColor: colors[LeftEdge] = decl.brushValue(pal); break; - case BorderRightColor: colors[RightEdge] = decl.brushValue(pal); break; - case BorderTopColor: colors[TopEdge] = decl.brushValue(pal); break; - case BorderBottomColor: colors[BottomEdge] = decl.brushValue(pal); break; - case BorderColor: decl.brushValues(colors, pal); break; + if (decl.values.isEmpty() || decl.values.count() > 2) + return Qt::AlignLeft | Qt::AlignTop; - case BorderTopStyle: styles[TopEdge] = decl.styleValue(); break; - case BorderBottomStyle: styles[BottomEdge] = decl.styleValue(); break; - case BorderLeftStyle: styles[LeftEdge] = decl.styleValue(); break; - case BorderRightStyle: styles[RightEdge] = decl.styleValue(); break; - case BorderStyles: decl.styleValues(styles); break; - - case BorderTopLeftRadius: radii[0] = sizeValue(decl); break; - case BorderTopRightRadius: radii[1] = sizeValue(decl); break; - case BorderBottomLeftRadius: radii[2] = sizeValue(decl); break; - case BorderBottomRightRadius: radii[3] = sizeValue(decl); break; - case BorderRadius: sizeValues(decl, radii); break; - - case BorderLeft: - borderValue(decl, &borders[LeftEdge], &styles[LeftEdge], &colors[LeftEdge]); - break; - case BorderTop: - borderValue(decl, &borders[TopEdge], &styles[TopEdge], &colors[TopEdge]); - break; - case BorderRight: - borderValue(decl, &borders[RightEdge], &styles[RightEdge], &colors[RightEdge]); - break; - case BorderBottom: - borderValue(decl, &borders[BottomEdge], &styles[BottomEdge], &colors[BottomEdge]); - break; - case Border: - borderValue(decl, &borders[LeftEdge], &styles[LeftEdge], &colors[LeftEdge]); - borders[TopEdge] = borders[RightEdge] = borders[BottomEdge] = borders[LeftEdge]; - styles[TopEdge] = styles[RightEdge] = styles[BottomEdge] = styles[LeftEdge]; - colors[TopEdge] = colors[RightEdge] = colors[BottomEdge] = colors[LeftEdge]; + Qt::Alignment a[2] = { 0, 0 }; + for (int i = 0; i < qMin(2, decl.values.count()); i++) { + if (decl.values.at(i).type != Value::KnownIdentifier) break; - - default: continue; - } - hit = true; - } - - return hit; -} - -bool ValueExtractor::extractOutline(qreal *borders, QBrush *colors, BorderStyle *styles, - QSize *radii, qreal *offsets) -{ - extractFont(); - bool hit = false; - for (int i = 0; i < declarations.count(); i++) { - const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case OutlineWidth: asReals(decl, borders); break; - case OutlineColor: decl.brushValues(colors, pal); break; - case OutlineStyle: decl.styleValues(styles); break; - - case OutlineTopLeftRadius: radii[0] = sizeValue(decl); break; - case OutlineTopRightRadius: radii[1] = sizeValue(decl); break; - case OutlineBottomLeftRadius: radii[2] = sizeValue(decl); break; - case OutlineBottomRightRadius: radii[3] = sizeValue(decl); break; - case OutlineRadius: sizeValues(decl, radii); break; - case OutlineOffset: asReals(decl, offsets); break; - - case Outline: - borderValue(decl, &borders[LeftEdge], &styles[LeftEdge], &colors[LeftEdge]); - borders[TopEdge] = borders[RightEdge] = borders[BottomEdge] = borders[LeftEdge]; - styles[TopEdge] = styles[RightEdge] = styles[BottomEdge] = styles[LeftEdge]; - colors[TopEdge] = colors[RightEdge] = colors[BottomEdge] = colors[LeftEdge]; - break; - - default: continue; - } - hit = true; - } - - return hit; -} -#endif -static Qt::Alignment parseAlignment(const Value *values, int count) -{ - Qt::Alignment a[2] = { 0, 0 }; - for (int i = 0; i < qMin(2, count); i++) { - if (values[i].type != Value::KnownIdentifier) - break; - switch (values[i].variant.toInt()) { + switch (decl.values.at(i).variant.toInt()) { case Value_Left: a[i] = Qt::AlignLeft; break; case Value_Right: a[i] = Qt::AlignRight; break; case Value_Top: a[i] = Qt::AlignTop; break; @@ -941,9 +403,11 @@ } if (a[0] == Qt::AlignCenter && a[1] != 0 && a[1] != Qt::AlignCenter) - a[0] = (a[1] == Qt::AlignLeft || a[1] == Qt::AlignRight) ? Qt::AlignVCenter : Qt::AlignHCenter; + a[0] = (a[1] == Qt::AlignLeft || + a[1] == Qt::AlignRight) ? Qt::AlignVCenter : Qt::AlignHCenter; if ((a[1] == 0 || a[1] == Qt::AlignCenter) && a[0] != Qt::AlignCenter) - a[1] = (a[0] == Qt::AlignLeft || a[0] == Qt::AlignRight) ? Qt::AlignVCenter : Qt::AlignHCenter; + a[1] = (a[0] == Qt::AlignLeft || + a[0] == Qt::AlignRight) ? Qt::AlignVCenter : Qt::AlignHCenter; return a[0] | a[1]; } @@ -961,7 +425,322 @@ return mode; } -static QColor parseColorValue(Value v, const QPalette &pal) +static bool setFontSizeFromValue(Value value, QFont &font) +{ + if (value.type != Value::Length) + return false; + + bool valid = false; + QString s = value.variant.toString(); + if (s.endsWith(QLatin1String("pt"), Qt::CaseInsensitive)) { + s.chop(2); + value.variant = s; + if (value.variant.convert(HbVariant::Double)) { + font.setPointSizeF(value.variant.toDouble()); + valid = true; + } + } else if (s.endsWith(QLatin1String("px"), Qt::CaseInsensitive)) { + s.chop(2); + value.variant = s; + if (value.variant.convert(HbVariant::Int)) { + font.setPixelSize(value.variant.toInt()); + valid = true; + } + } + return valid; +} + +static bool setFontStyleFromValue(const Value &value, QFont &font) +{ + if (value.type != Value::KnownIdentifier) + return false ; + switch (value.variant.toInt()) { + case Value_Normal: font.setStyle(QFont::StyleNormal); return true; + case Value_Italic: font.setStyle(QFont::StyleItalic); return true; + case Value_Oblique: font.setStyle(QFont::StyleOblique); return true; + default: break; + } + return false; +} + +static bool setFontWeightFromValue(const Value &value, QFont &font) +{ + if (value.type == Value::KnownIdentifier) { + switch (value.variant.toInt()) { + case Value_Normal: font.setWeight(QFont::Normal); return true; + case Value_Bold: font.setWeight(QFont::Bold); return true; + default: break; + } + return false; + } + if (value.type != Value::Number) + return false; + font.setWeight(qMin(value.variant.toInt() / 8, 99)); + return true; +} + +static bool setFontFamilyFromValues(const Declaration &decl, QFont &font) +{ + QString family; + for (int i = 0; i < decl.values.count(); ++i) { + const Value &v = decl.values.at(i); + if (v.type == Value::TermOperatorComma) + break; + const QString str = v.variant.toString(); + if (str.isEmpty()) + break; + family += str; + family += QLatin1Char(' '); + } + family = family.simplified(); + if (family.isEmpty()) + return false; + font.setFamily(family); + return true; +} + +static void setTextDecorationFromValues(const Declaration &decl, QFont &font) +{ + for (int i = 0; i < decl.values.count(); ++i) { + if (decl.values.at(i).type != Value::KnownIdentifier) + continue; + switch (decl.values.at(i).variant.toInt()) { + case Value_Underline: font.setUnderline(true); break; + case Value_Overline: font.setOverline(true); break; + case Value_LineThrough: font.setStrikeOut(true); break; + case Value_None: + font.setUnderline(false); + font.setOverline(false); + font.setStrikeOut(false); + break; + default: break; + } + } +} + +static void parseShorthandFontProperty(const Declaration &decl, QFont &font) +{ + font.setStyle(QFont::StyleNormal); + font.setWeight(QFont::Normal); + + int i = 0; + while (i < decl.values.count()) { + if (setFontStyleFromValue(decl.values.at(i), font) + || setFontWeightFromValue(decl.values.at(i), font)) + ++i; + else + break; + } + + if (i < decl.values.count()) { + setFontSizeFromValue(decl.values.at(i), font); + ++i; + } + + if (i < decl.values.count()) { + QString fam = decl.values.at(i).variant.toString(); + if (!fam.isEmpty()) + font.setFamily(fam); + } +} + +static void setFontVariantFromValue(const Value &value, HbFontSpec &fontSpec, QFont &font ) +{ + // Sets font variants. Some set the fontspec and some the HbFontSpec + HbFontSpec::Role role( HbFontSpec::Undefined ); + if (value.type == Value::KnownIdentifier) { + switch (value.variant.toInt()) { + case Value_Normal: font.setCapitalization(QFont::MixedCase); break; + case Value_SmallCaps: font.setCapitalization(QFont::SmallCaps); break; + case Value_Primary: role = HbFontSpec::Primary; break; + case Value_Secondary: role = HbFontSpec::Secondary; break; + case Value_Title: role = HbFontSpec::Title; break; + case Value_PrimarySmall: role = HbFontSpec::PrimarySmall; break; + case Value_Digital: role = HbFontSpec::Digital; break; + default: break; + } + } + if (role != HbFontSpec::Undefined) { + fontSpec.setRole( role ); + } +} + +static void setTextTransformFromValue(const Value &value, QFont &font) +{ + if (value.type == Value::KnownIdentifier) { + switch (value.variant.toInt()) { + case Value_None: font.setCapitalization(QFont::MixedCase); break; + case Value_Uppercase: font.setCapitalization(QFont::AllUppercase); break; + case Value_Lowercase: font.setCapitalization(QFont::AllLowercase); break; + default: break; + } + } +} + +bool ValueExtractor::extractKnownProperties(KnownProperties &prop) +{ + KnownPropertyFlags flags(0); + bool hit = false; + bool tphSet = false; + + // Initialize border prop to zero + prop.mBorderWidths[TopEdge] = 0.0; + prop.mBorderWidths[RightEdge] = 0.0; + prop.mBorderWidths[BottomEdge] = 0.0; + prop.mBorderWidths[LeftEdge] = 0.0; + + // Initialize font prop + prop.mFont = QFont(); + prop.mFontSpec = HbFontSpec(); + + for (int i = 0; i < declarations.count(); i++) { + const Declaration &decl = declarations.at(i); + switch (decl.propertyId) { + case Property_MinimumWidth: prop.mMinW = asReal(decl); flags|=ExtractedMinW; break; + case Property_MinimumLength: // fall-through + case Property_MinimumHeight: prop.mMinH = asReal(decl); flags|=ExtractedMinH; break; + case Property_MaximumWidth: prop.mMaxW = asReal(decl); flags|=ExtractedMaxW; break; + case Property_MaximumLength: // fall-through + case Property_MaximumHeight: prop.mMaxH = asReal(decl); flags|=ExtractedMaxH; break; + case Property_PreferredWidth: prop.mPrefW = asReal(decl); flags|=ExtractedPrefW; break; + case Property_PreferredLength: // fall-through + case Property_PreferredHeight: prop.mPrefH = asReal(decl); flags|=ExtractedPrefH; break; + case Property_FixedWidth: + prop.mPrefW = asReal(decl); flags|=ExtractedPrefW; + prop.mSizePolicy.setHorizontalPolicy(QSizePolicy::Fixed); flags|=ExtractedPolHor; + break; + case Property_FixedLength: // fall-through + case Property_FixedHeight: + prop.mPrefH = asReal(decl); flags|=ExtractedPrefH; + prop.mSizePolicy.setVerticalPolicy(QSizePolicy::Fixed); flags|=ExtractedPolVer; + if (!tphSet) { + // legacy support. deprecated. + prop.mFontSpec.setTextHeight(asReal(decl)); + } + break; + case Property_SizePolicy: + prop.mSizePolicy.setHorizontalPolicy(parseSizePolicy(decl.values.at(0))); + if (decl.values.count() > 1) { + prop.mSizePolicy.setVerticalPolicy(parseSizePolicy(decl.values.at(1))); + } else { + prop.mSizePolicy.setVerticalPolicy(prop.mSizePolicy.horizontalPolicy()); + } + flags|=ExtractedPolHor; + flags|=ExtractedPolVer; + break; + case Property_SizePolicyHorizontal: + prop.mSizePolicy.setHorizontalPolicy(parseSizePolicy(decl.values.at(0))); + flags|=ExtractedPolHor; + break; + case Property_SizePolicyVertical: + prop.mSizePolicy.setVerticalPolicy(parseSizePolicy(decl.values.at(0))); + flags|=ExtractedPolVer; + break; + case Property_MinimumSize: + prop.mMinW = asReal(decl.values.at(0)); + prop.mMinH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : prop.mMinW; + flags|=ExtractedMinW; + flags|=ExtractedMinH; + break; + case Property_MaximumSize: + prop.mMaxW = asReal(decl.values.at(0)); + prop.mMaxH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : prop.mMaxW; + flags|=ExtractedMaxW; + flags|=ExtractedMaxH; + break; + case Property_PreferredSize: + prop.mPrefW = asReal(decl.values.at(0)); + prop.mPrefH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : prop.mPrefW; + flags|=ExtractedPrefW; + flags|=ExtractedPrefH; + break; + case Property_FixedSize: + prop.mPrefW = asReal(decl.values.at(0)); + prop.mPrefH = (decl.values.count() > 1) ? asReal(decl.values.at(1)) : prop.mPrefW; + prop.mSizePolicy.setHorizontalPolicy(QSizePolicy::Fixed); + prop.mSizePolicy.setVerticalPolicy(QSizePolicy::Fixed); + flags|=ExtractedPrefW; + flags|=ExtractedPrefH; + flags|=ExtractedPolHor; + flags|=ExtractedPolVer; + break; + + case Property_Left: prop.mLeft = asReal(decl); flags|=ExtractedLeft; break; + case Property_Top: prop.mTop = asReal(decl); flags|=ExtractedTop; break; + case Property_Right: prop.mRight = asReal(decl); flags|=ExtractedRight; break; + case Property_Bottom: prop.mBottom = asReal(decl); flags|=ExtractedBottom; break; + case Property_CenterHorizontal: + prop.mCenterH = asReal(decl); flags|=ExtractedCenterH; break; + case Property_CenterVertical: + prop.mCenterV = asReal(decl); flags|=ExtractedCenterV; break; + + case Property_LayoutDirection: // fall-through + prop.mLayoutDir = parseLayoutDirectionValue(decl.values.at(0)); + flags|=ExtractedLayoutDir; + break; + + case Property_Alignment: + case Property_TextAlignment: + prop.mAlignment = parseAlignment(decl); flags|=ExtractedAlignment; break; + case Property_TextLineCountMin: + prop.mMinLines = decl.values.first().variant.toInt(); flags|=ExtractedMinLines; break; + case Property_TextLineCountMax: + prop.mMaxLines = decl.values.first().variant.toInt(); flags|=ExtractedMaxLines; break; + case Property_TextWrapMode: + prop.mTextWrapMode = parseWrapMode(decl.values.at(0)); flags|=ExtractedWrapMode; break; + case Property_ZValue: prop.mZ = + asReal(decl); flags|=ExtractedZValue; break; + + case Property_BorderWidthBottom: + prop.mBorderWidths[BottomEdge] = asReal(decl); flags|=ExtractedBorderWidths; break; + case Property_BorderWidthLeft: + prop.mBorderWidths[LeftEdge] = asReal(decl); flags|=ExtractedBorderWidths; break; + case Property_BorderWidthRight: + prop.mBorderWidths[RightEdge] = asReal(decl); flags|=ExtractedBorderWidths; break; + case Property_BorderWidthTop: + prop.mBorderWidths[TopEdge] = asReal(decl); flags|=ExtractedBorderWidths; break; + case Property_BorderWidth: + asReals(decl, prop.mBorderWidths); flags|=ExtractedBorderWidths; break; + + case Property_AspectRatio: + prop.mAspectRatioMode = parseAspectRatioMode(decl.values.at(0)); + flags|=ExtractedAspectRatioMode; + break; + + case Property_FontSize: setFontSizeFromValue(decl.values.at(0), prop.mFont); break; + case Property_FontStyle: setFontStyleFromValue(decl.values.at(0), prop.mFont); break; + case Property_FontWeight: setFontWeightFromValue(decl.values.at(0), prop.mFont); break; + case Property_FontFamily: setFontFamilyFromValues(decl, prop.mFont); break; + case Property_TextDecoration: setTextDecorationFromValues(decl, prop.mFont); break; + case Property_Font: parseShorthandFontProperty(decl, prop.mFont); break; + case Property_FontVariant: + setFontVariantFromValue(decl.values.at(0), prop.mFontSpec, prop.mFont); break; + case Property_TextTransform: + setTextTransformFromValue(decl.values.at(0), prop.mFont); break; + case Property_TextHeight: + tphSet = true; prop.mFontSpec.setTextHeight(asReal(decl)); break; + + case Property_AnchorDirection: + prop.mAnchorDir = parseAnchorDirection(decl.values.at(0)); + flags|=ExtractedAnchorDir; + break; + default: continue; + } + hit = true; + } + + if (prop.mFont != QFont()) { + flags |= ExtractedFont; + } + if (!prop.mFontSpec.isNull()) { + flags |= ExtractedFontSpec; + } + + prop.mFlags = flags; + return hit; +} + +static QColor parseColorValue(Value v) { if (v.type == Value::Identifier || v.type == Value::String || v.type == Value::Color) return v.variant.toColor(); @@ -976,14 +755,6 @@ if (lst.count() != 2) return QColor(); - if ((lst.at(0).compare(QLatin1String("palette"), Qt::CaseInsensitive)) == 0) { - int role = findKnownValue(lst.at(1), values, NumKnownValues); - if (role >= Value_FirstColorRole && role <= Value_LastColorRole) - return pal.color((QPalette::ColorRole)(role-Value_FirstColorRole)); - - return QColor(); - } - bool rgb = lst.at(0).startsWith(QLatin1String("rgb")); Parser p(lst.at(1)); @@ -1012,419 +783,9 @@ : QColor::fromHsv(v1, v2, v3, alpha); } -static QBrush parseBrushValue(Value v, const QPalette &pal) -{ - QColor c = parseColorValue(v, pal); - if (c.isValid()) - return QBrush(c); - - if (v.type != Value::Function) - return QBrush(); - - QStringList lst = v.variant.toStringList(); - if (lst.count() != 2) - return QBrush(); - - QStringList gradFuncs; - gradFuncs << QLatin1String("qlineargradient") << QLatin1String("qradialgradient") << QLatin1String("qconicalgradient") << QLatin1String("qgradient"); - int gradType = -1; - - if ((gradType = gradFuncs.indexOf(lst.at(0).toLower())) == -1) - return QBrush(); - - QHash vars; - QVector stops; - - int spread = -1; - QStringList spreads; - spreads << QLatin1String("pad") << QLatin1String("reflect") << QLatin1String("repeat"); - - Parser parser(lst.at(1)); - while (parser.hasNext()) { - parser.skipSpace(); - if (!parser.test(IDENT)) - return QBrush(); - QString attr = parser.lexem(); - parser.skipSpace(); - if (!parser.test(COLON)) - return QBrush(); - parser.skipSpace(); - if (attr.compare(QLatin1String("stop"), Qt::CaseInsensitive) == 0) { - Value stop, color; - parser.next(); - if (!parser.parseTerm(&stop)) return QBrush(); - parser.skipSpace(); - parser.next(); - if (!parser.parseTerm(&color)) return QBrush(); - stops.append(QGradientStop(stop.variant.toDouble(), parseColorValue(color, pal))); - } else { - parser.next(); - Value value; - parser.parseTerm(&value); - if (attr.compare(QLatin1String("spread"), Qt::CaseInsensitive) == 0) { - spread = spreads.indexOf(value.variant.toString()); - } else { - vars[attr] = value.variant.toString().toDouble(); - } - } - parser.skipSpace(); - parser.test(COMMA); - } - - if (gradType == 0) { - QLinearGradient lg(vars.value(QLatin1String("x1")), vars.value(QLatin1String("y1")), - vars.value(QLatin1String("x2")), vars.value(QLatin1String("y2"))); - lg.setCoordinateMode(QGradient::ObjectBoundingMode); - lg.setStops(stops); - if (spread != -1) - lg.setSpread(QGradient::Spread(spread)); - return QBrush(lg); - } - - if (gradType == 1) { - QRadialGradient rg(vars.value(QLatin1String("cx")), vars.value(QLatin1String("cy")), - vars.value(QLatin1String("radius")), vars.value(QLatin1String("fx")), - vars.value(QLatin1String("fy"))); - rg.setCoordinateMode(QGradient::ObjectBoundingMode); - rg.setStops(stops); - if (spread != -1) - rg.setSpread(QGradient::Spread(spread)); - return QBrush(rg); - } - - if (gradType == 2) { - QConicalGradient cg(vars.value(QLatin1String("cx")), vars.value(QLatin1String("cy")), - vars.value(QLatin1String("angle"))); - cg.setCoordinateMode(QGradient::ObjectBoundingMode); - cg.setStops(stops); - if (spread != -1) - cg.setSpread(QGradient::Spread(spread)); - return QBrush(cg); - } - - return QBrush(); -} - -static BorderStyle parseStyleValue(Value v) -{ - if (v.type == Value::KnownIdentifier) { - switch (v.variant.toInt()) { - case Value_None: - return BorderStyle_None; - case Value_Dotted: - return BorderStyle_Dotted; - case Value_Dashed: - return BorderStyle_Dashed; - case Value_Solid: - return BorderStyle_Solid; - case Value_Double: - return BorderStyle_Double; - case Value_DotDash: - return BorderStyle_DotDash; - case Value_DotDotDash: - return BorderStyle_DotDotDash; - case Value_Groove: - return BorderStyle_Groove; - case Value_Ridge: - return BorderStyle_Ridge; - case Value_Inset: - return BorderStyle_Inset; - case Value_Outset: - return BorderStyle_Outset; - case Value_Native: - return BorderStyle_Native; - default: - break; - } - } - - return BorderStyle_Unknown; -} -#ifndef HB_BIN_CSS -void ValueExtractor::borderValue(const Declaration &decl, qreal *width, HbCss::BorderStyle *style, QBrush *color) -{ - *width = 0; - *style = BorderStyle_None; - *color = QColor(); - - if (decl.values.isEmpty()) - return; - - int i = 0; - if (decl.values.at(i).type == Value::Length || decl.values.at(i).type == Value::Number) { - *width = asReal(decl.values.at(i)); - if (++i >= decl.values.count()) - return; - } - - *style = parseStyleValue(decl.values.at(i)); - if (*style != BorderStyle_Unknown) { - if (++i >= decl.values.count()) - return; - } else { - *style = BorderStyle_None; - } - - *color = parseBrushValue(decl.values.at(i), pal); -} - -static void parseShorthandBackgroundProperty(const HbVector &values, QBrush *brush, QString *image, Repeat *repeat, Qt::Alignment *alignment, const QPalette &pal) -{ - *brush = QBrush(); - image->clear(); - *repeat = Repeat_XY; - *alignment = Qt::AlignTop | Qt::AlignLeft; - - for (int i = 0; i < values.count(); ++i) { - const Value v = values.at(i); - if (v.type == Value::Uri) { - *image = v.variant.toString(); - continue; - } else if (v.type == Value::KnownIdentifier && v.variant.toInt() == Value_None) { - image->clear(); - continue; - } else if (v.type == Value::KnownIdentifier && v.variant.toInt() == Value_Transparent) { - *brush = QBrush(Qt::transparent); - } - - Repeat repeatAttempt = static_cast(findKnownValue(v.variant.toString(), - repeats, NumKnownRepeats)); - if (repeatAttempt != Repeat_Unknown) { - *repeat = repeatAttempt; - continue; - } - - if (v.type == Value::KnownIdentifier) { - const int start = i; - int count = 1; - if (i < values.count() - 1 - && values.at(i + 1).type == Value::KnownIdentifier) { - ++i; - ++count; - } - Qt::Alignment a = parseAlignment(values.constData() + start, count); - if (int(a) != 0) { - *alignment = a; - continue; - } - i -= count - 1; - } - - *brush = parseBrushValue(v, pal); - } -} - -bool ValueExtractor::extractBackground(QBrush *brush, QString *image, Repeat *repeat, - Qt::Alignment *alignment, Origin *origin, Attachment *attachment, - Origin *clip) -{ - bool hit = false; - for (int i = 0; i < declarations.count(); ++i) { - const Declaration &decl = declarations.at(i); - if (decl.values.isEmpty()) - continue; - const Value val = decl.values.first(); - switch (decl.propertyId) { - case BackgroundColor: - *brush = parseBrushValue(val, pal); - break; - case BackgroundImage: - if (val.type == Value::Uri) - *image = val.variant.toString(); - break; - case BackgroundRepeat: - *repeat = static_cast(findKnownValue(val.variant.toString(), - repeats, NumKnownRepeats)); - break; - case BackgroundPosition: - *alignment = decl.alignmentValue(); - break; - case BackgroundOrigin: - *origin = decl.originValue(); - break; - case BackgroundClip: - *clip = decl.originValue(); - break; - case Background: - parseShorthandBackgroundProperty(decl.values, brush, image, repeat, alignment, pal); - break; - case BackgroundAttachment: - *attachment = decl.attachmentValue(); - break; - default: continue; - } - hit = true; - } - return hit; -} - -static bool setFontSizeFromValue(Value value, QFont *font, int *fontSizeAdjustment) -{ - if (value.type == Value::KnownIdentifier) { - bool valid = true; - switch (value.variant.toInt()) { - case Value_Small: *fontSizeAdjustment = -1; break; - case Value_Medium: *fontSizeAdjustment = 0; break; - case Value_Large: *fontSizeAdjustment = 1; break; - case Value_XLarge: *fontSizeAdjustment = 2; break; - case Value_XXLarge: *fontSizeAdjustment = 3; break; - default: valid = false; break; - } - return valid; - } - if (value.type != Value::Length) - return false; - - bool valid = false; - QString s = value.variant.toString(); - if (s.endsWith(QLatin1String("pt"), Qt::CaseInsensitive)) { - s.chop(2); - value.variant = s; - if (value.variant.convert(HbVariant::Double)) { - font->setPointSizeF(value.variant.toDouble()); - valid = true; - } - } else if (s.endsWith(QLatin1String("px"), Qt::CaseInsensitive)) { - s.chop(2); - value.variant = s; - if (value.variant.convert(HbVariant::Int)) { - font->setPixelSize(value.variant.toInt()); - valid = true; - } - } - return valid; -} - -static bool setFontStyleFromValue(const Value &value, QFont *font) -{ - if (value.type != Value::KnownIdentifier) - return false ; - switch (value.variant.toInt()) { - case Value_Normal: font->setStyle(QFont::StyleNormal); return true; - case Value_Italic: font->setStyle(QFont::StyleItalic); return true; - case Value_Oblique: font->setStyle(QFont::StyleOblique); return true; - default: break; - } - return false; -} - -static bool setFontWeightFromValue(const Value &value, QFont *font) -{ - if (value.type == Value::KnownIdentifier) { - switch (value.variant.toInt()) { - case Value_Normal: font->setWeight(QFont::Normal); return true; - case Value_Bold: font->setWeight(QFont::Bold); return true; - default: break; - } - return false; - } - if (value.type != Value::Number) - return false; - font->setWeight(qMin(value.variant.toInt() / 8, 99)); - return true; -} - -static bool setFontFamilyFromValues(const HbVector &values, QFont *font) -{ - QString family; - for (int i = 0; i < values.count(); ++i) { - const Value &v = values.at(i); - if (v.type == Value::TermOperatorComma) - break; - const QString str = v.variant.toString(); - if (str.isEmpty()) - break; - family += str; - family += QLatin1Char(' '); - } - family = family.simplified(); - if (family.isEmpty()) - return false; - font->setFamily(family); - return true; -} - -static void setTextDecorationFromValues(const HbVector &values, QFont *font) -{ - for (int i = 0; i < values.count(); ++i) { - if (values.at(i).type != Value::KnownIdentifier) - continue; - switch (values.at(i).variant.toInt()) { - case Value_Underline: font->setUnderline(true); break; - case Value_Overline: font->setOverline(true); break; - case Value_LineThrough: font->setStrikeOut(true); break; - case Value_None: - font->setUnderline(false); - font->setOverline(false); - font->setStrikeOut(false); - break; - default: break; - } - } -} - -static void parseShorthandFontProperty(const HbVector &values, QFont *font, int *fontSizeAdjustment) -{ - font->setStyle(QFont::StyleNormal); - font->setWeight(QFont::Normal); - *fontSizeAdjustment = 0; - - int i = 0; - while (i < values.count()) { - if (setFontStyleFromValue(values.at(i), font) - || setFontWeightFromValue(values.at(i), font)) - ++i; - else - break; - } - - if (i < values.count()) { - setFontSizeFromValue(values.at(i), font, fontSizeAdjustment); - ++i; - } - - if (i < values.count()) { - QString fam = values.at(i).variant.toString(); - if (!fam.isEmpty()) - font->setFamily(fam); - } -} - -static void setFontVariantFromValue(const Value &value, HbFontSpec *fontSpec, QFont *font ) -{ - // Sets font variants. Some set the fontspec and some the HbFontSpec - HbFontSpec::Role role( HbFontSpec::Undefined ); - if (value.type == Value::KnownIdentifier) { - switch (value.variant.toInt()) { - case Value_Normal: font->setCapitalization(QFont::MixedCase); break; - case Value_SmallCaps: font->setCapitalization(QFont::SmallCaps); break; - case Value_Primary: role = HbFontSpec::Primary; break; - case Value_Secondary: role = HbFontSpec::Secondary; break; - case Value_Title: role = HbFontSpec::Title; break; - case Value_PrimarySmall: role = HbFontSpec::PrimarySmall; break; - case Value_Digital: role = HbFontSpec::Digital; break; - default: break; - } - } - if (role != HbFontSpec::Undefined) { - fontSpec->setRole( role ); - } -} - -static void setTextTransformFromValue(const Value &value, QFont *font) -{ - if (value.type == Value::KnownIdentifier) { - switch (value.variant.toInt()) { - case Value_None: font->setCapitalization(QFont::MixedCase); break; - case Value_Uppercase: font->setCapitalization(QFont::AllUppercase); break; - case Value_Lowercase: font->setCapitalization(QFont::AllLowercase); break; - default: break; - } - } -} - - -bool ValueExtractor::extractValue(const QString& variableName, HbVector& values) const +bool ValueExtractor::extractVariableValue( + const QString& variableName, + HbVector& values) const { bool variableFound = false; if ( !variableDeclarationsHash.isEmpty() ) { @@ -1445,30 +806,31 @@ return variableFound; } -bool ValueExtractor::extractValue(const QString& variableName, qreal& value) +bool ValueExtractor::extractVariableValue(const QString& variableName, qreal& value) { bool variableFound = false; HbVector values; - if (extractValue(variableName, values)) { + if (extractVariableValue(variableName, values)) { value = asReal(values.first()); variableFound = true; } return variableFound; } -bool ValueExtractor::extractValue( const QString& variableName, HbCss::Value &val ) const +bool ValueExtractor::extractVariableValue( const QString& variableName, HbCss::Value &val ) const { HbVector values; - bool variableFound = extractValue( variableName, values ); + bool variableFound = extractVariableValue( variableName, values ); //for variable cascading support if ( variableFound ) { val = values.first(); if ( val.type == Value::Variable ){ - variableFound = extractValue ( val.variant.toString (), val ); + variableFound = extractVariableValue ( val.variant.toString (), val ); } - }else { - HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); + } else { + HbLayeredStyleLoader *styleLoader = + HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); if (styleLoader) { variableFound = styleLoader->findInDefaultVariables(variableName, val); } @@ -1495,7 +857,7 @@ int precedenceLevel = 0; bool parseVariable = false; bool endMark = false; - int operatorCount = 1; // there can only be 2 sequental operators if the latter one is unary '-' + int operatorCount = 1;//there can only be 2 sequental operators if the latter one is unary '-' while (position < expression.size()) { endMark = false; if (expression.at(position) == SPACE) { @@ -1531,12 +893,14 @@ if (valueString.startsWith("var(") && valueString.endsWith(")")) { // remove var( and last ) QString variableString = valueString.mid(4, valueString.size()-5); - if (!extractValue(variableString, val)) { + if (!extractVariableValue(variableString, val)) { expressionValues.clear(); return false; } } else { - if (!asReal(valueString, val)) { + bool real_ok = true; + val = asReal(valueString, Value::String, &real_ok); + if (!real_ok) { expressionValues.clear(); return false; } @@ -1547,12 +911,14 @@ begin = -1; if (expression.at(position) == MINUS) { if (operatorCount == 1) { - expressionValues.append(ExpressionValue(ExpressionValue::UnaryMinus,precedenceLevel+2,0)); + expressionValues.append( + ExpressionValue(ExpressionValue::UnaryMinus,precedenceLevel+2,0)); } else if (operatorCount > 1) { expressionValues.clear(); return false; } else { - expressionValues.append(ExpressionValue(ExpressionValue::Minus,precedenceLevel,0)); + expressionValues.append( + ExpressionValue(ExpressionValue::Minus,precedenceLevel,0)); } operatorCount++; } else if (expression.at(position) == PLUS) { @@ -1560,21 +926,24 @@ expressionValues.clear(); return false; } - expressionValues.append(ExpressionValue(ExpressionValue::Plus,precedenceLevel,0)); + expressionValues.append( + ExpressionValue(ExpressionValue::Plus,precedenceLevel,0)); operatorCount++; } else if (expression.at(position) == STAR) { if (operatorCount > 0) { expressionValues.clear(); return false; } - expressionValues.append(ExpressionValue(ExpressionValue::Star,precedenceLevel+1,0)); + expressionValues.append( + ExpressionValue(ExpressionValue::Star,precedenceLevel+1,0)); operatorCount++; } else if (expression.at(position) == SLASH) { if (operatorCount > 0) { expressionValues.clear(); return false; } - expressionValues.append(ExpressionValue(ExpressionValue::Slash,precedenceLevel+1,0)); + expressionValues.append( + ExpressionValue(ExpressionValue::Slash,precedenceLevel+1,0)); operatorCount++; } position++; @@ -1607,12 +976,14 @@ if (valueString.startsWith("var(") && valueString.endsWith(")")) { // remove var( and last ) QString variableString = valueString.mid(4, valueString.size()-5); - if (!extractValue(variableString, val)) { + if (!extractVariableValue(variableString, val)) { expressionValues.clear(); return false; } } else { - if (!asReal(valueString, val)) { + bool real_ok = true; + val = asReal(valueString, Value::String, &real_ok); + if (!real_ok) { expressionValues.clear(); return false; } @@ -1673,7 +1044,8 @@ break; } if (expressionValues[calculateIndex].mToken == ExpressionValue::UnaryMinus) { - expressionValues[calculateIndex+1].mValue = -expressionValues[calculateIndex+1].mValue; + expressionValues[calculateIndex+1].mValue = + -expressionValues[calculateIndex+1].mValue; expressionValues.removeAt(calculateIndex); } else { expressionValues[calculateIndex-1].mValue = answer; @@ -1689,14 +1061,14 @@ } -bool ValueExtractor::extractParameters( const QList ¶ms, QList &values ) +bool ValueExtractor::extractCustomProperties( const QList &keys, QList &values ) { - if ( params.count() != values.count() ) { + if ( keys.count() != values.count() ) { return false; } for ( int i = 0; i < declarations.count(); i++ ) { - for( int j = 0; j < params.count(); j++ ) { - if (declarations[i].property == params[j] ) { + for( int j = 0; j < keys.count(); j++ ) { + if (declarations[i].property == keys[j] ) { Value val = declarations[i].values.last(); switch (val.type) { case Value::Length: @@ -1704,11 +1076,9 @@ case Value::VariableNegative: case Value::Expression: case Value::ExpressionNegative: + case Value::Percentage: values[j] = asReal(val); break; - case Value::Percentage: - values[j] = val.variant.toDouble() / 100; - break; case Value::KnownIdentifier: values[j] = (QString)val.original; break; @@ -1723,114 +1093,19 @@ return true; } -bool ValueExtractor::extractFont(QFont *font, HbFontSpec *fontSpec, int *fontSizeAdjustment) +bool ValueExtractor::extractLayout(QString &layoutName, QString §ionName) { - if (fontExtracted) { - *font = f; - *fontSizeAdjustment = adjustment; - *fontSpec = fSpec; - return fontExtracted == 1; - } - - bool hit = false; - bool tphSet = false; - for (int i = 0; i < declarations.count(); ++i) { - const Declaration &decl = declarations.at(i); - if (decl.values.isEmpty()) - continue; - const Value val = decl.values.first(); - switch (decl.propertyId) { - case FontSize: setFontSizeFromValue(val, font, fontSizeAdjustment); break; - case FontStyle: setFontStyleFromValue(val, font); break; - case FontWeight: setFontWeightFromValue(val, font); break; - case FontFamily: setFontFamilyFromValues(decl.values, font); break; - case TextDecoration: setTextDecorationFromValues(decl.values, font); break; - case Font: parseShorthandFontProperty(decl.values, font, fontSizeAdjustment); break; - case FontVariant: setFontVariantFromValue(val, fontSpec, font); break; - case TextTransform: setTextTransformFromValue(val, font); break; - // Text-height alone is not enough to make 'hit' true. - case HbFixedHeight: if (!tphSet) fontSpec->setTextHeight(asReal(decl)); continue; - case HbTextHeight: tphSet = true; fontSpec->setTextHeight(asReal(decl)); continue; - default: continue; - } - hit = true; - } - - f = *font; - fSpec = *fontSpec; - adjustment = *fontSizeAdjustment; - fontExtracted = hit ? 1 : 2; - return hit; -} - -bool ValueExtractor::extractPalette(QBrush *fg, QBrush *sfg, QBrush *sbg, QBrush *abg) -{ + QString tempSectionName; bool hit = false; for (int i = 0; i < declarations.count(); ++i) { const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case Color: *fg = decl.brushValue(pal); break; - case QtSelectionForeground: *sfg = decl.brushValue(pal); break; - case QtSelectionBackground: *sbg = decl.brushValue(pal); break; - case QtAlternateBackground: *abg = decl.brushValue(pal); break; - default: continue; - } - hit = true; - } - return hit; -} - -void ValueExtractor::extractFont() -{ - if (fontExtracted) - return; - int dummy = -255; - // Values extracted into the object's own member variables. - extractFont(&f, &fSpec, &dummy); -} - -bool ValueExtractor::extractImage(QIcon *icon, Qt::Alignment *a, QSize *size) -{ - bool hit = false; - for (int i = 0; i < declarations.count(); ++i) { - const Declaration &decl = declarations.at(i); - switch (decl.propertyId) { - case QtImage: - *icon = decl.iconValue(); - if (decl.values.count() > 0 && decl.values.at(0).type == Value::Uri) { - // try to pull just the size from the image... - QImageReader imageReader(decl.values.at(0).variant.toString()); - if ((*size = imageReader.size()).isNull()) { - // but we'll have to load the whole image if the - // format doesn't support just reading the size - *size = imageReader.read().size(); - } - } - break; - case QtImageAlignment: *a = decl.alignmentValue(); break; - default: continue; - } - hit = true; - } - return hit; -} - -bool ValueExtractor::extractLayout(QString *layoutName, QString *sectionName) -{ - QString tempSectionName; - if ( !layoutName || !sectionName ) { - return false; - } - bool hit = false; - for (int i = 0; i < declarations.count(); ++i) { - const Declaration &decl = declarations.at(i); - if ( decl.propertyId == HbLayout ) { + if ( decl.propertyId == Property_Layout ) { if( decl.values.count() == 1 ) { - *layoutName = decl.values.at(0).variant.toString(); + layoutName = decl.values.at(0).variant.toString(); hit = true; } } - else if ( decl.propertyId == HbSection ) { + else if ( decl.propertyId == Property_Section ) { if (decl.values.count() == 1 ) { tempSectionName = decl.values.at(0).variant.toString(); // a section without a layout doesn't count as a hit @@ -1838,335 +1113,46 @@ } } if(hit) - *sectionName = tempSectionName; + sectionName = tempSectionName; return hit; } - -bool ValueExtractor::extractAspectRatioMode(Qt::AspectRatioMode *mode) -{ - bool hit = false; - for (int i = 0; i < declarations.count(); ++i) { - const Declaration &decl = declarations.at(i); - if ( decl.propertyId == HbAspectRatio && decl.values.count() == 1 ) { - switch (decl.values.at(0).variant.toInt()) - { - case Value_Ignore: - *mode = Qt::IgnoreAspectRatio; - break; - case Value_Keep: - *mode = Qt::KeepAspectRatio; - break; - case Value_KeepExpand: - *mode = Qt::KeepAspectRatioByExpanding; - break; - default: - continue; - } - hit = true; - } - } - return hit; -} - -bool ValueExtractor::extractColor( QColor *col ) const +bool ValueExtractor::extractColor( QColor &color ) const { bool hit = false; const int declarationsCount = declarations.count(); for ( int i = 0; i < declarationsCount; ++i ) { const Declaration &decl = declarations.at(i); switch(decl.propertyId) { - case Color: - if( decl.values.at(0).type == Value::Variable ) { - HbCss::Value value; - hit = extractValue( decl.values.at(0).variant.toString (), value ); - if (hit) { - *col = value.variant.toColor(); + case Property_Color: + { + HbCss::Value value; + if ( decl.values.at(0).type == Value::Variable ) { + const QString variableName = decl.values.at(0).variant.toString(); + HbThemeIndexResource resource(variableName); + if (resource.isValid()) { + // Color value coming from index + color = resource.colorValue(); + } else { + // Color value coming from custom css + extractVariableValue( variableName, value ); + color = parseColorValue(value); } + } else { + value = decl.values.at(0); + color = parseColorValue(value); } - else { - *col = decl.values.at(0).variant.toColor(); - hit = true; + hit = true; + break; } default: - break; + break; } } return hit; } #endif -QColor Declaration::colorValue(const QPalette &pal) const -{ - if (values.count() != 1) - return QColor(); - - return parseColorValue(values.first(), pal); -} - -QBrush Declaration::brushValue(const QPalette &pal) const -{ - if (values.count() != 1) - return QBrush(); - - return parseBrushValue(values.first(), pal); -} - -void Declaration::brushValues(QBrush *c, const QPalette &pal) const -{ - int i; - for (i = 0; i < qMin(values.count(), 4); i++) - c[i] = parseBrushValue(values.at(i), pal); - if (i == 0) c[0] = c[1] = c[2] = c[3] = QBrush(); - else if (i == 1) c[3] = c[2] = c[1] = c[0]; - else if (i == 2) c[2] = c[0], c[3] = c[1]; - else if (i == 3) c[3] = c[1]; -} - -bool Declaration::realValue(qreal *real, const char *unit) const -{ - if (values.count() != 1) - return false; - const Value &v = values.first(); - if (unit && v.type != Value::Length) - return false; - QString s = v.variant.toString(); - if (unit) { - if (!s.endsWith(QLatin1String(unit), Qt::CaseInsensitive)) - return false; - s.chop(qstrlen(unit)); - } - bool ok = false; - qreal val = s.toDouble(&ok); - if (ok) - *real = val; - return ok; -} - -static bool intValueHelper(const Value &v, int *i, const char *unit) -{ - if (unit && v.type != Value::Length) - return false; - QString s = v.variant.toString(); - if (unit) { - if (!s.endsWith(QLatin1String(unit), Qt::CaseInsensitive)) - return false; - s.chop(qstrlen(unit)); - } - bool ok = false; - int val = s.toInt(&ok); - if (ok) - *i = val; - return ok; -} - -bool Declaration::intValue(int *i, const char *unit) const -{ - if (values.count() != 1) - return false; - return intValueHelper(values.first(), i, unit); -} - -QSize Declaration::sizeValue() const -{ - int x[2] = { 0, 0 }; - if (values.count() > 0) - intValueHelper(values.at(0), &x[0], "px"); - if (values.count() > 1) - intValueHelper(values.at(1), &x[1], "px"); - else - x[1] = x[0]; - return QSize(x[0], x[1]); -} - -QRect Declaration::rectValue() const -{ - if (values.count() != 1) - return QRect(); - const Value &v = values.first(); - if (v.type != Value::Function) - return QRect(); - QStringList func = v.variant.toStringList(); - if (func.count() != 2 || func.first().compare(QLatin1String("rect")) != 0) - return QRect(); - QStringList args = func[1].split(QLatin1String(" "), QString::SkipEmptyParts); - if (args.count() != 4) - return QRect(); - return QRect(args[0].toInt(), args[1].toInt(), args[2].toInt(), args[3].toInt()); -} - -void Declaration::colorValues(QColor *c, const QPalette &pal) const -{ - int i; - for (i = 0; i < qMin(values.count(), 4); i++) - c[i] = parseColorValue(values.at(i), pal); - if (i == 0) c[0] = c[1] = c[2] = c[3] = QColor(); - else if (i == 1) c[3] = c[2] = c[1] = c[0]; - else if (i == 2) c[2] = c[0], c[3] = c[1]; - else if (i == 3) c[3] = c[1]; -} - -BorderStyle Declaration::styleValue() const -{ - if (values.count() != 1) - return BorderStyle_None; - return parseStyleValue(values.first()); -} - -void Declaration::styleValues(BorderStyle *s) const -{ - int i; - for (i = 0; i < qMin(values.count(), 4); i++) - s[i] = parseStyleValue(values.at(i)); - if (i == 0) s[0] = s[1] = s[2] = s[3] = BorderStyle_None; - else if (i == 1) s[3] = s[2] = s[1] = s[0]; - else if (i == 2) s[2] = s[0], s[3] = s[1]; - else if (i == 3) s[3] = s[1]; -} - -Repeat Declaration::repeatValue() const -{ - if (values.count() != 1) - return Repeat_Unknown; - return static_cast(findKnownValue(values.first().variant.toString(), - repeats, NumKnownRepeats)); -} - -Origin Declaration::originValue() const -{ - if (values.count() != 1) - return Origin_Unknown; - return static_cast(findKnownValue(values.first().variant.toString(), - origins, NumKnownOrigins)); -} - -PositionMode Declaration::positionValue() const -{ - if (values.count() != 1) - return PositionMode_Unknown; - return static_cast(findKnownValue(values.first().variant.toString(), - positions, NumKnownPositionModes)); -} - -Attachment Declaration::attachmentValue() const -{ - if (values.count() != 1) - return Attachment_Unknown; - return static_cast(findKnownValue(values.first().variant.toString(), - attachments, NumKnownAttachments)); -} - -int Declaration::styleFeaturesValue() const -{ - int features = StyleFeature_None; - for (int i = 0; i < values.count(); i++) { - features |= static_cast(findKnownValue(values.value(i).variant.toString(), - styleFeatures, NumKnownStyleFeatures)); - } - return features; -} - -QString Declaration::uriValue() const -{ - if (values.isEmpty() || values.first().type != Value::Uri) - return QString(); - return values.first().variant.toString(); -} - -Qt::Alignment Declaration::alignmentValue() const -{ - if (values.isEmpty() || values.count() > 2) - return Qt::AlignLeft | Qt::AlignTop; - - return parseAlignment(values.constData(), values.count()); -} - -Hb::TextWrapping Declaration::wrapModeValue() const -{ - if (values.isEmpty() || values.count() > 1) - return Hb::TextNoWrap; - - return parseWrapMode(values.at(0)); -} - -void Declaration::borderImageValue(QString *image, int *cuts, - TileMode *h, TileMode *v) const -{ - *image = uriValue(); - for (int i = 0; i < 4; i++) - cuts[i] = -1; - *h = *v = TileMode_Stretch; - - if (values.count() < 2) - return; - - if (values.at(1).type == Value::Number) { // cuts! - int i; - for (i = 0; i < qMin(values.count()-1, 4); i++) { - const Value& v = values.at(i+1); - if (v.type != Value::Number) - break; - cuts[i] = v.variant.toString().toInt(); - } - if (i == 0) cuts[0] = cuts[1] = cuts[2] = cuts[3] = 0; - else if (i == 1) cuts[3] = cuts[2] = cuts[1] = cuts[0]; - else if (i == 2) cuts[2] = cuts[0], cuts[3] = cuts[1]; - else if (i == 3) cuts[3] = cuts[1]; - } - - if (values.last().type == Value::Identifier) { - *v = static_cast(findKnownValue(values.last().variant.toString(), - tileModes, NumKnownTileModes)); - } - if (values[values.count() - 2].type == Value::Identifier) { - *h = static_cast - (findKnownValue(values[values.count()-2].variant.toString(), - tileModes, NumKnownTileModes)); - } else - *h = *v; -} - -QIcon Declaration::iconValue() const -{ - QIcon icon; - for (int i = 0; i < values.count();) { - Value value = values.at(i++); - if (value.type != Value::Uri) - break; - QString uri = value.variant.toString(); - QIcon::Mode mode = QIcon::Normal; - QIcon::State state = QIcon::Off; - for (int j = 0; j < 2; j++) { - if (i != values.count() && values.at(i).type == Value::KnownIdentifier) { - switch (values.at(i).variant.toInt()) { - case Value_Disabled: mode = QIcon::Disabled; break; - case Value_Active: mode = QIcon::Active; break; - case Value_Selected: mode = QIcon::Selected; break; - case Value_Normal: mode = QIcon::Normal; break; - case Value_On: state = QIcon::On; break; - case Value_Off: state = QIcon::Off; break; - default: break; - } - ++i; - } else { - break; - } - } - - // QIcon is soo broken - if (icon.isNull()) - icon = QIcon(uri); - else - icon.addPixmap(uri, mode, state); - - if (i == values.count()) - break; - - if (values.at(i).type == Value::TermOperatorComma) - i++; - } - return icon; -} /////////////////////////////////////////////////////////////////////////////// // Selector @@ -2236,7 +1222,8 @@ widgetSheets.clear(); } -int StyleSelector::selectorMatches(const Selector &selector, NodePtr node, bool nameCheckNeeded) const +int StyleSelector::selectorMatches( + const Selector &selector, NodePtr node, bool nameCheckNeeded) const { if (selector.basicSelectors.isEmpty()) { return -1; @@ -2290,7 +1277,8 @@ break; } firstLoop = false; - } while (i >= 0 && (matchLevel >= 0 || sel.relationToNext == BasicSelector::MatchNextSelectorIfAncestor)); + } while (i >= 0 && (matchLevel >= 0 || + sel.relationToNext == BasicSelector::MatchNextSelectorIfAncestor)); return (matchLevel < 0) ? -1 : firstMatchLevel; } @@ -2311,7 +1299,10 @@ } } -int StyleSelector::basicSelectorMatches(const BasicSelector &sel, NodePtr node, bool nameCheckNeeded) const +const uint CLASS_HASH = qHash(QString("class")); + +int StyleSelector::basicSelectorMatches( + const BasicSelector &sel, NodePtr node, bool nameCheckNeeded) const { int matchLevel = 0; HbString elementName(HbMemoryManager::HeapMemory); @@ -2322,7 +1313,7 @@ for (int i = 0; i < sel.attributeSelectors.count(); ++i) { const AttributeSelector &a = sel.attributeSelectors.at(i); - if (a.name == QLatin1String("class")) { + if (a.nameHash == CLASS_HASH) { elementName = a.value; } if (!attributeMatches(node, a)) { @@ -2350,18 +1341,21 @@ return matchLevel; } -static inline bool qcss_selectorStyleRuleLessThan(const QPair &lhs, const QPair &rhs) +static inline bool qcss_selectorStyleRuleLessThan( + const QPair &lhs, const QPair &rhs) { return lhs.first < rhs.first; } -static inline bool qcss_selectorDeclarationLessThan(const QPair &lhs, const QPair &rhs) +static inline bool qcss_selectorDeclarationLessThan( + const QPair &lhs, const QPair &rhs) { return lhs.first < rhs.first; } -void StyleSelector::matchRules(NodePtr node, const HbVector &rules, StyleSheetOrigin origin, - int depth, QVector *weightedRules, bool nameCheckNeeded) const +void StyleSelector::matchRules( + NodePtr node, const HbVector &rules, StyleSheetOrigin origin, + int depth, QVector *weightedRules, bool nameCheckNeeded) const { for (int i = 0; i < rules.count(); ++i) { const StyleRule &rule = rules.at(i); @@ -2386,7 +1380,8 @@ // Returns style rules that are in ascending order of specificity // Each of the StyleRule returned will contain exactly one Selector -HbVector StyleSelector::styleRulesForNode(NodePtr node, const Qt::Orientation orientation) const +HbVector StyleSelector::styleRulesForNode( + NodePtr node, const Qt::Orientation orientation) const { HbVector rules; if (styleSheets.isEmpty()) @@ -2404,7 +1399,8 @@ // Returns style rules and specificity values (unordered) -QVector StyleSelector::weightedStyleRulesForNode(NodePtr node, const Qt::Orientation orientation) const +QVector StyleSelector::weightedStyleRulesForNode( + NodePtr node, const Qt::Orientation orientation) const { initNode(node); QVector weightedRules; // (spec, rule) that will be sorted below @@ -2432,12 +1428,15 @@ if(styleSheet) { WidgetStyleRules* widgetStack = styleSheet->widgetStack(classNameHash); if (widgetStack) { - matchRules(node, widgetStack->styleRules, styleSheet->origin, styleSheet->depth, &weightedRules, false); + matchRules(node, widgetStack->styleRules, styleSheet->origin, + styleSheet->depth, &weightedRules, false); // Append orientation-specific rules if (orientation == Qt::Vertical) { - matchRules(node, widgetStack->portraitRules, styleSheet->origin, styleSheet->depth, &weightedRules, false); + matchRules(node, widgetStack->portraitRules, styleSheet->origin, + styleSheet->depth, &weightedRules, false); }else if (orientation == Qt::Horizontal) { - matchRules(node, widgetStack->landscapeRules, styleSheet->origin, styleSheet->depth, &weightedRules, false); + matchRules(node, widgetStack->landscapeRules, styleSheet->origin, + styleSheet->depth, &weightedRules, false); } } if (firstLoop && !medium.isEmpty()) { // Media rules are only added to global widget stack @@ -2446,8 +1445,8 @@ if (styleSheet->mediaRules.at(i).media.contains( HbString(medium, HbMemoryManager::HeapMemory), Qt::CaseInsensitive)) { - matchRules(node, styleSheet->mediaRules.at(i).styleRules, styleSheet->origin, - styleSheet->depth, &weightedRules); + matchRules(node, styleSheet->mediaRules.at(i).styleRules, + styleSheet->origin, styleSheet->depth, &weightedRules); } } }// End medium.isEmpty loop @@ -2496,8 +1495,10 @@ // Returns declarations and specificity values (unordered) -QVector StyleSelector::weightedDeclarationsForNode(NodePtr node, const Qt::Orientation orientation, - const char *extraPseudo) const +QVector StyleSelector::weightedDeclarationsForNode( + NodePtr node, + const Qt::Orientation orientation, + const char *extraPseudo) const { QVector decls; QVector rules = weightedStyleRulesForNode(node, orientation); @@ -2513,8 +1514,7 @@ quint64 pseudoClass = selector.pseudoClass(); bool pseudoClassIsValid = - pseudoClass == PseudoClass_Enabled - || pseudoClass == PseudoClass_Unspecified + pseudoClass == PseudoClass_Unspecified || pseudoClass == PseudoClass_Landscape || pseudoClass == PseudoClass_Portrait; @@ -2533,14 +1533,17 @@ // for qtexthtmlparser which requires just the declarations with Enabled state // and without pseudo elements -HbVector StyleSelector::declarationsForNode(NodePtr node, const Qt::Orientation orientation, +HbVector StyleSelector::declarationsForNode( + NodePtr node, + const Qt::Orientation orientation, const char *extraPseudo) const { HbVector decls; if (styleSheets.isEmpty()) return decls; - QVector weightedDecls = weightedDeclarationsForNode(node, orientation, extraPseudo); + QVector weightedDecls = + weightedDeclarationsForNode(node, orientation, extraPseudo); qStableSort(weightedDecls.begin(), weightedDecls.end(), qcss_selectorDeclarationLessThan); @@ -2642,22 +1645,9 @@ return output; } -int HbQCss::QCssScanner_Generated::handleCommentStart() -{ - while (pos < input.size() - 1) { - if (input.at(pos) == QLatin1Char('*') - && input.at(pos + 1) == QLatin1Char('/')) { - pos += 2; - break; - } - ++pos; - } - return S; -} - void Scanner::scan(const QString &preprocessedInput, QVector *symbols) { - HbQCss::QCssScanner_Generated scanner(preprocessedInput); + HbCssScanner_Generated scanner(preprocessedInput); Symbol sym; int tok = scanner.lex(); while (tok != -1) { @@ -2833,7 +1823,8 @@ if (((pseudo & HbCss::PseudoClass_Portrait) && ((negated & HbCss::PseudoClass_Portrait) == 0)) || (negated & HbCss::PseudoClass_Landscape)) { widgetStack->portraitRules.append(rule); - } else if (((pseudo & HbCss::PseudoClass_Landscape) && ((negated & HbCss::PseudoClass_Landscape) == 0)) + } else if (((pseudo & HbCss::PseudoClass_Landscape) && + ((negated & HbCss::PseudoClass_Landscape) == 0)) || (negated & HbCss::PseudoClass_Portrait)) { widgetStack->landscapeRules.append(rule); } else { @@ -2977,7 +1968,8 @@ bool Parser::parseProperty(Declaration *decl) { decl->property = lexem(); - decl->propertyId = static_cast(findKnownValue(decl->property, properties, NumProperties)); + decl->propertyId = static_cast(findKnownValue( + decl->property, properties, NumProperties)); skipSpace(); return true; } @@ -2985,7 +1977,6 @@ -//new function added for varibale support bool Parser::parseVariableset(VariableRule *variableRule) { //no selector needs to be identified @@ -3133,6 +2124,7 @@ onceMore = true; AttributeSelector a(basicSel->memoryType); a.name = QLatin1String("class"); + a.nameHash = qHash(a.name); a.valueMatchCriterium = AttributeSelector::MatchContains; if (!parseClass(&a.value)) return false; #ifdef CSS_PARSER_TRACES @@ -3188,6 +2180,7 @@ if (!next(IDENT)) return false; attr->name = lexem(); + attr->nameHash = qHash(attr->name); skipSpace(); if (test(EXCLAMATION_SYM)) { @@ -3547,4 +2540,196 @@ return true; } + +#ifdef CSS_PARSER_TRACES +static const QString what(Value::Type t) +{ + QString returnString; + switch(t) { + case Value::Unknown: + returnString = QString("Unknown"); + break; + case Value::Number: + returnString = QString("Number"); + break; + case Value::Percentage: + returnString = QString("Percentage"); + break; + case Value::Length: + returnString = QString("Length"); + break; + case Value::String: + returnString = QString("String"); + break; + case Value::Identifier: + returnString = QString("Identifier"); + break; + case Value::KnownIdentifier: + returnString = QString("KnownIdentifier"); + break; + case Value::Uri: + returnString = QString("Uri"); + break; + case Value::Color: + returnString = QString("Color"); + break; + case Value::Function: + returnString = QString("Function"); + break; + case Value::TermOperatorSlash: + returnString = QString("TermOperatorSlash"); + break; + case Value::TermOperatorComma: + returnString = QString("TermOperatorComma"); + break; + case Value::Variable: + returnString = QString("Variable"); + break; + default: + break; + } + return returnString; +} + +void Value::print() const +{ + qDebug() <<"\t \t \t"<<"==============Value::Print():Begin=================="; + qDebug() <<"\t \t \t"<< "Value::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() <<"\t \t \t"<< "Value::Type type = " << what(type); + qDebug() <<"\t \t \t"<< "Value::HbString original = " << original; + qDebug() <<"\t \t \t"<< "Value::HbVariant variant = " << variant.toString(); + qDebug() <<"\t \t \t"<<"==============Value::Print():End===================="; +} + +void Declaration::print() const +{ + qDebug() <<"\t"<<"==============Declaration::Print():Begin=================="; + qDebug() <<"\t"<<"Declaration::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "\t"<< "Declaration::HbString property = " << property; + qDebug() << "\t"<< "Declaration::Property propertyId = " << propertyId; + qDebug() << "\t"<< "Declaration::HbVector values = " ; + values.print(); + qDebug() <<"\t"<<"==============Declaration::Print():End===================="; +} + +void Pseudo::print() const +{ + qDebug() <<"==============Pseudo::Print():Begin=================="; + qDebug() << "Pseudo::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "Pseudo::HbString name= " << name; + qDebug() << "Pseudo::HbString function = " << function; + qDebug() <<"==============Pseudo::Print():End=================="; +} + +void AttributeSelector::print() const +{ + qDebug() <<"==============AttributeSelector::Print():Begin=================="; + qDebug() << "AttributeSelector::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "AttributeSelector::HbString name= " << name; + qDebug() << "AttributeSelector::HbString value = " << value; + qDebug() <<"==============AttributeSelector::Print():End=================="; +} + +void BasicSelector::print() const +{ + qDebug() <<"\t \t"<<"==============BasicSelector::Print():Begin=================="; + qDebug() <<"\t \t"<<"BasicSelector::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() <<"\t \t"<<"BasicSelector::HbString elementName= " << elementName; + //qDebug() <<"\t \t"<<"BasicSelector::QStringList ids = " << ids; + qDebug() <<"\t \t"<<"BasicSelector::PseudoVector pseudos = "; + pseudos.print(); + qDebug() <<"\t \t"<< "BasicSelector::AttributeSelectorVector attributeSelectors = "; + attributeSelectors.print(); + qDebug() <<"\t \t"<<"==============BasicSelector::Print():End===================="; +} + +void Selector::print() const +{ + qDebug() <<"\t "<<"==============Selector::Print():Begin=================="; + qDebug() <<"\t "<<"Selector::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() <<"\t "<<"Selector::BasicSelectorVector basicSelectors= "; + basicSelectors.print(); + qDebug() <<"\t "<<"==============Selector::Print():End=================="; +} + +void StyleRule::print() const +{ + qDebug() <<"==============StyleRule::Print():Begin=================="; + qDebug() << "StyleRule::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "StyleRule::SelectorVector selectors = "; + selectors.print(); + qDebug() << "StyleRule::DeclarationVector declarations = "; + declarations.print(); + qDebug() <<"==============StyleRule::Print():End=================="; +} + +void VariableRule::print() const +{ + qDebug() <<"==============VariableRule::Print():Begin=================="; + qDebug() << "VariableRule::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "VariableRule::DeclarationVector declarations = "; + declarations.print(); + qDebug() <<"==============VariableRule::Print():End=================="; +} + +void MediaRule::print() const +{ + qDebug() <<"==============MediaRule::Print():Begin=================="; + qDebug() << "MediaRule::HbMemoryManager::MemoryType memoryType = " << memoryType; + //qDebug() << "MediaRule::QStringList media = " << media; + qDebug() << "MediaRule::StyleRuleVector styleRules = "; + styleRules.print(); + qDebug() <<"==============MediaRule::Print():End=================="; +} + +void PageRule::print() const +{ + qDebug() <<"==============PageRule::Print():Begin=================="; + qDebug() << "PageRule::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "PageRule::HbString selector = " << selector; + qDebug() << "PageRule::DeclarationVector declarations = "; + declarations.print(); + qDebug() <<"==============PageRule::Print():End=================="; +} + +void ImportRule::print() const +{ + qDebug() <<"==============ImportRule::Print():Begin=================="; + qDebug() << "ImportRule::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "ImportRule::HbString href = " << href; + //qDebug() << "ImportRule::QStringList media = " << media; + qDebug() <<"==============ImportRule::Print():End=================="; +} + +void WidgetStyleRules::print() const +{ + qDebug() <<"==============WidgetStyleRules::Print():Begin=================="; + qDebug() << "Generic rules:"; + styleRules.print(); + qDebug() << "Portrait rules:"; + portraitRules.print(); + qDebug() << "Landscape rules:"; + landscapeRules.print(); + qDebug() <<"==============WidgetStyleRules::Print():End=================="; +} + +void StyleSheet::print() const +{ + qDebug() <<"==============StyleSheet::Print():Begin=================="; + qDebug() << "StyleSheet::HbMemoryManager::MemoryType memoryType = " << memoryType; + qDebug() << "StyleSheet::VariableRuleVector variableRules = "; + variableRules.print(); + qDebug() << "StyleSheet::WidgetStyleRuleVector widgetRules = "; + widgetRules.print(); + qDebug() << "StyleSheet::MediaRuleVector mediaRules = "; + mediaRules.print(); + qDebug() << "StyleSheet::PageRulesVector pageRules = "; + pageRules.print(); + qDebug() << "StyleSheet::ImportRuleVector importRules = "; + importRules.print(); + qDebug() <<"==============StyleSheet::Print():End=================="; +} + +#endif // CSS_PARSER_TRACES + //QT_END_NAMESPACE diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbcssparser_p.h --- a/src/hbcore/cssparser/hbcssparser_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbcssparser_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -41,6 +40,7 @@ #include #include #include +#include // smart containers and memory manager inclusion #include "hbmemorymanager_p.h" @@ -49,226 +49,85 @@ #include "hbvariant_p.h" #include "hbstringvector_p.h" -class HbFontSpec; - -//QT_BEGIN_NAMESPACE - namespace HbCss { enum Property { - UnknownProperty, - BackgroundColor, - Color, - Float, - Font, - FontFamily, - FontSize, - FontStyle, - FontWeight, - Margin, - MarginBottom, - MarginLeft, - MarginRight, - MarginTop, - QtBlockIndent, - QtListIndent, - QtParagraphType, - QtTableType, - QtUserState, - TextDecoration, - TextIndent, - TextUnderlineStyle, - VerticalAlignment, - Whitespace, - QtSelectionForeground, - QtSelectionBackground, - Border, - BorderLeft, - BorderRight, - BorderTop, - BorderBottom, - Padding, - PaddingLeft, - PaddingRight, - PaddingTop, - PaddingBottom, - PageBreakBefore, - PageBreakAfter, - QtAlternateBackground, - BorderLeftStyle, - BorderRightStyle, - BorderTopStyle, - BorderBottomStyle, - BorderStyles, - BorderLeftColor, - BorderRightColor, - BorderTopColor, - BorderBottomColor, - BorderColor, - BorderLeftWidth, - BorderRightWidth, - BorderTopWidth, - BorderBottomWidth, - BorderWidth, - BorderTopLeftRadius, - BorderTopRightRadius, - BorderBottomLeftRadius, - BorderBottomRightRadius, - BorderRadius, - Background, - BackgroundOrigin, - BackgroundClip, - BackgroundRepeat, - BackgroundPosition, - BackgroundAttachment, - BackgroundImage, - BorderImage, - QtSpacing, - Width, - Height, - MinimumWidth, - MinimumHeight, - MaximumWidth, - MaximumHeight, - QtImage, - Left, - Right, - Top, - Bottom, - QtOrigin, - QtPosition, - Position, - QtStyleFeatures, - QtBackgroundRole, - ListStyleType, - ListStyle, - QtImageAlignment, - TextAlignment, - Outline, - OutlineOffset, - OutlineWidth, - OutlineColor, - OutlineStyle, - OutlineRadius, - OutlineTopLeftRadius, - OutlineTopRightRadius, - OutlineBottomLeftRadius, - OutlineBottomRightRadius, - FontVariant, - TextTransform, - HbSpacingHorizontal, - HbSpacingVertical, - HbColumnNarrowWidth, - HbColumnWideWidth, - HbIndent, - HbSmallIconSize, - HbLargeIconSize, - HbTopMarginWeight, - HbIconLeftAlignmentWeight, - HbStretchable, - HbLayout, - HbAspectRatio, - HbPreferredWidth, - HbPreferredHeight, - HbPreferredSize, - HbFixedWidth, - HbFixedHeight, - HbFixedSize, - HbMinimumSize, - HbMaximumSize, - HbSizePolicy, - HbSizePolicyHorizontal, - HbSizePolicyVertical, - HbCenterHorizontal, - HbCenterVertical, - HbSection, - HbTextLineCountMin, - HbTextLineCountMax, - HbTextHeight, - HbTextWrapMode, - Mirroring, // deprecated - HbLayoutDirection, - ZValue, + Property_Unknown, + Property_Alignment, + Property_AnchorDirection, + Property_AspectRatio, + Property_BorderWidth, + Property_BorderWidthBottom, + Property_BorderWidthLeft, + Property_BorderWidthRight, + Property_BorderWidthTop, + Property_Bottom, + Property_CenterHorizontal, + Property_CenterVertical, + Property_Color, + Property_FixedHeight, + Property_FixedLength, + Property_FixedSize, + Property_FixedWidth, + Property_Font, + Property_FontFamily, + Property_FontSize, + Property_FontStyle, + Property_FontVariant, + Property_FontWeight, + Property_Layout, + Property_LayoutDirection, + Property_Left, + Property_MaximumHeight, + Property_MaximumLength, + Property_MaximumSize, + Property_MaximumWidth, + Property_MinimumHeight, + Property_MinimumLength, + Property_MinimumSize, + Property_MinimumWidth, + Property_PreferredHeight, + Property_PreferredLength, + Property_PreferredSize, + Property_PreferredWidth, + Property_Right, + Property_Section, + Property_SizePolicy, + Property_SizePolicyHorizontal, + Property_SizePolicyVertical, + Property_TextAlignment, + Property_TextDecoration, + Property_TextHeight, + Property_TextLineCountMax, + Property_TextLineCountMin, + Property_TextTransform, + Property_TextWrapMode, + Property_Top, + Property_ZValue, NumProperties }; enum KnownValue { UnknownValue, Value_Normal, - Value_Pre, - Value_Small, - Value_Medium, - Value_Large, - Value_XLarge, - Value_XXLarge, Value_Italic, Value_Oblique, Value_Bold, Value_Underline, Value_Overline, Value_LineThrough, - Value_Sub, - Value_Super, Value_Left, Value_Right, Value_Top, Value_Bottom, Value_Center, - Value_Native, - Value_Solid, - Value_Dotted, - Value_Dashed, - Value_DotDash, - Value_DotDotDash, - Value_Double, - Value_Groove, - Value_Ridge, - Value_Inset, - Value_Outset, - Value_Wave, - Value_Middle, - Value_Auto, - Value_Always, Value_None, Value_Transparent, - Value_Disc, - Value_Circle, - Value_Square, - Value_Decimal, - Value_LowerAlpha, - Value_UpperAlpha, Value_SmallCaps, Value_Uppercase, Value_Lowercase, - /* keep these in same order as QPalette::ColorRole */ - Value_FirstColorRole, - Value_WindowText = Value_FirstColorRole, - Value_Button, - Value_Light, - Value_Midlight, - Value_Dark, - Value_Mid, - Value_Text, - Value_BrightText, - Value_ButtonText, - Value_Base, - Value_Window, - Value_Shadow, - Value_Highlight, - Value_HighlightedText, - Value_Link, - Value_LinkVisited, - Value_AlternateBase, - Value_LastColorRole = Value_AlternateBase, - - Value_Disabled, - Value_Active, - Value_Selected, - Value_On, - Value_Off, - Value_Ignore, Value_Keep, Value_KeepExpand, @@ -287,7 +146,6 @@ Value_MinimumExpanding, Value_Ignored, - Value_Mirrored, // deprecated Value_LeftToRight, Value_RightToLeft, Value_Parent, @@ -296,24 +154,10 @@ Value_WordWrap, Value_WrapAnywhere, - NumKnownValues -}; + Value_Positive, + Value_Negative, -enum BorderStyle { - BorderStyle_Unknown, - BorderStyle_None, - BorderStyle_Dotted, - BorderStyle_Dashed, - BorderStyle_Solid, - BorderStyle_Double, - BorderStyle_DotDash, - BorderStyle_DotDotDash, - BorderStyle_Groove, - BorderStyle_Ridge, - BorderStyle_Inset, - BorderStyle_Outset, - BorderStyle_Native, - NumKnownBorderStyles + NumKnownValues }; enum Edge { @@ -324,48 +168,6 @@ NumEdges }; -enum Corner { - TopLeftCorner, - TopRightCorner, - BottomLeftCorner, - BottomRightCorner -}; - -enum TileMode { - TileMode_Unknown, - TileMode_Round, - TileMode_Stretch, - TileMode_Repeat, - NumKnownTileModes -}; - -enum Repeat { - Repeat_Unknown, - Repeat_None, - Repeat_X, - Repeat_Y, - Repeat_XY, - NumKnownRepeats -}; - -enum Origin { - Origin_Unknown, - Origin_Padding, - Origin_Border, - Origin_Content, - Origin_Margin, - NumKnownOrigins -}; - -enum PositionMode { - PositionMode_Unknown, - PositionMode_Static, - PositionMode_Relative, - PositionMode_Absolute, - PositionMode_Fixed, - NumKnownPositionModes -}; - enum LayoutDirection { LayoutDirection_LeftToRight, LayoutDirection_RightToLeft, @@ -373,21 +175,7 @@ NumKnownLayoutDirections }; -enum Attachment { - Attachment_Unknown, - Attachment_Fixed, - Attachment_Scroll, - NumKnownAttachments -}; - -enum StyleFeature { - StyleFeature_None = 0, - StyleFeature_BackgroundColor = 1, - StyleFeature_BackgroundGradient = 2, - NumKnownStyleFeatures = 4 -}; - -struct HB_CORE_PRIVATE_EXPORT Value +struct HB_CORE_PRIVATE_EXPORT Value //krazy:exclude=multiclasses { enum Type { Unknown, @@ -415,69 +203,10 @@ variant(memType) { } - //for debug only #ifdef CSS_PARSER_TRACES - const QString what(Type t) const - { - QString returnString; - switch(t) { - case Unknown: - returnString = QString("Unknown"); - break; - case Number: - returnString = QString("Number"); - break; - case Percentage: - returnString = QString("Percentage"); - break; - case Length: - returnString = QString("Length"); - break; - case String: - returnString = QString("String"); - break; - case Identifier: - returnString = QString("Identifier"); - break; - case KnownIdentifier: - returnString = QString("KnownIdentifier"); - break; - case Uri: - returnString = QString("Uri"); - break; - case Color: - returnString = QString("Color"); - break; - case Function: - returnString = QString("Function"); - break; - case TermOperatorSlash: - returnString = QString("TermOperatorSlash"); - break; - case TermOperatorComma: - returnString = QString("TermOperatorComma"); - break; - case Variable: - returnString = QString("Variable"); - break; - default: - break; - } - return returnString; - } + void print() const; +#endif - bool supportsPrinting() const {return true;} - - void print() const - { - qDebug() <<"\t \t \t"<<"==============Value::Print():Begin=================="; - qDebug() <<"\t \t \t"<< "Value::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() <<"\t \t \t"<< "Value::Type type = " << what(type); - qDebug() <<"\t \t \t"<< "Value::HbString original = " << original; - qDebug() <<"\t \t \t"<< "Value::HbVariant variant = " << variant.toString(); - qDebug() <<"\t \t \t"<<"==============Value::Print():End===================="; - } -#endif // Data HbMemoryManager::MemoryType memoryType; Type type; @@ -491,59 +220,22 @@ // 4. QVector - { prop1: value1; prop2: value2; } // 5. Declaration - prop1: value1; -struct HB_CORE_PRIVATE_EXPORT Declaration +struct HB_CORE_PRIVATE_EXPORT Declaration //krazy:exclude=multiclasses { inline Declaration(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) :memoryType(type), property(type), - propertyId(UnknownProperty), + propertyId(Property_Unknown), values(type), important(false) {} - inline bool isEmpty() const { return property.isEmpty() && propertyId == UnknownProperty; } - - // helper functions - QColor colorValue(const QPalette & = QPalette()) const; - void colorValues(QColor *c, const QPalette & = QPalette()) const; - QBrush brushValue(const QPalette & = QPalette()) const; - void brushValues(QBrush *c, const QPalette & = QPalette()) const; - - BorderStyle styleValue() const; - void styleValues(BorderStyle *s) const; - - Origin originValue() const; - Repeat repeatValue() const; - Qt::Alignment alignmentValue() const; - Hb::TextWrapping wrapModeValue() const; - PositionMode positionValue() const; - Attachment attachmentValue() const; - int styleFeaturesValue() const; - - bool intValue(int *i, const char *unit = 0) const; - bool realValue(qreal *r, const char *unit = 0) const; - - QSize sizeValue() const; - QRect rectValue() const; - QString uriValue() const; - QIcon iconValue() const; - - void borderImageValue(QString *image, int *cuts, TileMode *h, TileMode *v) const; + inline bool isEmpty() const { return property.isEmpty() && propertyId == Property_Unknown; } #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} + void print() const; +#endif - void print() const - { - qDebug() <<"\t"<<"==============Declaration::Print():Begin=================="; - qDebug() <<"\t"<<"Declaration::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "\t"<< "Declaration::HbString property = " << property; - qDebug() << "\t"<< "Declaration::Property propertyId = " << propertyId; - qDebug() << "\t"<< "Declaration::HbVector values = " ; - values.print(); - qDebug() <<"\t"<<"==============Declaration::Print():End===================="; - } -#endif // Data HbMemoryManager::MemoryType memoryType; HbString property; @@ -554,61 +246,17 @@ typedef QPair WeightedDeclaration; -const quint64 PseudoClass_Unknown = Q_UINT64_C(0x0000000000000000); -const quint64 PseudoClass_Enabled = Q_UINT64_C(0x0000000000000001); -const quint64 PseudoClass_Disabled = Q_UINT64_C(0x0000000000000002); -const quint64 PseudoClass_Pressed = Q_UINT64_C(0x0000000000000004); -const quint64 PseudoClass_Focus = Q_UINT64_C(0x0000000000000008); -const quint64 PseudoClass_Hover = Q_UINT64_C(0x0000000000000010); -const quint64 PseudoClass_Checked = Q_UINT64_C(0x0000000000000020); -const quint64 PseudoClass_Unchecked = Q_UINT64_C(0x0000000000000040); -const quint64 PseudoClass_Indeterminate = Q_UINT64_C(0x0000000000000080); -const quint64 PseudoClass_Unspecified = Q_UINT64_C(0x0000000000000100); -const quint64 PseudoClass_Selected = Q_UINT64_C(0x0000000000000200); -const quint64 PseudoClass_Horizontal = Q_UINT64_C(0x0000000000000400); -const quint64 PseudoClass_Vertical = Q_UINT64_C(0x0000000000000800); -const quint64 PseudoClass_Window = Q_UINT64_C(0x0000000000001000); -const quint64 PseudoClass_Children = Q_UINT64_C(0x0000000000002000); -const quint64 PseudoClass_Sibling = Q_UINT64_C(0x0000000000004000); -const quint64 PseudoClass_Default = Q_UINT64_C(0x0000000000008000); -const quint64 PseudoClass_First = Q_UINT64_C(0x0000000000010000); -const quint64 PseudoClass_Last = Q_UINT64_C(0x0000000000020000); -const quint64 PseudoClass_Middle = Q_UINT64_C(0x0000000000040000); -const quint64 PseudoClass_OnlyOne = Q_UINT64_C(0x0000000000080000); -const quint64 PseudoClass_PreviousSelected = Q_UINT64_C(0x0000000000100000); -const quint64 PseudoClass_NextSelected = Q_UINT64_C(0x0000000000200000); -const quint64 PseudoClass_Flat = Q_UINT64_C(0x0000000000400000); -const quint64 PseudoClass_Left = Q_UINT64_C(0x0000000000800000); -const quint64 PseudoClass_Right = Q_UINT64_C(0x0000000001000000); -const quint64 PseudoClass_Top = Q_UINT64_C(0x0000000002000000); -const quint64 PseudoClass_Bottom = Q_UINT64_C(0x0000000004000000); -const quint64 PseudoClass_Exclusive = Q_UINT64_C(0x0000000008000000); -const quint64 PseudoClass_NonExclusive = Q_UINT64_C(0x0000000010000000); -const quint64 PseudoClass_Frameless = Q_UINT64_C(0x0000000020000000); -const quint64 PseudoClass_ReadOnly = Q_UINT64_C(0x0000000040000000); -const quint64 PseudoClass_Active = Q_UINT64_C(0x0000000080000000); -const quint64 PseudoClass_Closable = Q_UINT64_C(0x0000000100000000); -const quint64 PseudoClass_Movable = Q_UINT64_C(0x0000000200000000); -const quint64 PseudoClass_Floatable = Q_UINT64_C(0x0000000400000000); -const quint64 PseudoClass_Minimized = Q_UINT64_C(0x0000000800000000); -const quint64 PseudoClass_Maximized = Q_UINT64_C(0x0000001000000000); -const quint64 PseudoClass_On = Q_UINT64_C(0x0000002000000000); -const quint64 PseudoClass_Off = Q_UINT64_C(0x0000004000000000); -const quint64 PseudoClass_Editable = Q_UINT64_C(0x0000008000000000); -const quint64 PseudoClass_Item = Q_UINT64_C(0x0000010000000000); -const quint64 PseudoClass_Closed = Q_UINT64_C(0x0000020000000000); -const quint64 PseudoClass_Open = Q_UINT64_C(0x0000040000000000); -const quint64 PseudoClass_EditFocus = Q_UINT64_C(0x0000080000000000); -const quint64 PseudoClass_Alternate = Q_UINT64_C(0x0000100000000000); -const quint64 PseudoClass_Landscape = Q_UINT64_C(0x0000200000000000); -const quint64 PseudoClass_Portrait = Q_UINT64_C(0x0000400000000000); -const quint64 PseudoClass_LeftToRight = Q_UINT64_C(0x0000800000000000); -const quint64 PseudoClass_RightToLeft = Q_UINT64_C(0x0001000000000000); +const quint32 PseudoClass_Unknown = 0x00000000; +const quint32 PseudoClass_Unspecified = 0x00000001; +const quint32 PseudoClass_Landscape = 0x00000002; +const quint32 PseudoClass_Portrait = 0x00000004; +const quint32 PseudoClass_LeftToRight = 0x00000008; +const quint32 PseudoClass_RightToLeft = 0x00000010; // The Any specifier is never generated, but can be used as a wildcard in searches. -const quint64 PseudoClass_Any = Q_UINT64_C(0x0002000000000000); -const int NumPseudos = 50; +const quint32 PseudoClass_Any = 0x00000020; +const int NumPseudos = 7; -struct HB_CORE_PRIVATE_EXPORT Pseudo +struct HB_CORE_PRIVATE_EXPORT Pseudo //krazy:exclude=multiclasses { Pseudo(HbMemoryManager::MemoryType memType = HbMemoryManager::HeapMemory) : memoryType(memType), @@ -618,16 +266,9 @@ { } #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} - void print() const - { qDebug() <<"==============Pseudo::Print():Begin=================="; - qDebug() << "Pseudo::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "Pseudo::HbString name= " << name; - qDebug() << "Pseudo::HbString function = " << function; - qDebug() <<"==============Pseudo::Print():End=================="; - - } + void print() const; #endif + //Data HbMemoryManager::MemoryType memoryType; bool negated; @@ -636,7 +277,7 @@ HbString function; }; -struct HB_CORE_PRIVATE_EXPORT AttributeSelector +struct HB_CORE_PRIVATE_EXPORT AttributeSelector //krazy:exclude=multiclasses { enum ValueMatchType { NoMatch, @@ -648,31 +289,25 @@ inline AttributeSelector(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : memoryType(type), name(type), + nameHash(0), value(type), valueMatchCriterium(NoMatch), negated(false) {} +#ifdef CSS_PARSER_TRACES + void print() const; +#endif + HbMemoryManager::MemoryType memoryType; HbString name; + uint nameHash; HbString value; ValueMatchType valueMatchCriterium; bool negated; -#ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} - - void print() const - { - qDebug() <<"==============AttributeSelector::Print():Begin=================="; - qDebug() << "AttributeSelector::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "AttributeSelector::HbString name= " << name; - qDebug() << "AttributeSelector::HbString value = " << value; - qDebug() <<"==============AttributeSelector::Print():End=================="; - } -#endif }; -struct HB_CORE_PRIVATE_EXPORT BasicSelector +struct HB_CORE_PRIVATE_EXPORT BasicSelector //krazy:exclude=multiclasses { inline BasicSelector(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : memoryType(type), @@ -705,20 +340,9 @@ }; #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} - void print() const - { - qDebug() <<"\t \t"<<"==============BasicSelector::Print():Begin=================="; - qDebug() <<"\t \t"<<"BasicSelector::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() <<"\t \t"<<"BasicSelector::HbString elementName= " << elementName; -// qDebug() <<"\t \t"<<"BasicSelector::QStringList ids = " << ids; - qDebug() <<"\t \t"<<"BasicSelector::PseudoVector pseudos = "; - pseudos.print(); - qDebug() <<"\t \t"<< "BasicSelector::AttributeSelectorVector attributeSelectors = "; - attributeSelectors.print(); - qDebug() <<"\t \t"<<"==============BasicSelector::Print():End===================="; - } + void print() const; #endif + // Data HbMemoryManager::MemoryType memoryType; HbString elementName; @@ -729,7 +353,7 @@ Relation relationToNext; }; -struct HB_CORE_PRIVATE_EXPORT Selector +struct HB_CORE_PRIVATE_EXPORT Selector //krazy:exclude=multiclasses { Selector() : memoryType(HbMemoryManager::HeapMemory), @@ -746,137 +370,103 @@ QString pseudoElement() const; #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} + void print() const; +#endif - void print() const - { - qDebug() <<"\t "<<"==============Selector::Print():Begin=================="; - qDebug() <<"\t "<<"Selector::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() <<"\t "<<"Selector::BasicSelectorVector basicSelectors= "; - basicSelectors.print(); - qDebug() <<"\t "<<"==============Selector::Print():End=================="; - } -#endif // Data HbMemoryManager::MemoryType memoryType; HbVector basicSelectors; }; -enum PositionValueFlag { - ExtractedLeft = 0x0001, - ExtractedRight = 0x0002, - ExtractedTop = 0x0004, - ExtractedBottom = 0x0008, - ExtractedOrigin = 0x0010, - ExtractedAlign = 0x0020, - ExtractedMode = 0x0040, - ExtractedTextAlign = 0x0080, - ExtractedCenterH = 0x0100, - ExtractedCenterV = 0x0200, - ExtractedLayoutDirection = 0x0400, - ExtractedZValue = 0x0800, - ExtractedWrapMode = 0x1000 -}; -Q_DECLARE_FLAGS(PositionValueFlags, PositionValueFlag) +enum KnownPropertyFlag { + + // Generic + ExtractedLeft = 0x00000001, + ExtractedRight = 0x00000002, + ExtractedTop = 0x00000004, + ExtractedBottom = 0x00000008, + ExtractedCenterH = 0x00000010, + ExtractedCenterV = 0x00000020, + + ExtractedPrefW = 0x00000100, + ExtractedPrefH = 0x00000200, + ExtractedMinW = 0x00000400, + ExtractedMinH = 0x00000800, + ExtractedMaxW = 0x00001000, + ExtractedMaxH = 0x00002000, + ExtractedPolHor = 0x00004000, + ExtractedPolVer = 0x00008000, -enum GeometryValueFlag { - ExtractedPrefW = 0x0001, - ExtractedPrefH = 0x0002, - ExtractedMinW = 0x0004, - ExtractedMinH = 0x0008, - ExtractedMaxW = 0x0010, - ExtractedMaxH = 0x0020, - ExtractedPolHor = 0x0040, - ExtractedPolVer = 0x0080 + ExtractedLayoutDir = 0x00010000, + ExtractedZValue = 0x00020000, + ExtractedAlignment = 0x00040000, + + // Text specific + ExtractedWrapMode = 0x00200000, + ExtractedMinLines = 0x00400000, + ExtractedMaxLines = 0x00800000, + ExtractedFont = 0x01000000, + ExtractedFontSpec = 0x02000000, + + // Icon specific + ExtractedAspectRatioMode = 0x10000000, + + // Frame specific + ExtractedBorderWidths = 0x20000000, + + // Anchor specific + ExtractedAnchorDir = 0x80000000 }; -Q_DECLARE_FLAGS(GeometryValueFlags, GeometryValueFlag) +Q_DECLARE_FLAGS(KnownPropertyFlags, KnownPropertyFlag) -enum TextValueFlag { - ExtractedLineCountMin = 0x0001, - ExtractedLineCountMax = 0x0002 -}; -Q_DECLARE_FLAGS(TextValueFlags, TextValueFlag) - -struct GeometryValues +struct KnownProperties { + qreal mLeft, mTop, mRight, mBottom, mCenterH, mCenterV, mZ; qreal mPrefW, mPrefH, mMinW, mMinH, mMaxW, mMaxH; QSizePolicy mSizePolicy; - GeometryValueFlags mFlags; -}; + + HbCss::LayoutDirection mLayoutDir; + Qt::Alignment mAlignment; + + Hb::TextWrapping mTextWrapMode; + int mMinLines, mMaxLines; -struct PositionValues -{ - qreal mLeft, mTop, mRight, mBottom, mCenterH, mCenterV, mZ; - Qt::Alignment mPosition; - HbCss::Origin mOrigin; - HbCss::PositionMode mPositionMode; - Qt::Alignment mTextAlignment; - HbCss::LayoutDirection mLayoutDirection; - Hb::TextWrapping mTextWrapMode; - PositionValueFlags mFlags; + QFont mFont; + HbFontSpec mFontSpec; + + Qt::AspectRatioMode mAspectRatioMode; + + qreal mBorderWidths[HbCss::NumEdges]; + + HbAnchor::Direction mAnchorDir; + + KnownPropertyFlags mFlags; }; -struct TextValues +struct HB_CORE_PRIVATE_EXPORT ValueExtractor //krazy:exclude=multiclasses { - int mLineCountMin; - int mLineCountMax; - TextValueFlags mFlags; -}; - - -struct StyleRule; -struct MediaRule; -struct PageRule; -struct ImportRule; -struct VariableRule; //new added for variable support - -struct HB_CORE_PRIVATE_EXPORT ValueExtractor -{ - ValueExtractor(const HbVector &declarations, const HbDeviceProfile &profile, const QPalette & = QPalette()); + ValueExtractor(const HbVector &declarations, const HbDeviceProfile &profile); ValueExtractor(const HbVector &declarations, const QHash &varDeclarations, - const HbDeviceProfile &profile, const QPalette & = QPalette()); + const HbDeviceProfile &profile); ValueExtractor(const HbVector &varDeclarations, bool isVariable, const HbDeviceProfile &profile = HbDeviceProfile()); ValueExtractor(const QHash &varDecls, bool isVariable, const HbDeviceProfile &profile = HbDeviceProfile()); - bool extractFont(QFont *font, HbFontSpec *fontSpec, int *fontSizeAdjustment); - bool extractValue(const QString& variableName, HbVector& values) const; - bool extractValue(const QString& variableName, qreal& value); - bool extractValue( const QString &variableName, HbCss::Value &value ) const; + bool extractVariableValue(const QString &variableName, HbVector& values) const; + bool extractVariableValue(const QString &variableName, qreal& value); + bool extractVariableValue(const QString &variableName, HbCss::Value &value) const; bool extractExpressionValue(QString &expression, qreal &value); - bool extractBackground(QBrush *, QString *, Repeat *, Qt::Alignment *, HbCss::Origin *, HbCss::Attachment *, - HbCss::Origin *); - bool extractGeometry(GeometryValues &geomValues); - bool extractPosition(PositionValues &posValues); - bool extractBox(qreal *margins, qreal *paddings, qreal *spacing = 0); - bool extractBorder(qreal *borders, QBrush *colors, BorderStyle *Styles, QSize *radii); - bool extractOutline(qreal *borders, QBrush *colors, BorderStyle *Styles, QSize *radii, qreal *offsets); - bool extractPalette(QBrush *fg, QBrush *sfg, QBrush *sbg, QBrush *abg); - int extractStyleFeatures(); - bool extractImage(QIcon *icon, Qt::Alignment *a, QSize *size); - bool extractLayout(QString *layoutName, QString *sectionName); - bool extractAspectRatioMode(Qt::AspectRatioMode *mode); - bool extractParameters( const QList ¶ms, QList &values ); - bool extractColor( QColor *col ) const; - bool extractTextValues( TextValues &textValues ); - bool asBool(const Declaration &decl); - qreal asReal(const Declaration &decl); - - int lengthValue(const Declaration &decl); + bool extractKnownProperties(KnownProperties &prop); + bool extractCustomProperties(const QList &keys, QList &values); + bool extractLayout(QString &layoutName, QString §ionName); + bool extractColor(QColor &color) const; private: - void extractFont(); - void borderValue(const Declaration &decl, qreal *width, HbCss::BorderStyle *style, QBrush *color); - int lengthValue(const Value& v); - qreal asReal(const Value& v); - qreal asReal(QString &s, Value::Type type); - bool asReal(QString &s, qreal &value); - void asReals(const Declaration &decl, qreal *m); - QSizePolicy asSizePolicy(const Declaration &decl); - QSizePolicy::Policy asPolicy(const Value& v); - void lengthValues(const Declaration &decl, int *m); - QSize sizeValue(const Declaration &decl); - void sizeValues(const Declaration &decl, QSize *radii); + + qreal asReal(const Declaration &decl, bool *ok = 0); + qreal asReal(const Value &v, bool *ok = 0); + qreal asReal(QString &s, Value::Type type, bool *ok = 0); + bool asReals(const Declaration &decl, qreal *m); struct ExpressionValue { @@ -899,18 +489,13 @@ HbVector declarations; HbVector variableDeclarations; //for variables QHash variableDeclarationsHash; - QFont f; - HbFontSpec fSpec; - int adjustment; - int fontExtracted; - QPalette pal; HbDeviceProfile currentProfile; QList expressionValues; // for parsed expression string }; struct StyleSheet; -struct HB_CORE_PRIVATE_EXPORT StyleRule +struct HB_CORE_PRIVATE_EXPORT StyleRule //krazy:exclude=multiclasses { StyleRule(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : memoryType(type), @@ -922,19 +507,9 @@ {} #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} + void print() const; +#endif - void print() const - { - qDebug() <<"==============StyleRule::Print():Begin=================="; - qDebug() << "StyleRule::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "StyleRule::SelectorVector selectors = "; - selectors.print(); - qDebug() << "StyleRule::DeclarationVector declarations = "; - declarations.print(); - qDebug() <<"==============StyleRule::Print():End=================="; - } -#endif // Data HbMemoryManager::MemoryType memoryType; HbVector selectors; @@ -946,7 +521,7 @@ typedef QPair WeightedRule; -struct HB_CORE_PRIVATE_EXPORT VariableRule +struct HB_CORE_PRIVATE_EXPORT VariableRule //krazy:exclude=multiclasses { VariableRule(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : memoryType (type), @@ -954,22 +529,15 @@ {} #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} - void print() const - { - qDebug() <<"==============VariableRule::Print():Begin=================="; - qDebug() << "VariableRule::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "VariableRule::DeclarationVector declarations = "; - declarations.print(); - qDebug() <<"==============VariableRule::Print():End=================="; - } + void print() const; #endif + // Data HbMemoryManager::MemoryType memoryType; HbVector declarations; }; -struct HB_CORE_PRIVATE_EXPORT MediaRule +struct HB_CORE_PRIVATE_EXPORT MediaRule //krazy:exclude=multiclasses { MediaRule(HbMemoryManager::MemoryType type=HbMemoryManager::HeapMemory) : memoryType(type), @@ -978,18 +546,9 @@ {} #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} - void print() const - { - qDebug() <<"==============MediaRule::Print():Begin=================="; - qDebug() << "MediaRule::HbMemoryManager::MemoryType memoryType = " << memoryType; -// qDebug() << "MediaRule::QStringList media = " << media; - qDebug() << "MediaRule::StyleRuleVector styleRules = "; - styleRules.print(); - qDebug() <<"==============MediaRule::Print():End=================="; - - } + void print() const; #endif + // data HbMemoryManager::MemoryType memoryType; //ToDo: Replace it with HbStringList if we have it in future @@ -997,7 +556,7 @@ HbVector styleRules; }; -struct HB_CORE_PRIVATE_EXPORT PageRule +struct HB_CORE_PRIVATE_EXPORT PageRule //krazy:exclude=multiclasses { PageRule(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : memoryType(type), @@ -1006,25 +565,16 @@ {} #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} + void print() const; +#endif - void print() const - { - qDebug() <<"==============PageRule::Print():Begin=================="; - qDebug() << "PageRule::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "PageRule::HbString selector = " << selector; - qDebug() << "PageRule::DeclarationVector declarations = "; - declarations.print(); - qDebug() <<"==============PageRule::Print():End=================="; - } -#endif // Data HbMemoryManager::MemoryType memoryType; HbString selector; HbVector declarations; }; -struct HB_CORE_PRIVATE_EXPORT ImportRule +struct HB_CORE_PRIVATE_EXPORT ImportRule //krazy:exclude=multiclasses { ImportRule(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : memoryType(type), @@ -1033,17 +583,9 @@ {} #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} + void print() const; +#endif - void print() const - { - qDebug() <<"==============ImportRule::Print():Begin=================="; - qDebug() << "ImportRule::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "ImportRule::HbString href = " << href; -// qDebug() << "ImportRule::QStringList media = " << media; - qDebug() <<"==============ImportRule::Print():End=================="; - } -#endif // Data HbMemoryManager::MemoryType memoryType; HbString href; @@ -1066,20 +608,9 @@ { } #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} + void print() const; +#endif - void print() const - { - qDebug() <<"==============WidgetStyleRules::Print():Begin=================="; - qDebug() << "Generic rules:"; - styleRules.print(); - qDebug() << "Portrait rules:"; - portraitRules.print(); - qDebug() << "Landscape rules:"; - landscapeRules.print(); - qDebug() <<"==============WidgetStyleRules::Print():End=================="; - } -#endif // Data uint classNameHash; HbVector styleRules; @@ -1087,7 +618,7 @@ HbVector landscapeRules; }; -struct HB_AUTOTEST_EXPORT StyleSheet +struct HB_AUTOTEST_EXPORT StyleSheet //krazy:exclude=multiclasses { StyleSheet(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : memoryType(type), @@ -1127,24 +658,7 @@ } #ifdef CSS_PARSER_TRACES - bool supportsPrinting() const {return true;} - - void print() const - { - qDebug() <<"==============StyleSheet::Print():Begin=================="; - qDebug() << "StyleSheet::HbMemoryManager::MemoryType memoryType = " << memoryType; - qDebug() << "StyleSheet::VariableRuleVector variableRules = "; - variableRules.print(); - qDebug() << "StyleSheet::WidgetStyleRuleVector widgetRules = "; - widgetRules.print(); - qDebug() << "StyleSheet::MediaRuleVector mediaRules = "; - mediaRules.print(); - qDebug() << "StyleSheet::PageRulesVector pageRules = "; - pageRules.print(); - qDebug() << "StyleSheet::ImportRuleVector importRules = "; - importRules.print(); - qDebug() <<"==============StyleSheet::Print():End=================="; - } + void print() const; #endif // Utility functions @@ -1180,7 +694,7 @@ #endif }; -class HB_AUTOTEST_EXPORT StyleSelector +class HB_AUTOTEST_EXPORT StyleSelector //krazy:exclude=multiclasses { public: StyleSelector(); @@ -1271,7 +785,7 @@ OR }; -struct HB_CORE_PRIVATE_EXPORT Symbol +struct HB_CORE_PRIVATE_EXPORT Symbol //krazy:exclude=multiclasses { inline Symbol() : start(0), len(-1) {} TokenType token; @@ -1280,15 +794,14 @@ QString lexem() const; }; -class /*Q_AUTOTEST_EXPORT*/ Scanner +class Scanner { public: static QString preprocess(const QString &input, bool *hasEscapeSequences = 0); static void scan(const QString &preprocessedInput, QVector *symbols); - static const char *tokenName(TokenType t); }; -class HB_CORE_PRIVATE_EXPORT Parser +class HB_CORE_PRIVATE_EXPORT Parser //krazy:exclude=multiclasses { public: enum Error{ @@ -1388,6 +901,4 @@ } // namespace HbCss -//QT_END_NAMESPACE - -#endif +#endif // HBCSSPARSER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbcssscanner_p.cpp --- a/src/hbcore/cssparser/hbcssscanner_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbcssscanner_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,14 +23,11 @@ ** ****************************************************************************/ -// namespace added to avoid symbol conflicts with QT. -namespace HbQCss { - // auto generated. DO NOT EDIT. -class QCssScanner_Generated +class HbCssScanner_Generated { public: - QCssScanner_Generated(const QString &inp); + HbCssScanner_Generated(const QString &inp); inline QChar next() { return (pos < input.length()) ? input.at(pos++).toLower() : QChar(); @@ -44,7 +41,7 @@ int lexemLength; }; -QCssScanner_Generated::QCssScanner_Generated(const QString &inp) +HbCssScanner_Generated::HbCssScanner_Generated(const QString &inp) { input = inp; pos = 0; @@ -52,8 +49,20 @@ lexemLength = 0; } +int HbCssScanner_Generated::handleCommentStart() +{ + while (pos < input.size() - 1) { + if (input.at(pos) == QLatin1Char('*') + && input.at(pos + 1) == QLatin1Char('/')) { + pos += 2; + break; + } + ++pos; + } + return HbCss::S; +} -int QCssScanner_Generated::lex() +int HbCssScanner_Generated::lex() { lexemStart = pos; lexemLength = 0; @@ -1130,6 +1139,3 @@ } return token; } - -} // namespace - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hblayeredstyleloader_p.cpp --- a/src/hbcore/cssparser/hblayeredstyleloader_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hblayeredstyleloader_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -57,8 +57,8 @@ /*! \proto \class HbLayeredStyleLoader - \brief allows discrete collections of stylesheet definitions to be layered using a priority system - to enforce the sequence of stylesheet definitions + \brief allows discrete collections of stylesheet definitions to be layered using a priority + system to enforce the sequence of stylesheet definitions HbLayeredStyleLoader allows stylesheet files to be loaded and unloaded into separate layers, specified by a priority value. Any stylesheet definitions loaded will be then be @@ -101,6 +101,12 @@ if (stacks) { if (!stacks->contains(con)) { (*stacks)[con].mConcern = con; + if (con != Concern_All) { + HbLayeredStyleLoader *allStack = getStack(Concern_All); + if (allStack) { + (*stacks)[con].mUsedLayers = allStack->mUsedLayers; + } + } } result = &((*stacks)[con]); } @@ -124,7 +130,8 @@ \param the priority of the layer to be used, selected from LayerPriority \return the handle to be used to unload the corresponding stylesheet */ -int HbLayeredStyleLoader::load(const QString &fileName, LayerPriority priority, bool enableBinarySupport) +int HbLayeredStyleLoader::load( + const QString &fileName, LayerPriority priority) { HB_START_TIME(); @@ -141,7 +148,8 @@ //if file doesn't exist no need to proceed further if (fileExists) { //if sharing is required based on Layer Priority, e.g. Core, Operator, Theme, - //get the shared stylesheet from the theme client, which in turn fetches it from the server. + //get the shared stylesheet from the theme client, which in turn fetches it + // from the server. if (sharingNeeded(priority)) { #ifdef LAYEREDSTYLELOADER_DEBUG @@ -160,24 +168,12 @@ //if sharing of stylesheet is not required, it means stylesheet is app specific //so it won't be loaded from the server styleSheet = HbMemoryUtils::create(HbMemoryManager::HeapMemory); - if (isBinaryFile(fileName)) { - loadBinary (fileName, styleSheet); - } else if (enableBinarySupport && loadBinary(getBinaryFileName(fileName), styleSheet)) { - // if only binary support is enabled then only try to load the corresponding - // binary file from the temp folder. - // it will speed up the performance as we don't have to search whether file - // exists or not. - } else { - HbCss::Parser parser; - parser.init(fileName, true); - if (parser.parse(styleSheet)) { - if (enableBinarySupport) { - saveBinary (getBinaryFileName(fileName), styleSheet); - } - } else { - HbMemoryUtils::release(styleSheet); - styleSheet = 0; - } + + HbCss::Parser parser; + parser.init(fileName, true); + if (!parser.parse(styleSheet)) { + HbMemoryUtils::release(styleSheet); + styleSheet = 0; } } } @@ -192,6 +188,8 @@ #ifdef LAYEREDSTYLELOADER_DEBUG qDebug("Handle returned: %x", handle); #endif + + updateLayersListIfRequired(priority); return handle; } @@ -216,7 +214,8 @@ HbCss::Parser parser; parser.init(contents, false); - HbCss::StyleSheet* styleSheet = HbMemoryUtils::create(HbMemoryManager::HeapMemory); + HbCss::StyleSheet* styleSheet = + HbMemoryUtils::create(HbMemoryManager::HeapMemory); if (parser.parse(styleSheet)) { layer.styleSelector.addStyleSheet(styleSheet); @@ -224,6 +223,7 @@ } } + updateLayersListIfRequired(priority); return handle; } @@ -327,11 +327,13 @@ \note The effects will not be noticed until other related stylesheets are subsequently parsed. - \note If this is not performed, the stylesheets will be automatically deleted on application shutdown. + \note If this is not performed, the stylesheets will be automatically deleted on application + shutdown. \sa unload(int handle, int priority) - \param handles handles that were returned from a call to load() or loadDir() with the same value for \a priority + \param handles handles that were returned from a call to load() or loadDir() with the same + value for \a priority \param priority the priority of the layer from which to unload the specified stylesheets */ void HbLayeredStyleLoader::unload(const QVector &handles, LayerPriority priority) @@ -377,12 +379,14 @@ } -static inline bool qcss_selectorStyleRuleLessThan(const QPair &lhs, const QPair &rhs) +static inline bool qcss_selectorStyleRuleLessThan( + const QPair &lhs, const QPair &rhs) { return lhs.first < rhs.first; } -static inline bool qcss_selectorDeclarationLessThan(const QPair &lhs, const QPair &rhs) +static inline bool qcss_selectorDeclarationLessThan( + const QPair &lhs, const QPair &rhs) { return lhs.first < rhs.first; } @@ -395,9 +399,9 @@ loader->loadCss(widget); QVector > weightedRulesList; - HbLayeredStyleLoader *allStack = getStack(Concern_All); + HbLayeredStyleLoader *allStack = mConcern == Concern_All ? 0 : getStack(Concern_All); - QListIterator iter(LayerList()); + QListIterator iter(mUsedLayers); while (iter.hasNext()) { LayerPriority priority = iter.next(); QMap::const_iterator it = mStyleLayers.constFind(priority); @@ -407,7 +411,8 @@ } } if (allStack) { - QMap::const_iterator allIt = allStack->mStyleLayers.constFind(priority); + QMap::const_iterator allIt = + allStack->mStyleLayers.constFind(priority); if (allIt != allStack->mStyleLayers.constEnd()) { if (allIt->styleSelector.hasOrientationSpecificStyleRules(node)) { return true; @@ -425,27 +430,35 @@ \param extraPseudo a string corresponding to the subcontrol of the node \return declarations */ -HbVector HbLayeredStyleLoader::declarationsForNode(HbStyleSelector::NodePtr node, - const Qt::Orientation orientation, const char *extraPseudo) const +HbVector HbLayeredStyleLoader::declarationsForNode( + HbStyleSelector::NodePtr node, + const Qt::Orientation orientation, + const char *extraPseudo) const { HbWidget* widget = (HbWidget*) node.ptr; HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance(); loader->loadCss(widget); QVector > weightedDeclsList; - HbLayeredStyleLoader *allStack = getStack(Concern_All); + HbLayeredStyleLoader *allStack = mConcern == Concern_All ? 0 : getStack(Concern_All); - QListIterator iter(LayerList()); + QListIterator iter(mUsedLayers); while (iter.hasNext()) { LayerPriority priority = iter.next(); QMap::const_iterator it = mStyleLayers.constFind(priority); if (it != mStyleLayers.constEnd()) { - weightedDeclsList.append(it->styleSelector.weightedDeclarationsForNode(node, orientation, extraPseudo)); + weightedDeclsList.append( + it->styleSelector.weightedDeclarationsForNode(node, orientation, extraPseudo)); } if (allStack) { - QMap::const_iterator allIt = allStack->mStyleLayers.constFind(priority); + QMap::const_iterator allIt = + allStack->mStyleLayers.constFind(priority); if (allIt != allStack->mStyleLayers.constEnd()) { - weightedDeclsList.append(allIt->styleSelector.weightedDeclarationsForNode(node, orientation, extraPseudo)); + weightedDeclsList.append( + allIt->styleSelector.weightedDeclarationsForNode( + node, + orientation, + extraPseudo)); } } } @@ -481,19 +494,22 @@ loader->loadCss(widget); QVector > weightedRulesList; - HbLayeredStyleLoader *allStack = getStack(Concern_All); + HbLayeredStyleLoader *allStack = mConcern == Concern_All ? 0 : getStack(Concern_All); - QListIterator iter(LayerList()); + QListIterator iter(mUsedLayers); while (iter.hasNext()) { LayerPriority priority = iter.next(); QMap::const_iterator it = mStyleLayers.constFind(priority); if (it != mStyleLayers.constEnd()) { - weightedRulesList.append(it->styleSelector.weightedStyleRulesForNode(node, orientation)); + weightedRulesList.append( + it->styleSelector.weightedStyleRulesForNode(node, orientation)); } if (allStack) { - QMap::const_iterator allIt = allStack->mStyleLayers.constFind(priority); + QMap::const_iterator allIt = + allStack->mStyleLayers.constFind(priority); if (allIt != allStack->mStyleLayers.constEnd()) { - weightedRulesList.append(allIt->styleSelector.weightedStyleRulesForNode(node, orientation)); + weightedRulesList.append( + allIt->styleSelector.weightedStyleRulesForNode(node, orientation)); } } } @@ -527,9 +543,9 @@ */ void HbLayeredStyleLoader::variableRuleSets(QHash *variables) const { - HbLayeredStyleLoader *allStack = getStack(Concern_All); + HbLayeredStyleLoader *allStack = mConcern == Concern_All ? 0 : getStack(Concern_All); - QListIterator iter(LayerList()); + QListIterator iter(mUsedLayers); while (iter.hasNext()) { LayerPriority priority = iter.next(); QMap::const_iterator it = mStyleLayers.constFind(priority); @@ -541,14 +557,16 @@ } else { // These variables are from Core Priority // insert it into hash to be used during look up, this happens only once - // next time onwards instead of comparing each value from list, it's looked from this hash only. + // next time onwards instead of comparing each value from list, it's looked from + // this hash only. if (!mDefaultVariables.count()) { it->styleSelector.variableRuleSets(&mDefaultVariables); } } } if (allStack) { - QMap::const_iterator allIt = allStack->mStyleLayers.constFind(priority); + QMap::const_iterator allIt = + allStack->mStyleLayers.constFind(priority); if (allIt != allStack->mStyleLayers.constEnd()) { allIt->styleSelector.variableRuleSets(variables); } @@ -561,7 +579,9 @@ \return True if it finds in default colorgroup.css, false otherwise */ -bool HbLayeredStyleLoader::findInDefaultVariables(const QString& variableName, HbCss::Value &val) const +bool HbLayeredStyleLoader::findInDefaultVariables( + const QString& variableName, + HbCss::Value &val) const { bool found = false; if (mDefaultVariables.contains(variableName)) { @@ -573,381 +593,31 @@ /*! - Gets the list of all priority layers in use in this or the 'All' stack + Updates the cached list of used layers to include the specified layer. + If this is the All stack, all other stacks' used lists are also updated + to include this layer. - \return List of all layer priorities in use + \param The LayerPriority to add if not already present */ -QList HbLayeredStyleLoader::LayerList() const +void HbLayeredStyleLoader::updateLayersListIfRequired(LayerPriority priority) { - QList mergedLayers = mStyleLayers.keys(); - HbLayeredStyleLoader *allStack = getStack(Concern_All); - if (allStack) { - QList allLayers = allStack->mStyleLayers.keys(); - for (int i=0; i::iterator iter = stacks->begin(); + while (iter != stacks->end()) { + if (!iter->mUsedLayers.contains(priority)) { + iter->mUsedLayers.append(priority); + qSort(iter->mUsedLayers); + } + ++iter; } } } - qSort(mergedLayers); - - return mergedLayers; } - - -/*! - Saves the contents of a stylesheet into a binary file. - \note if the filepath and filename does not exists, it will be created first. - - \param fileName, file in which the binary data will be stored. - \param defaultSs, stylesheet which needs to be stored as binary format. -*/ -bool HbLayeredStyleLoader::saveBinary(const QString& fileName, - HbCss::StyleSheet *defaultSs) -{ - QFile file(fileName); - QDir dir; - bool success = false; - int index = fileName.lastIndexOf ("/"); - QString dirPath = fileName.left(index); - - if (!dir.exists(dirPath)) { - success =dir.mkpath(dirPath); - - } - if (file.open(QFile::WriteOnly)) { - - // Create writable datastream - QDataStream stream(&file); - - //write the number of variables rules - - int var_count =0; - var_count = defaultSs->variableRules.count(); - stream << defaultSs->variableRules.count(); - - if (var_count != 0) { - //call the savedeclaration for variable rules - for (int varRuleCount=0;varRuleCount decl = defaultSs->variableRules.at(varRuleCount).declarations; - saveDeclarations(stream,&decl); - } - } - - int widgetstack_count = defaultSs->widgetRules.count(); - stream << widgetstack_count; - foreach (const HbCss::WidgetStyleRules &rules, defaultSs->widgetRules) { - stream << rules.classNameHash; - saveStyleRules(stream, &rules.styleRules); - saveStyleRules(stream, &rules.portraitRules); - saveStyleRules(stream, &rules.landscapeRules); - }// Widget stack loop end - - file.close(); - success = true; - } - - if (!success) { - qWarning() << "Failed to save binary stylesheet file:" << fileName; - } - - return success; -} - -/*! - Load the contents of a binary file into stylesheet. - - \param fileName, file from which the binary data will be read - \param defaultSs, stylesheet which will be loaded. -*/ -bool HbLayeredStyleLoader::loadBinary(const QString& fileName, HbCss::StyleSheet *sheet) -{ - QTime timer; - timer.start(); -#ifdef HB_CSS_INSPECTOR - sheet->fileName = fileName; - mCurrentSheet = sheet; -#endif - QFile file(fileName); - if (file.open (QFile::ReadOnly)) { - - //create a qbytearray and dump the file content in it. - QByteArray arr = file.readAll(); - QDataStream stream(arr); - - //getting the variable rules count - int var_count; - stream >> var_count; - - if (var_count!=0) { - for (int varRuleCount=0; varRuleCount declarations = loadDeclarations(stream); - var_rule.declarations = declarations; - //storing the variable rules in stylesheet - sheet->variableRules.append(var_rule); - } - } - - int widgetstacks_count; - stream >> widgetstacks_count; - for (int stack = 0; stack < widgetstacks_count; stack++) { - // Create the widget stack if necessary - uint classNameHash; - stream >> classNameHash; - - HbCss::WidgetStyleRules rules(classNameHash, sheet->memoryType); - HbCss::WidgetStyleRules* addedStack = sheet->addWidgetStack(rules); - - loadStyleRules(stream, addedStack->styleRules); - loadStyleRules(stream, addedStack->portraitRules); - loadStyleRules(stream, addedStack->landscapeRules); - } // widget stacks loop end - file.close(); -#ifdef LAYEREDSTYLELOADER_DEBUG - qDebug() << "time elapsed_loadbinary_function: %d ms" << timer.elapsed(); -#endif - return true; - - } -#ifdef LAYEREDSTYLELOADER_DEBUG - qWarning() << "Failed to load binary file:" << fileName; -#endif - return false; - -} - -/*! - saveStyleRules to a datastream. - - \param stream, data stream which will be populated by the style rules - \param decls, vector of style rules which needs to be serialized into datastream. -*/ -void HbLayeredStyleLoader::saveStyleRules(QDataStream &stream, const HbVector *rules) -{ - //writing the number of style rules - int styleRuleCount = rules->count(); - stream << styleRuleCount; - - //iterating through each style rule and writing the content - int counter=0; - for (counter=0; counter at(counter).selectors.count(); - stream << num_selectors; - for (int numSel =0; numSel< num_selectors; numSel++) { - //writing the number of basic selectors - int num_basicselector = rules->at(counter).selectors.at(numSel).basicSelectors.count(); - stream << num_basicselector; - for (int numBasicSel =0; numBasicSel < num_basicselector; numBasicSel++) { - //writing the basic selector vector contents - stream << rules->at(counter).selectors.at(numSel).basicSelectors.at(numBasicSel).elementName; - //writing the number of attributeselectors (to check if any present) - int num_attribueselectors = rules->at(counter).selectors.at(numSel).basicSelectors.at(numBasicSel).attributeSelectors.count(); - stream << num_attribueselectors; - if (num_attribueselectors != 0) { - for (int numAttSel=0;numAttSel< num_attribueselectors; numAttSel++) { - HbCss::AttributeSelector asel = rules->at(counter).selectors.at(numSel).basicSelectors.at(numBasicSel).attributeSelectors.at(numAttSel); - stream << asel.name; - stream << asel.value; - stream << asel.valueMatchCriterium; - } - } - } - } - //writing the declarations - - HbVector stylerule_decl = rules->at(counter).declarations; - //call the savedeclaration - saveDeclarations(stream, &stylerule_decl); - }//style rule loop end -} - -/*! - loadStyleRules from a datastream. - - \param stream, data stream from which the style rules will be read. - \return HbVector of style rules -*/ -void HbLayeredStyleLoader::loadStyleRules(QDataStream &stream, HbVector &rules) -{ - //populating the style rules (selectors + declarations) - int num_stylerules; - stream >> num_stylerules; - - //iterating for each style rule and populating the selectors and declarations - for (int counter =0; counter < num_stylerules; counter++) { - HbCss::StyleRule style_rule; - //getting the number of selector - int num_selector; - stream >> num_selector; - for (int numSel=0; numSel > num_basicSelector; - for (int numBsel=0; numBsel > bsel.elementName;//elementname; - //getting the number of attributeselectors - int num_attributeselectors; - stream >> num_attributeselectors; - if (num_attributeselectors != 0) { //has some content - for (int numAttSel =0;numAttSel < num_attributeselectors; numAttSel++) { - HbCss::AttributeSelector asel; - stream >> asel.name; - stream >> asel.value; - int valueMatchCriterium; - stream >> valueMatchCriterium; - asel.valueMatchCriterium =(HbCss::AttributeSelector::ValueMatchType)valueMatchCriterium; - bsel.attributeSelectors.append(asel); - } - } - sel.basicSelectors.append (bsel); - } - style_rule.selectors.append (sel); - } - - //populating the declarations - HbVector declarations = loadDeclarations(stream); - style_rule.declarations= declarations; -#ifdef HB_CSS_INSPECTOR - style_rule.owningStyleSheet = mCurrentSheet; -#endif - rules.append(style_rule); - }// style rule loop end -} - -/*! - saveDeclarations to a datastream. - - \param stream, data stream which will be populated by the declarations - \param decls, vector of declarations which needs to be serialized into datastream. -*/ -void HbLayeredStyleLoader::saveDeclarations(QDataStream & stream, - HbVector* decls) -{ - // number of declarations in variable rules - int decl_count = decls->count(); - stream << decl_count; - - //looping through the declarations and storing the property and values for each declaration. - - int i=0; - for (i=0; iat(i); - //writing the property and property id - stream << declaration.property; - stream << declaration.propertyId; - //writing the value count - stream << declaration.values.count(); - - //writing the values - int j=0; - for (j=0; j HbLayeredStyleLoader::loadDeclarations(QDataStream & stream) -{ - HbVector declarations; - //getting the number of declarations - int decl_count; - stream >> decl_count; - - // read all declarations - for (int i=0; i> decl.property; - int propertyid =0; - stream >> propertyid; - decl.propertyId = (HbCss::Property)propertyid; - - //get the values count and iterate to get the multiple values - int val_count; - stream >> val_count; - int j=0; - for (j=0; j> value; - val.variant = value; - int type; - stream >> type; - val.type = (HbCss::Value::Type) type; - decl.values.append(val); - - } - stream >> decl.important; - declarations.append (decl); - } - - return declarations; -} - -/*! - Checks whether a given file is binary or not. - - \note The version check will be added later. - - \param fileName, CssFile for which the binary check needs to be done - \return true if the file is binary. -*/ -bool HbLayeredStyleLoader::isBinaryFile(const QString& fileName) -{ - QString extension = fileName.right(3); - if (extension== "bin") { - return true; - } - return false; -} - -/*! - Returns a binary file name corresponding to provided filename.binary file can be used - for writing and reading the stylesheet content. - - \note The Timestamp comparision mechanism will be added later - - \param fileName, CssFile for which the binaryfilename is required - \return BinaryFileName including the complete file syytem path. -*/ -QString HbLayeredStyleLoader::getBinaryFileName(const QString &fileName) -{ - static const QString tempPath = QDir::tempPath(); - QString binaryFileName = tempPath + "/"; - int hbindex ; - hbindex = fileName.indexOf("hb", 0, Qt::CaseInsensitive); - QString pathToAppend; - if (hbindex == -1) { - int nameIndex = fileName.lastIndexOf("/"); - pathToAppend = fileName.right(fileName.length()-nameIndex-1); - } else { - pathToAppend = fileName.right(fileName.length()-hbindex); - } - binaryFileName.append(pathToAppend); - // append our binary extension - binaryFileName.append(".bin"); - - return binaryFileName; -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hblayeredstyleloader_p.h --- a/src/hbcore/cssparser/hblayeredstyleloader_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hblayeredstyleloader_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -65,7 +65,7 @@ return (layerPriority >= Priority_AppTheme && layerPriority <= Priority_Application )? false : true; } - int load(const QString &fileName, LayerPriority priority, bool enableBinarySupport =false); + int load(const QString &fileName, LayerPriority priority); int load(QIODevice *device, LayerPriority priority); QVector loadAll(const QStringList &files, LayerPriority priority); QVector loadDir(const QString &dirPath, QDir::SortFlags sort, LayerPriority priority); @@ -84,17 +84,10 @@ HbVector styleRulesForNode(HbStyleSelector::NodePtr node, const Qt::Orientation orientation) const; void variableRuleSets(QHash *variables) const; - -private: - QList LayerList() const; - bool loadBinary(const QString& fileName,HbCss::StyleSheet *styleSheet); - bool saveBinary(const QString& fileName,HbCss::StyleSheet *styleSheet); - void saveDeclarations(QDataStream & stream,HbVector* decls ); - HbVector loadDeclarations(QDataStream & stream ); - void saveStyleRules(QDataStream &stream, const HbVector *rules); - void loadStyleRules(QDataStream &stream, HbVector &rules); - bool isBinaryFile(const QString& fileName); - QString getBinaryFileName(const QString& fileName); + +protected: + void updateLayersListIfRequired(LayerPriority priority); + QList mUsedLayers; private: PriorityLayerMap mStyleLayers; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbstyleloader.cpp --- a/src/hbcore/cssparser/hbstyleloader.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbstyleloader.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -48,6 +48,10 @@ are at least equally specific and define the same properties will override those equivalent platform property definitions. + For any stylesheet registered that correspond to properties that are not defined by the + platform, the set values will not be reset when the corresponding stylesheet is + unregister. + In order to remove stylesheets or layout definitions that were previously registered, the same filename should be provided to the corresponding unregister method. Again, a repolish is needed in order to detect the changes. diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbstyleselector_p.cpp --- a/src/hbcore/cssparser/hbstyleselector_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbstyleselector_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -67,6 +67,8 @@ return level; } +const uint CLASS_HASH = qHash(QString("class")); + bool HbStyleSelector::attributeMatches(NodePtr node, const HbCss::AttributeSelector &attr) const { if (isNullNode(node)) { @@ -78,8 +80,8 @@ QGraphicsWidget *widget = WIDGET(node); - QHash &cache = mAttributeCache[widget]; - QHash::const_iterator cacheIt = cache.constFind(attr.name); + QHash &cache = mAttributeCache[widget]; + QHash::const_iterator cacheIt = cache.constFind(attr.nameHash); if (cacheIt != cache.constEnd()) { aVal = cacheIt.value(); } else { @@ -87,11 +89,10 @@ QVariant value = widget->property(attr.name.toLatin1()); if (!value.isValid()) { - if (attr.name == QLatin1String("class")) { + if (attr.nameHash == CLASS_HASH) { QString className = QString::fromLatin1(metaObject ->className()); - if (className.contains(QLatin1Char(':'))) - className.replace(QLatin1Char(':'), QLatin1Char('-')); + className.replace(QLatin1Char(':'), QLatin1Char('-')); aVal.mValue1 = className; } else { // Requested property not found. @@ -112,17 +113,19 @@ aVal.mEmptyValue = icon.isNull(); #endif } - const QMetaProperty metaProperty = metaObject->property(metaObject->indexOfProperty(attr.name.toLatin1())); + const QMetaProperty metaProperty = + metaObject->property(metaObject->indexOfProperty(attr.name.toLatin1())); if (metaProperty.isEnumType()) { aVal.mValue2 = metaProperty.enumerator().valueToKey(value.toInt()); } } - cache[attr.name] = aVal; + cache[attr.nameHash] = aVal; } bool match(false); if (attr.valueMatchCriterium == HbCss::AttributeSelector::MatchContains) { - QStringList lst = aVal.mValue1.split(QLatin1Char(' ')) + aVal.mValue2.split(QLatin1Char(' ')); + QStringList lst = aVal.mValue1.split(QLatin1Char(' ')) + + aVal.mValue2.split(QLatin1Char(' ')); match = lst.contains(attr.value); } else if (attr.valueMatchCriterium == HbCss::AttributeSelector::MatchEqual) { match = (aVal.mValue1 == attr.value || aVal.mValue2 == attr.value); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbstyleselector_p.h --- a/src/hbcore/cssparser/hbstyleselector_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbstyleselector_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -52,7 +52,7 @@ QString mValue2; bool mEmptyValue; }; - mutable QHash > mAttributeCache; + mutable QHash > mAttributeCache; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbwidgetstyleloader_p.cpp --- a/src/hbcore/cssparser/hbwidgetstyleloader_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbwidgetstyleloader_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,6 @@ #include "hbinstance_p.h" #include #include "hbstyle_p.h" -#include "hbcolortheme_p.h" #endif #include "hbwidgetstyleloader_p.h" #include "hbwidgetloader_p.h" @@ -57,8 +56,8 @@ Multiple FileSets can be active at any given time, and apply to any layer of any stack. - A list of class names that CSS has been loaded for is maintained for each FileSet, and the parent - hierarchy is navigated up to HbWidget to load CSS for all parent classes. + A list of class names that CSS has been loaded for is maintained for each FileSet, and the + parent hierarchy is navigated up to HbWidget to load CSS for all parent classes. \note When a FileSet is removed, the corresponding layer of the CSS stack will be cleared. Any other FileSets active on the same layer will have their loaded list cleared, and required @@ -194,7 +193,8 @@ \return whether the addition was successful */ /* -bool HbWidgetStyleLoader::addFileSet(const QString &pathPattern, const HbLayeredStyleLoader::Concern concern, +bool HbWidgetStyleLoader::addFileSet(const QString &pathPattern, + const HbLayeredStyleLoader::Concern concern, const HbLayeredStyleLoader::LayerPriority priority) { return doAddFileSet(pathPattern, FileSetType_Pattern, concern, priority); @@ -242,10 +242,6 @@ if (HbInstancePrivate::d_ptr()->mStyle) { HbInstancePrivate::d_ptr()->mStyle->d_func()->clearStyleSheetCaches(); } - if ( concern == HbLayeredStyleLoader::Concern_Colors - || concern == HbLayeredStyleLoader::Concern_All) { - HbColorTheme::instance()->flushVariableCache(); - } #endif #ifdef WIDGETSTYLELOADER_DEBUG @@ -312,13 +308,6 @@ if (HbInstancePrivate::d_ptr()->mStyle) { HbInstancePrivate::d_ptr()->mStyle->d_func()->clearStyleSheetCaches(); } - if ( concern && (*concern == HbLayeredStyleLoader::Concern_Colors || - *concern == HbLayeredStyleLoader::Concern_All)) { - HbColorTheme *colorThemeInstance = HbColorTheme::instance(); - if (colorThemeInstance) { // Check that the instance has not been destroyed. - colorThemeInstance->flushVariableCache(); - } - } #endif } #ifdef WIDGETSTYLELOADER_DEBUG @@ -341,7 +330,8 @@ Attempts to load CSS for the given widget (and all parent classes) based on the currently existing filesets. Note that a list of loaded CSS files is stored, so calling this function on a widget whose CSS is already loaded will NOT cause duplicate CSS. - Failed attempts to load a file will also be cached to avoid repeated filesystem access requests. + Failed attempts to load a file will also be cached to avoid repeated filesystem access + requests. \param widget, Widget to load CSS for */ @@ -443,12 +433,15 @@ \sa addFileSet - \param widget, Widget to load layout for. If successful, the widget's layout variable will be modified. + \param widget, Widget to load layout for. If successful, the widget's layout variable will be + modified. \param layoutName, The layout name (previously extracted from CSS) to look for - \param sectionName, The section name (previously extracted from CSS) to look for, if not defined then use the first section found + \param sectionName, The section name (previously extracted from CSS) to look for, if not + defined then use the first section found */ #ifndef HB_BIN_CSS -bool HbWidgetStyleLoader::loadWidgetML(HbWidget *widget, const QString &layoutName, const QString §ionName) +bool HbWidgetStyleLoader::loadWidgetML( + HbWidget *widget, const QString &layoutName, const QString §ionName) { if(!widget){ return false; @@ -459,7 +452,8 @@ qDebug() << "Looking for layout" << layoutName << "in section" << sectionName; #endif - // Iterate backwards to ensure filesets override correctly (eg landscape delta overrides portrait) + // Iterate backwards to ensure filesets override correctly (eg landscape delta overrides + // portrait) int c = mFileSets.count(); while(c-- && !loaded){ if ( !(mFileSets.at(c).type == FileSetType_Pattern || diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/cssparser/hbwidgetstyleloader_p.h --- a/src/hbcore/cssparser/hbwidgetstyleloader_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/cssparser/hbwidgetstyleloader_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -53,7 +53,8 @@ void loadCss(const HbWidget *widget); - bool loadWidgetML(HbWidget *widget, const QString &layoutName, const QString §ion = QString()); + bool loadWidgetML( + HbWidget *widget, const QString &layoutName, const QString §ion = QString()); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbbatteryindicator.cpp --- a/src/hbcore/decorators/hbbatteryindicator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbbatteryindicator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,6 +28,7 @@ #include "hbstyleoptionbatteryindicator_p.h" #include +#include /* \class HbBatteryIndicator @@ -73,10 +74,12 @@ mChargingTimer.stop(); } mChargingTimer.start(250, q); + emit q->levelChanged(); // to make sure the charging status is communicated } else { mChargingOn = false; mChargingTimer.stop(); q->setLevel(mSystemDeviceInfo->batteryLevel()); + emit q->levelChanged(); // to make sure the non-charging status is communicated } } #endif // HB_HAVE_QT_MOBILITY @@ -155,6 +158,7 @@ if (d->mLevelPercent != levelPercent) { d->mLevelPercent = levelPercent; updatePrimitives(); + emit levelChanged(); // must be emitted whenever the visualization changes (i.e. also while charging) } } @@ -206,4 +210,30 @@ option->batteryValue = d->mLevelPercent; } +bool HbBatteryIndicator::isCharging() const +{ + Q_D(const HbBatteryIndicator); + // Cannot use mChargingOn only because this function must work + // reliably even when called while being in setLevel(). On the + // other hand the timer is stopped while being in sleep mode. So + // check both. + return d->mChargingTimer.isActive() || d->mChargingOn; +} + +/*! + \reimp +*/ +bool HbBatteryIndicator::event(QEvent *e) +{ + Q_D(HbBatteryIndicator); + if (e->type() == HbEvent::SleepModeEnter) { + d->mChargingTimer.stop(); + } else if (e->type() == HbEvent::SleepModeExit) { + if (d->mChargingOn) { + d->mChargingTimer.start(250, this); + } + } + return HbWidget::event(e); +} + #include "moc_hbbatteryindicator_p.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbbatteryindicator_p.h --- a/src/hbcore/decorators/hbbatteryindicator_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbbatteryindicator_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -50,6 +50,7 @@ inline int type() const { return Type; } int level() const; + bool isCharging() const; public slots: virtual void createPrimitives(); @@ -57,9 +58,13 @@ void setLevel(int levelPercent); +signals: + void levelChanged(); + protected: void timerEvent(QTimerEvent *event); void initStyleOption(HbStyleOptionBatteryIndicator *option) const; + bool event(QEvent *event); private: Q_DECLARE_PRIVATE_D(d_ptr, HbBatteryIndicator) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbindicatorbutton.cpp --- a/src/hbcore/decorators/hbindicatorbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbindicatorbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,6 +28,9 @@ #include #include #include +#include +#include +#include #include "hbindicatorbutton_p.h" #include "hbindicatorbutton_p_p.h" @@ -42,30 +45,49 @@ static const char noteIndicatorType[] = {"com.nokia.hb.indicatormenu/1.0"}; HbIndicatorButtonPrivate::HbIndicatorButtonPrivate() : - handleIcon(0), defaultAction(0), newEventAction(0), deviceDialog(0) + mHandleIcon(0), mDefaultAction(0), mNewEventAction(0), mProgressAction(0), mDeviceDialog(0), + mProgressAnimationFound(false), mNewEventIcon(0), mNewEvent(false), mStyle(0), mIndicatorMenuOpen(false), + mTouchArea(0) { } HbIndicatorButtonPrivate::~HbIndicatorButtonPrivate() { - delete deviceDialog; + delete mDeviceDialog; } void HbIndicatorButtonPrivate::init() { + Q_Q(HbIndicatorButton); setBackgroundVisible(false); + mProgressAnimationFound = HbIconAnimationManager::global()->addDefinitionFile( + "qtg_anim_mono_loading.axml"); + + // add default actions + mDefaultAction = new HbAction(HbIcon("qtg_mono_options_menu"), "IndicatorMenu", q); + mNewEventAction = new HbAction(HbIcon("qtg_mono_new_event"), "IndicatorMenu", q); + + QString iconName("qtg_anim_mono_loading_1"); + if (mProgressAnimationFound) { + iconName = "qtg_anim_mono_loading"; + } + HbIcon icon(iconName); + icon.setFlags(HbIcon::Colorized); + mProgressAction = new HbAction(icon, "IndicatorMenu", q); } void HbIndicatorButtonPrivate::showIndicatorMenu() { - if (mIndicators.count() > 0) { - QVariantMap parametersMap; - QString noteType(noteIndicatorType); + QVariantMap parametersMap; + QString noteType(noteIndicatorType); - parametersMap.clear(); - deviceDialog->show(noteType, parametersMap); - } + parametersMap.clear(); + mDeviceDialog->show(noteType, parametersMap); + mNewEvent = false; + mIndicatorMenuOpen = true; + + updateIcon(); } void HbIndicatorButtonPrivate::addIndicators(const QList &clientInfo) @@ -73,6 +95,9 @@ for (int i = 0; i < clientInfo.size(); ++i) { if (clientInfo.at(i).hasMenuData) { mIndicators.prepend(clientInfo.at(i)); + if (clientInfo.at(i).category == HbIndicatorInterface::NotificationCategory) { + mNewEvent = true; + } } } @@ -106,18 +131,55 @@ void HbIndicatorButtonPrivate::updateIcon() { Q_Q(HbIndicatorButton); + + setStyle(); + switch (mStyle) + { + case 0: + q->setProperty("layout_type", 1); + q->setAction(mDefaultAction); + break; + case 1: + q->setProperty("layout_type", 1); + q->setAction(mNewEventAction); + break; + case 2: + q->setProperty("layout_type", 1); + q->setAction(mProgressAction); + break; + case 3: + q->setProperty("layout_type", 2); + q->setAction(mProgressAction); + break; + default: + q->setProperty("layout_type", 1); + q->setAction(mDefaultAction); + break; + } + q->repolish(); +} + +void HbIndicatorButtonPrivate::setStyle() +{ bool newEvent(false); + bool progress(false); for (int i = 0; i < mIndicators.size(); ++i) { - if (mIndicators.at(i).category == HbIndicatorInterface::NotificationCategory - || mIndicators.at(i).category == HbIndicatorInterface::ProgressCategory) { + if (mIndicators.at(i).category == HbIndicatorInterface::NotificationCategory && mNewEvent) { newEvent = true; - break; + } + if (mIndicators.at(i).category == HbIndicatorInterface::ProgressCategory) { + progress = true; } } - if (newEvent) { - q->setAction(newEventAction); + + if (!newEvent && !progress) { + mStyle = 0; + } else if (newEvent && !progress){ + mStyle = 1; + } else if (!newEvent && progress){ + mStyle = 2; } else { - q->setAction(defaultAction); + mStyle = 3; } } @@ -125,12 +187,10 @@ : HbToolButton(*new HbIndicatorButtonPrivate, parent) { Q_D(HbIndicatorButton); + setProperty("layout_type", 1); d->init(); - // add default actions - d->defaultAction = new HbAction(HbIcon("qtg_mono_options_menu"), "IndicatorMenu", this); - d->newEventAction = new HbAction(HbIcon("qtg_mono_new_event"), "IndicatorMenu", this); - setAction(d->defaultAction); + setAction(d->mDefaultAction); createPrimitives(); } @@ -147,13 +207,14 @@ connect(this, SIGNAL(pressed()), this, SLOT(handlePress())); connect(this, SIGNAL(released()), this, SLOT(handleRelease())); - d->deviceDialog = new HbDeviceDialog(HbDeviceDialog::ImmediateResourceReservationFlag); + d->mDeviceDialog = new HbDeviceDialog(HbDeviceDialog::ImmediateResourceReservationFlag); + connect(d->mDeviceDialog, SIGNAL(deviceDialogClosed()), this, SLOT(resetBackground())); } void HbIndicatorButton::showHandleIndication(bool show) { Q_D(HbIndicatorButton); - d->handleIcon->setVisible(show); + d->mHandleIcon->setVisible(show); } bool HbIndicatorButton::handleVisible() const @@ -165,12 +226,32 @@ return handleVisible; } +int HbIndicatorButton::buttonStyle() const +{ + Q_D(const HbIndicatorButton); + return d->mStyle; +} + +void HbIndicatorButton::currentViewChanged(HbView *view) +{ + Q_D(HbIndicatorButton); + HbIconItem *item = qgraphicsitem_cast(d->iconItem); + if (item) { + item->animator().setOwnerView(view); + } +} + void HbIndicatorButton::createPrimitives() { Q_D(HbIndicatorButton); - d->handleIcon = style()->createPrimitive(HbStyle::P_IndicatorButton_handleindication, this); - d->handleIcon->setVisible(false); - setBackgroundItem(HbStyle::P_IndicatorButton_background); // calls updatePrimitives() + d->mHandleIcon = style()->createPrimitive(HbStyle::P_IndicatorButton_handleindication, this); + d->mHandleIcon->setVisible(false); + d->mNewEventIcon = style()->createPrimitive(HbStyle::P_IndicatorButton_eventindication, this); + d->mTouchArea = style()->createPrimitive(HbStyle::P_IndicatorButton_toucharea, this); + QGraphicsObject *touchArea = static_cast(d->mTouchArea); + touchArea->grabGesture(Qt::TapGesture); + ungrabGesture(Qt::TapGesture); + d->setBackgroundItem(HbStyle::P_IndicatorButton_background); } void HbIndicatorButton::updatePrimitives() @@ -179,7 +260,9 @@ HbStyleOptionIndicatorButton option; initStyleOption(&option); style()->updatePrimitive(backgroundItem(), HbStyle::P_IndicatorButton_background, &option); - style()->updatePrimitive(d->handleIcon, HbStyle::P_IndicatorButton_handleindication, &option); + style()->updatePrimitive(d->mHandleIcon, HbStyle::P_IndicatorButton_handleindication, &option); + style()->updatePrimitive(d->mNewEventIcon, HbStyle::P_IndicatorButton_eventindication, &option); + style()->updatePrimitive(d->mTouchArea, HbStyle::P_IndicatorButton_toucharea, &option); HbToolButton::updatePrimitives(); } @@ -195,10 +278,27 @@ d->removeIndicators(clientInfo); } +void HbIndicatorButton::activateAll(const QList &clientInfo) +{ + Q_D(HbIndicatorButton); + d->mIndicators.clear(); + d->addIndicators(clientInfo); +} + +void HbIndicatorButton::resetBackground() +{ + Q_D(HbIndicatorButton); + d->mIndicatorMenuOpen = false; + updatePrimitives(); +} + void HbIndicatorButton::initStyleOption(HbStyleOptionIndicatorButton *option) const { + Q_D(const HbIndicatorButton); if (isDown()) { option->mode = QIcon::Active; + } else if (d->mIndicatorMenuOpen) { + option->mode = QIcon::Selected; } else { option->mode = QIcon::Normal; } @@ -207,6 +307,7 @@ option->transparent = true; } } + option->twoIcons = (d->mStyle == 3); } void HbIndicatorButton::changeEvent(QEvent* event) @@ -217,6 +318,17 @@ HbToolButton::changeEvent(event); } +/* + Overloaded hit detection to include touch area + */ +bool HbIndicatorButton::hitButton(const QPointF &pos) const +{ + Q_D(const HbIndicatorButton); + QRectF compRect = d->mTouchArea->boundingRect(); + compRect.translate(d->mTouchArea->pos()); + return compRect.contains(pos); +} + void HbIndicatorButton::handlePress() { #ifdef HB_EFFECTS @@ -234,3 +346,4 @@ #endif updatePrimitives(); } + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbindicatorbutton_p.h --- a/src/hbcore/decorators/hbindicatorbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbindicatorbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,11 +31,13 @@ class HbIndicatorButtonPrivate; class HbStyleOptionIndicatorButton; +class HbView; struct IndicatorClientInfo; class HB_CORE_PRIVATE_EXPORT HbIndicatorButton : public HbToolButton { Q_OBJECT + Q_PROPERTY(int buttonStyle READ buttonStyle) public: explicit HbIndicatorButton(QGraphicsItem *parent = 0); @@ -49,15 +51,22 @@ void showHandleIndication(bool show); bool handleVisible() const; + int buttonStyle() const; + + void currentViewChanged(HbView *view); + public slots: virtual void createPrimitives(); virtual void updatePrimitives(); void activate(const QList &clientInfo); void deactivate(const QList &clientInfo); + void activateAll(const QList &clientInfo); + void resetBackground(); protected: virtual void initStyleOption(HbStyleOptionIndicatorButton *option) const; virtual void changeEvent(QEvent* event); + virtual bool hitButton(const QPointF &pos) const; private slots: void handlePress(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbindicatorbutton_p_p.h --- a/src/hbcore/decorators/hbindicatorbutton_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbindicatorbutton_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,16 +44,25 @@ void removeIndicators(const QList &clientInfo); int findIndicator(const IndicatorClientInfo &indicator) const; void updateIcon(); + void setStyle(); private: - QGraphicsItem *handleIcon; - HbAction *defaultAction; - HbAction *newEventAction; + QGraphicsItem *mHandleIcon; + HbAction *mDefaultAction; + HbAction *mNewEventAction; + HbAction *mProgressAction; - HbDeviceDialog *deviceDialog; + HbDeviceDialog *mDeviceDialog; QList mIndicators; + + bool mProgressAnimationFound; + QGraphicsItem *mNewEventIcon; + bool mNewEvent; + int mStyle; + bool mIndicatorMenuOpen; + QGraphicsItem *mTouchArea; }; #endif // HBINDICATORBUTTON_P_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbindicatorgroup.cpp --- a/src/hbcore/decorators/hbindicatorgroup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbindicatorgroup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,13 +23,12 @@ ** ****************************************************************************/ -#include - #include "hbindicatorgroup_p.h" #include "hbindicatorgroup_p_p.h" #include "hbstyleoptionindicatorgroup_p.h" #include "hbiconitem.h" +#include "hbiconanimator.h" #if defined(Q_OS_SYMBIAN) #include "hbindicatorsym_p.h" @@ -38,8 +37,7 @@ #endif // defined(Q_OS_SYMBIAN) HbIndicatorGroupPrivate::HbIndicatorGroupPrivate() : - mIndicatorType(HbIndicatorGroup::NotificationType), - mProgressAdded(false), mIndicatorAdded(false), mProgressAnimationFound(false) + mIndicatorType(HbIndicatorGroup::NotificationType), mIndicatorAdded(false) { } @@ -56,8 +54,6 @@ QStringList() << "indicator_appear" << "indicator_disappear" << "indicator_move_right" << "indicator_move_left", QStringList() << "appear" << "disappear" << "move_right" << "move_left"); #endif - - mProgressAnimationFound = HbIconAnimationManager::global()->addDefinitionFile("qtg_status_progress.axml"); } void HbIndicatorGroupPrivate::init() @@ -68,28 +64,8 @@ int HbIndicatorGroupPrivate::setIconName(HbStyleOptionIndicatorGroup &option, int index) { - bool ok(mProgressAdded); - while (ok && mIndicators.count() > index) { - if (mIndicators.at(index).category == HbIndicatorInterface::ProgressCategory) { - ++index; - } else { - ok = false; - } - } - if (mIndicators.count() > index) { - if (mIndicators.at(index).category == HbIndicatorInterface::ProgressCategory) { - if (!mProgressAdded) { - if (mProgressAnimationFound) { - option.iconName = "qtg_status_progress"; - } else { - option.iconName = "qtg_status_progress_1"; - } - mProgressAdded = true; - } - } else { - option.iconName = mIndicators.at(index).iconPath; - } + option.iconName = mIndicators.at(index).iconPath; } else { option.iconName = ""; } @@ -113,6 +89,12 @@ int index = findIndicator(clientInfo.at(i)); if (index >= 0) { mIndicators[index].iconPath = clientInfo.at(i).iconPath; + } else { + const IndicatorClientInfo &indicator = clientInfo.at(i); + if (canAddIndicator(indicator)) { + mIndicators.prepend(indicator); + mIndicatorAdded = true; + } } } } @@ -141,15 +123,7 @@ { int index = findIndicator(indicator); if (index >= 0) { - if (mIndicators.at(index).category == HbIndicatorInterface::ProgressCategory) { - if (mProgressAnimationFound) { - mRemovedIndicators.append("qtg_status_progress"); - } else { - mRemovedIndicators.append("qtg_status_progress_1"); - } - } else { - mRemovedIndicators.append(mIndicators.at(index).iconPath); - } + mRemovedIndicators.append(mIndicators.at(index).iconPath); mIndicators.removeAt(index); } } @@ -168,9 +142,6 @@ } else if (indicator.category == HbIndicatorInterface::SettingCategory && mIndicatorType == HbIndicatorGroup::SettingsType) { canAdd = true; - } else if (indicator.category == HbIndicatorInterface::ProgressCategory - && mIndicatorType == HbIndicatorGroup::SettingsType) { - canAdd = true; } return canAdd; } @@ -210,8 +181,8 @@ void HbIndicatorGroupPrivate::startRemovingEffect() { + Q_Q(HbIndicatorGroup); #ifdef HB_EFFECTS - Q_Q(HbIndicatorGroup); for (int i = 0; i < mRemovedIndicators.size(); ++i) { int index = findIndicatorIcon(mRemovedIndicators[i]); if (index >= 0) { @@ -231,7 +202,7 @@ } } #else - updatePrimitives(); + q->updatePrimitives(); #endif } @@ -260,7 +231,7 @@ Q_D(HbIndicatorGroup); d->init(); d->mIndicatorType = indicatorType; - setProperty("layout", d->mIndicatorType); + setProperty("alignment", d->mIndicatorType); } /* @@ -280,6 +251,17 @@ d->delayedConstruction(); } +void HbIndicatorGroup::currentViewChanged(HbView *view) +{ + Q_D(HbIndicatorGroup); + for (int i = 0; i < d->mIcons.size(); ++i) { + HbIconItem *iconItem = qgraphicsitem_cast(d->mIcons.at(i)); + if (iconItem) { + iconItem->animator().setOwnerView(view); + } + } +} + void HbIndicatorGroup::createPrimitives() { Q_D(HbIndicatorGroup); @@ -294,7 +276,6 @@ Q_D(HbIndicatorGroup); HbStyleOptionIndicatorGroup option; initStyleOption(&option); - d->mProgressAdded = false; int index(0); index = d->setIconName(option, index); style()->updatePrimitive(d->mIcons[0], HbStyle::P_IndicatorGroup_icon1, &option); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbindicatorgroup_p.h --- a/src/hbcore/decorators/hbindicatorgroup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbindicatorgroup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,6 +36,7 @@ class HbIndicatorGroupPrivate; class HbStyleOptionIndicatorGroup; struct IndicatorClientInfo; +class HbView; class HB_CORE_PRIVATE_EXPORT HbIndicatorGroup : public HbWidget { @@ -56,6 +57,8 @@ void delayedConstruction(); + void currentViewChanged(HbView *view); + public slots: virtual void createPrimitives(); virtual void updatePrimitives(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbindicatorgroup_p_p.h --- a/src/hbcore/decorators/hbindicatorgroup_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbindicatorgroup_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -60,11 +60,9 @@ HbIndicatorGroup::IndicatorType mIndicatorType; QList mIcons; QList mIndicators; - bool mProgressAdded; bool mIndicatorAdded; QList mOriginalPos; QStringList mRemovedIndicators; - bool mProgressAnimationFound; }; #endif // HBINDICATORGROUP_P_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbnavigationbutton.cpp --- a/src/hbcore/decorators/hbnavigationbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbnavigationbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ #include "hbstyleoptionnavigationbutton_p.h" #include "hbmainwindow_p.h" -HbNavigationButtonPrivate::HbNavigationButtonPrivate() +HbNavigationButtonPrivate::HbNavigationButtonPrivate() : mTouchArea(0) { } @@ -70,20 +70,21 @@ void HbNavigationButton::createPrimitives() { - setBackgroundItem(HbStyle::P_NavigationButton_background); // calls updatePrimitives() + Q_D(HbNavigationButton); + d->mTouchArea = style()->createPrimitive(HbStyle::P_NavigationButton_toucharea, this); + QGraphicsObject *touchArea = static_cast(d->mTouchArea); + touchArea->grabGesture(Qt::TapGesture); + ungrabGesture(Qt::TapGesture); + d->setBackgroundItem(HbStyle::P_NavigationButton_background); } void HbNavigationButton::updatePrimitives() { + Q_D(HbNavigationButton); HbStyleOptionNavigationButton option; initStyleOption(&option); - if (HbDeviceProfile::profile(this).touch()) { - style()->updatePrimitive(backgroundItem(), HbStyle::P_NavigationButton_background, &option); - } else { - // Hide icon & background & show text - setEnabled(true); - setToolButtonStyle(HbToolButton::ToolButtonText); - } + style()->updatePrimitive(backgroundItem(), HbStyle::P_NavigationButton_background, &option); + style()->updatePrimitive(d->mTouchArea, HbStyle::P_NavigationButton_toucharea, &option); HbToolButton::updatePrimitives(); } @@ -109,6 +110,17 @@ HbToolButton::changeEvent(event); } +/* + Overloaded hit detection to include touch area + */ +bool HbNavigationButton::hitButton(const QPointF &pos) const +{ + Q_D(const HbNavigationButton); + QRectF compRect = d->mTouchArea->boundingRect(); + compRect.translate(d->mTouchArea->pos()); + return compRect.contains(pos); +} + void HbNavigationButton::handlePress() { #ifdef HB_EFFECTS diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbnavigationbutton_p.h --- a/src/hbcore/decorators/hbnavigationbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbnavigationbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -52,6 +52,7 @@ protected: virtual void initStyleOption(HbStyleOptionNavigationButton *option) const; virtual void changeEvent(QEvent* event); + virtual bool hitButton(const QPointF &pos) const; private slots: void handlePress(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbnavigationbutton_p_p.h --- a/src/hbcore/decorators/hbnavigationbutton_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbnavigationbutton_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,6 +38,9 @@ virtual ~HbNavigationButtonPrivate(); void init(); + +private: + QGraphicsItem *mTouchArea; }; #endif // HBNAVIGATIONBUTTON_P_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbsignalindicator.cpp --- a/src/hbcore/decorators/hbsignalindicator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbsignalindicator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -48,6 +48,7 @@ #ifdef HB_HAVE_QT_MOBILITY ,mSystemNetworkInfo(new HbSystemInfo(0, false)) ,mNetworkMode(QSystemNetworkInfo::UnknownMode) + ,mNetworkStatus(QSystemNetworkInfo::UndefinedStatus) #endif // HB_HAVE_QT_MOBILITY { } @@ -65,16 +66,18 @@ Q_Q(HbSignalIndicator); if (mode != mNetworkMode) { mNetworkMode = mode; - _q_setNetworkMode(mNetworkMode); + _q_setNetworkMode(mNetworkMode, mNetworkStatus); } q->setLevel(strength); } -void HbSignalIndicatorPrivate::_q_setNetworkMode(QSystemNetworkInfo::NetworkMode mode) +void HbSignalIndicatorPrivate::_q_setNetworkMode(QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status) { Q_Q(HbSignalIndicator); mNetworkMode = mode; + mNetworkStatus = status; q->updatePrimitives(); + emit q->levelChanged(); // this signal should be emitted for any kind of change } #endif // HB_HAVE_QT_MOBILITY @@ -92,8 +95,8 @@ Q_D(HbSignalIndicator); connect(d->mSystemNetworkInfo, SIGNAL(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int)), this, SLOT(_q_setNetworkSignalStrength(QSystemNetworkInfo::NetworkMode, int))); - connect(d->mSystemNetworkInfo, SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)), - this, SLOT(_q_setNetworkMode(QSystemNetworkInfo::NetworkMode))); + connect(d->mSystemNetworkInfo, SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus)), + this, SLOT(_q_setNetworkMode(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus))); #endif // HB_HAVE_QT_MOBILITY } @@ -123,6 +126,7 @@ if (d->mLevelPercent != levelPercent) { d->mLevelPercent = levelPercent; updatePrimitives(); + emit levelChanged(); } } @@ -159,6 +163,14 @@ // style option should default to unknown mode if not set #ifdef HB_HAVE_QT_MOBILITY option->networkMode = d->mNetworkMode; + + if (d->mNetworkStatus != QSystemNetworkInfo::Connected && + d->mNetworkStatus != QSystemNetworkInfo::Roaming && + d->mNetworkStatus != QSystemNetworkInfo::HomeNetwork) { + option->networkMode = QSystemNetworkInfo::UnknownMode; + option->signalLevel = HbStyleOptionSignalIndicator::Zero; + return; + } #endif // HB_HAVE_QT_MOBILITY //signal level setting diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbsignalindicator_p.h --- a/src/hbcore/decorators/hbsignalindicator_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbsignalindicator_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,6 +54,9 @@ virtual void createPrimitives(); virtual void updatePrimitives(); +signals: + void levelChanged(); + protected: void initStyleOption(HbStyleOptionSignalIndicator *option) const; @@ -63,7 +66,7 @@ #ifdef HB_HAVE_QT_MOBILITY Q_PRIVATE_SLOT(d_func(), void _q_setNetworkSignalStrength(QSystemNetworkInfo::NetworkMode, int)) - Q_PRIVATE_SLOT(d_func(), void _q_setNetworkMode(QSystemNetworkInfo::NetworkMode)) + Q_PRIVATE_SLOT(d_func(), void _q_setNetworkMode(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus)) #endif // HB_HAVE_QT_MOBILITY }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbsignalindicator_p_p.h --- a/src/hbcore/decorators/hbsignalindicator_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbsignalindicator_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,7 +43,7 @@ #ifdef HB_HAVE_QT_MOBILITY void _q_setNetworkSignalStrength(QSystemNetworkInfo::NetworkMode mode, int strength); - void _q_setNetworkMode(QSystemNetworkInfo::NetworkMode mode); + void _q_setNetworkMode(QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status); #endif // HB_HAVE_QT_MOBILITY private: @@ -56,6 +56,7 @@ #ifdef HB_HAVE_QT_MOBILITY HbSystemInfo *mSystemNetworkInfo; QSystemNetworkInfo::NetworkMode mNetworkMode; + QSystemNetworkInfo::NetworkStatus mNetworkStatus; #endif // HB_HAVE_QT_MOBILITY }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbstatusbar.cpp --- a/src/hbcore/decorators/hbstatusbar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbstatusbar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,6 +28,8 @@ #include #include #include +#include +#include #include "hbstatusbar_p.h" #include "hbstatusbar_p_p.h" @@ -38,6 +40,8 @@ #if defined(Q_OS_SYMBIAN) #include "hbindicatorsym_p.h" +#include // CEnvironmentChangeNotifier +#include // EActivePriorityLogonA #else #include "hbindicatorwin32_p.h" #endif // defined(Q_OS_SYMBIAN) @@ -53,7 +57,6 @@ */ HbStatusBarPrivate::HbStatusBarPrivate() : - mTimeText(), mTimeTextItem(0), mSignalIndicator(0), mBatteryIndicator(0), @@ -63,12 +66,30 @@ mPreviousProperties(0), mIndicatorPrivate(0) { +#if defined(Q_OS_SYMBIAN) + // Register for system environment changes + TCallBack envCallback(EnvChangeCallback, this); + + mEnvChangeNotifier = + CEnvironmentChangeNotifier::NewL(EActivePriorityLogonA, envCallback); + + mEnvChangeNotifier->Start(); +#endif } HbStatusBarPrivate::~HbStatusBarPrivate() { mIndicatorPrivate->stopListen(); delete mIndicatorPrivate; + +#if defined(Q_OS_SYMBIAN) + // Stop environment change notifications + if (mEnvChangeNotifier) + { + mEnvChangeNotifier->Cancel(); + delete mEnvChangeNotifier; + } +#endif } void HbStatusBarPrivate::delayedConstruction() @@ -100,11 +121,28 @@ q->connect(mIndicatorPrivate, SIGNAL(activated(const QList &)), q, SIGNAL(activated(const QList &))); + q->connect(mIndicatorPrivate, SIGNAL(allActivated(const QList &)), + q, SIGNAL(allActivated(const QList &))); q->connect(mIndicatorPrivate, SIGNAL(deactivated(const QList &)), q, SIGNAL(deactivated(const QList &))); + q->connect(mIndicatorPrivate, SIGNAL(activated(const QList &)), + q, SLOT(_q_indicatorsChanged())); + q->connect(mIndicatorPrivate, SIGNAL(allActivated(const QList &)), + q, SLOT(_q_indicatorsChanged())); + q->connect(mIndicatorPrivate, SIGNAL(updated(const QList &)), + q, SLOT(_q_indicatorsChanged())); + q->connect(mIndicatorPrivate, SIGNAL(deactivated(const QList &)), + q, SLOT(_q_indicatorsChanged())); + mClockTimerId = q->startTimer(clockUpdateDelay); mIndicatorPrivate->startListen(); + + q->grabGesture(Qt::TapGesture); + q->grabGesture(Qt::TapAndHoldGesture); + q->grabGesture(Qt::PanGesture); + q->grabGesture(Qt::SwipeGesture); + q->grabGesture(Qt::PinchGesture); } void HbStatusBarPrivate::init() @@ -126,15 +164,40 @@ mIndicatorPrivate = new HbIndicatorPrivate; mIndicatorPrivate->init(); + + QObject::connect(mSignalIndicator, SIGNAL(levelChanged()), q, SLOT(_q_signalLevelChanged())); + QObject::connect(mBatteryIndicator, SIGNAL(levelChanged()), q, SLOT(_q_batteryLevelChanged())); +} + +void HbStatusBarPrivate::_q_signalLevelChanged() +{ + Q_Q(HbStatusBar); + emit q->contentChanged(HbStatusBar::SignalLevelChanged); +} + +void HbStatusBarPrivate::_q_batteryLevelChanged() +{ + Q_Q(HbStatusBar); + HbStatusBar::ContentChangeFlags flags = HbStatusBar::BatteryLevelChanged; + if (mBatteryIndicator->isCharging()) { + flags |= HbStatusBar::BatteryCharging; + } + emit q->contentChanged(flags); +} + +void HbStatusBarPrivate::_q_indicatorsChanged() +{ + Q_Q(HbStatusBar); + emit q->contentChanged(HbStatusBar::IndicatorsChanged); } void HbStatusBarPrivate::updateTime() { Q_Q(HbStatusBar); - // use QLocale to find out whether there is am/pm info - QString timeFormat(QLocale().timeFormat(QLocale::ShortFormat)); - if(timeFormat.contains("ap", Qt::CaseInsensitive)) { + QString timeFormat; + // set the time format accordingly + if (HbExtendedLocale().timeStyle() == HbExtendedLocale::Time12) { timeFormat.clear(); timeFormat.insert(0, "hh:mm ap"); } else { @@ -145,11 +208,35 @@ QTime current = QTime::currentTime(); // set time, using a proper formatting + QString oldTimeText = mTimeText; mTimeText = current.toString(timeFormat); q->updatePrimitives(); + + if (mTimeText != oldTimeText) { + emit q->contentChanged(HbStatusBar::TimeChanged); + } } +#if defined(Q_OS_SYMBIAN) +TInt HbStatusBarPrivate::EnvChangeCallback(TAny *aObject) +{ + // Return value for functions used as TCallBack objects should be EFalse + // unless the function is intended to be called again from a timer. + return static_cast(aObject)->DoEnvChange(); +} + +TInt HbStatusBarPrivate::DoEnvChange() +{ + const TInt changes(mEnvChangeNotifier->Change()); + if ((changes & EChangesLocale) || (changes & EChangesSystemTime)) + { + updateTime(); + } + return EFalse ; +} +#endif + /* Constructor, the statusbar. The \a parent is an optional parameter. @@ -169,9 +256,9 @@ */ HbStatusBar::~HbStatusBar() { - Q_D(HbStatusBar); - - if (d->mClockTimerId != 0) { + Q_D(HbStatusBar); + + if (d->mClockTimerId != 0) { killTimer(d->mClockTimerId); d->mClockTimerId = 0; } @@ -181,9 +268,9 @@ Delayed constructor. */ void HbStatusBar::delayedConstruction() -{ - Q_D(HbStatusBar); - d->delayedConstruction(); +{ + Q_D(HbStatusBar); + d->delayedConstruction(); } void HbStatusBar::propertiesChanged() @@ -199,19 +286,19 @@ Q_D(HbStatusBar); d->mTimeTextItem = style()->createPrimitive(HbStyle::P_StatusBar_timetext, this); - setBackgroundItem(HbStyle::P_StatusBar_background); + d->setBackgroundItem(HbStyle::P_StatusBar_background); - d->updateTime(); + d->updateTime(); } void HbStatusBar::updatePrimitives() { Q_D(HbStatusBar); - HbStyleOptionStatusBar option; - - initStyleOption(&option); + HbStyleOptionStatusBar option; + + initStyleOption(&option); style()->updatePrimitive(backgroundItem(), HbStyle::P_StatusBar_background, &option); - style()->updatePrimitive(d->mTimeTextItem, HbStyle::P_StatusBar_timetext, &option); + style()->updatePrimitive(d->mTimeTextItem, HbStyle::P_StatusBar_timetext, &option); } /* @@ -225,6 +312,9 @@ return; } + d->mNotificationIndicatorGroup->currentViewChanged(view); + d->mSettingsIndicatorGroup->currentViewChanged(view); + // only do repolish if properties have changed if (d->mPreviousProperties != view->viewFlags()) { d->mPreviousProperties = view->viewFlags(); @@ -252,7 +342,7 @@ Q_D(HbStatusBar); if (event->timerId() == d->mClockTimerId) { d->updateTime(); // get current time - } + } } /*! @@ -286,3 +376,32 @@ } } } + +/*! + \reimp +*/ +void HbStatusBar::gestureEvent(QGestureEvent *event) +{ + Q_UNUSED(event); + // all gesture events accepted by default +} + +/*! + \reimp +*/ +bool HbStatusBar::event(QEvent *e) +{ + Q_D(HbStatusBar); + if (e->type() == HbEvent::SleepModeEnter) { + if (d->mClockTimerId != 0) { + killTimer(d->mClockTimerId); + d->mClockTimerId = 0; + } + } else if (e->type() == HbEvent::SleepModeExit) { + d->updateTime(); + d->mClockTimerId = startTimer(clockUpdateDelay); + } + return HbWidget::event(e); +} + +#include "moc_hbstatusbar_p.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbstatusbar_p.h --- a/src/hbcore/decorators/hbstatusbar_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbstatusbar_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,6 +39,15 @@ Q_OBJECT public: + enum ContentChangeFlag { + TimeChanged, + BatteryLevelChanged, + SignalLevelChanged, + IndicatorsChanged, + BatteryCharging + }; + Q_DECLARE_FLAGS(ContentChangeFlags, ContentChangeFlag) + explicit HbStatusBar(HbMainWindow *mainWindow, QGraphicsItem *parent = 0); virtual ~HbStatusBar(); @@ -58,14 +67,24 @@ signals: void activated(const QList &clientInfo); void deactivated(const QList &clientInfo); + void allActivated(const QList &clientInfo); + void contentChanged(HbStatusBar::ContentChangeFlags changeType); protected: void initStyleOption(HbStyleOptionStatusBar *option) const; void timerEvent(QTimerEvent *event); + void gestureEvent(QGestureEvent* e); + bool event(QEvent *e); private: Q_DECLARE_PRIVATE_D(d_ptr, HbStatusBar) Q_DISABLE_COPY(HbStatusBar) + + Q_PRIVATE_SLOT(d_func(), void _q_signalLevelChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_batteryLevelChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_indicatorsChanged()) }; +Q_DECLARE_OPERATORS_FOR_FLAGS(HbStatusBar::ContentChangeFlags) + #endif // HBSTATUSBAR_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbstatusbar_p_p.h --- a/src/hbcore/decorators/hbstatusbar_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbstatusbar_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,6 +33,9 @@ class HbBatteryIndicator; class HbIndicatorGroup; class HbIndicatorPrivate; +#if defined(Q_OS_SYMBIAN) +class CEnvironmentChangeNotifier; // Receive system event notifications +#endif class HbStatusBarPrivate : public HbWidgetPrivate { @@ -43,10 +46,15 @@ virtual ~HbStatusBarPrivate(); void delayedConstruction(); - void init(); + void init(); void updateTime(); - - int mClockTimerId; + +#if defined(Q_OS_SYMBIAN) + static TInt EnvChangeCallback(TAny *aObject); + TInt DoEnvChange(); +#endif + + int mClockTimerId; QString mTimeText; QGraphicsItem *mTimeTextItem; @@ -59,6 +67,15 @@ int mPreviousProperties; HbIndicatorPrivate *mIndicatorPrivate; + +#if defined(Q_OS_SYMBIAN) + // Notifications about locale and time changes + CEnvironmentChangeNotifier *mEnvChangeNotifier; +#endif + + void _q_signalLevelChanged(); + void _q_batteryLevelChanged(); + void _q_indicatorsChanged(); }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbtitlebar.cpp --- a/src/hbcore/decorators/hbtitlebar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbtitlebar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,7 +32,8 @@ #include #include #include -#include + +#include #include "hbtitlebar_p.h" #include "hbtitlebar_p_p.h" @@ -75,6 +76,8 @@ mIndicatorButton, SLOT(activate(const QList &))); q->connect(q, SIGNAL(deactivated(const QList &)), mIndicatorButton, SLOT(deactivate(const QList &))); + q->connect(q, SIGNAL(allActivated(const QList &)), + mIndicatorButton, SLOT(activateAll(const QList &))); q->connect(mMainWindow, SIGNAL(currentViewChanged(HbView*)), q, SLOT(currentViewChanged(HbView*))); q->connect(mDefaultNavigationAction, SIGNAL(triggered()), qApp, SLOT(quit())); } @@ -83,6 +86,8 @@ { Q_Q(HbTitleBar); + q->setFlag(QGraphicsItem::ItemIsPanel, true); + // create title pane mTitlePane = new HbTitlePane(q); mTitlePane->setZValue(HbPrivate::TitlePaneZValue); @@ -106,8 +111,8 @@ mPreviousTitleBarProperties = 0; // view not yet ready - QObject::connect(this->mTitlePane, SIGNAL(panRight()), q, SLOT(gestureRight())); - QObject::connect(this->mTitlePane, SIGNAL(panLeft()), q, SLOT(gestureLeft())); + QObject::connect(this->mTitlePane, SIGNAL(swipeRight()), q, SLOT(gestureSwipeRight())); + QObject::connect(this->mTitlePane, SIGNAL(swipeLeft()), q, SLOT(gestureSwipeLeft())); } void HbTitleBarPrivate::initSceneEventFilters(HbView *view) @@ -120,7 +125,7 @@ mTouchAreaItem->setAcceptedMouseButtons(Qt::LeftButton); mTouchAreaItem->installSceneEventFilter(q); QGraphicsObject *touchAreaItemGraphicsObject = static_cast(mTouchAreaItem); - touchAreaItemGraphicsObject->grabGesture(Qt::PanGesture); + touchAreaItemGraphicsObject->grabGesture(Qt::SwipeGesture); } } else { // Remove scene event filter if (mTouchAreaItem) { @@ -169,6 +174,7 @@ d->q_ptr = this; d->mMainWindow = mainWindow; d->init(); + setFlag(QGraphicsItem::ItemIsPanel, true); } HbTitleBar::HbTitleBar(HbTitleBarPrivate &dd, HbMainWindow *mainWindow, @@ -200,8 +206,8 @@ */ void HbTitleBar::delayedConstruction() { - Q_D(HbTitleBar); - d->delayedConstruction(); + Q_D(HbTitleBar); + d->delayedConstruction(); } /* @@ -271,17 +277,17 @@ } /* - gestureRight. Handles left-to-right flick. - if(layoutDirection() == Qt::LeftToRight) { + gestureSwipeRight. Handles left-to-right flick. */ -void HbTitleBar::gestureRight() +void HbTitleBar::gestureSwipeRight() { Q_D(HbTitleBar); - if (!minimizable()) { + if (!minimizable()) { return; } + HbWidgetFeedback::triggered(this, Hb::InstantFlicked); Position p(position()); @@ -292,7 +298,6 @@ d->mIndicatorButton->isVisible() && p == HbTitleBar::Original) { #ifdef HB_EFFECTS - //grabMouse(); // this prevents taps/gestures on top of animating titlebar QRectF extRect(scenePos().x(), 0.0, screenSize.width(), 10.0); HbEffect::start(this, "titlebar", "minimize", this, "effectFinished", QVariant(), extRect); #else // no effects, just do the translation @@ -302,16 +307,17 @@ } /* - gestureLeft. Handles right-to-left flick. + gestureSwipeLeft. Handles right-to-left flick. */ -void HbTitleBar::gestureLeft() +void HbTitleBar::gestureSwipeLeft() { Q_D(HbTitleBar); if (!minimizable()) { return; } + HbWidgetFeedback::triggered(this, Hb::InstantFlicked); Position p(position()); @@ -323,7 +329,6 @@ d->mIndicatorButton->isVisible() && p == HbTitleBar::Minimized) { #ifdef HB_EFFECTS - //grabMouse(); // this prevents taps/gestures on top of animating titlebar // effect translates widget from rect's right x-coordinate to left x-coordinate QRectF extRect(-handleRect.width(), 0.0, scenePos().x(), 10.0); // height not used in effect HbEffect::start(this, "titlebar", "maximize", this, "effectFinished", QVariant(), extRect); @@ -385,6 +390,8 @@ } } + d->mIndicatorButton->currentViewChanged(view); + // only do repolish if titlebar properties have changed if (d->mPreviousTitleBarProperties != view->viewFlags()) { d->initTitleBarHandle(view); @@ -410,7 +417,9 @@ if (mainWindow() && mainWindow()->currentView()) { int viewFlags = mainWindow()->currentView()->viewFlags(); if (viewFlags & HbView::ViewTitleBarMinimizable) { - d->mTitleBarHandle->setVisible(true); + if (d->mTitleBarHandle) { + d->mTitleBarHandle->setVisible(true); + } d->mIndicatorButton->showHandleIndication(true); } else { d->mIndicatorButton->showHandleIndication(false); @@ -426,7 +435,7 @@ Q_D(HbTitleBar); bool filterOutEvent = false; - switch(event->type()){ + switch(event->type()){ case QEvent::GraphicsSceneMousePress: HbWidgetFeedback::triggered(this, Hb::InstantPressed); event->accept(); //we need to catch the mouse release and move events also @@ -454,24 +463,23 @@ HbWidgetFeedback::triggered(this, Hb::InstantReleased); } filterOutEvent = true; - break; + break; } case QEvent::Gesture: { QGestureEvent *gestureEvent = static_cast(event); - if (HbPanGesture *pan = qobject_cast(gestureEvent->gesture(Qt::PanGesture))) { - if(pan->state() == Qt::GestureUpdated || pan->state() == Qt::GestureFinished) { - if(pan->sceneDelta().x() < -0) { - gestureLeft(); - } - if(pan->sceneDelta().x() > 0) { - gestureRight(); - } - gestureEvent->accept(); + HbSwipeGesture *swipe = qobject_cast(gestureEvent->gesture(Qt::SwipeGesture)); + if(swipe) { + if(swipe->sceneHorizontalDirection() == QSwipeGesture::Right) { + gestureSwipeRight(); + } else if(swipe->sceneHorizontalDirection() == QSwipeGesture::Left) { + gestureSwipeLeft(); } + gestureEvent->accept(); } + filterOutEvent = true; break; - } + } default: break; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbtitlebar_p.h --- a/src/hbcore/decorators/hbtitlebar_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbtitlebar_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -77,10 +77,11 @@ void titleBarStateChanged(); void activated(const QList &clientInfo); void deactivated(const QList &clientInfo); + void allActivated(const QList &clientInfo); public slots: - void gestureRight(); - void gestureLeft(); + void gestureSwipeRight(); + void gestureSwipeLeft(); void currentViewChanged(HbView *view); #ifdef HB_EFFECTS void effectFinished(const HbEffect::EffectStatus &status); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbtitlepane.cpp --- a/src/hbcore/decorators/hbtitlepane.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbtitlepane.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -34,7 +34,9 @@ #include #include #include +#include #include +#include #include #include @@ -52,30 +54,22 @@ */ HbTitlePanePrivate::HbTitlePanePrivate() : - mText(), - mTextItem(0), - mToggled(false), - mIcon(0), - mMode(QIcon::Normal) + mText(), mTextItem(0), mToggled(false), mIcon(0), mMode(QIcon::Normal), mTouchArea(0) { } void HbTitlePanePrivate::delayedConstruction() { - Q_Q(HbTitlePane); - q->grabGesture(Qt::TapGesture); - q->grabGesture(Qt::PanGesture); } void HbTitlePanePrivate::init() { Q_Q(HbTitlePane); + createPrimitives(); q->setAcceptedMouseButtons(Qt::LeftButton); q->setText(HbApplication::applicationName()); - - createPrimitives(); } void HbTitlePanePrivate::toggle(bool on) @@ -89,22 +83,29 @@ mTextItem = q->style()->createPrimitive(HbStyle::P_TitlePane_text, q); mIcon = q->style()->createPrimitive(HbStyle::P_TitlePane_icon, q); - q->setBackgroundItem(HbStyle::P_TitlePane_background); // calls updatePrimitives + mTouchArea = q->style()->createPrimitive(HbStyle::P_TitlePane_toucharea, q); + + QGraphicsObject *touchArea = static_cast(mTouchArea); + touchArea->grabGesture(Qt::TapGesture); + touchArea->grabGesture(Qt::SwipeGesture); + touchArea->grabGesture(Qt::PanGesture); + + q->ungrabGesture(Qt::TapGesture); + q->ungrabGesture(Qt::SwipeGesture); + q->ungrabGesture(Qt::PanGesture); + + setBackgroundItem(HbStyle::P_TitlePane_background); } void HbTitlePanePrivate::updatePrimitives() { Q_Q(HbTitlePane); HbStyleOptionTitlePane option; - - if (q->backgroundItem() == 0 || mTextItem == 0) { - return; - } - q->initStyleOption(&option); q->style()->updatePrimitive(q->backgroundItem(), HbStyle::P_TitlePane_background, &option); q->style()->updatePrimitive(mTextItem, HbStyle::P_TitlePane_text, &option); q->style()->updatePrimitive(mIcon, HbStyle::P_TitlePane_icon, &option); + q->style()->updatePrimitive(mTouchArea, HbStyle::P_TitlePane_toucharea, &option); } // ======== MEMBER FUNCTIONS ======== @@ -187,6 +188,10 @@ if (tmp != d->mText) { d->mText = tmp; updatePrimitives(); + HbMarqueeItem* marquee = qgraphicsitem_cast(d->mTextItem); + if (marquee) { + marquee->startAnimation(); + } } } @@ -220,9 +225,23 @@ { Q_D(HbTitlePane); - if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { + if (mainWindow() && mainWindow()->currentView()) { + if (mainWindow()->currentView()->menu()->isEmpty()) { + return; + } + } + HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture)); + HbPanGesture *pan = qobject_cast(event->gesture(Qt::PanGesture)); + HbSwipeGesture *swipe = qobject_cast(event->gesture(Qt::SwipeGesture)); + + if(tap) { + switch(tap->state()) { case Qt::GestureStarted: { + if (scene()) { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); + } d->mMode = QIcon::Active; updatePrimitives(); #ifdef HB_EFFECTS @@ -232,7 +251,24 @@ d->toggle(true); break; } + case Qt::GestureCanceled: { + if (scene()) { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + } + HbWidgetFeedback::triggered(this, Hb::InstantReleased); + + if (d->mMode != QIcon::Normal) { + d->mMode = QIcon::Normal; + updatePrimitives(); + } + d->toggle(false); + + break; + } case Qt::GestureFinished: { + if (scene()) { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + } d->mMode = QIcon::Selected; updatePrimitives(); #ifdef HB_EFFECTS @@ -248,66 +284,21 @@ } default: break; - } - } else if (HbPanGesture *pan = qobject_cast(event->gesture(Qt::PanGesture))) { - QPointF pointerPos = mapFromScene(event->mapToGraphicsScene(pan->startPos() + pan->offset())); - switch(pan->state()) { - case Qt::GestureUpdated: { - if (boundingRect().contains(pointerPos)) { - if (d->mMode != QIcon::Active) { - d->mMode = QIcon::Active; - updatePrimitives(); - } - } else { - if (d->mMode != QIcon::Normal) { - d->mMode = QIcon::Normal; - updatePrimitives(); - } - } - if (boundingRect().contains(pointerPos) && !d->mToggled) { - HbWidgetFeedback::triggered(this, Hb::InstantPressed); - d->toggle(true); - } else if (!boundingRect().contains(pointerPos) && d->mToggled) { - HbWidgetFeedback::triggered(this, Hb::InstantReleased); - d->toggle(false); - } + } + } else if(pan) { + if(d->mMode != QIcon::Normal) { + HbWidgetFeedback::triggered(this, Hb::InstantReleased); + d->toggle(false); + d->mMode = QIcon::Normal; + updatePrimitives(); + } + } else if(swipe) { + HbWidgetFeedback::triggered(this, Hb::InstantFlicked); - if(pan->sceneDelta().x() > 0) { - emit panRight(); - } - else if(pan->sceneDelta().x() < 0) { - emit panLeft(); - } - - break; - } - case Qt::GestureFinished: { - if (boundingRect().contains(pointerPos) && !d->mToggled) { - d->mMode = QIcon::Selected; - updatePrimitives(); -#ifdef HB_EFFECTS - HbEffect::start(this, "decorator", "latched"); -#endif - if (d->mToggled) { - HbWidgetFeedback::triggered(this, Hb::InstantReleased); - } - - HbWidgetFeedback::triggered(this, Hb::InstantClicked); - QPointF launchPos(scenePos().x() + boundingRect().width() / 2 + 3, scenePos().y() + boundingRect().height()); - emit launchPopup(launchPos); - } - else { - if (d->mMode != QIcon::Normal) { - HbWidgetFeedback::triggered(this, Hb::InstantReleased); - d->toggle(false); - d->mMode = QIcon::Normal; - updatePrimitives(); - } - } - break; - } - default: - break; + if(swipe->sceneHorizontalDirection() == QSwipeGesture::Right) { + emit swipeRight(); + } else if(swipe->sceneHorizontalDirection() == QSwipeGesture::Left) { + emit swipeLeft(); } } } @@ -376,12 +367,12 @@ } else { if (itemName == "background") { return this->backgroundItem(); - } - else if (itemName == "text") { + } else if (itemName == "text") { return d->mTextItem; - } - else if (itemName == "icon") { + } else if (itemName == "icon") { return d->mIcon; + } else if (itemName == "toucharea") { + return d->mTouchArea; } else { return 0; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbtitlepane_p.h --- a/src/hbcore/decorators/hbtitlepane_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbtitlepane_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,8 +54,8 @@ signals: void launchPopup(const QPointF &pos); void visibilityChanged(); - void panLeft(); - void panRight(); + void swipeLeft(); + void swipeRight(); public slots: void setText(const QString &text); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/decorators/hbtitlepane_p_p.h --- a/src/hbcore/decorators/hbtitlepane_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/decorators/hbtitlepane_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -48,6 +48,7 @@ QGraphicsItem *mIcon; QIcon::Mode mMode; + QGraphicsItem *mTouchArea; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogbase.pri --- a/src/hbcore/devicedialogbase/devicedialogbase.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogbase.pri Thu Jul 22 16:36:53 2010 +0100 @@ -50,6 +50,9 @@ PRIVATE_HEADERS += $$PWD/hbindicatorsym_p.h PRIVATE_HEADERS += $$PWD/hbsymbianvariantconverter_p.h PRIVATE_HEADERS += $$PWD/hbdeleteguardsymbian_p.h +PRIVATE_HEADERS += $$PWD/hbdevicedialogconnecthelper_p.h +PRIVATE_HEADERS += $$PWD/hbdevicedialogconnecthelper_p_p.h +PRIVATE_HEADERS += $$PWD/hbdevicedialoglaunchhelper_p.h SOURCES += $$PWD/hbsymbianvariant.cpp SOURCES += $$PWD/hbdevicedialogsymbian.cpp @@ -61,6 +64,8 @@ SOURCES += $$PWD/hbsymbianvariantconverter.cpp SOURCES += $$PWD/hbtextresolversymbian.cpp SOURCES += $$PWD/hbdeleteguardsymbian.cpp +SOURCES += $$PWD/hbdevicedialogconnecthelper.cpp +SOURCES += $$PWD/hbdevicedialoglaunchhelper.cpp } !symbian { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -112,6 +112,16 @@ /*! \internal + Publish current orientation to PS-key + Returns error code if updating fails. 0 if updating succeeds. +*/ +int HbDeviceDialogManager::publishOrientation(int orientation) +{ + return d->publishOrientation(orientation); +} + +/*! + \internal Instructs HbDeviceDialogManager to close a concrete device dialog widget. Widget is identified by identifier. diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,7 +39,7 @@ #include #include #include - +#include #if defined(Q_OS_SYMBIAN) #include #include @@ -48,7 +48,7 @@ #include "hbindicatorwin32_p.h" #endif // Q_OS_SYMBIAN -const char* indicatorMenu = "com.nokia.hb.indicatormenu/1.0"; +const char* indicatorMenu = "com.nokia.hb.indicatormenu/1.0"; //local symbian helper functions #if defined(Q_OS_SYMBIAN) @@ -84,17 +84,17 @@ { if (event->type() == QEvent::QEvent::GraphicsSceneResize) { HbPopup *popup = qobject_cast(obj); - if (popup) { + if (popup) { QRectF rect = popup->rect(); rect.moveTo(popup->pos()); HbDeviceDialogsContainer::Dialog & dialog = mDeviceDialogManger->mDialogs.find(popup); mDeviceDialogManger->addRegionRect(dialog.id(), rect); } - } + } return false; } #endif - + /*! \internal Constructor. @@ -123,13 +123,22 @@ this, SLOT(indicatorRemoved(const IndicatorClientInfo))); connect(mIndicatorPluginManager, SIGNAL( indicatorUpdated(const IndicatorClientInfo) ), this, SLOT(indicatorUpdated(const IndicatorClientInfo))); - connect(mIndicatorPluginManager, SIGNAL(indicatorUserActivated(QVariantMap)), + connect(mIndicatorPluginManager, SIGNAL(indicatorUserActivated(QVariantMap)), q, SIGNAL(indicatorUserActivated(QVariantMap))); // Server publishes it's status. Applications use it to delay showing of notification // dialogs when server is showing. mServerStatus.setStatus(HbDeviceDialogServerStatus::NoFlags); qApp->installEventFilter(this); init(); +#if defined(Q_OS_SYMBIAN) + _LIT_SECURITY_POLICY_PASS(KRdPolicy); // all pass + _LIT_SECURITY_POLICY_S0(KWrPolicy, KHbPsForegroundAppOrientationCategoryUid.iUid); // pass device dialog server + + int error = mProperty.Define(KHbPsForegroundAppOrientationCategoryUid, KHbPsForegroundAppOrientationKey, + RProperty::EInt, KRdPolicy, KWrPolicy); + if(error == KErrNone) + mProperty.Attach(KHbPsForegroundAppOrientationCategoryUid, KHbPsForegroundAppOrientationKey); +#endif TRACE_EXIT } @@ -144,6 +153,7 @@ #if defined(Q_OS_SYMBIAN) mScene->removeItem(&mMousePressCatcher); mWindowRegion.Close(); + mProperty.Close(); #endif delete mIndicatorPluginManager; TRACE_EXIT @@ -152,19 +162,22 @@ void HbDeviceDialogManagerPrivate::init() { TRACE_ENTRY - // Performance optimization for indicator menu. + // Performance optimization for indicator menu. bool recycled(true); int error(0); +#if defined(Q_OS_SYMBIAN) + // Speed-up search by specifying a file name + QString pluginBaseFileName("HbIndicatorMenuPlugin"); +#else // Q_OS_SYMBIAN + QString pluginBaseFileName; +#endif // Q_OS_SYMBIAN + HbDeviceDialogInterface *deviceDialogIf = - mPluginManager.createWidget(QString(indicatorMenu), QVariantMap(), recycled, error); + mPluginManager.createWidget(QString(indicatorMenu), QVariantMap(), pluginBaseFileName, + QString(), recycled, error); if (deviceDialogIf) { - HbPopup *popup = deviceDialogIf->deviceDialogWidget(); -#if defined(Q_OS_SYMBIAN) - mIndicatorPluginManager->connectTo(popup); -#else - HbIndicatorPrivate::pluginManager()->connectTo(popup); -#endif + connectIndicatorStatus(deviceDialogIf); mPluginManager.freeWidget(deviceDialogIf); } TRACE_EXIT @@ -196,6 +209,7 @@ int id = 0; HbDeviceDialogPlugin::DeviceDialogInfo info; + memset(&info, 0, sizeof(info)); HbPopup *popup = 0; HbDeviceDialogInterface *deviceDialogIf = createDeviceDialog( parameters, info, popup); @@ -210,6 +224,10 @@ HbDeviceDialogsContainer::Dialog &dialog = mDialogs.add(deviceDialogIf, info); dialog.setVariable(HbDeviceDialogsContainer::Dialog::ClientTag, parameters.mClientTag); + if (info.flags & HbDeviceDialogPlugin::SingleInstance) { + // Only single instance of the dialog should be shown, save dialog type for later comparison + dialog.setVariable(HbDeviceDialogsContainer::Dialog::DialogType, parameters.mType); + } id = dialog.id(); if (info.group == HbDeviceDialogPlugin::DeviceNotificationDialogGroup) { @@ -266,13 +284,24 @@ return ret; } +// Publish current orientation to PS-key +int HbDeviceDialogManagerPrivate::publishOrientation(int orientation) +{ +#if defined(Q_OS_SYMBIAN) + int ret = mProperty.Set(orientation); + return ret; +#else + Q_UNUSED(orientation) + return 0; +#endif +} + // Client (session) is closing void HbDeviceDialogManagerPrivate::deviceDialogClientClosing(quintptr clientTag) { // Mark device dialogs launched by the client as having client (session) closed. // Housekeeper closes these after a timeout. Dialogs without a client are allowed but // they need to close within a timeout. - markNoClient(clientTag); } @@ -320,8 +349,9 @@ void HbDeviceDialogManagerPrivate::moveToForeground(bool foreground) { TRACE_ENTRY_ARGS(foreground) + if (foreground) { - if(!mMainWindow->isVisible()) { + if(!mMainWindow->isVisible() || !mMainWindow->isActiveWindow()) { mMainWindow->showFullScreen(); doMoveToForeground(foreground, ECoeWinPriorityAlwaysAtFront); } @@ -398,7 +428,7 @@ const HbDeviceDialogsContainer::Dialog::Flags closeCalled( HbDeviceDialogsContainer::Dialog::CloseCalled); const HbDeviceDialogsContainer::Dialog::Flags noFlags(0); - + // Check if any notification dialogs are showing const HbDeviceDialogsContainer::Dialog start; bool showingNotification = mDialogs.next(start, notificationGroup|showing, @@ -409,6 +439,18 @@ securityGroup|showing).isValid(); HbDeviceDialogsContainer::Dialog::Flags newDialogs(0); +#if defined(Q_OS_SYMBIAN) + int val = 0; + int error = mProperty.Get(KHbPsForegroundAppOrientationCategoryUid, KHbPsForegroundAppOrientationKey, val); + + if (val & KHbFixedOrientationMask) { + Qt::Orientation currentOrientation = (Qt::Orientation) (val & KHbOrientationMask); + if (currentOrientation == Qt::Vertical || currentOrientation == Qt::Horizontal) { + mMainWindow->setOrientation(currentOrientation, false); + } + } +#endif + // Loop over not showing dialogs HbDeviceDialogsContainer::Dialog *current = &mDialogs.next(start, noFlags, showing | closeCalled); @@ -422,7 +464,7 @@ newDialogs |= current->flags(); #if defined(Q_OS_SYMBIAN) popup->installSceneEventFilter(&mMousePressCatcher); - popup->installEventFilter(&mRegionUpdateFilter); + popup->installEventFilter(&mRegionUpdateFilter); #endif //Q_OS_SYMBIAN } } else { // generic dialog @@ -449,11 +491,11 @@ if (newDialogs & lightsMask) { refreshDisplayLightsTime(); } - + const HbDeviceDialogsContainer::Dialog &nonNotificationDialog = mDialogs.next(start, showing, notificationGroup|showing); bool dialogsShowing = showingNotification || nonNotificationDialog.isValid(); - + return dialogsShowing; } @@ -466,7 +508,7 @@ HbDeviceDialogsContainer::Dialog::NotificationGroup); const HbDeviceDialogsContainer::Dialog::Flags showing( HbDeviceDialogsContainer::Dialog::Showing); - + const HbDeviceDialogsContainer::Dialog start; bool showingNotification = mDialogs.next(start, notificationGroup|showing, notificationGroup|showing).isValid(); @@ -501,22 +543,23 @@ { parameters.mError = HbDeviceDialogNoError; - if (!mPluginManager.loadPlugin(parameters.mType)) { + QString pluginFilePath; + if (!mPluginManager.loadPlugin(parameters.mType, QString(), &pluginFilePath)) { parameters.mError = HbDeviceDialogNotFoundError; return 0; } - const HbDeviceDialogPlugin &plugin = mPluginManager.plugin(parameters.mType); + const HbDeviceDialogPlugin &plugin = mPluginManager.plugin(pluginFilePath); if (!plugin.deviceDialogInfo(parameters.mType, parameters.mData, &deviceDialogInfo)) { // Ensure plugin returns valid error code parameters.mError = checkpluginerror(plugin.error()); - mPluginManager.unloadPlugin(parameters.mType); + mPluginManager.unloadPlugin(pluginFilePath); return 0; } if (!checkDialogInfo(deviceDialogInfo)) { parameters.mError = HbDeviceDialogGeneralError; - mPluginManager.unloadPlugin(parameters.mType); + mPluginManager.unloadPlugin(pluginFilePath); return 0; } @@ -526,6 +569,16 @@ addSecurityCredentials(parameters, credentials); if (!plugin.accessAllowed(parameters.mType, parameters.mData, credentials)) { parameters.mError = HbDeviceDialogAccessDeniedError; + mPluginManager.unloadPlugin(pluginFilePath); + return 0; + } + } + + // If dialog is single instance, launch it only if it's not shown already + if (deviceDialogInfo.flags & HbDeviceDialogPlugin::SingleInstance) { + if (isShowing(parameters.mType)) { + parameters.mError = HbDeviceDialogAlreadyExists; + mPluginManager.unloadPlugin(pluginFilePath); return 0; } } @@ -534,11 +587,13 @@ // first time it's shown. bool recycled = (deviceDialogInfo.group == HbDeviceDialogPlugin::IndicatorGroup); HbDeviceDialogInterface *deviceDialogIf = - mPluginManager.createWidget(parameters.mType, parameters.mData, recycled, - parameters.mError); + mPluginManager.createWidget(parameters.mType, parameters.mData, QString(), pluginFilePath, + recycled, parameters.mError); + // Decrease plugin reference count increased by loadPlugin() above. Unload takes place when // device dialog widget is deleted. - mPluginManager.unloadPlugin(parameters.mType); + mPluginManager.unloadPlugin(pluginFilePath); + if (!deviceDialogIf){ parameters.mError = checkpluginerror(parameters.mError); return deviceDialogIf; @@ -570,15 +625,11 @@ connect(sender, SIGNAL(deviceDialogData(QVariantMap)), SLOT(deviceDialogUpdate(const QVariantMap))); - if (!recycled && deviceDialogInfo.group == HbDeviceDialogPlugin::IndicatorGroup) { + if (!recycled && (deviceDialogInfo.flags & HbDeviceDialogPlugin::ReceiveIndicatorStatus)) { // Connect plugin manager signals to indicator menu slots, so that // it will get indicator updates. If the widget is reused, signals // are already connected. -#if defined(Q_OS_SYMBIAN) - mIndicatorPluginManager->connectTo(popup); -#else - HbIndicatorPrivate::pluginManager()->connectTo(popup); -#endif + connectIndicatorStatus(deviceDialogIf); } // Set popup priority @@ -702,18 +753,23 @@ } } emit q->deviceDialogClosed(id, closeReason); + disconnectDialogSignals(current.widget()); mDialogs.remove(current); removeRegionRect(id); } - showDialogs(); setupWindowRegion(); updateStatus(); + + //make sure there is no fixed orientation + if (mDialogs.isEmpty()) { + mMainWindow->unsetOrientation(false); + } if (!securityDialog) { return; } - + // security or critical level active const HbDeviceDialogsContainer::Dialog begin; const HbDeviceDialogsContainer::Dialog::Flags securityGroup( @@ -743,13 +799,12 @@ moreDialogs = mDialogs.next(dialog, criticalGroup|showing, criticalGroup|showing).isValid(); } - + if (showingSecurity && !moreDialogs) { #if defined(Q_OS_SYMBIAN) - doMoveToForeground(false, ECoeWinPriorityAlwaysAtFront-1); - mMainWindow->hide(); -#endif - } + doMoveToForeground(false, ECoeWinPriorityAlwaysAtFront); +#endif + } TRACE_EXIT } @@ -762,7 +817,7 @@ if (event->type() == QEvent::ApplicationActivate) { #if defined(Q_OS_SYMBIAN) RWindowGroup &rootWindowGroup = CCoeEnv::Static()->RootWin(); - if (rootWindowGroup.OrdinalPriority() == ECoeWinPriorityAlwaysAtFront-1) { + if (rootWindowGroup.OrdinalPriority() == ECoeWinPriorityAlwaysAtFront) { moveToForeground(true); } #endif // Q_OS_SYMBIAN @@ -884,19 +939,21 @@ // Loop over dialogs having their client (session) closed and increase their housekeeping counters HbDeviceDialogsContainer::Dialog *current = &mDialogs.next(start, noClient, noClient); + const HbDeviceDialogsContainer::Dialog::Variable noClientCount = + HbDeviceDialogsContainer::Dialog::NoClientHousekeeping; while(current->isValid() && (current->flags() & showing)) { - current->setVariable(HbDeviceDialogsContainer::Dialog::NoClientHousekeeping, - current->variable(HbDeviceDialogsContainer::Dialog::NoClientHousekeeping) + 1); + current->setVariable(noClientCount, current->intVariable(noClientCount) + 1); // Find next one current = &mDialogs.next(*current, noClient, noClient); } // Loop over dialogs that have been closed and increase their housekeeping counters current = &mDialogs.next(start, closeCalled, closeCalled); + const HbDeviceDialogsContainer::Dialog::Variable closedCount = + HbDeviceDialogsContainer::Dialog::CloseHousekeeping; while(current->isValid()) { - current->setVariable(HbDeviceDialogsContainer::Dialog::CloseHousekeeping, - current->variable(HbDeviceDialogsContainer::Dialog::CloseHousekeeping) + 1); - current->setVariable(HbDeviceDialogsContainer::Dialog::NoClientHousekeeping, 0); + current->setVariable(closedCount, current->intVariable(closedCount) + 1); + current->setVariable(noClientCount, 0); // Find next one current = &mDialogs.next(*current, closeCalled, closeCalled); } @@ -904,9 +961,9 @@ // Close dialogs without a client that have passed time limit for(;;) { HbDeviceDialogsContainer::Dialog &dialog = mDialogs.next(start, - HbDeviceDialogsContainer::Dialog::NoClientHousekeeping, MaxSessionlessDialogLife); + noClientCount, MaxSessionlessDialogLife); if (dialog.isValid()) { - dialog.setVariable(HbDeviceDialogsContainer::Dialog::NoClientHousekeeping, 0); + dialog.setVariable(noClientCount, 0); closeDeviceDialog(dialog.id(), false); } else { break; @@ -916,19 +973,42 @@ // Delete closed dialogs that haven't given deviceDialogClosed() signal within a time limit for(;;) { HbDeviceDialogsContainer::Dialog &dialog = mDialogs.next(start, - HbDeviceDialogsContainer::Dialog::CloseHousekeeping, MaxDialogClosingPeriod); + closedCount, MaxDialogClosingPeriod); if (dialog.isValid()) { deleteDeviceDialog(dialog.id()); } else { break; } } - + // Return true if housekeeping needs to continue return mDialogs.next(start, closeCalled, closeCalled).isValid() || mDialogs.next(start, noClient, noClient).isValid(); } +// Check if dialog with a type is showing (not closed yet) +bool HbDeviceDialogManagerPrivate::isShowing(const QString &type) +{ + const HbDeviceDialogsContainer::Dialog start; + + const HbDeviceDialogsContainer::Dialog::Flags closeCalled( + HbDeviceDialogsContainer::Dialog::CloseCalled); + const HbDeviceDialogsContainer::Dialog::Flags showing( + HbDeviceDialogsContainer::Dialog::Showing); + + const HbDeviceDialogsContainer::Dialog::Variable dialogType = + HbDeviceDialogsContainer::Dialog::DialogType; + HbDeviceDialogsContainer::Dialog *current = &mDialogs.next(start, dialogType, type); + while(current->isValid()){ + if ((current->flags() & (closeCalled|showing)) == showing) { + return true; + } + // Find next one + current = &mDialogs.next(*current, dialogType, type); + } + return false; +} + // Handle timer event void HbDeviceDialogManagerPrivate::timerEvent(QTimerEvent *event) { @@ -956,3 +1036,45 @@ clientTag); } } + +// Connect indicators status (activate/deactivate) signals to device dialog (indicator menu +// and screen saver) +void HbDeviceDialogManagerPrivate::connectIndicatorStatus(HbDeviceDialogInterface *dialogInterface) +{ + HbIndicatorPluginManager *indicatorPluginManager; +#if defined(Q_OS_SYMBIAN) + indicatorPluginManager = mIndicatorPluginManager; +#else + indicatorPluginManager = HbIndicatorPrivate::pluginManager(); +#endif + + QObject *receiver = dialogSignaler(dialogInterface); + indicatorPluginManager->disconnect(receiver); + + // Connect indicator plugin manager signals to device dialog slots for it to get + // indicator updates + receiver->connect(indicatorPluginManager, SIGNAL(indicatorActivated(HbIndicatorInterface*)), + SLOT(indicatorActivated(HbIndicatorInterface*))); + receiver->connect(indicatorPluginManager, SIGNAL(indicatorRemoved(HbIndicatorInterface*)), + SLOT(indicatorDeactivated(HbIndicatorInterface*))); + + indicatorPluginManager->signalActiveIndicators(receiver); +} + +// Disconnect device dialog signals +void HbDeviceDialogManagerPrivate::disconnectDialogSignals(HbDeviceDialogInterface *dialogInterface) +{ + dialogSignaler(dialogInterface)->disconnect(this); // disconnect signals +} + +// Return device dialog signals source/target +QObject *HbDeviceDialogManagerPrivate::dialogSignaler(HbDeviceDialogInterface *dialogInterface) +{ + // Plugin can specify signal source/target by signalSender() or allow default which is device + // dialog widget + QObject *signalSourceAndTarget = dialogInterface->signalSender(); + if (!signalSourceAndTarget) { + signalSourceAndTarget = dialogInterface->deviceDialogWidget(); + } + return signalSourceAndTarget; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -50,6 +50,7 @@ // Device dialog client related API int showDeviceDialog(HbDeviceDialogServer::DialogParameters ¶meters); int updateDeviceDialog(int identifier, const QVariantMap ¶meters); + int publishOrientation(int orientation); int closeDeviceDialog(int identifier); void deviceDialogClientClosing(quintptr clientTag); int activateIndicator(HbDeviceDialogServer::IndicatorParameters ¶meters); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogmanager_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,6 +33,7 @@ #include #if defined(Q_OS_SYMBIAN) #include +#include #endif #include "hbdevicedialogserver_p.h" @@ -112,6 +113,7 @@ // Device dialog client related API int showDeviceDialog(HbDeviceDialogServer::DialogParameters ¶meters); int updateDeviceDialog(int id, const QVariantMap ¶meters); + int publishOrientation(int orientation); int closeDeviceDialog(int id, bool byClient = true); void deviceDialogClientClosing(quintptr clientTag); int activateIndicator(HbDeviceDialogServer::IndicatorParameters ¶meters); @@ -154,9 +156,13 @@ void startHousekeeperTimer() {if (mHousekeeperTimerId == 0) mHousekeeperTimerId = startTimer(HousekeeperTimerPeriod);} bool doHousekeeping(); + bool isShowing(const QString &type); void timerEvent(QTimerEvent *event); void markNoClient(quintptr clientTag); void setupWindowRegion(); + void connectIndicatorStatus(HbDeviceDialogInterface *dialogInterface); + void disconnectDialogSignals(HbDeviceDialogInterface *dialogInterface); + QObject *dialogSignaler(HbDeviceDialogInterface *dialogInterface); private: // Public interface HbDeviceDialogManager * const q; @@ -185,6 +191,7 @@ }; QList mRegionList; RRegion mWindowRegion; + RProperty mProperty; #endif }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogpluginmanager.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogpluginmanager.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogpluginmanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -50,8 +50,6 @@ match each loadPlugin() with a corresponding unloadPlugin(). Each widget created createWidget() should be freed by freeWidget(); - HbDeviceDialogPluginManager can preload plugins into memory by a preloadPlugins() function. - Plugins in file system are scanned and those returning preload flag are loaded into memory. Plugins may also specify a keep loaded flag. These are kept loaded in memory after they have been loaded first time. */ @@ -73,8 +71,9 @@ int readOnlyPaths; mPluginPathList = pluginPathList("/devicedialogs/", readOnlyPaths); - // Scan only read-only drives at startup to ensure installed plugins cannot affect device boot - for(int i = 0; i < readOnlyPaths; i++) { + // Scan only read-only drives + allow eclipsing at startup to ensure installed plugins cannot + // affect device boot + for(int i = 0; i < mPluginPathList.count(); i++) { updateCachePath(mPluginPathList.at(i), true); } TRACE_EXIT @@ -90,36 +89,30 @@ } /* - Preloads plugins into memory. -*/ -void HbDeviceDialogPluginManager::preloadPlugins() -{ - TRACE_ENTRY - // Check if preloading is disabled - if (mFlags & HbDeviceDialogPluginManager::NoPreloadFlag) { - return; - } - - QString unused; - // Scan plugins and load those that request preloading - scanPlugins(&HbDeviceDialogPluginManager::preloadPluginCallback, unused, false); - TRACE_EXIT -} - -/* Creates a device dialog widget. Plugin is loaded into memory if it's not already loaded. \a deviceDialogType contains device dialog type. \a parameters contains widget parameters. - \a error receives an error code if widget couldn't be created. Returns pointer to widget - or null on error. + \a baseFileName limits search for certain file name. \a pluginFilePath contains a plugin + file path, if empty a search is performed. \a error receives an error code if + widget couldn't be created. Returns pointer to widget or null on error. */ HbDeviceDialogInterface *HbDeviceDialogPluginManager::createWidget(const QString &deviceDialogType, - const QVariantMap ¶meters, bool &recycled, int &error) + const QVariantMap ¶meters, const QString &baseFileName, const QString &pluginFilePath, + bool &recycled, int &error) { TRACE_ENTRY error = HbDeviceDialogNoError; HbDeviceDialogInterface *widgetIf = 0; - if (loadPlugin(deviceDialogType)) { - PluginInfo &pluginInfo = mPlugins[findPlugin(deviceDialogType)]; + QString filePath; + bool loaded; + if (!pluginFilePath.isEmpty()) { + incPluginRefCount(pluginFilePath); + filePath = pluginFilePath; + loaded = true; + } else { + loaded = loadPlugin(deviceDialogType, baseFileName, &filePath); + } + if (loaded) { + PluginInfo &pluginInfo = mPlugins[findPlugin(filePath)]; // Check if widget reuse is requested if (recycled) { pluginInfo.mFlags |= PluginInfo::RecycleWidget; // freeWidget() will keep the widget @@ -141,9 +134,7 @@ qobject_cast(pluginInstance); widgetIf = pluginIf->createDeviceDialog(deviceDialogType, parameters); if (widgetIf) { - // Add a dynamic property to be able to find plugin from a widget - widgetIf->deviceDialogWidget()->setProperty(deviceDialogTypePropertyName, - QVariant(deviceDialogType)); + pluginInfo.mWidgets.append(widgetIf); pluginInfo.mRefCount++; } else { error = static_cast(pluginInstance)->error(); @@ -174,30 +165,18 @@ TRACE_ENTRY if (widget) { // Check if widget should be reused - QObject *obj = widget->deviceDialogWidget(); - QString deviceDialogType = obj->property(deviceDialogTypePropertyName).toString(); - int index = findPlugin(deviceDialogType); + int index = findPlugin(widget); Q_ASSERT(index >= 0); PluginInfo &pluginInfo = mPlugins[index]; - // Get signal sender for the widget - QObject *sender = widget->signalSender(); - if (!sender) { - sender = obj; - } if (pluginInfo.mFlags & PluginInfo::RecycleWidget && pluginInfo.mRecycledWidget == 0) { pluginInfo.mRecycledWidget = widget; - sender->disconnect(); // disconnect all signals from receivers } else { - // Delete widget from a timer as deviceDialogClosed() signal may - // come before device dialog is fully closed. - sender->disconnect(); // disconnect all signals + // Delete widget from a timer mDeleteWidgets.append(widget); -#if defined(Q_OS_SYMBIAN) - const int deleteDelay = 2000; // 2s -#else - const int deleteDelay = 500; // 0.5s -#endif + // Delete immediately as widget should be ready to be deleted (close effect ended) when + // devicedialogClosed() signal was emitted + const int deleteDelay = 0; mDeleteTimer.start(deleteDelay); } } @@ -206,57 +185,78 @@ /* Loads a plugin into memory. \a deviceDialogType contains device dialog type of the plugin. - If plugin is already loaded, only reference count is increased. Returns true on success - and false on failure. + \a baseFileName limits the search to a certain file name. \a pluginFilePath contains plugin + file path on return. If plugin is already loaded, only reference count is increased. + Returns true on success and false on failure. */ -bool HbDeviceDialogPluginManager::loadPlugin(const QString &deviceDialogType) +bool HbDeviceDialogPluginManager::loadPlugin(const QString &deviceDialogType, const QString &baseFileName, + QString *pluginFilePath) { TRACE_ENTRY_ARGS(deviceDialogType) - // If plugin is not loaded, try to load it - int index = findPlugin(deviceDialogType); - if (index < 0) { - // Check if plugin file name is in cache - bool loaded = false; - const QString filePath = mNameCache.find(deviceDialogType); - if (!filePath.isEmpty()) { - TRACE("cache hit") + QString baseNameWithExt(baseFileName); + if (!baseNameWithExt.isEmpty()) { + // Add extension to file name + baseNameWithExt.append(fileNameExtension()); + } + // Search name cache + bool loaded = false; + QString filePath = mNameCache.find(deviceDialogType, baseNameWithExt); + if (!filePath.isEmpty()) { + TRACE("cache hit") + int index = findPlugin(filePath); + if (index >= 0) { + loaded = true; + // Plugin is already loaded, increase reference count + mPlugins[index].mRefCount++; + } else { loaded = scanPlugin(&HbDeviceDialogPluginManager::loadPluginCallback, deviceDialogType, filePath); - // If plugin wasn't loaded, the cache has stale information. Rescan the directory. - if (!loaded) { - TRACE("cache stale") - updateCachePath(filePath); + } + // If plugin wasn't loaded, the cache has stale information. Rescan the directory. + if (!loaded) { + TRACE("cache stale") + updateCachePath(filePath); + } + } + if (!loaded) { + TRACE("cache miss") + // Plugin name wasn't in cache, try to find it + filePath = scanPlugins(deviceDialogType, baseNameWithExt); + if (!filePath.isEmpty()) { + int index = findPlugin(filePath); + if (index >= 0) { + loaded = true; + // Plugin is already loaded, increase reference count + mPlugins[index].mRefCount++; + } else { + loaded = scanPlugin(&HbDeviceDialogPluginManager::loadPluginCallback, deviceDialogType, + filePath); } } - if (!loaded) { - TRACE("cache miss") - // Plugin name wasn't in cache, try to find it - scanPlugins(&HbDeviceDialogPluginManager::loadPluginCallback, deviceDialogType); - int i = findPlugin(deviceDialogType); - if (i >= 0) { - // Plugin was found, update plugin name cache by scanning the directory - updateCachePath(mPlugins[i].mLoader->fileName()); - } + if (loaded) { + // Plugin was found, update plugin name cache by scanning the directory + updateCachePath(filePath); } - } else { - // Plugin is already loaded, increase reference count - mPlugins[index].mRefCount++; + } + TRACE("loaded" << loaded) + + if (loaded) { + *pluginFilePath = filePath; } TRACE_EXIT - // Return true if plugin is loaded - return findPlugin(deviceDialogType) >= 0; + return loaded; } /* Unloads plugin from memory. Each loadPlugin() should be matched by unloadPlugin(). Plugin is - unloaded from memory if reference count becomes 0. \a deviceDialogType contains device dialog - type of the plugin. Returns true on success and false on failure. + unloaded from memory if reference count becomes 0. \a pluginFilePath contains plugin file name + and path. Returns true on success and false on failure. */ -bool HbDeviceDialogPluginManager::unloadPlugin(const QString &deviceDialogType) +bool HbDeviceDialogPluginManager::unloadPlugin(const QString &pluginFilePath) { - TRACE_ENTRY_ARGS(deviceDialogType) + TRACE_ENTRY_ARGS(pluginFilePath) bool removed = false; - int index = findPlugin(deviceDialogType); + int index = findPlugin(pluginFilePath); if (index >= 0) { PluginInfo &pluginInfo = mPlugins[index]; if (--pluginInfo.mRefCount == 0) { @@ -273,11 +273,11 @@ deviceDialog type of the plugin. */ const HbDeviceDialogPlugin &HbDeviceDialogPluginManager::plugin( - const QString &deviceDialogType) + const QString &pluginFilePath) { TRACE_ENTRY // Plugin has to be loaded when this function is called - int index = findPlugin(deviceDialogType); + int index = findPlugin(pluginFilePath); Q_ASSERT(index >= 0); const PluginInfo &pluginInfo = mPlugins[index]; @@ -286,22 +286,36 @@ return *qobject_cast(pluginInstance); } -// Scan plugins in file system -void HbDeviceDialogPluginManager::scanPlugins(PluginScanCallback func, const QString &deviceDialogType, bool stopIfFound) +// Scan plugins in file system. Returns plugin file path. +QString HbDeviceDialogPluginManager::scanPlugins(const QString &deviceDialogType, + const QString &baseFileName) { TRACE_ENTRY const QString fileNameFilter = pluginFileNameFilter(); + QString pluginFileName(baseFileName); + if (!pluginFileName.isEmpty()) { + // Add extension to file name + pluginFileName.append(fileNameExtension()); + } + QString result; foreach(const QString &path, mPluginPathList) { QDir pluginDir(path, fileNameFilter, QDir::NoSort, QDir::Files | QDir::Readable); foreach(const QString &fileName, pluginDir.entryList()) { - if (scanPlugin(func, deviceDialogType, pluginDir.absoluteFilePath(fileName)) && - stopIfFound) { - break; + if (pluginFileName.isEmpty() || HbPluginNameCache::compare(pluginFileName, fileName) == 0) { + const QString current(pluginDir.absoluteFilePath(fileName)); + if (scanPlugin(&HbDeviceDialogPluginManager::scanPluginCallback, deviceDialogType, + current)) { + result = current; + if (pluginFileName.isEmpty()) { + pluginFileName = fileName; + } + } } } } TRACE_EXIT + return result; } // Scan a plugin. Return true if plugin was loaded. @@ -329,32 +343,6 @@ return loaded; } -// Callback for scanPlugins(). Load plugin if it has a preload flag. -HbLockedPluginLoader *HbDeviceDialogPluginManager::preloadPluginCallback(HbLockedPluginLoader *loader, - const QString &unused) -{ - TRACE_ENTRY - Q_UNUSED(unused); - - QObject *pluginInstance = loader->instance(); - HbDeviceDialogPlugin *plugin = qobject_cast(pluginInstance); - - HbDeviceDialogPlugin::PluginFlags flags = plugin->pluginFlags(); - if (flags & HbDeviceDialogPlugin::PreloadPlugin) { - // Save preloaded plugin into a list - PluginInfo pluginInfo; - pluginInfo.mTypes = plugin->deviceDialogTypes(); - pluginInfo.mPluginFlags = flags; - pluginInfo.mLoader = loader; - loader = 0; - pluginInfo.mRefCount++; // this keeps plugin loaded in memory - mPlugins.append(pluginInfo); - pluginInfo.mLoader = 0; // ownership was transferred to the list - } - TRACE_EXIT - return loader; -} - // Callback for scanPlugins(). Load plugin for device dialog type. HbLockedPluginLoader *HbDeviceDialogPluginManager::loadPluginCallback(HbLockedPluginLoader *loader, const QString &deviceDialogType) @@ -367,7 +355,6 @@ if (types.contains(deviceDialogType)) { // Save plugin into a list PluginInfo pluginInfo; - pluginInfo.mTypes = types; pluginInfo.mPluginFlags = plugin->pluginFlags(); pluginInfo.mLoader = loader; loader = 0; @@ -385,13 +372,31 @@ return loader; } +// Callback for scanPlugins(). Check whether plugin implements device dialog type. +HbLockedPluginLoader *HbDeviceDialogPluginManager::scanPluginCallback(HbLockedPluginLoader *loader, + const QString &deviceDialogType) +{ + TRACE_ENTRY + QObject *pluginInstance = loader->instance(); + HbDeviceDialogPlugin *plugin = qobject_cast(pluginInstance); + + QStringList types = plugin->deviceDialogTypes(); + if (types.contains(deviceDialogType)) { + loader->unload(); + delete loader; + loader = 0; + } + TRACE_EXIT + return loader; +} + // Find index of a plugin -int HbDeviceDialogPluginManager::findPlugin(const QString &deviceDialogType) const +int HbDeviceDialogPluginManager::findPlugin(const QString &pluginFilePath) const { TRACE_ENTRY int count = mPlugins.count(); for(int i = 0; i < count; i++) { - if (mPlugins.at(i).mTypes.contains(deviceDialogType)) { + if (HbPluginNameCache::compare(mPlugins.at(i).mLoader->fileName(), pluginFilePath) == 0) { TRACE_EXIT_ARGS(i); return i; } @@ -400,6 +405,29 @@ return -1; } +// Find index of a plugin +int HbDeviceDialogPluginManager::findPlugin(HbDeviceDialogInterface* widget) const +{ + TRACE_ENTRY + int count = mPlugins.count(); + for(int i = 0; i < count; i++) { + if (mPlugins.at(i).mWidgets.contains(widget)) { + TRACE_EXIT_ARGS(i); + return i; + } + } + TRACE_EXIT_ARGS(-1); + return -1; +} + +// Increase plugin reference count +void HbDeviceDialogPluginManager::incPluginRefCount(const QString &pluginFilePath) +{ + int index = findPlugin(pluginFilePath); + Q_ASSERT(index >= 0); + mPlugins[index].mRefCount++; +} + // Free widgets that are kept for re-use. Widget reuse is a performance optimization // to get widgets to appear faster. void HbDeviceDialogPluginManager::freeRecycleWidgets() @@ -416,17 +444,26 @@ } // Update plugin name cache watch/scan list -void HbDeviceDialogPluginManager::updateCachePath(const QString &path, bool updateReadOnly) +void HbDeviceDialogPluginManager::updateCachePath(const QString &path, bool firstScan) { QString dirPath = HbPluginNameCache::directoryPath(path); QFileInfo fileInfo(dirPath); if (fileInfo.exists()) { // If directory is writable, watch it. Otherwise scan it only once. if (fileInfo.isWritable()) { - mNameCache.addWatchPath(dirPath); + HbPluginNameCache::ScanParameters::Options scanOptions = + HbPluginNameCache::ScanParameters::NoOptions; + Q_UNUSED(firstScan) +#if defined(Q_OS_SYMBIAN) + if (firstScan) { + scanOptions = HbPluginNameCache::ScanParameters::LimitToSet; + } +#endif // defined(Q_OS_SYMBIAN) + mNameCache.addWatchPath(HbPluginNameCache::ScanParameters(dirPath, scanOptions)); } else { - if (updateReadOnly) { - mNameCache.scanDirectory(dirPath); + if (firstScan) { + HbPluginNameCache::ScanParameters parameters(path, HbPluginNameCache::ScanParameters::AddToLimitSet); + mNameCache.scanDirectory(parameters); } } } else { @@ -451,7 +488,7 @@ pluginPathList << path; } #elif defined(Q_OS_WIN32) || defined(Q_OS_UNIX) - pluginPathList << qApp->applicationDirPath() + '/' << HB_PLUGINS_DIR + subDir; + pluginPathList << HB_PLUGINS_DIR + subDir << qApp->applicationDirPath() + '/'; #endif readOnlyPaths = trimPluginPathList(pluginPathList); // Plugin name caching differentiates directory and file names by trailing slash in a name @@ -466,14 +503,22 @@ // Generate plugin file name filter QString HbDeviceDialogPluginManager::pluginFileNameFilter() { -#if defined(Q_OS_LINUX) - return QString("*.so"); + QString filter("*"); + filter.append(fileNameExtension()); + return filter; +} + +// Generate file name extension +QString HbDeviceDialogPluginManager::fileNameExtension() +{ +#if defined(Q_OS_SYMBIAN) + return QString(".qtplugin"); #elif defined(Q_OS_MAC) - return QString("*.dylib"); + return QString(".dylib"); #elif defined(Q_OS_WIN32) - return QString("*.dll"); + return QString(".dll"); #else - return QString("*.qtplugin"); + return QString(".so"); #endif } @@ -492,17 +537,16 @@ QList::iterator i = mDeleteWidgets.begin(); while (i != mDeleteWidgets.end()) { HbDeviceDialogInterface *&widgetIf = *i; - QString deviceDialogType = widgetIf->deviceDialogWidget()-> - property(deviceDialogTypePropertyName).toString(); + int index = findPlugin(widgetIf); // IN Windows/Linux scene may get deleted before plugin manager and deletes all widgets if (!mAllWidgetsDeleted) { delete widgetIf; } - int index = findPlugin(deviceDialogType); Q_ASSERT(index >= 0); PluginInfo &pluginInfo = mPlugins[index]; pluginInfo.mRefCount--; - unloadPlugin(deviceDialogType); + pluginInfo.mWidgets.removeAt(pluginInfo.mWidgets.indexOf(widgetIf)); + unloadPlugin(pluginInfo.mLoader->fileName()); ++i; } mDeleteWidgets.clear(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogpluginmanager_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogpluginmanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogpluginmanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -59,16 +59,17 @@ explicit HbDeviceDialogPluginManager(Flags flags = NoFlags, QObject *parent = 0); virtual ~HbDeviceDialogPluginManager(); - void preloadPlugins(); HbDeviceDialogInterface *createWidget(const QString &deviceDialogType, - const QVariantMap ¶meters, bool &recycled, int &error); + const QVariantMap ¶meters, const QString &baseFileName, const QString &pluginFilePath, + bool &recycled, int &error); void freeWidget(HbDeviceDialogInterface *widget); - bool loadPlugin(const QString &deviceDialogType); - bool unloadPlugin(const QString &deviceDialogType); - const HbDeviceDialogPlugin &plugin(const QString &deviceDialogType); + bool loadPlugin(const QString &deviceDialogType, const QString &baseFileName, QString *pluginFilePath); + bool unloadPlugin(const QString &pluginFilePath); + const HbDeviceDialogPlugin &plugin(const QString &pluginFilePath); static QStringList pluginPathList(const QString &subDir, int &readOnlyPaths); static QString pluginFileNameFilter(); + static QString fileNameExtension(); static int trimPluginPathList(QStringList &pathList); private: // types @@ -79,7 +80,7 @@ }; Q_DECLARE_FLAGS(Flags, Flag) - QStringList mTypes; // device dialog types implemented by the plugin + QList mWidgets; // widgets created by the plugin HbLockedPluginLoader *mLoader; // loaded plugin int mRefCount; // number of references into the plugin HbDeviceDialogPlugin::PluginFlags mPluginFlags; @@ -94,14 +95,16 @@ (HbLockedPluginLoader*, const QString&); private: // functions - void scanPlugins(PluginScanCallback func, const QString &deviceDialogType, bool stopIfFound = true); + QString scanPlugins(const QString &deviceDialogType, const QString &baseFileName); bool scanPlugin(PluginScanCallback func, const QString &deviceDialogType, const QString &filePath); - HbLockedPluginLoader *preloadPluginCallback(HbLockedPluginLoader *loader, const QString& unused); HbLockedPluginLoader *loadPluginCallback(HbLockedPluginLoader *loader, const QString &deviceDialogType); + HbLockedPluginLoader *scanPluginCallback(HbLockedPluginLoader *loader, const QString &deviceDialogType); - int findPlugin(const QString &deviceDialogType) const; + int findPlugin(const QString &pluginFilePath) const; + int findPlugin(HbDeviceDialogInterface* widget) const; + void incPluginRefCount(const QString &pluginFilePath); void freeRecycleWidgets(); - void updateCachePath(const QString &path, bool updateReadOnly = false); + void updateCachePath(const QString &path, bool firstScan = false); static QStringList pluginKeys(QObject *pluginInstance); private slots: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogscontainer.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogscontainer.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogscontainer.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -38,9 +38,6 @@ mId = InvalidId; mPtr = 0; mFlags = NoFlags; - for(int i = 0; i < NumVariables; i++) { - mVariables[i] = 0; - } mIndex = InvalidIndex; #ifndef QT_NO_DEBUG mContainer = 0; @@ -188,7 +185,7 @@ // Get next dialog with matching variable value HbDeviceDialogsContainer::Dialog &HbDeviceDialogsContainer::next( - const Dialog &from, Dialog::Variable variable, quintptr value) + const Dialog &from, Dialog::Variable variable, const QVariant &value) { // With invalid from start from beginning, otherwise start from next int i = from.isValid() ? from.mIndex + 1 : 0; @@ -209,3 +206,9 @@ dialog.mIndex = i; return dialog; } + +// check is the dialog list empty +bool HbDeviceDialogsContainer::isEmpty() const +{ + return mDialogs.isEmpty(); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogscontainer_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogscontainer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogscontainer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,6 +29,7 @@ #include #include #include +#include #include class HbDeviceDialogPluginManager; @@ -59,6 +60,7 @@ ClientTag, CloseHousekeeping, NoClientHousekeeping, + DialogType, NumVariables }; enum { @@ -77,8 +79,10 @@ Flags flags() const {Q_ASSERT(verify()); return mFlags;} void setFlags(Flags flags){Q_ASSERT(verify()); mFlags |= flags;} void resetFlags(Flags flags){Q_ASSERT(verify()); mFlags &= ~flags;} - quintptr variable(Variable selector) const {return mVariables[selector];} - void setVariable(Variable selector, quintptr value){mVariables[selector] = value;} + qulonglong intVariable(Variable selector) const {return mVariables[selector].toULongLong();} + QString stringVariable(Variable selector) const {return mVariables[selector].toString();} + void setVariable(Variable selector, qulonglong value){mVariables[selector].setValue(value);} + void setVariable(Variable selector, const QString &value){mVariables[selector].setValue(value);} bool operator ==(const Dialog &other) const; private: bool verify() const; @@ -86,15 +90,15 @@ int mId; HbDeviceDialogInterface *mPtr; Flags mFlags; - quintptr mVariables[NumVariables]; + QVariant mVariables[NumVariables]; int mIndex; #ifndef QT_NO_DEBUG HbDeviceDialogsContainer *mContainer; // used by verify() #endif // QT_NO_DEBUG friend class HbDeviceDialogsContainer; }; + public: - HbDeviceDialogsContainer(HbDeviceDialogPluginManager &pluginManager); virtual ~HbDeviceDialogsContainer(); @@ -104,7 +108,12 @@ Dialog &find(const QObject *widget); void remove(Dialog &dialog); Dialog &next(const Dialog &from, Dialog::Flags flags, Dialog::Flags mask); - Dialog &next(const Dialog &from, Dialog::Variable variable, quintptr value); + Dialog &next(const Dialog &from, Dialog::Variable variable, quintptr value) + {return next(from, variable, QVariant(static_cast(value)));} + Dialog &next(const Dialog &from, Dialog::Variable variable, const QString &value) + {return next(from, variable, QVariant(value));} + Dialog &next(const Dialog &from, Dialog::Variable variable, const QVariant &value); + bool isEmpty() const; private: HbDeviceDialogPluginManager &mPluginManager; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserver.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserver.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserver.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -121,6 +121,16 @@ /*! \internal + Publish current orientation to PS-key +*/ +int HbDeviceDialogServer::publishOrientation(int orientation) +{ + return iManager->publishOrientation( orientation ); +} + +/*! + \internal + Calls HbDeviceDialogManager to close device dialog. On return the status of the call is received. identifier identifies the device dialog. diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserver_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserver_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserver_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -81,6 +81,7 @@ void setMainWindow(HbMainWindow *mainWindow); int showDeviceDialog(DialogParameters ¶meters); int updateDeviceDialog(int identifier, const QVariantMap &data); + int publishOrientation(int orientation); int closeDeviceDialog(int identifier); void deviceDialogClientClosing(quintptr sessionTag); int activateIndicator(IndicatorParameters ¶meters); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserverdefs_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserverdefs_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserverdefs_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -83,6 +83,7 @@ EHbSrvClientClosing, EHbSrvCancelUpdateChannel, EHbSrvOpenUpdateChannel, + EHbSrvPublishOrientation, //indicator commands EHbSrvIndicatorCommandsStart, diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserversym_p.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserversym_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserversym_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -200,6 +200,15 @@ /*! \internal + Publish current orientation to PS-key +*/ +int HbDeviceDialogServerPrivate::publishOrientation( int orientation ) +{ + return q_func()->publishOrientation( orientation ); +} + +/*! + \internal Forward client initiated close event. */ int HbDeviceDialogServerPrivate::closeDeviceDialog( int id ) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserversym_p_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserversym_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogserversym_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -56,6 +56,7 @@ int showDeviceDialog(HbDeviceDialogServer::DialogParameters ¶meters); int updateDeviceDialog(int id, QVariantMap &data); int closeDeviceDialog(int id); + int publishOrientation(int orientation); void deviceDialogClientClosing(quintptr sessionTag); int activateIndicator(HbDeviceDialogServer::IndicatorParameters ¶meters); int deactivateIndicator(HbDeviceDialogServer::IndicatorParameters ¶meters); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogsession.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogsession.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogsession.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -154,6 +154,10 @@ UpdateDataRequestL( aMessage ); break; } + case EHbSrvPublishOrientation: { + PublishOrientation( aMessage ); + break; + } default: { break; @@ -500,6 +504,21 @@ /*! \internal + Publish current orientation to PS-key +*/ +void HbDeviceDialogSession::PublishOrientation(const RMessage2 &aMessage) +{ + TRACE_ENTRY + TInt result = KErrNone; + TInt val0 = aMessage.Int0(); + result = Server().publishOrientation( val0 ); + + aMessage.Complete( result ); + TRACE_EXIT_ARGS("result " << result) +} + +/*! + \internal */ HbDeviceDialogSession::HbDeviceDialogSession() { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogsession_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogsession_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbdevicedialogsession_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -67,6 +67,7 @@ void UpdateDataRequestL( const RMessage2 &aMessage ); void CancelUpdateChannel(const RMessage2 aMessage); void WriteUpdateData(const QVariantMap ¶meters, int deviceDialogId); + void PublishOrientation(const RMessage2 &aMessage); int WriteCloseData(int deviceDialogId, int closeReason); QString indicatorTypeFromMessageL(const RMessage2 &aMessage) const; HbDeviceDialogSession(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbpluginnamecache.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbpluginnamecache.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbpluginnamecache.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -74,24 +74,27 @@ class HbPluginNameCacheThread : public QThread { public: + typedef HbPluginNameCache::ScanParameters WorkItem; + HbPluginNameCacheThread(HbPluginNameCache &nameCache, HbPluginNameCache::GetPluginKeys getPluginKeys, HbPluginNameCache::PluginFileNameFilter pluginFileNameFilter); - void scanDirectory(const QString &path); + void scanDirectory(const WorkItem &workItem); void cancelScan(const QString &path); void stop(); QMutex &lock(){return *mMutex;} private: - void doDirectoryScan(const QString &path); + void doDirectoryScan(const WorkItem &workItem); void run(); private: // data HbPluginNameCache::GetPluginKeys mGetPluginKeys; // function to get keys from a plugin HbPluginNameCache::PluginFileNameFilter mPluginFileNameFilter; bool mExit; - QStringList mWorkQueue; // queue for directories to be scanned - QString mCurrentScan; // directory currently scanned + QList mWorkQueue; // queue for directories to be scanned + WorkItem mCurrentScan; // directory currently scanned + QStringList mLimitSet; // names of plugin-files found from rom-drives HbPluginNameCache &mNameCache; static QMutex *mMutex; }; @@ -99,6 +102,13 @@ // Share lock between all instances of the cache. QMutex *HbPluginNameCacheThread::mMutex = 0; +// For file name compare +#if defined(Q_OS_LINUX) && !defined(Q_OS_SYMBIAN) + static const Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive; +#else + static const Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive; +#endif // defined(Q_OS_LINUX) && !defined(Q_OS_SYMBIAN) + HbPluginNameCacheThread::HbPluginNameCacheThread(HbPluginNameCache &nameCache, HbPluginNameCache::GetPluginKeys getPluginKeys, HbPluginNameCache::PluginFileNameFilter pluginFileNameFilter) : @@ -111,11 +121,11 @@ } // Add directory to be scanned -void HbPluginNameCacheThread::scanDirectory(const QString &path) +void HbPluginNameCacheThread::scanDirectory(const WorkItem &workItem) { QMutexLocker lock(mMutex); - if (!mWorkQueue.contains(path)) { - mWorkQueue.append(path); + if (!mWorkQueue.contains(workItem)) { + mWorkQueue.append(workItem); } #ifdef USE_NAME_CACHE_THREAD if (!isRunning()) { @@ -134,19 +144,21 @@ { QMutexLocker lock(mMutex); // If scan is waiting in a queue, remove it - int i = mWorkQueue.indexOf(path); + WorkItem workItem(path); + int i = mWorkQueue.indexOf(workItem); if (i >= 0) { mWorkQueue.removeAt(i); } #ifdef USE_NAME_CACHE_THREAD // If thread is currently scanning the path, stop and wait for it to exit - if (isRunning() && mCurrentScan == path) { + if (isRunning() && mCurrentScan.mDirPath.compare(path, caseSensitivity) == 0) { mExit = true; lock.unlock(); stop(); // Restart scan thread if scan queue is not empty if (!mWorkQueue.isEmpty()) { - scanDirectory(mWorkQueue.first()); + const WorkItem &workItem = mWorkQueue.first(); + scanDirectory(workItem); } } #endif @@ -170,28 +182,42 @@ } // Scan directory for plugins and keys they implement. -void HbPluginNameCacheThread::doDirectoryScan(const QString &path) +void HbPluginNameCacheThread::doDirectoryScan(const WorkItem &workItem) { TRACE_ENTRY_ARGS(path) // Invalidate cache contents for the path - mNameCache.removePath(path); + mNameCache.insertPath(workItem.mDirPath); QString fileNameFilter = mPluginFileNameFilter(); - QDir pluginDir(path, fileNameFilter, QDir::NoSort, QDir::Files | QDir::Readable); - foreach (const QString &fileName, pluginDir.entryList()) { + QDir pluginDir(workItem.mDirPath, fileNameFilter, QDir::NoSort, QDir::Files | QDir::Readable); + foreach(const QString &fileName, pluginDir.entryList()) { if (mExit) { break; } - + if (workItem.mOptions == HbPluginNameCache::ScanParameters::LimitToSet) { + // Scan is limited to a set of files + if (!mLimitSet.contains(fileName, caseSensitivity)) { + continue; + } + } const QString absolutePath = pluginDir.absoluteFilePath(fileName); HbLockedPluginLoader *loader = new HbLockedPluginLoader(*mMutex, absolutePath); QObject *pluginInstance = loader->instance(); if (pluginInstance) { // If plugin type is correct, plugin file name and keys are saved into a cache - mNameCache.insert(mGetPluginKeys(pluginInstance), absolutePath); + QStringList keys = mGetPluginKeys(pluginInstance); + if (!keys.isEmpty()) { + mNameCache.insert(keys, workItem.mDirPath, fileName); + if (workItem.mOptions == HbPluginNameCache::ScanParameters::AddToLimitSet) { + // Add file name to limit set + if (!mLimitSet.contains(fileName, caseSensitivity)) { + mLimitSet.append(fileName); + } + } + } } loader->unload(); delete loader; @@ -237,16 +263,16 @@ } // Add directory watch path -void HbPluginNameCache::addWatchPath(const QString &path) +void HbPluginNameCache::addWatchPath(const ScanParameters ¶meters) { - TRACE_ENTRY_ARGS(path) - QString dirPath = directoryPath(path); + TRACE_ENTRY_ARGS(parameters.mDirPath) + QString dirPath = directoryPath(parameters.mDirPath); TRACE(dirPath) if (!dirPath.isEmpty()) { #ifdef MONITOR_INSTALLATION_DIRS mWatcher.addPath(dirPath); // start watching #endif // MONITOR_INSTALLATION_DIRS - directoryChanged(dirPath); // scan directory + mThread->scanDirectory(ScanParameters(dirPath, parameters.mOptions)); } } @@ -258,12 +284,7 @@ TRACE(dirPath) if (!dirPath.isEmpty()) { #ifdef MONITOR_INSTALLATION_DIRS -#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) - const Qt::CaseSensitivity cs = Qt::CaseSensitive; -#else - const Qt::CaseSensitivity cs = Qt::CaseInsensitive; -#endif // Q_OS_LINUX || Q_OS_MAC - if (mWatcher.directories().contains(dirPath, cs)) { + if (mWatcher.directories().contains(dirPath, caseSensitivity)) { mWatcher.removePath(dirPath); #else // MONITOR_INSTALLATION_DIRS { @@ -275,22 +296,46 @@ } // Scan directory directory for plugins -void HbPluginNameCache::scanDirectory(const QString &path) +void HbPluginNameCache::scanDirectory(const ScanParameters ¶meters) { TRACE_ENTRY_ARGS(path) - QString dirPath = directoryPath(path); + QString dirPath = directoryPath(parameters.mDirPath); TRACE(dirPath) if (!dirPath.isEmpty()) { - mThread->scanDirectory(dirPath); + mThread->scanDirectory(ScanParameters(dirPath, parameters.mOptions)); } } -// Find a plugin by a key. Returns plugin file path or an empty string -QString HbPluginNameCache::find(const QString &key) +// Find a plugin by a key. Returns plugin file path or an empty string. Search may be limited +// to a certain file name. +QString HbPluginNameCache::find(const QString &key, const QString &fileName) { TRACE_ENTRY_ARGS(key) QMutexLocker(&mThread->lock()); - return mCache.value(key); + const DirItem *resultDir = 0; + const FileItem *resultFile = 0; + int count = mCache.count(); + for(int i = 0; i < count; i++) { + const DirItem &item = mCache.at(i); + int files = item.mFiles.count(); + for(int j = 0; j < files; j++) { + const FileItem &fileItem = item.mFiles.at(j); + // Search limited to a certain file name + if (!fileName.isEmpty() && compare(fileName, fileItem.mFile)) { + continue; + } + // Allow eclipsing only if file names are the same + if (resultFile && compare(resultFile->mFile, fileItem.mFile) != 0) { + continue; + } + if (!fileItem.mKeys.contains(key)) { + continue; + } + resultDir = &item; + resultFile = &fileItem; + } + } + return resultFile ? resultDir->mPath + resultFile->mFile : QString(); } // Get directory part of a file name @@ -308,38 +353,75 @@ } } +// Case sensitive/insensitive compare depending on os +int HbPluginNameCache::compare(const QString &s1, const QString &s2) +{ + return s1.compare(s2, caseSensitivity); +} + // Print cache contents void HbPluginNameCache::print() { TRACE_ENTRY QMutexLocker(&mThread->lock()); - QHash::iterator i = mCache.begin(); - while (i != mCache.end()) { - TRACE(i.key() << i.value()) - ++i; - } -} + TRACE("Name cache") -// Update cache with \a keys and \a filePath -void HbPluginNameCache::insert(const QStringList &keys, const QString &filePath) -{ - TRACE_ENTRY_ARGS("keys" << keys << "filePath" << filePath) - QMutexLocker(&mThread->lock()); - for (int i = 0; i < keys.size(); ++i) { - // New entry is added into a cache. If the key is already present, value is not - // updated. This is to prevent overriding an existing plugin. - if (!mCache.contains(keys.at(i))) { - mCache.insert(keys.at(i), filePath); + int count = mCache.count(); + for(int i = 0; i < count; i++) { + const DirItem ¤t = mCache.at(i); + TRACE("Dir:" << current.mPath) + int fileCount = current.mFiles.count(); + for(int j = 0; j < fileCount; j++) { + const FileItem &fileitem = current.mFiles.at(j); + TRACE("File:" << fileitem.mFile) + int keyCount = fileitem.mKeys.count(); + for(int k = 0; k < keyCount; k++) { + TRACE(fileitem.keys.at(k)) + } } } } -// Remove a key from from a cache -void HbPluginNameCache::remove(const QString &key) +// Create cache entry for directory path +void HbPluginNameCache::insertPath(const QString &dirPath) +{ + TRACE_ENTRY_ARGS(dirPath) + QMutexLocker(&mThread->lock()); + DirItem searchItem; + searchItem.mPath = dirPath; + int index = mCache.indexOf(searchItem); + if (index < 0) { + mCache.append(searchItem); + } else { + mCache[index].mFiles.clear(); + } +} + +// Update cache with \a keys , \a firPath and \a fileName +void HbPluginNameCache::insert(const QStringList &keys, const QString &dirPath, + const QString &fileName) { - TRACE_ENTRY_ARGS(key) + TRACE_ENTRY_ARGS("keys" << keys << "filePath" << filePath) QMutexLocker(&mThread->lock()); - mCache.remove(key); + // Find directory path + DirItem searchItem; + searchItem.mPath = dirPath; + int dirIndex = mCache.indexOf(searchItem); + if (dirIndex >= 0) { + DirItem &dirItem = mCache[dirIndex]; + FileItem searchItem; + searchItem.mFile = fileName; + int fileIndex = dirItem.mFiles.indexOf(searchItem); + if (fileIndex >= 0) { + FileItem &fileItem = dirItem.mFiles[fileIndex]; + fileItem.mKeys = keys; + } else { + FileItem fileItem; + fileItem.mFile = fileName; + fileItem.mKeys = keys; + dirItem.mFiles.append(fileItem); + } + } } // Remove all keys with a \a filePath @@ -347,32 +429,25 @@ { TRACE_ENTRY_ARGS(filePath) QMutexLocker(&mThread->lock()); - QHash::iterator i = mCache.begin(); - while (i != mCache.end()) { -#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) - const Qt::CaseSensitivity cs = Qt::CaseSensitive; -#else - const Qt::CaseSensitivity cs = Qt::CaseInsensitive; -#endif // Q_OS_LINUX || Q_OS_MAC - if (i.value().startsWith(filePath, cs)) { - i = mCache.erase(i); - } else { - ++i; - } + DirItem searchItem; + searchItem.mPath = directoryPath(filePath); + int index = mCache.indexOf(searchItem); + if (index >= 0) { + mCache[index].mFiles.clear(); } } // Generate filter for plugin file names QString HbPluginNameCache::pluginFileNameFilter() { -#if defined(Q_OS_LINUX) - return QString("*.so"); +#if defined(Q_OS_SYMBIAN) + return QString("*.qtplugin"); #elif defined(Q_OS_MAC) return QString("*.dylib"); #elif defined(Q_OS_WIN32) return QString("*.dll"); #else - return QString("*.qtplugin"); + return QString("*.so"); #endif } @@ -380,10 +455,26 @@ void HbPluginNameCache::directoryChanged(const QString &path) { TRACE_ENTRY_ARGS(path) + mThread->scanDirectory(ScanParameters(path)); + TRACE_EXIT +} - mThread->scanDirectory(path); +// Compare scan parameters +bool HbPluginNameCache::ScanParameters::operator ==(const ScanParameters &other) const +{ + return compare(mDirPath, other.mDirPath) == 0; +} - TRACE_EXIT +// Compare cache items +bool HbPluginNameCache::FileItem::operator ==(const FileItem &other) const +{ + return compare(mFile, other.mFile) == 0; +} + +// Compare cache items +bool HbPluginNameCache::DirItem::operator ==(const DirItem &other) const +{ + return compare(mPath, other.mPath) == 0; } // Constructor diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbpluginnamecache_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbpluginnamecache_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbpluginnamecache_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -48,6 +48,19 @@ public: + class ScanParameters { + public: + enum Options {NoOptions, AddToLimitSet, LimitToSet}; + ScanParameters(){mOptions = NoOptions;} + ScanParameters(const QString &path, Options options = NoOptions): + mOptions(options), mDirPath(path){} + bool operator ==(const ScanParameters &other) const; + void clear(){mDirPath.clear();} + + Options mOptions; // scan options + QString mDirPath; // directory to scan + }; + typedef QStringList (*GetPluginKeys)(QObject *pluginInstance); typedef QString (*PluginFileNameFilter)(); @@ -55,16 +68,30 @@ PluginFileNameFilter pluginFileNameFilter = 0, QObject *parent = 0); ~HbPluginNameCache(); - void addWatchPath(const QString &path); + void addWatchPath(const ScanParameters ¶meters); void removeWatchPath(const QString &path); - void scanDirectory(const QString &path); - QString find(const QString &key); + void scanDirectory(const ScanParameters ¶meters); + QString find(const QString &key, const QString &fileName); static QString directoryPath(const QString &path); + static int compare(const QString &s1, const QString &s2); + void print(); - void print(); private: - void insert(const QStringList &keys, const QString &filePath); - void remove(const QString &key); + class FileItem { + public: + bool operator ==(const FileItem &other) const; + QString mFile; + QStringList mKeys; + }; + class DirItem { + public: + bool operator ==(const DirItem &other) const; + QString mPath; + QList mFiles; + }; + + void insertPath(const QString &dirPath); + void insert(const QStringList &keys, const QString &dirPath, const QString &fileName); void removePath(const QString &filePath); static QString pluginFileNameFilter(); @@ -73,7 +100,7 @@ private: // data Q_DISABLE_COPY(HbPluginNameCache) - QHash mCache; + QList mCache; HbPluginNameCacheThread *mThread; QFileSystemWatcher mWatcher; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfo_p.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfo_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfo_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -45,6 +45,12 @@ delete d_ptr; } +QSystemNetworkInfo::NetworkStatus HbSystemInfo::networkStatus() const +{ + Q_D(const HbSystemInfo); + return d->networkStatus(); +} + int HbSystemInfo::networkSignalStrength() const { Q_D(const HbSystemInfo); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfo_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfo_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfo_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,6 +43,7 @@ explicit HbSystemInfo(QObject *parent = 0, bool writer = false); virtual ~HbSystemInfo(); + QSystemNetworkInfo::NetworkStatus networkStatus() const; int networkSignalStrength() const; QSystemNetworkInfo::NetworkMode networkMode() const; int batteryLevel() const; @@ -50,7 +51,7 @@ signals: void networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int); - void networkModeChanged(QSystemNetworkInfo::NetworkMode); + void networkModeChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus); void batteryLevelChanged(int); void powerStateChanged(QSystemDeviceInfo::PowerState); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfosym_p_p.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfosym_p_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfosym_p_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,11 +24,11 @@ ****************************************************************************/ #include "hbsysteminfosym_p_p.h" -#include "hbsysteminfo_p.h" #include #include const TUint32 secureId = 0x20022FC5; +const TUint32 splashGenServerSecureId = 0x2002E68B; // publish & subscribe const TUid PropertyCategoryUid = {secureId}; @@ -46,6 +46,7 @@ HbSystemInfoPrivate::~HbSystemInfoPrivate() { + Cancel(); if (!mWriter) { lostForeground(); } @@ -61,12 +62,19 @@ if (writer) { RProcess me; if ((me.SecureId().iId != secureId )) { + me.Close(); return; } + me.Close(); } if (writer) { mSystemNetworkInfo = new QtMobility::QSystemNetworkInfo(); + mDeviceSystemInfo.networkMode = mSystemNetworkInfo->currentMode(); + mDeviceSystemInfo.networkStatus = mSystemNetworkInfo->networkStatus(mDeviceSystemInfo.networkMode); + mDeviceSystemInfo.signalStrength = QSystemNetworkInfo::networkSignalStrength(mDeviceSystemInfo.networkMode); + connect(mSystemNetworkInfo, SIGNAL(networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus)), + this, SLOT(setNetworkStatus(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus))); connect(mSystemNetworkInfo, SIGNAL(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int)), this, SLOT(setNetworkSignalStrength(QSystemNetworkInfo::NetworkMode, int))); connect(mSystemNetworkInfo, SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)), @@ -97,7 +105,15 @@ mPtr.Set(mDataBuffer->Des()); mInfoProperty.Attach(PropertyCategoryUid, InfoKey); } - + + // hbsplashgenerator will not have any Qt widget shown (and + // thus created) so we cannot rely on foreground-background + // notifications. Instead, invoke gainedForeground manually. + RProcess me; + if (me.SecureId().iId == splashGenServerSecureId) { + QMetaObject::invokeMethod(this, "gainedForeground", Qt::QueuedConnection); + } + me.Close(); } } @@ -141,15 +157,21 @@ { Q_Q(HbSystemInfo); bool modeChanged = info.networkMode != mDeviceSystemInfo.networkMode; - bool signalLevelChanged = info.signalStrength != mDeviceSystemInfo.signalStrength; + bool statusChanged = info.networkStatus != mDeviceSystemInfo.networkStatus; if (modeChanged) { mDeviceSystemInfo.networkMode = info.networkMode; } - if (modeChanged && !signalLevelChanged) { - emit q->networkModeChanged((QSystemNetworkInfo::NetworkMode)mDeviceSystemInfo.networkMode); - } else { + if (statusChanged) { + mDeviceSystemInfo.networkStatus = info.networkStatus; + } + if (modeChanged || statusChanged) { + emit q->networkModeChanged((QSystemNetworkInfo::NetworkMode)mDeviceSystemInfo.networkMode, + (QSystemNetworkInfo::NetworkStatus)mDeviceSystemInfo.networkStatus); + } + + if (info.signalStrength != mDeviceSystemInfo.signalStrength) { mDeviceSystemInfo.signalStrength = info.signalStrength; emit q->networkSignalStrengthChanged((QSystemNetworkInfo::NetworkMode)mDeviceSystemInfo.networkMode, mDeviceSystemInfo.signalStrength); @@ -168,6 +190,10 @@ void HbSystemInfoPrivate::DoCancel() { + if (mListening) { + mInfoProperty.Cancel(); + mListening = false; + } } void HbSystemInfoPrivate::RunL() @@ -181,6 +207,27 @@ } } +void HbSystemInfoPrivate::setNetworkStatus( + QSystemNetworkInfo::NetworkMode networkMode, + QSystemNetworkInfo::NetworkStatus networkStatus) +{ + bool changed(false); + if (networkMode != mDeviceSystemInfo.networkMode) { + mDeviceSystemInfo.networkMode = networkMode; + changed = true; + } + + if (networkStatus != mDeviceSystemInfo.networkStatus) { + mDeviceSystemInfo.networkStatus = networkStatus; + changed = true; + } + + if (changed) { + writeDeviceInfo(); + } + +} + void HbSystemInfoPrivate::setNetworkSignalStrength( QSystemNetworkInfo::NetworkMode mode, int strength) @@ -228,11 +275,15 @@ void HbSystemInfoPrivate::lostForeground() { - if (mListening) { + // Statusbars are rendered in the background by hbsplashgenerator + // so cannot stop listening in that case. + RProcess me; + if (mListening && me.SecureId().iId != splashGenServerSecureId) { mInfoProperty.Cancel(); Cancel(); mListening = false; } + me.Close(); } void HbSystemInfoPrivate::gainedForeground() @@ -244,6 +295,11 @@ } } +QSystemNetworkInfo::NetworkStatus HbSystemInfoPrivate::networkStatus() const +{ + return mDeviceSystemInfo.networkStatus; +} + int HbSystemInfoPrivate::networkSignalStrength() const { return mDeviceSystemInfo.signalStrength; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfosym_p_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfosym_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfosym_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,6 +39,7 @@ powerState(QSystemDeviceInfo::UnknownPower) {} QSystemNetworkInfo::NetworkMode networkMode; + QSystemNetworkInfo::NetworkStatus networkStatus; int signalStrength; int batteryLevel; QSystemDeviceInfo::PowerState powerState; @@ -48,6 +49,7 @@ const DeviceSystemInfo &obj) { outStream << obj.networkMode; + outStream << obj.networkStatus; outStream << obj.signalStrength; outStream << obj.powerState; outStream << obj.batteryLevel; @@ -60,9 +62,11 @@ int temp; inStream >> temp; obj.networkMode = (QSystemNetworkInfo::NetworkMode)temp; + inStream >> temp; + obj.networkStatus = (QSystemNetworkInfo::NetworkStatus)temp; inStream >> obj.signalStrength; inStream >> temp; - obj.powerState= (QSystemDeviceInfo::PowerState)temp; + obj.powerState = (QSystemDeviceInfo::PowerState)temp; inStream >> obj.batteryLevel; return inStream; } @@ -84,6 +88,7 @@ void dataReceived(const DeviceSystemInfo& info); bool eventFilter(QObject *obj, QEvent *event); public: + QSystemNetworkInfo::NetworkStatus networkStatus() const; int networkSignalStrength() const; QSystemNetworkInfo::NetworkMode networkMode() const; int batteryLevel() const; @@ -94,6 +99,7 @@ virtual void RunL(); public slots: + void setNetworkStatus(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus); void setNetworkSignalStrength(QSystemNetworkInfo::NetworkMode, int); void setNetworkMode(QSystemNetworkInfo::NetworkMode); void setBatteryLevel(int); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfowin_p_p.cpp --- a/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfowin_p_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfowin_p_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,8 @@ q, SIGNAL(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode, int))); connect(mSystemNetworkInfo, SIGNAL(networkModeChanged(QSystemNetworkInfo::NetworkMode)), this, SLOT(setNetworkMode(QSystemNetworkInfo::NetworkMode))); - + connect(mSystemNetworkInfo, SIGNAL(networkStatusChanged(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus)), + this, SLOT(setNetworkStatus(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus))); mSystemDeviceInfo = new QSystemDeviceInfo(); connect(mSystemDeviceInfo, SIGNAL(batteryLevelChanged(int)), q, SIGNAL(batteryLevelChanged(int))); @@ -64,6 +65,11 @@ { } +QSystemNetworkInfo::NetworkStatus HbSystemInfoPrivate::networkStatus() const +{ + return mSystemNetworkInfo->networkStatus(mNetworkMode); +} + int HbSystemInfoPrivate::networkSignalStrength() const { return mSystemNetworkInfo->networkSignalStrength(mNetworkMode); @@ -88,5 +94,14 @@ { Q_Q(HbSystemInfo); mNetworkMode = mode; - emit q->networkModeChanged(mode); + emit q->networkModeChanged(mode, mNetworkStatus); } + +void HbSystemInfoPrivate::setNetworkStatus(QSystemNetworkInfo::NetworkMode mode, QSystemNetworkInfo::NetworkStatus status) +{ + Q_Q(HbSystemInfo); + mNetworkMode = mode; + mNetworkStatus = status; + emit q->networkModeChanged(mode, mNetworkStatus); + +} \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfowin_p_p.h --- a/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfowin_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/devicedialogserver/hbsysteminfowin_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,6 +37,7 @@ virtual ~HbSystemInfoPrivate(); void init(bool writer); + QSystemNetworkInfo::NetworkStatus networkStatus() const; int networkSignalStrength() const; QSystemNetworkInfo::NetworkMode networkMode() const; int batteryLevel() const; @@ -44,6 +45,7 @@ public slots: void setNetworkMode(QSystemNetworkInfo::NetworkMode); + void setNetworkStatus(QSystemNetworkInfo::NetworkMode, QSystemNetworkInfo::NetworkStatus); void lostForeground(); void gainedForeground(); @@ -51,6 +53,7 @@ QSystemNetworkInfo *mSystemNetworkInfo; QSystemDeviceInfo *mSystemDeviceInfo; QSystemNetworkInfo::NetworkMode mNetworkMode; + QSystemNetworkInfo::NetworkStatus mNetworkStatus; Q_DECLARE_PUBLIC(HbSystemInfo) HbSystemInfo *q_ptr; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialog.cpp --- a/src/hbcore/devicedialogbase/hbdevicedialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -268,6 +268,12 @@ */ /*! + \var HbDeviceDialog::DeviceDialogError HbDeviceDialog::InstanceExistsError + A device dialog widget is a single instance and already exists (has been launched). + See HbDeviceDialogPlugin::SingleInstance. +*/ + +/*! \var HbDeviceDialog::DeviceDialogFlags HbDeviceDialog::NoFlags No flags specified. */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialog.h --- a/src/hbcore/devicedialogbase/hbdevicedialog.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialog.h Thu Jul 22 16:36:53 2010 +0100 @@ -47,7 +47,8 @@ PluginErrors = 0x10000000, ErrorTypeMask = 0xf0000000, CancelledError = 0x0fffffff, - SystemCancelledError = 0x0ffffffe + SystemCancelledError = 0x0ffffffe, + InstanceExistsError = 0x0ffffffd }; enum DeviceDialogFlag{ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogclientsession.cpp --- a/src/hbcore/devicedialogbase/hbdevicedialogclientsession.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogclientsession.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -118,7 +118,7 @@ TBool RHbDeviceDialogClientSession::ServerRunning() { - TRACE_ENTRY + TRACE_STATIC_ENTRY TFindServer findHbServer(KHbServerName); TFullName name; TRACE_EXIT diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogconnecthelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/devicedialogbase/hbdevicedialogconnecthelper.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include +#include + +/*! + HbDeviceDialogConnectHelper + \internal +*/ + + +HbDeviceDialogConnectHelperPrivate::HbDeviceDialogConnectHelperPrivate(HbDeviceDialogConnectHelper *wrapper) +: CActive(CActive::EPriorityStandard), q_ptr(wrapper), mSessionConnected(0) +{ + CActiveScheduler::Add(this); +} + +HbDeviceDialogConnectHelperPrivate::~HbDeviceDialogConnectHelperPrivate() +{ + Cancel(); + if (mSessionConnected) { + mClientSession.Close(); + mSessionConnected = false; + } +} + +void HbDeviceDialogConnectHelperPrivate::connect() +{ + if (!IsActive()) { + iStatus = KRequestPending; + if (mClientSession.Connect(&iStatus) == KErrNone) { + SetActive(); + } + } +} + +void HbDeviceDialogConnectHelperPrivate::RunL() +{ + if (iStatus == KErrNone) { + emit q_ptr->sessionEstablished(&mClientSession); + mSessionConnected = true; + } +} + +void HbDeviceDialogConnectHelperPrivate::DoCancel() +{ + TRequestStatus *rs = &iStatus; + User::RequestComplete(rs, KErrCancel); +} + + + +HbDeviceDialogConnectHelper::HbDeviceDialogConnectHelper(QObject *parent) +: QObject(parent) +{ + d_ptr = new HbDeviceDialogConnectHelperPrivate(this); +} + +HbDeviceDialogConnectHelper::~HbDeviceDialogConnectHelper() +{ + delete d_ptr; +} + +void HbDeviceDialogConnectHelper::connect() +{ + d_ptr->connect(); +} + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogconnecthelper_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/devicedialogbase/hbdevicedialogconnecthelper_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBDEVICEDIALOGCONNECTHELPER_P_H +#define HBDEVICEDIALOGCONNECTHELPER_P_H + +#include +#include + +class HbDeviceDialogConnectHelperPrivate; + +class HbDeviceDialogConnectHelper : public QObject +{ + Q_OBJECT + +public: + HbDeviceDialogConnectHelper(QObject *parent = 0); + ~HbDeviceDialogConnectHelper(); + + void connect(); + +signals: + void sessionEstablished(RHbDeviceDialogClientSession *clientSession); + +private: + friend class HbDeviceDialogConnectHelperPrivate; + HbDeviceDialogConnectHelperPrivate *d_ptr; +}; +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogconnecthelper_p_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/devicedialogbase/hbdevicedialogconnecthelper_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBDEVICEDIALOGCONNECTHELPER_P_P_H +#define HBDEVICEDIALOGCONNECTHELPER_P_P_H + +#include +#include + +class HbDeviceDialogConnectHelper; + +class HbDeviceDialogConnectHelperPrivate : public CActive +{ +public: + HbDeviceDialogConnectHelperPrivate(HbDeviceDialogConnectHelper *wrapper); + ~HbDeviceDialogConnectHelperPrivate(); + + void connect(); + +protected: // From CActive + void RunL(); + void DoCancel(); + +private: + HbDeviceDialogConnectHelper *q_ptr; + RHbDeviceDialogClientSession mClientSession; + bool mSessionConnected; +}; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogerrors_p.h --- a/src/hbcore/devicedialogbase/hbdevicedialogerrors_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogerrors_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,9 @@ const int HbDeviceDialogConnectError = HbDeviceDialog::FrameworkErrors + 5; // Plugin denies client access of a plugin const int HbDeviceDialogAccessDeniedError = HbDeviceDialog::FrameworkErrors + 6; -//unknown indicator error -const int HbDeviceDialogUnknownIndicatorError = HbDeviceDialog::FrameworkErrors + 7; +// Dialog is single instance and already showing +const int HbDeviceDialogAlreadyExists = HbDeviceDialog::FrameworkErrors + 7; +// Unknown indicator error +const int HbDeviceDialogUnknownIndicatorError = HbDeviceDialog::FrameworkErrors + 8; #endif // HBDEVICEDIALOGERRORS_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialoglaunchhelper.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/devicedialogbase/hbdevicedialoglaunchhelper.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,181 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include +#include +#include +#include +#include + +/*! + HbDeviceDialogLaunchHelper + \internal +*/ +class HbDeviceDialogLaunchHelperPrivate : public CActive + { +public: + HbDeviceDialogLaunchHelperPrivate(); + ~HbDeviceDialogLaunchHelperPrivate(); + void Start(); + TInt Error() { return iError; } + void StartServer(); + +protected: + void RunL(); + void DoCancel(); + TInt RunError(TInt aError); + +public: + RProcess iProcess; + CActiveSchedulerWait iWait; + TInt iError; + }; + +HbDeviceDialogLaunchHelperPrivate::HbDeviceDialogLaunchHelperPrivate() +: CActive(CActive::EPriorityStandard) +{ + CActiveScheduler::Add(this); +} + +HbDeviceDialogLaunchHelperPrivate::~HbDeviceDialogLaunchHelperPrivate() +{ + if (iWait.IsStarted()) { + iWait.AsyncStop(); + } + Cancel(); +} + +void HbDeviceDialogLaunchHelperPrivate::Start() +{ + StartServer(); + + if (iError == KErrNone) { + SetActive(); + iWait.Start(); + } +} + +void HbDeviceDialogLaunchHelperPrivate::RunL() +{ + iError = iStatus.Int(); + + if (iProcess.ExitType() == EExitPanic) { + iError = KErrGeneral; + } + + iProcess.Close(); + + if (iWait.IsStarted()) { + iWait.AsyncStop(); + } +} + +void HbDeviceDialogLaunchHelperPrivate::DoCancel() +{ + if (IsActive()) { + iProcess.RendezvousCancel(iStatus); + } +} + +TInt HbDeviceDialogLaunchHelperPrivate::RunError(TInt aError) +{ + iError = aError; + return KErrNone; +} + +void HbDeviceDialogLaunchHelperPrivate::StartServer() +{ + iError = KErrNone; + + if (RHbDeviceDialogClientSession::ServerRunning()) { + // Already running, return error. + iError = KErrAlreadyExists; + return; + } + + // Create the server process + iError = iProcess.Create(KHbServerExe, KNullDesC); + + if (iError != KErrNone) { + // Process could not be created, return error. + return; + } + + CApaCommandLine* apaCommandLine = 0; + TRAP(iError, apaCommandLine = CApaCommandLine::NewL()); + if (iError != KErrNone) { + iProcess.Close(); + return; + } + TRAP(iError, + apaCommandLine->SetExecutableNameL(KHbServerExe); + apaCommandLine->SetCommandL(EApaCommandBackground); + apaCommandLine->SetProcessEnvironmentL(iProcess); + ); + delete apaCommandLine; + apaCommandLine = 0; + + if (iError != KErrNone) { + iProcess.Close(); + return; + } + + iProcess.Rendezvous(iStatus); + iProcess.Resume(); // logon OK - start the server +} + +HbDeviceDialogLaunchHelper* HbDeviceDialogLaunchHelper::NewLC() +{ + HbDeviceDialogLaunchHelper* self = new (ELeave) HbDeviceDialogLaunchHelper; + CleanupStack::PushL(self); + self->d_ptr = new (ELeave) HbDeviceDialogLaunchHelperPrivate(); + return self; +} + +HbDeviceDialogLaunchHelper* HbDeviceDialogLaunchHelper::NewL() +{ + HbDeviceDialogLaunchHelper* self = NewLC(); + CleanupStack::Pop(self); + return self; +} + +HbDeviceDialogLaunchHelper::~HbDeviceDialogLaunchHelper() +{ + delete d_ptr; +} + +void HbDeviceDialogLaunchHelper::Start() +{ + d_ptr->Start(); +} + +TInt HbDeviceDialogLaunchHelper::Error() +{ + return d_ptr->iError; +} + +HbDeviceDialogLaunchHelper::HbDeviceDialogLaunchHelper() +{ +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialoglaunchhelper_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/devicedialogbase/hbdevicedialoglaunchhelper_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,52 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBDEVICEDIALOGLAUNCHHELPER_P_H +#define HBDEVICEDIALOGLAUNCHHELPER_P_H + +#include +#include + +class HbDeviceDialogLaunchHelperPrivate; + +class HbDeviceDialogLaunchHelper : public CBase + { +public: + static HbDeviceDialogLaunchHelper *NewLC(); + static HbDeviceDialogLaunchHelper *NewL(); + + ~HbDeviceDialogLaunchHelper(); + void Start(); + TInt Error(); + +private: + HbDeviceDialogLaunchHelper(); + +private: + friend class HbDeviceDialogLaunchHelperPrivate; + HbDeviceDialogLaunchHelperPrivate *d_ptr; + }; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogplugin.cpp --- a/src/hbcore/devicedialogbase/hbdevicedialogplugin.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogplugin.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -63,6 +63,12 @@ Device dialog widgets have to be derived from HbPopup either directly or by ancestry. + Device dialog widget can be derived from existing Hb class, eg. HbDialog or constructed from + a docml using HbDocumentLoader. Structure of the plugin differs depending on which approach + is selected. If docml is used the dialog widget cannot be multiple inherited from HbDialog + and HbDeviceDialogInterface. In this case a container can be used to to create and manage the + widget. See code example at the end. +
For future needs. Not implemented. Device dialog may be shared by several device dialog clients. Each client can update the @@ -105,6 +111,8 @@ Creating a device dialog plugin and widget involves following steps. - Set in .pro file TEMPLATE = lib and CONFIG += hb plugin - Derive a class from HbPopup or derivatives and HbDeviceDialogInterface + The example below is not using docml and dialog widget is derived from HbDialog and + HbDeviceDialogInterface. \code class HbSampleMessageBoxWidget : public HbMessageBox, public HbDeviceDialogInterface { @@ -185,6 +193,97 @@ } \enddot + The example below is using docml and dialog widget is managed by a container. + \code + class HbSampleDialogContainer : public QObject, public HbDeviceDialogInterface + { + Q_OBJECT + \endcode + - In the constructor create the dialog widget using HbDocumentLoader + - Implement HbDeviceDialogInterface functions + - From deviceDialogWidget() function return the created (docml) widget + - From signalSender() function return the container (HbSampleDialogContainer) + - Declare and emit deviceDialogClosed and optionally deviceDialogData signals. + - Do not call show(), hide() or setVisible() in the plugin. Device dialog + framework calls show() to display the widget. + \code + public: + bool setDeviceDialogParameters(const QVariantMap ¶meters); + int deviceDialogError() const; + void closeDeviceDialog(bool byClient); + HbPopup *deviceDialogWidget() const; + QObject *signalSender() const; + signals: + void deviceDialogClosed(); + void deviceDialogData(QVariantMap data); + \endcode + - Wrap the widget into a plugin derived from HbDeviceDialogPlugin + \code + class HbSampleDeviceDialogPlugin : public HbDeviceDialogPlugin + { + Q_OBJECT + \endcode + - Implement HbDeviceDialogPlugin pure virtual functions + - Return the container (HbSampleDialogContainer) from createDeviceDialog() function + \code + bool accessAllowed(const QString &deviceDialogType, + const QVariantMap ¶meters, const QVariantMap &securityInfo) const; + HbDeviceDialogInterface *createDeviceDialog(const QString &deviceDialogType, const QVariantMap ¶meters); + bool deviceDialogInfo(const QString &deviceDialogType, + const QVariantMap ¶meters, DeviceDialogInfo *info) const; + QStringList deviceDialogTypes() const; + PluginFlags pluginFlags() const; + int error() const; + \endcode + + Class diagram of the sample plugin using docml: + \dot + digraph G { + rankdir=LR; + + subgraph cluster_class_diagram { + style=solid; + + node [shape = box, style=solid, fontsize = 10]; + HbSampleDeviceDialogPlugin [label = "HbSampleDeviceDialogPlugin"]; + QObject [label = "QObject"]; + HbDeviceDialogPluginInterface [label = "HbDeviceDialogPluginInterface"]; + HbDeviceDialogPlugin [label = "HbDeviceDialogPlugin"]; + edge [fontsize = 10, style = filled]; + QObject -> HbDeviceDialogPlugin [label = "is a"]; + HbDeviceDialogPluginInterface -> HbDeviceDialogPlugin [label = "is a"]; + HbDeviceDialogPlugin -> HbSampleDeviceDialogPlugin [label = "is a"]; + + HbSampleDialogContainer [label = "HbSampleDialogContainer"]; + QObject2 [label = "QObject"]; + HbDeviceDialogInterface [label = "HbDeviceDialogInterface"]; + QObject2 -> HbSampleDialogContainer [label = "is a"]; + HbDeviceDialogInterface -> HbSampleDialogContainer [label = "is a"]; + + edge [fontsize = 10, style = dotted]; + HbSampleDeviceDialogPlugin -> HbSampleDialogContainer [label = "creates"]; + + DialogWidget [label = "Dialog widget (docml)"]; + edge [fontsize = 10, style = dotted]; + HbSampleDialogContainer -> DialogWidget [label = "creates"]; + } + + subgraph cluster_key { + label = "Key"; + style=solid; + node [shape = box, style=solid, fontsize = 10]; + Class1 [label = "Class"]; + Class2 [label = "Class"]; + Class3 [label = "Class"]; + + edge [fontsize = 10, style = filled]; + Class2 -> Class1 [label = "generalization"]; + edge [fontsize = 10, style = dotted]; + Class3 -> Class1 [label = "dependency"]; + } + } + \enddot + Sample plugin implementations can be found in src/hbplugins/devicedialogs directory. \sa HbDeviceDialogPluginInterface HbDeviceDialogInterface HbDeviceDialog HbPopup @@ -245,7 +344,7 @@ \enum HbDeviceDialogPlugin::DeviceDialogFlag Defines flags for a device dialog created by the plugin. - \sa deviceDialogInfo DeviceDialogInfo + \sa deviceDialogInfo() HbIndicatorInterface */ /*! \var HbDeviceDialogPlugin::DeviceDialogFlag HbDeviceDialogPlugin::NoDeviceDialogFlags @@ -263,7 +362,19 @@ If the flag is set, device dialog service calls accessAllowed() before creating or attaching to a device dialog widget. */ - +/*! + \var HbDeviceDialogPlugin::DeviceDialogFlag HbDeviceDialogPlugin::SingleInstance + If the flag is set, only one instance of the device dialog widget is allowed at + one time. Attempt to launch the widget while one exists results in an error to be + returned to the client. +*/ +/*! + \var HbDeviceDialogPlugin::DeviceDialogFlag HbDeviceDialogPlugin::ReceiveIndicatorStatus + Indicates that the device dialog is interested in indicator activation/deactivation events. + To receive indicator status the dialog has to implement two slots. Indicator activation is + received by a slot indicatorActivated(HbIndicatorInterface*) and deactivation by a slot + indicatorDeactivated(HbIndicatorInterface*). +*/ /*! @@ -333,7 +444,7 @@ "sym-caps" quint32 - Client's capability set as a bitmap + Client's capability set as a bitmap. Bit positions correspond to Symbian enum TCapability */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogplugin.h --- a/src/hbcore/devicedialogbase/hbdevicedialogplugin.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogplugin.h Thu Jul 22 16:36:53 2010 +0100 @@ -70,7 +70,9 @@ enum DeviceDialogFlag{ NoDeviceDialogFlags = 0x00, SharedDeviceDialog = 0x01, - SecurityCheck = 0x02 + SecurityCheck = 0x02, + SingleInstance = 0x04, + ReceiveIndicatorStatus = 0x08 }; Q_DECLARE_FLAGS(DeviceDialogFlags, DeviceDialogFlag) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogsym_p.cpp --- a/src/hbcore/devicedialogbase/hbdevicedialogsym_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogsym_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -100,7 +100,7 @@ TRACE_ENTRY if (!iBuffer) { - iBuffer = HBufC8::NewL(64); + TRAP_IGNORE(iBuffer = HBufC8::NewL(64)); if (iBuffer) { iDataPtr.Set(iBuffer->Des()); } else { @@ -422,10 +422,13 @@ // Any Symbian error, close session handle. It will be reopened on next show() if (errorCode < KErrNone) { mHbSession.Close(); - } - // All Symbian errors are connected to HbDeviceDialogConnectError - if (errorCode < KErrNone) { + // All Symbian errors are converted to HbDeviceDialogConnectError errorCode = HbDeviceDialogConnectError; + } else { + // Convert from internal to public error code + if (errorCode == HbDeviceDialogAlreadyExists) { + errorCode = HbDeviceDialog::InstanceExistsError; + } } } return errorCode; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogsymbian.cpp --- a/src/hbcore/devicedialogbase/hbdevicedialogsymbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogsymbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include "hbdevicedialogerrors_p.h" #include "hbdevicedialogclientsession_p.h" #include - +#include "hbdevicedialoglaunchhelper_p.h" #include "hbdevicedialogsymbian.h" #include "hbsymbianvariant.h" #include "hbsymbianvariantconverter_p.h" @@ -79,6 +79,11 @@ \var TDeviceDialogError::DeviceDialogError HbDeviceDialog::ESystemCancelledError Operation was cancelled by device dialog framework. */ +/*! + \var TDeviceDialogError::DeviceDialogError HbDeviceDialog::EInstanceExistsError + A single instance device dialog widget exists already (has been launched). + See HbDeviceDialogPlugin::SingleInstance. +*/ /*! \fn void MHbDeviceDialogObserver::DataReceived(CHbSymbianVariantMap& aData) @@ -111,21 +116,22 @@ class CHbDeviceDialogSymbianPrivate : public CActive { public: - CHbDeviceDialogSymbianPrivate(); + CHbDeviceDialogSymbianPrivate(TInt aFlags); ~CHbDeviceDialogSymbianPrivate(); - TInt Show( const QByteArray& aArray ); - TInt Update( const QByteArray& aArray ); + TInt Initialize(); + TInt Show(const QByteArray& aArray); + TInt Update(const QByteArray& aArray); void CancelDialog(); TInt Error() const; - void SetObserver( MHbDeviceDialogObserver* aObserver ); + void SetObserver(MHbDeviceDialogObserver* aObserver); // CActive void RunL(); void DoCancel(); - TInt RunError( TInt aError ); + TInt RunError(TInt aError); void Start(); - TInt SymToDeviceDialogError( TInt errorCode ); + TInt SymToDeviceDialogError(TInt errorCode); void SetError(TInt aError); bool CallDialogClosedObserver(TInt aCompletionCode); bool CallDataReceivedObserver(CHbSymbianVariantMap& aData); @@ -145,28 +151,18 @@ bool *iDeleted; }; -CHbDeviceDialogSymbianPrivate::CHbDeviceDialogSymbianPrivate(): -CActive( EPriorityStandard ), -iFlags(0), -iLastError(0), -iDeviceDialogId(0), -iBuffer(NULL), -iDataPtr(NULL, 0, 0), -iRequesting(EFalse), -iObserver(NULL) +CHbDeviceDialogSymbianPrivate::CHbDeviceDialogSymbianPrivate(TInt aFlags): +CActive(EPriorityStandard), +iFlags(aFlags), +iDataPtr(NULL, 0, 0) { - if (!iBuffer) { - iBuffer = HBufC8::NewL(64); - if (iBuffer) { - iDataPtr.Set(iBuffer->Des()); - } - } + CActiveScheduler::Add(this); } CHbDeviceDialogSymbianPrivate::~CHbDeviceDialogSymbianPrivate() { // Inform the server to finish the dialog session and not to cancel it - if(!iObserver) { + if (!iObserver) { iHbSession.SendSyncRequest(EHbSrvClientClosing); } @@ -185,14 +181,50 @@ } } -TInt CHbDeviceDialogSymbianPrivate::Show(const QByteArray& aArray ) +TInt CHbDeviceDialogSymbianPrivate::Initialize() +{ + if (!iBuffer) { + TRAP_IGNORE(iBuffer = HBufC8::NewL(64)); + if (iBuffer) { + iDataPtr.Set(iBuffer->Des()); + } else { + return KErrNoMemory; + } + } + + TInt error(KErrNone); + if (iFlags & CHbDeviceDialogSymbian::EASyncServerStartup) { + HbDeviceDialogLaunchHelper *helper(0); + TRAP(error, helper = HbDeviceDialogLaunchHelper::NewL()); + + if (helper) { + helper->Start(); + error = helper->Error(); + delete helper; + helper = 0; + } + } + + if (error == KErrNone || error == KErrAlreadyExists) { + error = iHbSession.Connect(); + } + return error; +} + +TInt CHbDeviceDialogSymbianPrivate::Show(const QByteArray& aArray) { TInt error = iLastError = KErrNone; + error = SymToDeviceDialogError(Initialize()); + if (error != HbDeviceDialogNoError){ + SetError(error); + return error; + } + TPtrC8 ptr( reinterpret_cast(aArray.data()), aArray.size() ); // Synchronous call to server to show dialog. - error = iHbSession.SendSyncRequest( EHbSrvShowDeviceDialog, ptr, &iDeviceDialogId ); - //error = SymToDeviceDialogError(error); + error = iHbSession.SendSyncRequest(EHbSrvShowDeviceDialog, ptr, &iDeviceDialogId); + error = SymToDeviceDialogError(error); if (error == KErrNone) { // Start listening for server updates. Device dialog update and closing is @@ -219,14 +251,14 @@ TPtrC8 ptr( reinterpret_cast(aArray.data()), aArray.size() ); error = iHbSession.SendSyncRequest( EHbSrvUpdateDeviceDialog, ptr ); - //error = SymToDeviceDialogError(error); + error = SymToDeviceDialogError(error); if (error != KErrNone) { SetError(error); } } else { - SetError(KErrBadHandle); - error = KErrBadHandle; + error = SymToDeviceDialogError(KErrBadHandle); + SetError(error); } return error; } @@ -240,12 +272,12 @@ void CHbDeviceDialogSymbianPrivate::CancelDialog() { iLastError = KErrNone; - int error = KErrNotFound; + int error = SymToDeviceDialogError(KErrNotFound); if (iRequesting) { // Ignore other than server errors. error = iHbSession.SendSyncRequest(EHbSrvCancelDeviceDialog, iDeviceDialogId()); - // error = SymToDeviceDialogError(error); + error = SymToDeviceDialogError(error); } if (error != KErrNone) { SetError(error); @@ -273,14 +305,14 @@ void CHbDeviceDialogSymbianPrivate::RunL() { TInt completionCode = iStatus.Int(); - //int errorCode = SymToDeviceDialogError(completionCode); + int errorCode = SymToDeviceDialogError(completionCode); if (completionCode < KErrNone) { // Any Symbian error, stop requesting, sycnhoronous requests are stopped // in the end of the RunL iRequesting = EFalse; - SetError(completionCode); - if (CallDialogClosedObserver(completionCode)) { + SetError(errorCode); + if (CallDialogClosedObserver(errorCode)) { return; // observed deleted this object, do not touch it } } @@ -299,13 +331,13 @@ iBuffer = HBufC8::NewL(updateInfo.iInfo.iDataInfo.iDataSize); iDataPtr.Set(iBuffer->Des()); completionCode = iHbSession.SendSyncRequest(EHbSrvUpdateData, iDataPtr); - //errorCode = SymToDeviceDialogError(completionCode); + errorCode = SymToDeviceDialogError(completionCode); // data request failed if (completionCode < KErrNone) { iRequesting = EFalse; - SetError(completionCode); - if (CallDialogClosedObserver(completionCode)) { + SetError(errorCode); + if (CallDialogClosedObserver(errorCode)) { return; // observed deleted this object, do not touch it } } @@ -340,10 +372,10 @@ case EHbDeviceDialogUpdateClosed: // Signal possible cancelled error if (completionCode != KErrNone) { - SetError(completionCode); + SetError(errorCode); } iRequesting = EFalse; - if (CallDialogClosedObserver(completionCode)) { + if (CallDialogClosedObserver(errorCode)) { return; // observed deleted this object, do not touch it } break; @@ -373,9 +405,9 @@ \internal RunError from CActive. */ -TInt CHbDeviceDialogSymbianPrivate::RunError( TInt /*aError*/ ) +TInt CHbDeviceDialogSymbianPrivate::RunError(TInt /*aError*/) { - SetError( KErrGeneral ); + SetError(SymToDeviceDialogError(KErrGeneral)); return KErrNone; } @@ -395,16 +427,12 @@ } // Convert symbian error code into HbDeviceDialog error code -int CHbDeviceDialogSymbianPrivate::SymToDeviceDialogError( TInt errorCode ) +int CHbDeviceDialogSymbianPrivate::SymToDeviceDialogError(TInt errorCode) { if (errorCode != HbDeviceDialogNoError) { - // Any Symbian error, close session handle. It will be reopened on next show() - if (errorCode < KErrNone) { - iHbSession.Close(); - } - // All Symbian errors are connected to HbDeviceDialogConnectError - if (errorCode < KErrNone) { - errorCode = HbDeviceDialogConnectError; + // Convert from internal to public error code + if (errorCode == HbDeviceDialogAlreadyExists) { + errorCode = CHbDeviceDialogSymbian::EInstanceExistsError; } } return errorCode; @@ -442,24 +470,23 @@ } /*! - Constructs CHbDeviceDialogSymbian object. \a f contains construct flags. Device - dialog service will clean all dialogs launched when the instance is deleted. + Constructs CHbDeviceDialogSymbian object. \a f contains construct flags. */ - -EXPORT_C CHbDeviceDialogSymbian* CHbDeviceDialogSymbian::NewL( TInt aFlags ) +EXPORT_C CHbDeviceDialogSymbian* CHbDeviceDialogSymbian::NewL(TInt aFlags) { - CHbDeviceDialogSymbian* deviceDialog = new (ELeave) CHbDeviceDialogSymbian(aFlags); - int error = KErrNone; - if(deviceDialog->d) { - error = deviceDialog->d->iHbSession.Connect(); + CHbDeviceDialogSymbian* self = new (ELeave) CHbDeviceDialogSymbian; + CleanupStack::PushL(self); + self->d = new (ELeave) CHbDeviceDialogSymbianPrivate(aFlags); + + if (aFlags & EImmediateResourceReservation) { + User::LeaveIfError(self->d->Initialize()); } - if(error != KErrNone) { - CleanupStack::PushL(deviceDialog); - User::Leave(error); - delete deviceDialog; - deviceDialog = 0; - } - return deviceDialog; + CleanupStack::Pop(); // self + return self; +} + +CHbDeviceDialogSymbian::CHbDeviceDialogSymbian() +{ } EXPORT_C CHbDeviceDialogSymbian::~CHbDeviceDialogSymbian() @@ -556,13 +583,3 @@ { d->SetObserver(aObserver); } - -CHbDeviceDialogSymbian::CHbDeviceDialogSymbian(TInt aFlags) : d(NULL) -{ - d = new CHbDeviceDialogSymbianPrivate; - d->iFlags = aFlags; - CActiveScheduler::Add(d); - - // Is needed to implement? - //if (mDeviceDialogFlags & HbDeviceDialog::ImmediateResourceReservationFlag) -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogsymbian.h --- a/src/hbcore/devicedialogbase/hbdevicedialogsymbian.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogsymbian.h Thu Jul 22 16:36:53 2010 +0100 @@ -51,11 +51,14 @@ EPluginErrors = 0x10000000, EErrorTypeMask = 0xf0000000, ECancelledError = 0x0fffffff, - ESystemCancelledError = 0x0ffffffe + ESystemCancelledError = 0x0ffffffe, + EInstanceExistsError = 0x0ffffffd }; enum TDeviceDialogFlag{ - ENoDeviceDialogFlags = 0x0 + ENoDeviceDialogFlags = 0x0, + EImmediateResourceReservation = 0x1, + EASyncServerStartup = 0x2 }; IMPORT_C static CHbDeviceDialogSymbian* NewL(TInt aFlags = ENoDeviceDialogFlags); @@ -73,13 +76,10 @@ IMPORT_C void SetObserver(MHbDeviceDialogObserver* aObserver); private: - - CHbDeviceDialogSymbian(TInt aFlags = ENoDeviceDialogFlags); - - void ConstructL(TInt aFlags = ENoDeviceDialogFlags); + CHbDeviceDialogSymbian(); CHbDeviceDialogSymbianPrivate* d; - }; +}; #endif // defined(__SYMBIAN32__) || defined(SYMBIAN) || defined(HB_DOXYGEN) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbdevicedialogwin32_p.cpp --- a/src/hbcore/devicedialogbase/hbdevicedialogwin32_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbdevicedialogwin32_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -190,6 +190,10 @@ // Set error void HbDeviceDialogPrivate::setError(int error) { + // Convert from internal to public error code + if (error == HbDeviceDialogAlreadyExists) { + error = HbDeviceDialog::InstanceExistsError; + } mLastError = error; emit q_func()->error(error); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbindicator.cpp --- a/src/hbcore/devicedialogbase/hbindicator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbindicator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -68,7 +68,7 @@ */ /*! - \fn void userActivated(const QString &type, const QVariantMap &data) + \fn void HbIndicator::userActivated(const QString &type, const QVariantMap &data) The class should emit this signal, when client needs to be notified of the user interaction. diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbindicatorsym_p.cpp --- a/src/hbcore/devicedialogbase/hbindicatorsym_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbindicatorsym_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -60,7 +60,10 @@ } void DoCancel() { - // No Cancel() available for RSessionBase::Connect() + // No Cancel() available for RSessionBase::Connect() + // Nevertheless we must do something to prevent deadlocking. + TRequestStatus *rs = &iStatus; + User::RequestComplete(rs, KErrCancel); } private: HbIndicatorPrivate *iIndicator; @@ -327,6 +330,8 @@ void HbIndicatorPrivate::DoCancel() { TRACE_ENTRY + TRequestStatus *rs = &iStatus; + User::RequestComplete(rs, KErrCancel); TRACE_EXIT } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/devicedialogbase/hbtextresolversymbian.cpp --- a/src/hbcore/devicedialogbase/hbtextresolversymbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/devicedialogbase/hbtextresolversymbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -145,19 +145,8 @@ if (tmp.isEmpty() == 0) { tmp = QString::fromUtf16(ptr.Ptr(), ptr.Length()); - } - - bool ok(false); - int conv = tmp.toInt(&ok); - - if (ok) - { - string = string.arg(conv); - } - else - { - string = string.arg(tmp); - } + } + string = string.arg(tmp); } TPtrC descriptor(static_cast(string.utf16()), string.length()); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffect.cpp --- a/src/hbcore/effects/hbeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -74,7 +74,7 @@ if (!result) { result = key1.mEffectEvent.compare(key2.mEffectEvent); } - return result<0; + return result < 0; } static void fixEffectGroupOrder(QList *groupList) @@ -95,7 +95,7 @@ } } - if (last - movedCount > 0 ) { + if (last - movedCount > 0) { for (int i = last - movedCount; i >= 0; --i) { HbEffectGroup *group = groupList->at(i); // If the group has a scale effect, move it second last before groups that had translate effects @@ -124,7 +124,7 @@ } HbEffectPrivate::~HbEffectPrivate() -{ +{ privateDestroyed = true; mDisabledItems.clear(); } @@ -135,61 +135,60 @@ if (!mViewChangeConnected) { mViewChangeConnected = true; QList windowList = hbInstance->allMainWindows(); - foreach (const HbMainWindow *window, windowList) { - connect(window, SIGNAL(currentViewChanged(HbView*)), SLOT(handleViewChanged(HbView*))); + foreach(const HbMainWindow * window, windowList) { + connect(window, SIGNAL(currentViewChanged(HbView *)), SLOT(handleViewChanged(HbView *))); } // Need a notification when a mainwindow is added in the future. - connect(HbInstancePrivate::d_ptr(), SIGNAL(windowAdded(HbMainWindow*)), SLOT(handleWindowAdded(HbMainWindow*))); + connect(HbInstancePrivate::d_ptr(), SIGNAL(windowAdded(HbMainWindow *)), SLOT(handleWindowAdded(HbMainWindow *))); } } void HbEffectPrivate::handleWindowAdded(HbMainWindow *window) { - connect(window, SIGNAL(currentViewChanged(HbView*)), SLOT(handleViewChanged(HbView*))); + connect(window, SIGNAL(currentViewChanged(HbView *)), SLOT(handleViewChanged(HbView *))); } void HbEffectPrivate::handleViewChanged(HbView *view) { - // Observers may be notified during cancellations which may result in starting a new + // Observers may be notified during cancellations which may result in starting a new // effect during which groups may be deleted and removed from // mEventEffectList. Therefore we cannot directly iterate on mEventEffectList. QList groupsToBeHandled; - foreach (HbEffectGroup *group, d.mEventEffectList) { + foreach(HbEffectGroup * group, d.mEventEffectList) { groupsToBeHandled.append(group); } - foreach (HbEffectGroup *group, groupsToBeHandled) { - // Check if the real list still contains the group. If not then it may have been - // deleted and removed meanwhile so do nothing. - if (d.mEventEffectList.values().contains(group)) { - if (group->isRunning()) { - // Looping effect - if (group->isLooping()) { - if (group->view() == view) { - group->resume(); // Effect's view activated, resume effect - } else { - group->pause(); // Effect's view deactivated, pause effect - } - } else { // Non-looping effect - if (group->view() != view) { // Effect's view deactivated, cancel the effect - group->cancelAll(true); - - // remove group from eventEffectsList - QMap::iterator e = d.mEventEffectList.begin(); - while (e != d.mEventEffectList.end()) { - if (e.value() == group) { // found, erase from event effect list - d.mEventEffectList.erase(e); - delete group; // once removed from list, delete group - e = d.mEventEffectList.end(); - } - else - e++; // try next one - } + foreach(HbEffectGroup * group, groupsToBeHandled) { + // Check if the real list still contains the group. If not then it may have been + // deleted and removed meanwhile so do nothing. + if (d.mEventEffectList.values().contains(group)) { + if (group->isRunning()) { + // Looping effect + if (group->isLooping()) { + if (group->view() == view) { + group->resume(); // Effect's view activated, resume effect + } else { + group->pause(); // Effect's view deactivated, pause effect + } + } else { // Non-looping effect + if (group->view() != view) { // Effect's view deactivated, cancel the effect + group->cancelAll(true); + // remove group from eventEffectsList + QMap::iterator e = d.mEventEffectList.begin(); + while (e != d.mEventEffectList.end()) { + if (e.value() == group) { // found, erase from event effect list + d.mEventEffectList.erase(e); + delete group; // once removed from list, delete group + e = d.mEventEffectList.end(); + } else { + e++; // try next one + } + } + } } } } - } -} + } } @@ -208,7 +207,7 @@ // Need information of receiver destroyed because this class gets // the notifications asynchronously so it must not invoke the // receiver if it has been destroyed meanwhile. - connect(mReceiver, SIGNAL(destroyed()), this, SLOT(receiverDestroyed())); + connect(mReceiver, SIGNAL(destroyed()), this, SLOT(receiverDestroyed())); } void HbAnimatedItemGroup::finished(const HbEffect::EffectStatus &status) @@ -345,8 +344,7 @@ #else // This API cannot be used to add HB library's effect definitions. // There is internal API in class HbEffectInternal for that. - if (itemType.startsWith(HB_EFFECT_ITEM_PREFIX)) - { + if (itemType.startsWith(HB_EFFECT_ITEM_PREFIX)) { return false; } return HbEffectInternal::add(itemType, filePath, effectEvent); @@ -383,9 +381,10 @@ Q_UNUSED(effectEvent); return false; #else - foreach (const QString &type, itemType) { - if (type.startsWith(HB_EFFECT_ITEM_PREFIX)) + foreach(const QString & type, itemType) { + if (type.startsWith(HB_EFFECT_ITEM_PREFIX)) { return false; + } } return HbEffectInternal::add(itemType, filePath, effectEvent); #endif // HB_EFFECT_API_OFF @@ -467,8 +466,7 @@ #else // This API cannot be used to remove HB library's effect definitions. // There is internal API in class HbEffectInternal for that. - if (itemType.startsWith(HB_EFFECT_ITEM_PREFIX)) - { + if (itemType.startsWith(HB_EFFECT_ITEM_PREFIX)) { return false; } HbEffectInternal::remove(itemType, filePath, effectEvent); @@ -522,7 +520,7 @@ #endif //HB_EFFECT_API_OFF } -/*! \brief This function is used to start an effect on a graphics item. +/*! \brief This function is used to start an effect on a graphics item. The effect definition is taken from the FXML file registered for the graphics item with matching itemType and effectEvent. @@ -570,17 +568,17 @@ Example to get notification of effect completion. \code - // Create a public slot in a the widget class if you want to get effect-finished - // notification. In normal scenario, the widget itself can be receiver. But it is possible + // Create a public slot in a the widget class if you want to get effect-finished + // notification. In normal scenario, the widget itself can be receiver. But it is possible // to use any QObject as receiver. class MyHbWidget : public HbWidget { Q_OBJECT public slots: void effectFinished(const HbEffect::EffectStatus &status); - // Other stuffs + // Other stuffs }; - + void MyObserver::effectFinished(const HbEffect::EffectStatus &status) { // Effect is finished. Do something. @@ -591,19 +589,19 @@ { // myFunction related other stuff // calling startefect - HbEffect::start(myGraphicsItem, + HbEffect::start(myGraphicsItem, "myItemType", "myEvent", this, "effectFinished"); - + // myFunction related other stuff } \endcode \sa cancel() */ -bool HbEffect::start(QGraphicsItem *item, - const QString &itemType, +bool HbEffect::start(QGraphicsItem *item, + const QString &itemType, const QString &effectEvent, QObject *receiver, const char *member, @@ -656,7 +654,7 @@ The function returns \c false if some invalid parameter is passed, or if the effect was disabled using disable(). */ -bool HbEffect::start(QGraphicsItem *item, +bool HbEffect::start(QGraphicsItem *item, const QString &effectEvent, QObject *receiver, const char *member, @@ -673,7 +671,7 @@ return false; #else return HbEffect::start( - item, HB_EFFECT_INTERNAL_ITEM, effectEvent, receiver, member, userData, extRect); + item, HB_EFFECT_INTERNAL_ITEM, effectEvent, receiver, member, userData, extRect); #endif //HB_EFFECT_API_OFF } @@ -719,8 +717,8 @@ effect was disabled using disable(). */ bool HbEffect::start( - const QList &items, - const QString &itemType, + const QList &items, + const QString &itemType, const QString &effectEvent, QObject *receiver, const char *member, @@ -728,7 +726,7 @@ { #ifdef HB_EFFECT_API_OFF Q_UNUSED(items); - Q_UNUSED(itemType); + Q_UNUSED(itemType); Q_UNUSED(effectEvent); Q_UNUSED(receiver); Q_UNUSED(member); @@ -759,7 +757,7 @@ groupMember = "finished"; } - foreach (QGraphicsItem *item, items) { + foreach(QGraphicsItem * item, items) { if (HbEffect::start(item, itemType, effectEvent, groupReceiver, groupMember, userData)) { // If at least one item succeeded to start, set return value to true ret = true; @@ -791,8 +789,8 @@ // Return true if the given item is running any effect if (effectEvent.isEmpty()) { for (QMap::const_iterator e = d.mEventEffectList.constBegin(); - e != d.mEventEffectList.constEnd(); - ++e ) { + e != d.mEventEffectList.constEnd(); + ++e) { HbEffectGroup *group = *e; if (group->registrationItem() == item && group->isRunning()) { ret = true; @@ -803,10 +801,10 @@ // effectEvent was specified, check if effect matching that is running EffectMapKey key(item, effectEvent); QMap::const_iterator e = d.mEventEffectList.find(key); - + // Effect found in the list? - if(e != d.mEventEffectList.constEnd()) { - HbEffectGroup* group = *e; + if (e != d.mEventEffectList.constEnd()) { + HbEffectGroup *group = *e; ret = group->isRunning(); } } @@ -858,7 +856,7 @@ Q_UNUSED(sendCallback); Q_UNUSED(itemIsValid); return false; -#else +#else if (privateDestroyed) { return false; } @@ -869,9 +867,10 @@ // Stop all the effects running on item at that point of time. // (iterator way had some problem and caused crash so using foreach) QList groupsToBeCanceled; - foreach (const EffectMapKey &key, d.mEventEffectList.keys()) { + QList keys = d.mEventEffectList.keys(); + foreach(const EffectMapKey & key, keys) { if (key.mItem == item) { - HbEffectGroup* group = d.mEventEffectList.take(key); + HbEffectGroup *group = d.mEventEffectList.take(key); groupsToBeCanceled.append(group); } } @@ -883,7 +882,7 @@ fixEffectGroupOrder(&groupsToBeCanceled); bool first = true; - foreach (HbEffectGroup *group, groupsToBeCanceled) { + foreach(HbEffectGroup * group, groupsToBeCanceled) { // If clearEffect is false then it is important to pass a default transform // first so the matrix multiplication in cancelAll ends up correct. group->cancelAll(sendCallback, itemIsValid, clearEffect, first || !itemIsValid ? QTransform() : item->transform()); @@ -897,7 +896,7 @@ return ret; } else { EffectMapKey key(item, effectEvent); - HbEffectGroup* group = d.mEventEffectList.take(key); + HbEffectGroup *group = d.mEventEffectList.take(key); if (group) { group->cancelAll(sendCallback, itemIsValid, clearEffect); delete group; @@ -915,7 +914,7 @@ The function takes following parameters: \param item pointer to QGraphicsItem for which the effect will be enabled. - + \sa disable() */ void HbEffect::enable(QGraphicsItem *item) @@ -930,19 +929,19 @@ /*! This function can be used to disable an effect for a graphicsitem. This is useful in cases where you have a component which usually shows an effect but you want to skip the effect for your object. - + You can enable the effect using enable(), and you should always call enable() once you do not need the object to be disabled, at latest when you're deleting your animated graphicsitem. This should be done to clean up the list of disabled items. Note that if the animated item is an HbWidget, then the enable() call happens automatically at the HbWidget destructor. - + Unlike remove()-methods, this won't touch the effect definition at all. The effect is just skipped when trying to start the effect. Note also that start()-method returns false if the effect is disabled. \param item pointer to QGraphicsItem for which the effect will be disabled - + \sa enable() \sa start() */ @@ -960,11 +959,11 @@ /*! \internal */ -HbGVWrapperItem::HbGVWrapperItem():mMainWindow(0) +HbGVWrapperItem::HbGVWrapperItem(): mMainWindow(0) { } -void HbGVWrapperItem::setMainWindow(HbMainWindow& mainWindow) +void HbGVWrapperItem::setMainWindow(HbMainWindow &mainWindow) { mMainWindow = &mainWindow; } @@ -978,12 +977,12 @@ { QRectF bRect; // viewportitem is used as a boundingrect since viewport item gets resized when changing orientation - if( mMainWindow ) { + if (mMainWindow) { bRect = mMainWindow->layoutRect(); } return bRect; } -void HbGVWrapperItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void HbGVWrapperItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(painter); Q_UNUSED(option); @@ -1007,10 +1006,9 @@ // Mark all effects using the given item type dirty, // so that they get re-created when the effect is shown next time for (QMap::iterator e = d.mEventEffectList.begin(); - e != d.mEventEffectList.end(); - ++e ) { + e != d.mEventEffectList.end(); + ++e) { HbEffectGroup *group = *e; - if (group->itemType() == itemType) { group->setDirty(true); } @@ -1075,10 +1073,9 @@ // Mark all effects using the given item type dirty, // so that they get re-created when the effect is shown next time for (QMap::iterator e = d.mEventEffectList.begin(); - e != d.mEventEffectList.end(); - ++e ) { + e != d.mEventEffectList.end(); + ++e) { HbEffectGroup *group = *e; - if (group->registrationItem() == item) { group->setDirty(true); } @@ -1134,12 +1131,13 @@ #else // FXML // If extension is not given then try both with and without .fxml - if (!filePath.endsWith(".fxml")) { - d.mController.removeFXML(itemType, filePath + ".fxml", effectEvent); + if (!filePath.endsWith(QLatin1String(".fxml"))) { + d.mController.removeFXML(itemType, filePath + QLatin1String(".fxml"), effectEvent); } d.mController.removeFXML(itemType, filePath, effectEvent); // Clean up mEventEffectList. - foreach (const EffectMapKey &key, d.mEventEffectList.keys()) { + QList keys = d.mEventEffectList.keys(); + foreach(const EffectMapKey & key, keys) { if (key.mEffectEvent == effectEvent) { HbEffectGroup *group = d.mEventEffectList.value(key); group->setDirty(true); // so the next start() will try to recreate the effect instead of re-using it @@ -1160,12 +1158,13 @@ #else // FXML // If extension is not given then try both with and without .fxml - if (!filePath.endsWith(".fxml")) { - d.mController.removeFXML(item, filePath + ".fxml", effectEvent); + if (!filePath.endsWith(QLatin1String(".fxml"))) { + d.mController.removeFXML(item, filePath + QLatin1String(".fxml"), effectEvent); } d.mController.removeFXML(item, filePath, effectEvent); // Clean up mEventEffectList. - foreach (const EffectMapKey &key, d.mEventEffectList.keys()) { + QList keys = d.mEventEffectList.keys(); + foreach(const EffectMapKey & key, keys) { if (key.mItem == item && key.mEffectEvent == effectEvent) { HbEffectGroup *group = d.mEventEffectList.value(key); group->setDirty(true); @@ -1186,7 +1185,8 @@ d.mDisabledItems.removeOne(item); // clean the disabled list as well d.mController.removeFXML(item); // Clean up mEventEffectList. - foreach (const EffectMapKey &key, d.mEventEffectList.keys()) { + QList keys = d.mEventEffectList.keys(); + foreach(const EffectMapKey & key, keys) { if (key.mItem == item) { HbEffectGroup *group = d.mEventEffectList.value(key); group->setDirty(true); @@ -1204,22 +1204,21 @@ // data. //parsedDataList.clear(); QList newDataList; - for (int i=0; i < parsedDataList.count(); i++) { + for (int i = 0; i < parsedDataList.count(); i++) { if (parsedDataList[i].fromTheme()) { newDataList.append(parsedDataList[i]); parsedDataList.removeAt(i); i--; } } - for (int i=0; i < newDataList.count(); i++) { - HbEffectInfo effectData = newDataList.at(i); + for (int i = 0; i < newDataList.count(); i++) { + HbEffectInfo effectData = newDataList.at(i); bool ret = false; QString relativename = QFileInfo(effectData.xmlFileFullPath()).baseName(); if (effectData.item() != 0) { ret = d.mController.addFXML(effectData.item(), relativename, effectData.effectEvent(), true); - } - else if (!effectData.componentType().isEmpty()) { + } else if (!effectData.componentType().isEmpty()) { ret = d.mController.addFXML(effectData.componentType(), relativename, effectData.effectEvent(), true); } @@ -1227,8 +1226,8 @@ // Mark all effects using the given item type dirty, // so that they get re-created when the effect is shown next time for (QMap::iterator e = d.mEventEffectList.begin(); - e != d.mEventEffectList.end(); - ++e ) { + e != d.mEventEffectList.end(); + ++e) { HbEffectGroup *group = *e; if (group->registrationItem() == effectData.item()) { group->setDirty(true); @@ -1244,16 +1243,16 @@ This is used for example when changing orientation; all but the orientation change effects are cancelled. */ -void HbEffectInternal::cancelAll(const QList *exceptionList, bool ignoreLooping) +void HbEffectInternal::cancelAll(const QList *exceptionList, bool ignoreLooping) { // Observers may be notified during cancelations which may result in starting a new // effect during which groups may be deleted and removed from // mEventEffectList. Therefore we cannot directly iterate on mEventEffectList. QList groupsToBeCanceled; - foreach (HbEffectGroup *group, d.mEventEffectList) { + foreach(HbEffectGroup * group, d.mEventEffectList) { groupsToBeCanceled.append(group); } - foreach (HbEffectGroup *group, groupsToBeCanceled) { + foreach(HbEffectGroup * group, groupsToBeCanceled) { // Check if the real list still contains the group. If not then it may have been // deleted and removed meanwhile so do nothing. if (d.mEventEffectList.values().contains(group)) { @@ -1276,10 +1275,10 @@ void HbEffectInternal::safeCancelAll(bool clear) { QList groupsToBeCanceled; - foreach (HbEffectGroup *group, d.mEventEffectList) { + foreach(HbEffectGroup * group, d.mEventEffectList) { groupsToBeCanceled.append(group); } - foreach (HbEffectGroup *group, groupsToBeCanceled) { + foreach(HbEffectGroup * group, groupsToBeCanceled) { if (d.mEventEffectList.values().contains(group)) { group->cancelAll(false, false, clear); } @@ -1297,13 +1296,21 @@ */ void HbEffectInternal::stopEffects() { - // Pause looping effects and stop others - foreach (HbEffectGroup *group, d.mEventEffectList) { - if (group->isRunning()) { - if (group->isLooping()) { - group->pause(); - } else { - group->cancelAll(true); + // Pause looping effects and stop others. As usual, we cannot just + // simply iterate through the list as cancelAll() may change the + // elements in mEventEffectList. + QList groupsToBeChecked; + foreach(HbEffectGroup * group, d.mEventEffectList) { + groupsToBeChecked.append(group); + } + foreach(HbEffectGroup * group, groupsToBeChecked) { + if (d.mEventEffectList.values().contains(group)) { + if (group->isRunning()) { + if (group->isLooping()) { + group->pause(); + } else { + group->cancelAll(true); + } } } } @@ -1321,7 +1328,7 @@ void HbEffectInternal::resumeEffects() { // Resume any looping effects that were paused with stopEffects call. - foreach (HbEffectGroup *group, d.mEventEffectList) { + foreach(HbEffectGroup * group, d.mEventEffectList) { if (group->isRunning() && group->isLooping()) { group->resume(); } @@ -1373,7 +1380,7 @@ bool HbEffectInternal::start(QGraphicsItem *registrationItem, QGraphicsItem *targetItem, EffectFlags flags, - const QString &itemType, + const QString &itemType, const QString &effectEvent, QObject *receiver, const char *member, @@ -1462,13 +1469,13 @@ QMap::iterator e = d.mEventEffectList.find(key); // Same effect found in the list? - if(e != d.mEventEffectList.end()) { + if (e != d.mEventEffectList.end()) { HbEffectGroup *group = e.value(); if (!group->dirty()) { // if the effect group is not dirty, restart it. Cancel possible earlier // effect first so that end position gets correct. group->cancelAll(true); - + // Update with given notification parameters updateGroup(group, receiver, member, userData, extRect, flags); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffect.h --- a/src/hbcore/effects/hbeffect.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffect.h Thu Jul 22 16:36:53 2010 +0100 @@ -48,27 +48,27 @@ QVariant userData; }; - static bool start(QGraphicsItem *item, - const QString &itemType, - const QString &effectEvent, - QObject *receiver = 0, - const char *member = 0, - const QVariant &userData = QVariant(), - const QRectF &extRect = QRectF()); + static bool start(QGraphicsItem *item, + const QString &itemType, + const QString &effectEvent, + QObject *receiver = 0, + const char *member = 0, + const QVariant &userData = QVariant(), + const QRectF &extRect = QRectF()); - static bool start(QGraphicsItem *item, - const QString &effectEvent, - QObject *receiver = 0, - const char *member = 0, - const QVariant &userData = QVariant(), - const QRectF &extRect = QRectF()); + static bool start(QGraphicsItem *item, + const QString &effectEvent, + QObject *receiver = 0, + const char *member = 0, + const QVariant &userData = QVariant(), + const QRectF &extRect = QRectF()); - static bool start(const QList &items, - const QString &itemType, - const QString &effectEvent, - QObject *receiver = 0, - const char *member = 0, - const QVariant &userData = QVariant()); + static bool start(const QList &items, + const QString &itemType, + const QString &effectEvent, + QObject *receiver = 0, + const char *member = 0, + const QVariant &userData = QVariant()); static bool effectRunning(QGraphicsItem *item, const QString &effectEvent = QString()); @@ -84,7 +84,7 @@ static bool add(QGraphicsItem *item, const QString &filePath, const QString &effectEvent = QString()); static bool add(QGraphicsItem *item, const QStringList &filePath, const QStringList &effectEvent = QStringList()); - + static bool remove(const QString &itemType, const QString &filePath, const QString &effectEvent = QString()); static bool remove(QGraphicsItem *item, const QString &filePath, const QString &effectEvent = QString()); static bool remove(QGraphicsItem *item); @@ -96,6 +96,6 @@ HbEffect(); }; -Q_DECLARE_METATYPE( HbEffect::EffectStatus ) +Q_DECLARE_METATYPE(HbEffect::EffectStatus) #endif // HBEFFECT_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffect_p.h --- a/src/hbcore/effects/hbeffect_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffect_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -85,7 +85,7 @@ QMap mEventEffectList; bool mEnabled; - QList mDisabledItems; + QList mDisabledItems; bool mViewChangeConnected; bool mEffectsEnabled; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectanimation.cpp --- a/src/hbcore/effects/hbeffectanimation.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectanimation.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#include #include "hbeffectanimation_p.h" +#include "hbglobal.h" #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" #include "hbeffectfxmldata_p.h" @@ -85,7 +85,7 @@ if (current > mLoopEnd) { int newCurrentTime = mLoopStart + current - mLoopEnd; - + // If the calculated new current time is again beyond the loop end, // change it to the loop end to avoid infinite recursion. if (newCurrentTime > mLoopEnd) { @@ -109,13 +109,13 @@ if (looping()) { int current = currentTime(); int newCurrentTime = mLoopStart + current - mLoopEnd; - + // If the calculated new current time is again beyond the loop end, // change it to the loop end to avoid infinite recursion. if (newCurrentTime > mLoopEnd) { newCurrentTime = mLoopEnd; } - + // Temporarily prevent the animation from reacting to update request, // because start() causes update with time=0 and the loop might start from a later point of time. mInactive = true; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectanimation_p.h --- a/src/hbcore/effects/hbeffectanimation_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectanimation_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,7 +49,9 @@ private: void updateCurrentValue(const QVariant &value); - inline bool looping() const { return mLoopEnd > 0; } + inline bool looping() const { + return mLoopEnd > 0; + } private slots: void handleFinished(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectbc.cpp --- a/src/hbcore/effects/hbeffectbc.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectbc.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #include #ifdef HB_FILTER_EFFECTS -#include "hbeffectbc_p.h" +#include "hbeffectbc_p.h" //krazy:exclude=includes #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" #include "hbvgchainedeffect_p.h" @@ -42,11 +42,11 @@ const HbEffectFxmlFilterData &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectFilter(0, item, group), - mAnimationO(0), - mAnimationB(0), - mAnimationC(0), - mVgBc(0) + HbEffectFilter(0, item, group), + mAnimationO(0), + mAnimationB(0), + mAnimationC(0), + mVgBc(0) { // Default values of if something is not passed in FXML qreal opacity_start = 1; @@ -59,14 +59,12 @@ QList params = data.paramData(); // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, params) { + Q_FOREACH(const HbEffectFxmlParamData & param, params) { if (param.name() == FXML_KEYWORD_BRIGHTNESS_CONTRAST_OPACITY) { mAnimationO = createAnimation(param, opacity_start, opacity_end, group); - } - else if (param.name() == FXML_KEYWORD_BRIGHTNESS_CONTRAST_BRIGHTNESS) { + } else if (param.name() == FXML_KEYWORD_BRIGHTNESS_CONTRAST_BRIGHTNESS) { mAnimationB = createAnimation(param, brightness_start, brightness_end, group); - } - else if (param.name() == FXML_KEYWORD_BRIGHTNESS_CONTRAST_CONTRAST) { + } else if (param.name() == FXML_KEYWORD_BRIGHTNESS_CONTRAST_CONTRAST) { mAnimationC = createAnimation(param, contrast_start, contrast_end, group); } } @@ -75,10 +73,10 @@ if (mEffectDefined) { // Add effect to the filter effect chain in the effect group HbVgChainedEffect *chain = HbEffectAbstract::group()->vgEffect(); - + mVgBc = new HbVgBcEffect(); mVgBc->setCaching(true); - + chain->add(mVgBc); // Set initial values for the effect diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectblur.cpp --- a/src/hbcore/effects/hbeffectblur.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectblur.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #include #ifdef HB_FILTER_EFFECTS -#include "hbeffectblur_p.h" +#include "hbeffectblur_p.h" //krazy:exclude=includes #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" #include "hbvgchainedeffect_p.h" @@ -43,12 +43,12 @@ const HbEffectFxmlFilterData &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectFilter(0, item, group), - mAnimationO(0), - mAnimationX(0), - mAnimationY(0), - mVgBlur(0), - mType(Blur) + HbEffectFilter(0, item, group), + mAnimationO(0), + mAnimationX(0), + mAnimationY(0), + mVgBlur(0), + mType(Blur) { // If it is a glow filter, change effect type if (data.type() == HB_EFFECT_NAME_GLOW) { @@ -66,14 +66,12 @@ QList params = data.paramData(); // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, params) { + Q_FOREACH(const HbEffectFxmlParamData & param, params) { if (param.name() == FXML_KEYWORD_BLUR_OPACITY) { mAnimationO = createAnimation(param, opacity_start, opacity_end, group); - } - else if (param.name() == FXML_KEYWORD_BLUR_ORIGIN_X) { + } else if (param.name() == FXML_KEYWORD_BLUR_ORIGIN_X) { mAnimationX = createAnimation(param, blur_x_start, blur_x_end, group); - } - else if (param.name() == FXML_KEYWORD_BLUR_ORIGIN_Y) { + } else if (param.name() == FXML_KEYWORD_BLUR_ORIGIN_Y) { mAnimationY = createAnimation(param, blur_y_start, blur_y_end, group); } } @@ -87,11 +85,10 @@ if (mEffectDefined) { // Add blur effect to the filter effect chain in the effect group HbVgChainedEffect *chain = HbEffectAbstract::group()->vgEffect(); - + if (mType == Blur) { mVgBlur = new HbVgBlurEffect(); - } - else { + } else { mVgBlur = new HbVgGlowEffect(); } mVgBlur->setCaching(true); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectblur_p.h --- a/src/hbcore/effects/hbeffectblur_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectblur_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -48,8 +48,7 @@ class HB_AUTOTEST_EXPORT HbEffectBlur : public HbEffectFilter { public: - enum Type - { + enum Type { Blur = 0x01, Glow = 0x02 }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectcolorize.cpp --- a/src/hbcore/effects/hbeffectcolorize.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectcolorize.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #include #ifdef HB_FILTER_EFFECTS -#include "hbeffectcolorize_p.h" +#include "hbeffectcolorize_p.h" //krazy:exclude=includes #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" #include "hbvgchainedeffect_p.h" @@ -42,10 +42,10 @@ const HbEffectFxmlFilterData &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectFilter(0, item, group), - mAnimationO(0), - mAnimationC(0), - mVgColorize(0) + HbEffectFilter(0, item, group), + mAnimationO(0), + mAnimationC(0), + mVgColorize(0) { // Default values of if something is not passed in FXML qreal opacity_start = 1; @@ -57,11 +57,10 @@ QList params = data.paramData(); // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, params) { + Q_FOREACH(const HbEffectFxmlParamData & param, params) { if (param.name() == FXML_KEYWORD_COLORIZE_OPACITY) { mAnimationO = createAnimation(param, opacity_start, opacity_end, group); - } - else if (param.name() == FXML_KEYWORD_COLORIZE_COLOR) { + } else if (param.name() == FXML_KEYWORD_COLORIZE_COLOR) { mAnimationC = createAnimation(param, color_start, color_end, group); } } @@ -70,7 +69,7 @@ if (mEffectDefined) { // Add blur effect to the filter effect chain in the effect group HbVgChainedEffect *chain = HbEffectAbstract::group()->vgEffect(); - + mVgColorize = new HbVgColorizeEffect(); mVgColorize->setCaching(true); chain->add(mVgColorize); @@ -98,7 +97,7 @@ mVgColorize->setOpacity(qVariantValue(mAnimationO->currentValue())); } if (mAnimationC) { - mVgColorize->setColor(qVariantValue(mAnimationC->currentValue())); + mVgColorize->setColor(qVariantValue(mAnimationC->currentValue())); } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectcontroller.cpp --- a/src/hbcore/effects/hbeffectcontroller.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectcontroller.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -40,10 +40,10 @@ /* \class HbEffectController hbeffectcontroller.h - \brief HbEffectController is used to read and store effects data. + \brief HbEffectController is used to read and store effects data. */ -/* +/* Constructs a HbEffectController. */ HbEffectController::HbEffectController() @@ -53,7 +53,7 @@ { } -/* +/* Destructor. */ HbEffectController::~HbEffectController() @@ -65,7 +65,7 @@ const QString &componentType, QGraphicsItem *component, const QString &effectEvent, - bool shared ) const + bool shared) const { Q_UNUSED(shared); // not yet needed since we have a list of added items in local process int componentTypeMatchIndex = -1; @@ -75,15 +75,14 @@ const HbEffectInfo &info = mEffectEntries.at(i); // If found a definition matching the graphics item, return that. if (info.item() // not null - && info.item() == component // matches the component - && info.inUse() // the effect is in use (not removed) - && info.effectEvent() == effectEvent) // matches the event - { + && info.item() == component // matches the component + && info.inUse() // the effect is in use (not removed) + && info.effectEvent() == effectEvent) { // matches the event // sharing support - if it's shared get the FxML data from server and return the object // with parsed FxML data - if( info.shared() ) { + if (info.shared()) { HbEffectFxmlData *dataFromSrv = HbThemeClient::global()->getSharedEffect(info.mDefFileFullPath); - if(dataFromSrv) { + if (dataFromSrv) { return *dataFromSrv; } } else { @@ -100,10 +99,10 @@ } if (componentTypeMatchIndex >= 0) { const HbEffectInfo &info = mEffectEntries.at(componentTypeMatchIndex); - if ( info.shared() ) { + if (info.shared()) { HbEffectFxmlData *dataFromSrv = HbThemeClient::global()->getSharedEffect(info.mDefFileFullPath); - if(dataFromSrv) { + if (dataFromSrv) { return *dataFromSrv; } } else { @@ -131,9 +130,8 @@ for (int i = mEffectEntries.count() - 1; i >= 0; i--) { const HbEffectInfo &info = mEffectEntries[i]; if (info.componentType() == componentType && - info.xmlFileFullPath() == fullPath && - info.effectEvent() == effectEvent) - { + info.xmlFileFullPath() == fullPath && + info.effectEvent() == effectEvent) { // Remove the definition for the given component type mEffectEntries.removeAt(i); } @@ -146,9 +144,8 @@ for (int i = mEffectEntries.count() - 1; i >= 0; i--) { const HbEffectInfo &info = mEffectEntries[i]; if (info.item() == item && - info.xmlFileFullPath() == fullPath && - info.effectEvent() == effectEvent) - { + info.xmlFileFullPath() == fullPath && + info.effectEvent() == effectEvent) { // Remove the definition for the given item mEffectEntries.removeAt(i); } @@ -184,7 +181,7 @@ QString HbEffectController::expandFileName(const QString &fn, bool *fromTheme, bool *shared) { // Sharing not supported if the file is in Qt resource. - if (fn.startsWith(":/") && shared && *shared) { + if (shared && *shared && (fn.startsWith(QLatin1String(":/")) || HbIconLoader::isInPrivateDirectory(fn))) { *shared = false; return fn; } else { @@ -202,7 +199,7 @@ shared = mShared; } // If client is not connected due to any reason, any kind of sharing is not possible - if ( !HbThemeClient::global()->clientConnected() ) { + if (!HbThemeClient::global()->clientConnected()) { shared = mShared = mSharingSet = false; } bool fromTheme = false; @@ -215,9 +212,8 @@ HbEffectInfo &info = mEffectEntries[i]; if ((item && info.item() == item) - || (!componentType.isEmpty() && info.componentType() == componentType)) - { - if (info.effectEvent() == effectEvent) { + || (!componentType.isEmpty() && info.componentType() == componentType)) { + if (info.effectEvent() == effectEvent) { if (info.xmlFileFullPath() == filePath) { // parsed already, just set in use info.mInUse = true; @@ -233,7 +229,7 @@ } } - if ( shared ) { + if (shared) { if (!HbThemeClient::global()->addSharedEffect(filePath)) { // Themeserver failed, try to parse locally. shared = false; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectcontroller_p.h --- a/src/hbcore/effects/hbeffectcontroller_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectcontroller_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -67,7 +67,7 @@ private: QList mEffectEntries; - HbEffectXmlParser* mParser; + HbEffectXmlParser *mParser; bool mShared; bool mSharingSet; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectdropshadow.cpp --- a/src/hbcore/effects/hbeffectdropshadow.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectdropshadow.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,7 @@ #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" -#include "hbeffectdropshadow_p.h" +#include "hbeffectdropshadow_p.h" //krazy:exclude=includes #include "hbeffectfilter_p.h" #include "hbvgchainedeffect_p.h" #include "hbvgshadoweffect_p.h" @@ -43,16 +43,16 @@ const HbEffectFxmlFilterData &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectFilter(0, item, group), - mAnimationO(0), - mAnimationS(0), - mAnimationOutlineX(0), - mAnimationOutlineY(0), - mAnimationOffsetX(0), - mAnimationOffsetY(0), - mAnimationC(0), - mVgOutline(0), - mType(HbEffectDropShadow::outline) + HbEffectFilter(0, item, group), + mAnimationO(0), + mAnimationS(0), + mAnimationOutlineX(0), + mAnimationOutlineY(0), + mAnimationOffsetX(0), + mAnimationOffsetY(0), + mAnimationC(0), + mVgOutline(0), + mType(HbEffectDropShadow::outline) { // Default values from FXML spec qreal opacity_start = 1; @@ -77,30 +77,24 @@ QList params = data.paramData(); // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, params) { + Q_FOREACH(const HbEffectFxmlParamData & param, params) { if (param.name() == FXML_KEYWORD_DROP_SHADOW_OPACITY) { mAnimationO = createAnimation(param, opacity_start, opacity_end, group); - } - else if (param.name() == FXML_KEYWORD_DROP_SHADOW_COLOR) { + } else if (param.name() == FXML_KEYWORD_DROP_SHADOW_COLOR) { mAnimationC = createAnimation(param, color_start, color_end, group); - } - else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OFFSET_X) { + } else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OFFSET_X) { mAnimationOffsetX = createAnimation(param, offset_x_start, offset_x_end, group); // If offset parameters are used, it is a drop shadow effect. mType = dropShadow; - } - else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OFFSET_Y) { + } else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OFFSET_Y) { mAnimationOffsetY = createAnimation(param, offset_y_start, offset_y_end, group); // If offset parameters are used, it is a drop shadow effect. mType = dropShadow; - } - else if (param.name() == FXML_KEYWORD_DROP_SHADOW_STEEPNESS) { + } else if (param.name() == FXML_KEYWORD_DROP_SHADOW_STEEPNESS) { mAnimationS = createAnimation(param, steepness_start, steepness_end, group); - } - else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OUTLINE_X) { + } else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OUTLINE_X) { mAnimationOutlineX = createAnimation(param, outline_x_start, outline_x_end, group); - } - else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OUTLINE_Y) { + } else if (param.name() == FXML_KEYWORD_DROP_SHADOW_OUTLINE_Y) { mAnimationOutlineY = createAnimation(param, outline_y_start, outline_y_end, group); } } @@ -109,7 +103,7 @@ if (mEffectDefined) { // Add effect to the filter effect chain in the effect group HbVgChainedEffect *chain = HbEffectAbstract::group()->vgEffect(); - + if (mType == dropShadow) { mVgOutline = new HbVgShadowEffect(); } else { @@ -165,10 +159,10 @@ mVgOutline->setSteepness(qVariantValue(mAnimationS->currentValue())); } if (mAnimationC) { - mVgOutline->setColor(qVariantValue(mAnimationC->currentValue())); + mVgOutline->setColor(qVariantValue(mAnimationC->currentValue())); } if (mAnimationO) { - mVgOutline->setOpacity(qVariantValue(mAnimationO->currentValue())); + mVgOutline->setOpacity(qVariantValue(mAnimationO->currentValue())); } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectdropshadow_p.h --- a/src/hbcore/effects/hbeffectdropshadow_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectdropshadow_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,8 +54,7 @@ { public: - enum type - { + enum type { dropShadow = 0x01, outline = 0x02 }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectfactory.cpp --- a/src/hbcore/effects/hbeffectfactory.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectfactory.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -43,7 +43,7 @@ inline bool isScaleParameter(const QString ¶m) { - return + return param == FXML_KEYWORD_SCALE_X || param == FXML_KEYWORD_SCALE_Y; } @@ -68,8 +68,8 @@ inline bool isTranslateParameter(const QString ¶m) { return - param == FXML_KEYWORD_TRANSLATION_X || - param == FXML_KEYWORD_TRANSLATION_Y; + param == FXML_KEYWORD_TRANSLATION_X || + param == FXML_KEYWORD_TRANSLATION_Y; } @@ -105,7 +105,7 @@ // Try to get FXML definition const HbEffectFxmlData &fxmlData = mController.fetchFxmlData( - itemType, registrationItem, effectEventType); + itemType, registrationItem, effectEventType); if (!fxmlData.isNull()) { QList params = fxmlData.paramData(); @@ -132,7 +132,7 @@ // This creates HbEffectAbstract instances from the definitions. // The whole list of parameters is passed to the effect // constructor, which skips parameters that it does not understand. - Q_FOREACH(const HbEffectFxmlParamData ¶m, params) { + Q_FOREACH(const HbEffectFxmlParamData & param, params) { QString paramName = param.name(); HbEffectAbstract *effect = 0; @@ -141,19 +141,15 @@ // Create a scale effect effect = new HbEffectScale(params, targetItem, group); effectsCreated |= scaleBit; - } - if (!(effectsCreated & rotateBit) && isRotateParameter(paramName)) { + } else if (!(effectsCreated & rotateBit) && isRotateParameter(paramName)) { // Create a rotate effect effect = new HbEffectRotate(params, targetItem, group); effectsCreated |= rotateBit; - } - if (!(effectsCreated & opacityBit) && isOpacityParameter(paramName)) { + } else if (!(effectsCreated & opacityBit) && isOpacityParameter(paramName)) { // Create an opacity effect effect = new HbEffectOpacity(params, targetItem, group); effectsCreated |= opacityBit; - } - - if (!(effectsCreated & translateBit) && isTranslateParameter(paramName)) { + } else if (!(effectsCreated & translateBit) && isTranslateParameter(paramName)) { // Create a translate effect effect = new HbEffectTranslate(params, targetItem, group); effectsCreated |= translateBit; @@ -170,12 +166,12 @@ // Handle filter definitions similarly QList filters = fxmlData.filterData(); - Q_FOREACH(const HbEffectFxmlFilterData &filter, filters) { + Q_FOREACH(const HbEffectFxmlFilterData & filter, filters) { HbEffectAbstract *effect = 0; QString type = filter.type(); if (!(effectsCreated & blurBit) && - (type == HB_EFFECT_NAME_BLUR || type == HB_EFFECT_NAME_GLOW)) { + (type == HB_EFFECT_NAME_BLUR || type == HB_EFFECT_NAME_GLOW)) { // Create a blur effect effect = new HbEffectBlur(filter, targetItem, group); effectsCreated |= blurBit; @@ -191,7 +187,7 @@ effectsCreated |= colorizeBit; } if (!(effectsCreated & dropShadowBit) && - (type == HB_EFFECT_NAME_DROP_SHADOW || type == HB_EFFECT_NAME_OUTLINE)) { + (type == HB_EFFECT_NAME_DROP_SHADOW || type == HB_EFFECT_NAME_OUTLINE)) { // Create a drop shadow effect effect = new HbEffectDropShadow(filter, targetItem, group); effectsCreated |= dropShadowBit; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectfilter.cpp --- a/src/hbcore/effects/hbeffectfilter.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectfilter.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #include #ifdef HB_FILTER_EFFECTS -#include "hbeffectfilter_p.h" +#include "hbeffectfilter_p.h" //krazy:exclude=includes #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" #include "hbeffectutils_p.h" @@ -34,10 +34,10 @@ #include HbEffectFilterAnimation::HbEffectFilterAnimation(HbEffectFilter *effect, - int duration, - HbEffectGroup *group) + int duration, + HbEffectGroup *group) : HbEffectAnimation(group), - mEffect(effect) + mEffect(effect) { setDuration(duration); } @@ -64,7 +64,7 @@ : HbEffectFilterAnimation(effect, duration, group) { } - + HbEffectColorAnimation::~HbEffectColorAnimation() { } @@ -78,19 +78,19 @@ int fromValue = fromColor.red(); int toValue = toColor.red(); - ret.setRed(fromValue + (int)(mCurve.valueForProgress(progress) * (toValue - fromValue))); + ret.setRed(fromValue + (int)(mCurve.valueForProgress(progress) *(toValue - fromValue))); fromValue = fromColor.green(); toValue = toColor.green(); - ret.setGreen(fromValue + (int)(mCurve.valueForProgress(progress) * (toValue - fromValue))); + ret.setGreen(fromValue + (int)(mCurve.valueForProgress(progress) *(toValue - fromValue))); fromValue = fromColor.blue(); toValue = toColor.blue(); - ret.setBlue(fromValue + (int)(mCurve.valueForProgress(progress) * (toValue - fromValue))); + ret.setBlue(fromValue + (int)(mCurve.valueForProgress(progress) *(toValue - fromValue))); fromValue = fromColor.alpha(); toValue = toColor.alpha(); - ret.setAlpha(fromValue + (int)(mCurve.valueForProgress(progress) * (toValue - fromValue))); + ret.setAlpha(fromValue + (int)(mCurve.valueForProgress(progress) *(toValue - fromValue))); return ret; } @@ -101,14 +101,14 @@ HbEffectFilter::HbEffectFilter(int /*startTime*/, QGraphicsItem *item, HbEffectGroup *group) : HbEffectAbstract(0, item, group), - mEffectDefined(false), - mCanceled(false) + mEffectDefined(false), + mCanceled(false) { } HbEffectFilter::~HbEffectFilter() { - Q_FOREACH(HbEffectFilterAnimation *anim, mAnimations) { + Q_FOREACH(HbEffectFilterAnimation * anim, mAnimations) { anim->stop(); delete anim; } @@ -132,7 +132,7 @@ } if (mAnimations.count()) { - Q_FOREACH(HbEffectFilterAnimation *anim, mAnimations) { + Q_FOREACH(HbEffectFilterAnimation * anim, mAnimations) { anim->stop(); // rewind the animation before starting again anim->setCurrentTime(0); anim->mFinished = false; @@ -155,7 +155,7 @@ mCanceled = true; // Put animations in their end state to reach the end state of the effect. - Q_FOREACH(HbEffectFilterAnimation *anim, mAnimations) { + Q_FOREACH(HbEffectFilterAnimation * anim, mAnimations) { anim->stop(); anim->setCurrentTime(anim->duration()); anim->mFinished = true; @@ -174,7 +174,7 @@ void HbEffectFilter::pause() { - Q_FOREACH(HbEffectFilterAnimation *anim, mAnimations) { + Q_FOREACH(HbEffectFilterAnimation * anim, mAnimations) { if (anim->state() == QAbstractAnimation::Running) { anim->pause(); } @@ -183,7 +183,7 @@ void HbEffectFilter::resume() { - Q_FOREACH(HbEffectFilterAnimation *anim, mAnimations) { + Q_FOREACH(HbEffectFilterAnimation * anim, mAnimations) { if (anim->state() == QAbstractAnimation::Paused) { anim->resume(); } @@ -199,7 +199,9 @@ HbEffectFilterAnimation *anim = 0; // Replace default values with parameter's values - mEffectDefined |= param.getValue(startValue); + if (param.getValue(startValue)) { + mEffectDefined = true; + } endValue = startValue; QList keyFrameList = param.keyFrames(); @@ -217,13 +219,12 @@ anim = new HbEffectFilterAnimation(this, duration, group); mAnimations.append(anim); // Go through keyframes - foreach(const HbKeyFrame &kf, keyFrameList) { - if (HbEffectUtils::fuzzyIsNull(kf.pos)) { - startValue = kf.val; - } - else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { - endValue = kf.val; - } + foreach(const HbKeyFrame & kf, keyFrameList) { + if (HbEffectUtils::fuzzyIsNull(kf.pos)) { + startValue = kf.val; + } else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { + endValue = kf.val; + } // Set keyframe in animation else { anim->setKeyValueAt(kf.pos, QVariant(kf.val)); @@ -255,7 +256,9 @@ if (!colorString.isEmpty()) { startValue.setNamedColor(colorString); endValue = startValue; - mEffectDefined |= startValue.isValid(); + if (startValue.isValid()) { + mEffectDefined = true; + } } QList keyFrameList = param.keyFrames(); @@ -273,13 +276,12 @@ anim = new HbEffectColorAnimation(this, duration, group); mAnimations.append(anim); // Go through keyframes - foreach(const HbKeyFrame &kf, keyFrameList) { - if (HbEffectUtils::fuzzyIsNull(kf.pos)) { + foreach(const HbKeyFrame & kf, keyFrameList) { + if (HbEffectUtils::fuzzyIsNull(kf.pos)) { startValue.setNamedColor(kf.stringValue); - } - else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { - endValue.setNamedColor(kf.stringValue); - } + } else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { + endValue.setNamedColor(kf.stringValue); + } // Set keyframe in animation else { QColor c(kf.stringValue); @@ -303,7 +305,7 @@ { bool allFinished = true; - Q_FOREACH(HbEffectFilterAnimation *anim, mAnimations) { + Q_FOREACH(HbEffectFilterAnimation * anim, mAnimations) { if (!anim->mFinished) { allFinished = false; } @@ -314,7 +316,7 @@ if (allFinished && !mCanceled) { // Make sure animations are in their end value to reach the end state of the effect. // Sometimes QVariantAnimation does not update the animation with its end value before sending finished signal. - Q_FOREACH(HbEffectFilterAnimation *anim, mAnimations) { + Q_FOREACH(HbEffectFilterAnimation * anim, mAnimations) { anim->stop(); anim->setCurrentTime(anim->duration()); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectfxmldata.cpp --- a/src/hbcore/effects/hbeffectfxmldata.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectfxmldata.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -104,7 +104,7 @@ // Make a regular QList. Note that some of the underlying structures may // still stay in shared memory. QList paramDataList; - foreach (const HbEffectFxmlParamData &data, mFxmlParams) { + foreach(const HbEffectFxmlParamData & data, mFxmlParams) { paramDataList.append(data); } return paramDataList; @@ -159,9 +159,10 @@ QString HbEffectFxmlParamData::getAttribute(const QString &attrName) const { - foreach (const HbEffectFxmlAttrListEntry &a, mAttributes) { - if (a.mKey == attrName) + foreach(const HbEffectFxmlAttrListEntry & a, mAttributes) { + if (a.mKey == attrName) { return a.mValue; + } } return QString(); } @@ -209,7 +210,7 @@ // Make a regular QList. Note that some of the underlying structures may // still stay in shared memory. QList keyFrameList; - foreach (const HbKeyFrame &keyFrame, mKeyFrames) { + foreach(const HbKeyFrame & keyFrame, mKeyFrames) { keyFrameList.append(keyFrame); } return keyFrameList; @@ -225,7 +226,7 @@ return mStartRef; } -void HbEffectFxmlParamData::setStartRef(const QString& value) +void HbEffectFxmlParamData::setStartRef(const QString &value) { mStartRef = value; } @@ -235,7 +236,7 @@ return mEndRef; } -void HbEffectFxmlParamData::setEndRef(const QString& value) +void HbEffectFxmlParamData::setEndRef(const QString &value) { mEndRef = value; } @@ -301,7 +302,7 @@ // Make a regular QList. Note that some of the underlying structures may // still stay in shared memory. QList paramDataList; - foreach (const HbEffectFxmlParamData &data, mFxmlParams) { + foreach(const HbEffectFxmlParamData & data, mFxmlParams) { paramDataList.append(data); } return paramDataList; @@ -317,7 +318,7 @@ // Make a regular QList. Note that some of the underlying structures may // still stay in shared memory. QList paramDataList; - foreach (const HbEffectFxmlFilterData &data, mFilters) { + foreach(const HbEffectFxmlFilterData & data, mFilters) { paramDataList.append(data); } return paramDataList; @@ -327,7 +328,7 @@ { return mMemoryType; } -HbEffectInfo::HbEffectInfo():mItem(0) +HbEffectInfo::HbEffectInfo(): mItem(0) { } @@ -362,7 +363,7 @@ } bool HbEffectInfo::shared() const { - return mShared; + return mShared; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectfxmldata_p.h --- a/src/hbcore/effects/hbeffectfxmldata_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectfxmldata_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,7 @@ #include #include -QT_FORWARD_DECLARE_CLASS(QGraphicsItem) +QT_FORWARD_DECLARE_CLASS(QGraphicsItem) struct HbKeyFrame { // Cannot change to qreal even though krazy may insist on that. @@ -44,8 +44,7 @@ : stringValue(memType) { } }; -struct HbEffectFxmlAttrListEntry -{ +struct HbEffectFxmlAttrListEntry { HbEffectFxmlAttrListEntry(HbMemoryManager::MemoryType memType = HbMemoryManager::HeapMemory) : mKey(memType), mValue(memType) { } HbString mKey; @@ -79,9 +78,9 @@ void append(const HbKeyFrame &keyFrame); QString startRef() const; - void setStartRef(const QString& value); + void setStartRef(const QString &value); QString endRef() const; - void setEndRef(const QString& value); + void setEndRef(const QString &value); bool loopDefined() const; @@ -166,7 +165,7 @@ QString xmlFileFullPath() const; QString effectEvent() const; bool inUse() const; - bool fromTheme() const; + bool fromTheme() const; QGraphicsItem *item() const; bool shared() const; @@ -184,7 +183,7 @@ bool mShared; QGraphicsItem *mItem; // for object specific effects // local or shared (depends on HbEffectFxmlData memory type) - HbEffectFxmlData mFxmlData; + HbEffectFxmlData mFxmlData; // Effect controller fills the info friend class HbEffectController; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectgroup.cpp --- a/src/hbcore/effects/hbeffectgroup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectgroup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -44,8 +44,8 @@ #endif HbEffectGroup::HbEffectGroup( - const QString &effectEventType, - QGraphicsItem *registrationItem, + const QString &effectEventType, + QGraphicsItem *registrationItem, QGraphicsItem *targetItem, const QString &itemType) : mRegistrationItem(registrationItem), @@ -133,7 +133,7 @@ if (effect->name() == HB_EFFECT_NAME_SCALE) { // Move scale effect second last in the effect list mEffects.takeAt(i); - mEffects.insert(mEffects.size()-1, effect); + mEffects.insert(mEffects.size() - 1, effect); } } @@ -148,18 +148,20 @@ void HbEffectGroup::updateItemTransform() { - QGraphicsView *gv(0); + QGraphicsView *gv(0); // support for graphics view transforms if (mTargetItem->type() == HbGVWrapperItemType) { - HbGVWrapperItem *gvw = static_cast(mTargetItem); - if (gvw) + HbGVWrapperItem *gvw = static_cast(mTargetItem); + if (gvw) { gv = gvw->mainWindow(); + } } QTransform transform; - foreach (HbEffectAbstract *effect, mEffects) { - if (effect) + foreach(HbEffectAbstract * effect, mEffects) { + if (effect) { effect->updateItemTransform(transform); + } } if (!gv) { mTargetItem->setTransform(transform); @@ -180,7 +182,7 @@ int HbEffectGroup::effectCount() const { - return mEffects.count(); + return mEffects.count(); } bool HbEffectGroup::isRunning() const @@ -200,14 +202,14 @@ void HbEffectGroup::pause() { - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { effect->pause(); } } void HbEffectGroup::resume() { - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { effect->resume(); } } @@ -303,7 +305,7 @@ // First resolve parameters and set the start states for all the effects. // This is done before starting the effect animations to avoid screen flickering. QTransform transform; - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { // Resolve parameters etc. effect->init(); if (effect->interval() == 0) { @@ -329,7 +331,7 @@ mTargetItemHidden = false; if (mEffects.empty()) { - // No effect exists but user wants notification when effect finishes. + // No effect exists but user wants notification when effect finishes. // Let the user do whatever he wanted to do when effect finishes. invokeObserver(Hb::EffectNotStarted); } else { @@ -340,7 +342,7 @@ if (isLooping()) { resolveView(); } - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { // If the starttime is zero, start effect immediately if (effect->interval() == 0) { effect->start(); // This may call group's effectFinished if the effect was empty. @@ -359,7 +361,7 @@ if (scene) { // Resolve the main window having the same scene that the item belongs to QList windowList = hbInstance->allMainWindows(); - foreach (const HbMainWindow *window, windowList) { + foreach(const HbMainWindow * window, windowList) { if (window->scene() == scene) { mView = window->currentView(); break; @@ -371,7 +373,7 @@ bool HbEffectGroup::hasTranslateEffect() const { - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { if (effect->name() == HB_EFFECT_NAME_TRANSLATE) { return true; } @@ -381,7 +383,7 @@ bool HbEffectGroup::hasRotateEffect() const { - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { if (effect->name() == HB_EFFECT_NAME_ROTATE) { return true; } @@ -392,7 +394,7 @@ bool HbEffectGroup::hasScaleEffect() const { - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { if (effect->name() == HB_EFFECT_NAME_SCALE) { return true; } @@ -402,7 +404,7 @@ bool HbEffectGroup::hasOpacityEffect() const { - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { if (effect->name() == HB_EFFECT_NAME_OPACITY) { return true; } @@ -438,9 +440,9 @@ mTargetItem->setOpacity(1.0f); } // Reset filter effects. -#ifdef HB_FILTER_EFFECTS +#ifdef HB_FILTER_EFFECTS deactivateVgEffect(); -#endif +#endif } void HbEffectGroup::cancelAll(bool sendCallback, bool itemIsValid, bool clearEffect, const QTransform &initialItemTransform) @@ -452,7 +454,7 @@ QTransform transform; bool opacityEffectUsed = false; - foreach (HbEffectAbstract *effect, mEffects) { + foreach(HbEffectAbstract * effect, mEffects) { if (effect) { HbTimer::instance()->unregisterEntry(effect); effect->cancel(transform, itemIsValid); @@ -531,8 +533,8 @@ status.userData = mUserData; status.reason = reason; - QObject *observer = mObserver; - + QObject *observer = mObserver; + // Clear the observer to make sure it is not sent more than once. // This is done before invokeMethod to avoid crash if the callback // deletes this object. diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectgroup_p.h --- a/src/hbcore/effects/hbeffectgroup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectgroup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -70,7 +70,7 @@ void addEffect(HbEffectAbstract *effect); void removeEffect(HbEffectAbstract *effect); void fixEffectOrder(); - + void setObserver(QObject *observer, const QString &effectFinishedSlotName); void updateItemTransform(); @@ -127,7 +127,7 @@ bool mDirty; QList mEffects; - + HbVgChainedEffect *mVgEffect; bool mVgEffectActivated; QPointer mVgEffectGuard; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffecthsl.cpp --- a/src/hbcore/effects/hbeffecthsl.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffecthsl.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #include #ifdef HB_FILTER_EFFECTS -#include "hbeffecthsl_p.h" +#include "hbeffecthsl_p.h" //krazy:exclude=includes #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" #include "hbvgchainedeffect_p.h" @@ -42,12 +42,12 @@ const HbEffectFxmlFilterData &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectFilter(0, item, group), - mAnimationO(0), - mAnimationH(0), - mAnimationS(0), - mAnimationL(0), - mVgHsl(0) + HbEffectFilter(0, item, group), + mAnimationO(0), + mAnimationH(0), + mAnimationS(0), + mAnimationL(0), + mVgHsl(0) { // Default values of if something is not passed in FXML qreal opacity_start = 1; @@ -62,17 +62,14 @@ QList params = data.paramData(); // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, params) { + Q_FOREACH(const HbEffectFxmlParamData & param, params) { if (param.name() == FXML_KEYWORD_HSL_OPACITY) { mAnimationO = createAnimation(param, opacity_start, opacity_end, group); - } - else if (param.name() == FXML_KEYWORD_HSL_HUE) { + } else if (param.name() == FXML_KEYWORD_HSL_HUE) { mAnimationH = createAnimation(param, hue_start, hue_end, group); - } - else if (param.name() == FXML_KEYWORD_HSL_SATURATION) { + } else if (param.name() == FXML_KEYWORD_HSL_SATURATION) { mAnimationS = createAnimation(param, saturation_start, saturation_end, group); - } - else if (param.name() == FXML_KEYWORD_HSL_LIGHTNESS) { + } else if (param.name() == FXML_KEYWORD_HSL_LIGHTNESS) { mAnimationL = createAnimation(param, lightness_start, lightness_end, group); } } @@ -81,10 +78,10 @@ if (mEffectDefined) { // Add blur effect to the filter effect chain in the effect group HbVgChainedEffect *chain = HbEffectAbstract::group()->vgEffect(); - + mVgHsl = new HbVgHslEffect(); mVgHsl->setCaching(true); - + chain->add(mVgHsl); // Set initial values for the effect diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectinternal_p.h --- a/src/hbcore/effects/hbeffectinternal_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectinternal_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,7 @@ #define HBEFFECTINTERNAL_P_H #include +#include #include const int HbGVWrapperItemType = Hb::ItemType_Last + 10000; // just some value after the last one @@ -38,8 +39,10 @@ { public: HbGVWrapperItem(); - int type() const { return HbGVWrapperItemType; } - void setMainWindow( HbMainWindow& mainWindow ); + int type() const { + return HbGVWrapperItemType; + } + void setMainWindow(HbMainWindow &mainWindow); HbMainWindow *mainWindow() const; qreal transformDegrees; private: @@ -91,7 +94,7 @@ static void reloadFxmlFiles(); - static void cancelAll(const QList *exceptionList = 0, bool ignoreLooping = false); + static void cancelAll(const QList *exceptionList = 0, bool ignoreLooping = false); static void safeCancelAll(bool clear = false); static void stopEffects(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectopacity.cpp --- a/src/hbcore/effects/hbeffectopacity.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectopacity.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,8 +32,8 @@ HbEffectOpacityAnimation::HbEffectOpacityAnimation( HbEffectGroup *group, - int duration ) : - HbEffectAnimation(group) + int duration) : + HbEffectAnimation(group) { setDuration(duration); } @@ -55,8 +55,8 @@ const QList &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectAbstract(0, item, group), - mAnimation(0) + HbEffectAbstract(0, item, group), + mAnimation(0) { // Default values of if something is not passed in FXML mStartOpacity = 1.0f; @@ -70,8 +70,8 @@ const HbEffectFxmlParamData *opacityParam = 0; // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, data) { - if (param.name() == FXML_KEYWORD_OPACITY) { + Q_FOREACH(const HbEffectFxmlParamData & param, data) { + if (param.name() == FXML_KEYWORD_OPACITY) { keyFrameList = param.keyFrames(); HbEffectUtils::resolveFxmlDuration(duration, param); HbEffectUtils::resolveFxmlCurveShape(curve, param); @@ -81,20 +81,19 @@ mEndOpacity = mStartOpacity; opacityParam = ¶m; - } + } } if (duration > 0) { - mAnimation = new HbEffectOpacityAnimation(group, duration); + mAnimation = new HbEffectOpacityAnimation(group, duration); - foreach( const HbKeyFrame &kf, keyFrameList ) { - if (HbEffectUtils::fuzzyIsNull(kf.pos)) { - // Start value 0.0 does not work so this trick fixes that. + foreach(const HbKeyFrame & kf, keyFrameList) { + if (HbEffectUtils::fuzzyIsNull(kf.pos)) { + // Start value 0.0 does not work so this trick fixes that. mStartOpacity = kf.val + 0.0001f; - } - else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { - mEndOpacity = kf.val; - } + } else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { + mEndOpacity = kf.val; + } // Set keyframe in animation else { mAnimation->setKeyValueAt(kf.pos, QVariant(kf.val)); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectplanarreflection.cpp --- a/src/hbcore/effects/hbeffectplanarreflection.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectplanarreflection.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #include #ifdef HB_FILTER_EFFECTS -#include "hbeffectplanarreflection_p.h" +#include "hbeffectplanarreflection_p.h" //krazy:exclude=includes #include "hbeffectgroup_p.h" #include "hbeffectdef_p.h" #include "hbvgchainedeffect_p.h" @@ -42,13 +42,13 @@ const HbEffectFxmlFilterData &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectFilter(0, item, group), - mAnimationO(0), - mAnimationC(0), - mAnimationX(0), - mAnimationY(0), - mAnimationF(0), - mVgReflection(0) + HbEffectFilter(0, item, group), + mAnimationO(0), + mAnimationC(0), + mAnimationX(0), + mAnimationY(0), + mAnimationF(0), + mVgReflection(0) { // Default values of if something is not passed in FXML qreal opacity_start = 1; @@ -69,20 +69,16 @@ QList params = data.paramData(); // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, params) { + Q_FOREACH(const HbEffectFxmlParamData & param, params) { if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_OPACITY) { mAnimationO = createAnimation(param, opacity_start, opacity_end, group); - } - else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_COLOR) { + } else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_COLOR) { mAnimationC = createAnimation(param, color_start, color_end, group); - } - else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_OFFSET_X) { + } else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_OFFSET_X) { mAnimationX = createAnimation(param, offset_x_start, offset_x_end, group); - } - else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_OFFSET_Y) { + } else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_OFFSET_Y) { mAnimationY = createAnimation(param, offset_y_start, offset_y_end, group); - } - else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_FADE) { + } else if (param.name() == FXML_KEYWORD_PLANAR_REFLECTION_FADE) { mAnimationF = createAnimation(param, fade_start, fade_end, group); } } @@ -91,10 +87,10 @@ if (mEffectDefined) { // Add the effect to the filter effect chain in the effect group HbVgChainedEffect *chain = HbEffectAbstract::group()->vgEffect(); - + mVgReflection = new HbVgReflectionEffect(); mVgReflection->setCaching(true); - + chain->add(mVgReflection); // Set initial values for the effect @@ -124,7 +120,7 @@ mVgReflection->setOpacity(qVariantValue(mAnimationO->currentValue())); } if (mAnimationC) { - mVgReflection->setColor(qVariantValue(mAnimationC->currentValue())); + mVgReflection->setColor(qVariantValue(mAnimationC->currentValue())); } QPointF offset = mVgReflection->offset(); @@ -139,7 +135,7 @@ mVgReflection->setOffset(offset); if (mAnimationF) { - mVgReflection->setFade(qVariantValue(mAnimationF->currentValue())); + mVgReflection->setFade(qVariantValue(mAnimationF->currentValue())); } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectrotate.cpp --- a/src/hbcore/effects/hbeffectrotate.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectrotate.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,7 @@ public: HbEffectRotateAnimation(HbEffectGroup *group, Qt::Axis axis, - int duration ); + int duration); void setCenter(const QPointF &p); @@ -56,13 +56,13 @@ HbEffectRotateAnimation::HbEffectRotateAnimation( HbEffectGroup *group, Qt::Axis axis, - int duration ) : - HbEffectAnimation(group), - mAxis(axis), - mCenterX(0), - mCenterY(0), - mCurrentRotation(0), - mTargetRotation(0) + int duration) : + HbEffectAnimation(group), + mAxis(axis), + mCenterX(0), + mCenterY(0), + mCurrentRotation(0), + mTargetRotation(0) { setDuration(duration); } @@ -94,11 +94,11 @@ Example of how to use HbEffectRotate \code - // animData here is pointer to HbEffectAnimation data, gruop is pointer to HbEffectGroup, and + // animData here is pointer to HbEffectAnimation data, gruop is pointer to HbEffectGroup, and // item is the QGraphicsItem on which effect will be applied. HbEffectRotate *effect= new HbEffectScale(animData, item, group); effect->start(); - + \endcode \warning This class is a part of internal library implementation and may @@ -111,11 +111,11 @@ const QList &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectAbstract(0, item, group), - mAnimation(0), - mCenterX(0.0), - mCenterY(0.0), - mPosChanged(false) + HbEffectAbstract(0, item, group), + mAnimation(0), + mCenterX(0.0), + mCenterY(0.0), + mPosChanged(false) { // Default values of rotation effect if something is not passed in FXML Qt::Axis axis = Qt::ZAxis; @@ -130,27 +130,23 @@ const HbEffectFxmlParamData *angleParam = 0; // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, data) { - if (param.name() == FXML_KEYWORD_ROTATION_ANGLE) { + Q_FOREACH(const HbEffectFxmlParamData & param, data) { + if (param.name() == FXML_KEYWORD_ROTATION_ANGLE) { keyFrameList = param.keyFrames(); HbEffectUtils::resolveFxmlDuration(duration, param); HbEffectUtils::resolveFxmlCurveShape(curve, param); angleParam = ¶m; - } - else if (param.name() == FXML_KEYWORD_ROTATION_ORIGIN_X) { + } else if (param.name() == FXML_KEYWORD_ROTATION_ORIGIN_X) { originXData = param; - } - else if (param.name() == FXML_KEYWORD_ROTATION_ORIGIN_Y) { + } else if (param.name() == FXML_KEYWORD_ROTATION_ORIGIN_Y) { originYData = param; - } - else if (param.name() == FXML_KEYWORD_ROTATION_AXIS_X) { + } else if (param.name() == FXML_KEYWORD_ROTATION_AXIS_X) { bool valueOk = false; int value = param.getValue().toInt(&valueOk); if (valueOk && (bool)value) { axis = Qt::XAxis; } - } - else if (param.name() == FXML_KEYWORD_ROTATION_AXIS_Y) { + } else if (param.name() == FXML_KEYWORD_ROTATION_AXIS_Y) { bool valueOk = false; int value = param.getValue().toInt(&valueOk); if (valueOk && (bool)value) { @@ -166,13 +162,12 @@ anim->addLooping(angleParam); - foreach( const HbKeyFrame &kf, keyFrameList ) { - if (HbEffectUtils::fuzzyIsNull(kf.pos)) { - startAngle = kf.val; - } - else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { - endAngle = kf.val; - } + foreach(const HbKeyFrame & kf, keyFrameList) { + if (HbEffectUtils::fuzzyIsNull(kf.pos)) { + startAngle = kf.val; + } else if (HbEffectUtils::fuzzyIsOneOrGreater(kf.pos)) { + endAngle = kf.val; + } // Set keyframe in animation else { anim->setKeyValueAt(kf.pos, QVariant(kf.val)); @@ -228,10 +223,10 @@ the result is undefined. */ void HbEffectRotate::start() -{ - mAnimation->setCenter(QPointF(mCenterX, mCenterY)); +{ + mAnimation->setCenter(QPointF(mCenterX, mCenterY)); mAnimation->setCurrentTime(0); - mAnimation->start(); + mAnimation->start(); } /* Cancels the effect animation and sets the animation end state immediately. @@ -241,7 +236,7 @@ Q_UNUSED(itemIsValid) mAnimation->stop(); - + //This will set the endstate for the object correctly when cancelling effect QTransform newTransform; newTransform.translate(mAnimation->mCenterX, mAnimation->mCenterY); @@ -254,7 +249,7 @@ void HbEffectRotate::updateItemTransform(QTransform &transform) { if (mAnimation) { - // Rotate the transformation matrix to reach the new rotation angle. + // Rotate the transformation matrix to reach the new rotation angle. QTransform newTransform; newTransform.translate(mAnimation->mCenterX, mAnimation->mCenterY); newTransform.rotate(mAnimation->mCurrentRotation, mAnimation->mAxis); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectrotate_p.h --- a/src/hbcore/effects/hbeffectrotate_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectrotate_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -63,10 +63,10 @@ qreal mCenterX; qreal mCenterY; bool mPosChanged; - - HbEffectFxmlParamData originXData; - HbEffectFxmlParamData originYData; - + + HbEffectFxmlParamData originXData; + HbEffectFxmlParamData originYData; + }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectscale.cpp --- a/src/hbcore/effects/hbeffectscale.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectscale.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,11 +35,11 @@ HbEffectScaleAnimation::HbEffectScaleAnimation( HbEffectGroup *group, HbEffectScale *effect, - int duration ) : - HbEffectAnimation(group), - mEffect(effect), - mCenter(0), - mCurrentScaling(1.0) + int duration) : + HbEffectAnimation(group), + mEffect(effect), + mCenter(0), + mCurrentScaling(1.0) { setDuration(duration); } @@ -75,9 +75,9 @@ const QList &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectAbstract(0, item, group), - mAnimationX(0), - mAnimationY(0) + HbEffectAbstract(0, item, group), + mAnimationX(0), + mAnimationY(0) { int durationX = 0; int durationY = 0; @@ -92,19 +92,19 @@ mCenterXValue = 0; mCenterYValue = 0; - const HbEffectFxmlParamData* paramX = 0; - const HbEffectFxmlParamData* paramY = 0; + const HbEffectFxmlParamData *paramX = 0; + const HbEffectFxmlParamData *paramY = 0; - Q_FOREACH(const HbEffectFxmlParamData ¶m, data) { - if (param.name() == FXML_KEYWORD_SCALE_X) { + Q_FOREACH(const HbEffectFxmlParamData & param, data) { + if (param.name() == FXML_KEYWORD_SCALE_X) { mKeyFrameListX = param.keyFrames(); - // for scale_x - mStartWidth = param.getAttribute(FXML_KEYWORD_START); - mStartWidthRef = param.startRef(); - // for scale_x - mEndWidth = param.getAttribute(FXML_KEYWORD_END); - mEndWidthRef = param.endRef(); - // duration and curvepath + // for scale_x + mStartWidth = param.getAttribute(FXML_KEYWORD_START); + mStartWidthRef = param.startRef(); + // for scale_x + mEndWidth = param.getAttribute(FXML_KEYWORD_END); + mEndWidthRef = param.endRef(); + // duration and curvepath HbEffectUtils::resolveFxmlDuration(durationX, param); HbEffectUtils::resolveFxmlCurveShape(curveX, param); @@ -114,15 +114,14 @@ } paramX = ¶m; - } - else if (param.name() == FXML_KEYWORD_SCALE_Y) { + } else if (param.name() == FXML_KEYWORD_SCALE_Y) { mKeyFrameListY = param.keyFrames(); - // for scale_y - mStartHeight = param.getAttribute(FXML_KEYWORD_START); - mStartHeightRef = param.startRef(); - // for scale_y - mEndHeight = param.getAttribute(FXML_KEYWORD_END); - mEndHeightRef = param.endRef(); + // for scale_y + mStartHeight = param.getAttribute(FXML_KEYWORD_START); + mStartHeightRef = param.startRef(); + // for scale_y + mEndHeight = param.getAttribute(FXML_KEYWORD_END); + mEndHeightRef = param.endRef(); HbEffectUtils::resolveFxmlDuration(durationY, param); HbEffectUtils::resolveFxmlCurveShape(curveY, param); @@ -132,22 +131,20 @@ } paramY = ¶m; - } - else if (param.name() == FXML_KEYWORD_SCALE_ORIGIN_X) { + } else if (param.name() == FXML_KEYWORD_SCALE_ORIGIN_X) { mCenterX = param.getValue(); mCenterXRef = param.getAttribute(FXML_PARAM_REF); - } - else if (param.name() == FXML_KEYWORD_SCALE_ORIGIN_Y) { + } else if (param.name() == FXML_KEYWORD_SCALE_ORIGIN_Y) { mCenterY = param.getValue(); mCenterYRef = param.getAttribute(FXML_PARAM_REF); - } + } } // Validate references. If start and end references are used, at least one of them must be a visual reference. if ((mStartWidthRef.isEmpty() || mStartWidthRef.startsWith(FXML_VISUAL) || - mEndWidthRef.isEmpty() || mEndWidthRef.startsWith(FXML_VISUAL)) && - (mStartHeightRef.isEmpty() || mStartHeightRef.startsWith(FXML_VISUAL) || - mEndHeightRef.isEmpty() || mEndHeightRef.startsWith(FXML_VISUAL))) { + mEndWidthRef.isEmpty() || mEndWidthRef.startsWith(FXML_VISUAL)) && + (mStartHeightRef.isEmpty() || mStartHeightRef.startsWith(FXML_VISUAL) || + mEndHeightRef.isEmpty() || mEndHeightRef.startsWith(FXML_VISUAL))) { // references ok } else { // Invalid references - disable effect @@ -187,7 +184,7 @@ /* deletes the effect and rewinds the animation so that next animation can star, - rewind is necessary as the general use case is that the effect is restarted before + rewind is necessary as the general use case is that the effect is restarted before being complete, in which case the rewind would transform the item and prepare for the next effect. */ @@ -224,7 +221,7 @@ // start width if (!mStartWidth.isEmpty()) { value = HbEffectUtils::resolveFxmlRef( - mStartWidthRef, mStartWidth, &valueOk, item(), HbEffectUtils::Size, extRect); + mStartWidthRef, mStartWidth, &valueOk, item(), HbEffectUtils::Size, extRect); if (valueOk) { mStartXValue = value; } @@ -240,7 +237,7 @@ // end width if (!mEndWidth.isEmpty()) { value = HbEffectUtils::resolveFxmlRef( - mEndWidthRef, mEndWidth, &valueOk, item(), HbEffectUtils::Size, extRect); + mEndWidthRef, mEndWidth, &valueOk, item(), HbEffectUtils::Size, extRect); if (valueOk) { mEndXValue = value; @@ -249,7 +246,7 @@ // end height if (!mEndHeight.isEmpty()) { value = HbEffectUtils::resolveFxmlRef( - mEndHeightRef, mEndHeight, &valueOk, item(), HbEffectUtils::Size, extRect); + mEndHeightRef, mEndHeight, &valueOk, item(), HbEffectUtils::Size, extRect); if (valueOk) { mEndYValue = value; @@ -258,14 +255,14 @@ // CenterX value = HbEffectUtils::resolveFxmlRef( - mCenterXRef, mCenterX, &valueOk, item(), HbEffectUtils::CenterMappedToTargetRect, extRect); - + mCenterXRef, mCenterX, &valueOk, item(), HbEffectUtils::CenterMappedToTargetRect, extRect); + if (valueOk) { mCenterXValue = value; } // CenterY value = HbEffectUtils::resolveFxmlRef( - mCenterYRef, mCenterY, &valueOk, item(), HbEffectUtils::CenterMappedToTargetRect, extRect); + mCenterYRef, mCenterY, &valueOk, item(), HbEffectUtils::CenterMappedToTargetRect, extRect); if (valueOk) { mCenterYValue = value; @@ -295,15 +292,15 @@ bool startEndRefUsed = !mStartWidthRef.isEmpty() && !mEndWidthRef.isEmpty(); qreal paramRefValueX = 0.0; - + // Resolve SCALE_X parameter's "ref" value only if that's needed if (!startEndRefUsed) { paramRefValueX = HbEffectUtils::resolveFxmlRef( - mParamRefX, "1", &valueOk, item(), HbEffectUtils::Size, extRect); + mParamRefX, "1", &valueOk, item(), HbEffectUtils::Size, extRect); } // Set keyframes in animation - foreach(const HbKeyFrame &kf, mKeyFrameListX) { + foreach(const HbKeyFrame & kf, mKeyFrameListX) { // If start and end references are used, // value at given step is (1-c)*startX + c*endX where c is the keyframe coefficient value @@ -342,11 +339,11 @@ // Resolve SCALE_Y parameter's "ref" value only if that's needed if (!startEndRefUsed) { paramRefValueY = HbEffectUtils::resolveFxmlRef( - mParamRefY, "1", &valueOk, item(), HbEffectUtils::Size, extRect); + mParamRefY, "1", &valueOk, item(), HbEffectUtils::Size, extRect); } // Set keyframes in animation - foreach(const HbKeyFrame &kf, mKeyFrameListY) { + foreach(const HbKeyFrame & kf, mKeyFrameListY) { // If start and end references are used, // value at given step is (1-c)*startY + c*endY where c is the keyframe coefficient value if (startEndRefUsed) { @@ -425,7 +422,7 @@ QTransform newTransform; // Handle centering for scaling the matrix newTransform.translate(mCenterXValue, mCenterYValue); - + // Get the current scaling factor from animation or use 1.0 if animation does not exist qreal currentScalingX = mAnimationX ? mAnimationX->mCurrentScaling : 1.0; qreal currentScalingY = mAnimationY ? mAnimationY->mCurrentScaling : 1.0; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectscale_p.h --- a/src/hbcore/effects/hbeffectscale_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectscale_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -77,15 +77,15 @@ QString mStartWidthRef; QString mStartHeight; QString mStartHeightRef; - QString mEndWidth; + QString mEndWidth; QString mEndWidthRef; QString mEndHeight; QString mEndHeightRef; // These are resolved from strings in init() - qreal mStartXValue; + qreal mStartXValue; qreal mStartYValue; - qreal mEndXValue; + qreal mEndXValue; qreal mEndYValue; qreal mCenterXValue; qreal mCenterYValue; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffecttranslate.cpp --- a/src/hbcore/effects/hbeffecttranslate.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffecttranslate.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -34,8 +34,8 @@ HbEffectGroup *group, HbEffectTranslate *effect, int duration) : - HbEffectAnimation(group), - effect(effect) + HbEffectAnimation(group), + effect(effect) { setDuration(duration); } @@ -65,9 +65,9 @@ const QList &data, QGraphicsItem *item, HbEffectGroup *group) : - HbEffectAbstract(0, item, group), - mAnimationX(0), - mAnimationY(0) + HbEffectAbstract(0, item, group), + mAnimationX(0), + mAnimationY(0) { // Default values if something is not passed in FXML int durationX = 0; @@ -76,43 +76,42 @@ QEasingCurve curveShapeX = QEasingCurve::Linear; QEasingCurve curveShapeY = QEasingCurve::Linear; - const HbEffectFxmlParamData* paramX = 0; - const HbEffectFxmlParamData* paramY = 0; + const HbEffectFxmlParamData *paramX = 0; + const HbEffectFxmlParamData *paramY = 0; // Handle FXML parameters - Q_FOREACH(const HbEffectFxmlParamData ¶m, data) { - if (param.name() == FXML_KEYWORD_TRANSLATION_X) { + Q_FOREACH(const HbEffectFxmlParamData & param, data) { + if (param.name() == FXML_KEYWORD_TRANSLATION_X) { mKeyFrameListX = param.keyFrames(); HbEffectUtils::resolveFxmlDuration(durationX, param); HbEffectUtils::resolveFxmlCurveShape(curveShapeX, param); - mStartXRef = param.startRef(); - mEndXRef = param.endRef(); - mStartX = param.getAttribute(FXML_KEYWORD_START); - mEndX = param.getAttribute(FXML_KEYWORD_END); + mStartXRef = param.startRef(); + mEndXRef = param.endRef(); + mStartX = param.getAttribute(FXML_KEYWORD_START); + mEndX = param.getAttribute(FXML_KEYWORD_END); // Only if "start ref" and "end ref" are not used, read parameter's "ref" attribute if (mStartXRef.isEmpty() && mEndXRef.isEmpty()) { mParamRefX = param.getAttribute(FXML_PARAM_REF); } paramX = ¶m; - } - else if (param.name() == FXML_KEYWORD_TRANSLATION_Y) { + } else if (param.name() == FXML_KEYWORD_TRANSLATION_Y) { mKeyFrameListY = param.keyFrames(); HbEffectUtils::resolveFxmlDuration(durationY, param); HbEffectUtils::resolveFxmlCurveShape(curveShapeY, param); - mStartYRef = param.startRef(); - mEndYRef = param.endRef(); - mStartY = param.getAttribute(FXML_KEYWORD_START); - mEndY = param.getAttribute(FXML_KEYWORD_END); + mStartYRef = param.startRef(); + mEndYRef = param.endRef(); + mStartY = param.getAttribute(FXML_KEYWORD_START); + mEndY = param.getAttribute(FXML_KEYWORD_END); // Only if "start ref" and "end ref" are not used, read parameter's "ref" attribute if (mStartYRef.isEmpty() && mEndYRef.isEmpty()) { mParamRefY = param.getAttribute(FXML_PARAM_REF); } paramY = ¶m; - } + } } if (durationX > 0) { @@ -130,7 +129,7 @@ } /* Deletes the effect and rewinds the animation so that next animation can start, - rewind is necessary as the general use case is that the effect is restarted before + rewind is necessary as the general use case is that the effect is restarted before being complete, in which case the rewind would transform the item and prepare for the next effect,otherwise would result in flicker. */ @@ -161,17 +160,17 @@ // StartX qreal value = HbEffectUtils::resolveFxmlRef( - mStartXRef, mStartX, &valueOk, item(), HbEffectUtils::Position, extRect); + mStartXRef, mStartX, &valueOk, item(), HbEffectUtils::Position, extRect); if (valueOk) { mStartXValue = value; } else { // Failed to resolve parameters, use item's current position. mStartXValue = item()->pos().x(); } - + // StartY value = HbEffectUtils::resolveFxmlRef( - mStartYRef, mStartY, &valueOk, item(), HbEffectUtils::Position, extRect); + mStartYRef, mStartY, &valueOk, item(), HbEffectUtils::Position, extRect); if (valueOk) { mStartYValue = value; } else { @@ -181,7 +180,7 @@ // EndX value = HbEffectUtils::resolveFxmlRef( - mEndXRef, mEndX, &valueOk, item(), HbEffectUtils::Position, extRect); + mEndXRef, mEndX, &valueOk, item(), HbEffectUtils::Position, extRect); if (valueOk) { mEndXValue = value; } else { @@ -191,7 +190,7 @@ // EndY value = HbEffectUtils::resolveFxmlRef( - mEndYRef, mEndY, &valueOk, item(), HbEffectUtils::Position, extRect); + mEndYRef, mEndY, &valueOk, item(), HbEffectUtils::Position, extRect); if (valueOk) { mEndYValue = value; } else { @@ -207,7 +206,7 @@ bool startEndRefUsed = !mStartXRef.isEmpty() && !mEndXRef.isEmpty(); // Set keyframes in animation - foreach(const HbKeyFrame &kf, mKeyFrameListX) { + foreach(const HbKeyFrame & kf, mKeyFrameListX) { // If start and end references are used, // value at given step is (1-c)*startX + c*endX where c is the keyframe coefficient value if (startEndRefUsed) { @@ -216,7 +215,7 @@ // Otherwise c defines the value else { value = HbEffectUtils::resolveFxmlRef( - mParamRefX, QString().setNum(kf.val), &valueOk, item(), HbEffectUtils::Position, extRect); + mParamRefX, QString().setNum(kf.val), &valueOk, item(), HbEffectUtils::Position, extRect); if (!valueOk) { // Default to item's position if failed value = item()->pos().x(); @@ -242,7 +241,7 @@ bool startEndRefUsed = !mStartYRef.isEmpty() && !mEndYRef.isEmpty(); // Set keyframes in animation - foreach(const HbKeyFrame &kf, mKeyFrameListY) { + foreach(const HbKeyFrame & kf, mKeyFrameListY) { // If start and end references are used, // value at given step is (1-c)*startY + c*endY where c is the keyframe coefficient value if (startEndRefUsed) { @@ -251,7 +250,7 @@ // Otherwise c defines the relative value to parameter's reference else { value = HbEffectUtils::resolveFxmlRef( - mParamRefY, QString().setNum(kf.val), &valueOk, item(), HbEffectUtils::Position, extRect); + mParamRefY, QString().setNum(kf.val), &valueOk, item(), HbEffectUtils::Position, extRect); if (!valueOk) { // Default to item's position if failed value = item()->pos().y(); @@ -271,7 +270,7 @@ } void HbEffectTranslate::setStartState(QTransform &transform) -{ +{ qreal translateX = mAnimationX ? mStartXValue - mAnimationX->originalPos : 0; qreal translateY = mAnimationY ? mStartYValue - mAnimationY->originalPos : 0; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectutils.cpp --- a/src/hbcore/effects/hbeffectutils.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectutils.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -47,7 +47,7 @@ qreal HbEffectUtils::resolveFxmlRef( const QString &ref, const QString &value, - bool* ok, + bool *ok, const QGraphicsItem *item, HbEffectUtils::valueType type, const QRectF &extRect) @@ -73,88 +73,71 @@ refValue = 0; addToPos = true; x = true; - } - else if (ref == FXML_KEYWORD_VISUAL_RIGHT) { + } else if (ref == FXML_KEYWORD_VISUAL_RIGHT) { refValue = rect.width(); addToPos = true; x = true; - } - else if (ref == FXML_KEYWORD_VISUAL_TOP) { + } else if (ref == FXML_KEYWORD_VISUAL_TOP) { refValue = 0; addToPos = true; y = true; - } - else if (ref == FXML_KEYWORD_VISUAL_BOTTOM) { + } else if (ref == FXML_KEYWORD_VISUAL_BOTTOM) { refValue = rect.height(); addToPos = true; y = true; - } - else if (ref == FXML_KEYWORD_VISUAL_WIDTH) { + } else if (ref == FXML_KEYWORD_VISUAL_WIDTH) { refValue = rect.width(); addToPos = true; x = true; - } - else if (ref == FXML_KEYWORD_VISUAL_HEIGHT) { + } else if (ref == FXML_KEYWORD_VISUAL_HEIGHT) { refValue = rect.height(); addToPos = true; y = true; - } - else { + } else { // Reference is something else than visual, so need to map to item's coordinates mapToItemCoordinates = true; srcRect = extRect; - + // Extrect values if (ref == FXML_KEYWORD_EXTRECT_LEFT) { refValue = extRect.left(); x = true; - } - else if (ref == FXML_KEYWORD_EXTRECT_RIGHT) { + } else if (ref == FXML_KEYWORD_EXTRECT_RIGHT) { refValue = extRect.right(); x = true; - } - else if (ref == FXML_KEYWORD_EXTRECT_TOP) { + } else if (ref == FXML_KEYWORD_EXTRECT_TOP) { refValue = extRect.top(); y = true; - } - else if (ref == FXML_KEYWORD_EXTRECT_BOTTOM) { + } else if (ref == FXML_KEYWORD_EXTRECT_BOTTOM) { refValue = extRect.bottom(); y = true; - } - else if (ref == FXML_KEYWORD_EXTRECT_WIDTH) { + } else if (ref == FXML_KEYWORD_EXTRECT_WIDTH) { refValue = extRect.width(); x = true; - } - else if (ref == FXML_KEYWORD_EXTRECT_HEIGHT) { + } else if (ref == FXML_KEYWORD_EXTRECT_HEIGHT) { refValue = extRect.height(); y = true; - } - else { - // Screen values - QSize screenSize = HbDeviceProfile::profile(item).logicalSize(); - srcRect = QRectF(QPointF(0,0), screenSize); + } else { + // Screen values + QSize screenSize = HbDeviceProfile::profile(item).logicalSize(); + srcRect = QRectF(QPointF(0, 0), screenSize); if (ref == FXML_KEYWORD_SCREEN_LEFT) { refValue = 0; x = true; - } - else if (ref == FXML_KEYWORD_SCREEN_RIGHT) { + } else if (ref == FXML_KEYWORD_SCREEN_RIGHT) { refValue = screenSize.width(); x = true; - } - else if (ref == FXML_KEYWORD_SCREEN_TOP) { + } else if (ref == FXML_KEYWORD_SCREEN_TOP) { refValue = 0; y = true; - } - else if (ref == FXML_KEYWORD_SCREEN_BOTTOM) { + } else if (ref == FXML_KEYWORD_SCREEN_BOTTOM) { refValue = screenSize.height(); y = true; - } - else if (ref == FXML_KEYWORD_SCREEN_WIDTH) { + } else if (ref == FXML_KEYWORD_SCREEN_WIDTH) { refValue = screenSize.width(); x = true; - } - else if (ref == FXML_KEYWORD_SCREEN_HEIGHT) { + } else if (ref == FXML_KEYWORD_SCREEN_HEIGHT) { refValue = screenSize.height(); y = true; } @@ -176,8 +159,7 @@ if (addToPos && type == HbEffectUtils::Position) { if (x) { refValue += item->pos().x(); - } - else { + } else { refValue += item->pos().y(); } } @@ -200,26 +182,28 @@ } } } - + // Convert to item size units if needed if (type == HbEffectUtils::Size) { if (x) { - if (!fuzzyIsNull(rect.width())) + if (!fuzzyIsNull(rect.width())) { refValue /= rect.width(); - else + } else { refValue = 0; + } } else if (y) { - if (!fuzzyIsNull(rect.height())) + if (!fuzzyIsNull(rect.height())) { refValue /= rect.height(); - else + } else { refValue = 0; - } + } + } } // This operation is needed e.g. when scale is done from some other rect to target rect if (type == HbEffectUtils::CenterMappedToTargetRect && mapToItemCoordinates) { QPointF scenePos = item->scenePos(); - // If the item is already translated, have to substract that to get correct result + // If the item is already translated, have to subtract that to get correct result QTransform trans = item->transform(); qreal dx = trans.dx(); qreal dy = trans.dy(); @@ -249,7 +233,7 @@ qreal HbEffectUtils::resolveFxmlRef( - const HbEffectFxmlParamData &data, bool* ok, const QGraphicsItem *item, HbEffectUtils::valueType type, const QRectF &extRect) + const HbEffectFxmlParamData &data, bool *ok, const QGraphicsItem *item, HbEffectUtils::valueType type, const QRectF &extRect) { return HbEffectUtils::resolveFxmlRef(data.getAttribute(FXML_PARAM_REF), data.getValue(), ok, item, type, extRect); } @@ -261,32 +245,24 @@ if (!style.isEmpty()) { if (style == FXML_KEYWORD_STYLE_LINEAR) { curve = QEasingCurve::Linear; - } - else if (style == FXML_KEYWORD_STYLE_INQUAD) { + } else if (style == FXML_KEYWORD_STYLE_INQUAD) { curve = QEasingCurve::InQuad; - } - else if (style == FXML_KEYWORD_STYLE_OUTQUAD) { + } else if (style == FXML_KEYWORD_STYLE_OUTQUAD) { curve = QEasingCurve::OutQuad; - } - else if (style == FXML_KEYWORD_STYLE_INOUTQUAD) { + } else if (style == FXML_KEYWORD_STYLE_INOUTQUAD) { curve = QEasingCurve::InOutQuad; - } - else if (style == FXML_KEYWORD_STYLE_OUTINQUAD) { + } else if (style == FXML_KEYWORD_STYLE_OUTINQUAD) { curve = QEasingCurve::OutInQuad; - } - else if (style == FXML_KEYWORD_STYLE_INBACK) { + } else if (style == FXML_KEYWORD_STYLE_INBACK) { curve = QEasingCurve::InBack; - } - else if (style == FXML_KEYWORD_STYLE_OUTBACK) { + } else if (style == FXML_KEYWORD_STYLE_OUTBACK) { curve = QEasingCurve::OutBack; - } - else if (style == FXML_KEYWORD_STYLE_INOUTBACK) { + } else if (style == FXML_KEYWORD_STYLE_INOUTBACK) { curve = QEasingCurve::InOutBack; - } - else if (style == FXML_KEYWORD_STYLE_OUTINBACK) { + } else if (style == FXML_KEYWORD_STYLE_OUTINBACK) { curve = QEasingCurve::OutInBack; } - } + } } void HbEffectUtils::resolveFxmlDuration(int &duration, const HbEffectFxmlParamData &data) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectutils_p.h --- a/src/hbcore/effects/hbeffectutils_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectutils_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -50,14 +50,14 @@ static qreal resolveFxmlRef( const QString &ref, const QString &value, - bool* ok, + bool *ok, const QGraphicsItem *item, valueType type, const QRectF &extRect = QRectF()); static qreal resolveFxmlRef( const HbEffectFxmlParamData &data, - bool* ok, + bool *ok, const QGraphicsItem *item, valueType type, const QRectF &extRect = QRectF()); @@ -66,24 +66,20 @@ static void resolveFxmlDuration(int &duration, const HbEffectFxmlParamData &data); - static inline bool fuzzyIsNull(double d) - { - return qAbs(d) <= 0.000000000001; + static inline bool fuzzyIsNull(double d) { + return qAbs(d) <= 0.000000000001; } - static inline bool fuzzyIsNull(float f) - { - return qAbs(f) <= 0.00001f; + static inline bool fuzzyIsNull(float f) { + return qAbs(f) <= 0.00001f; } - static inline bool fuzzyIsOneOrGreater(double d) - { - return d >= 1.0 - 0.000000000001; + static inline bool fuzzyIsOneOrGreater(double d) { + return d >= 1.0 - 0.000000000001; } - static inline bool fuzzyIsOneOrGreater(float f) - { - return f >= 1.0f - 0.00001f; + static inline bool fuzzyIsOneOrGreater(float f) { + return f >= 1.0f - 0.00001f; } }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectxmlparser.cpp --- a/src/hbcore/effects/hbeffectxmlparser.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectxmlparser.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -46,7 +46,7 @@ Constructor. */ HbEffectXmlParser::HbEffectXmlParser() - :mFxmlData(0) + : mFxmlData(0) { } @@ -74,7 +74,7 @@ qWarning("HbEffectXmlParser: Document element is invalid (not "); raiseError("HbEffectXmlParser::read The document is not an valid effect definitions document."); } - } + } } if (error()) { @@ -141,8 +141,9 @@ readNext(); if (isEndElement()) { - if (name() == FXML_LAYERS) + if (name() == FXML_LAYERS) { break; + } } if (isStartElement()) { @@ -152,14 +153,11 @@ else if (name() == FXML_LAYERGROUP) { // Not needed - } - else if (name() == FXML_BLENDING) { + } else if (name() == FXML_BLENDING) { readBlendingElement(); - } - else if (name() == FXML_COMMENT) { + } else if (name() == FXML_COMMENT) { // Comments are skipped - } - else if (name() == FXML_FILTER) { + } else if (name() == FXML_FILTER) { #ifdef HB_FILTER_EFFECTS readFilterData(); #endif @@ -186,13 +184,11 @@ if (isStartElement()) { if (name() == FXML_PARAM) { mFxmlData->appendParamData(readParamData()); - } - else if (name() == FXML_FILTER) { + } else if (name() == FXML_FILTER) { #ifdef HB_FILTER_EFFECTS readFilterData(); #endif - } - else { + } else { readUnknownElement(); } } @@ -211,7 +207,7 @@ // Parse filter type QXmlStreamAttributes attrs = attributes(); - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { // "type" = ... if (attr.name().toString() == FXML_PARAM_TYPE) { filterData.setType(attr.value().toString()); @@ -247,18 +243,18 @@ // This parses information inside one field. // E.g. "scale_x", "scale_y", "scale_origin_x" -// +// HbEffectFxmlParamData HbEffectXmlParser::readParamData() { Q_ASSERT(isStartElement() && name() == FXML_PARAM); - + HbEffectFxmlParamData param(mFxmlData->memoryType()); HbKeyFrame kf(mFxmlData->memoryType()); QXmlStreamAttributes attrs = attributes(); // Populate the PARAM attributes - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { // "name" = ... if (attr.name().toString() == FXML_PARAM_NAME) { param.setName(attr.value().toString()); @@ -293,7 +289,7 @@ // tag else if (name() == FXML_MARKER) { QXmlStreamAttributes attrs = attributes(); - + enum { Undefined = 0, Start, @@ -301,7 +297,7 @@ } loopType = Undefined; // Fetch "type" attribute from tag - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { if (attr.name().toString() == FXML_PARAM_TYPE) { QString s = attr.value().toString(); if (s == FXML_LOOP_START) { @@ -315,7 +311,7 @@ if (loopType != Undefined) { // Fetch "at" attribute from tag - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { if (attr.name().toString() == FXML_PARAM_AT) { QString s = attr.value().toString(); bool ok = false; @@ -343,11 +339,11 @@ // tag else if (name() == FXML_KEYFRAME) { QXmlStreamAttributes attrs = attributes(); - + bool ok = false; // Fetch "at" attribute from tag - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { if (attr.name().toString() == FXML_PARAM_AT) { QString s = attr.value().toString(); kf.pos = s.toFloat(&ok); @@ -373,27 +369,26 @@ } } // element - else if(name() == FXML_KEYWORD_START) { + else if (name() == FXML_KEYWORD_START) { QXmlStreamAttributes attrs = attributes(); - foreach (const QXmlStreamAttribute &attr, attrs) { - if( attr.name() == FXML_PARAM_REF ) { + foreach(const QXmlStreamAttribute & attr, attrs) { + if (attr.name() == FXML_PARAM_REF) { param.setStartRef(attr.value().toString()); } } param.setAttribute(FXML_KEYWORD_START, readElementText()); } // element - else if(name() == FXML_KEYWORD_END) { + else if (name() == FXML_KEYWORD_END) { QXmlStreamAttributes attrs = attributes(); - foreach (const QXmlStreamAttribute &attr, attrs) { - if( attr.name() == FXML_PARAM_REF ) { + foreach(const QXmlStreamAttribute & attr, attrs) { + if (attr.name() == FXML_PARAM_REF) { param.setEndRef(attr.value().toString()); } } param.setAttribute(FXML_KEYWORD_END, readElementText()); - } - else { + } else { readUnknownElement(); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/effects/hbeffectxmlparser_p.h --- a/src/hbcore/effects/hbeffectxmlparser_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/effects/hbeffectxmlparser_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -51,8 +51,8 @@ void readFilterData(); void readBlendingElement(); - HbEffectFxmlParamData readParamData(); - + HbEffectFxmlParamData readParamData(); + private: HbEffectFxmlData *mFxmlData; QString mCurrentBlending; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/feedback/hbfeedbackplugingroup.cpp --- a/src/hbcore/feedback/hbfeedbackplugingroup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/feedback/hbfeedbackplugingroup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -123,8 +123,8 @@ foreach (const QFileInfo &driveInfo, driveInfoList) { const QString drive = driveInfo.absolutePath(); - if (drive.startsWith("z:", Qt::CaseInsensitive) || - drive.startsWith("c:", Qt::CaseInsensitive)) { + if (drive.startsWith(QLatin1String("z:"), Qt::CaseInsensitive) || + drive.startsWith(QLatin1String("c:"), Qt::CaseInsensitive)) { QString path(drive + pluginRelativePath); pluginPathList << path; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbgesturerecognizers_p.cpp --- a/src/hbcore/gestures/hbgesturerecognizers_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbgesturerecognizers_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,6 +33,7 @@ #include #include +#include //#define RECOGNIZERS_DEBUG #ifdef RECOGNIZERS_DEBUG @@ -116,9 +117,8 @@ \return */ -HbTapGestureRecognizer::HbTapGestureRecognizer(int tapRadius) -{ - HbTapGestureLogic::mTapRadius = tapRadius; +HbTapGestureRecognizer::HbTapGestureRecognizer() +{ DEBUG() << "Creating HbTapGestureRecognizer" << this; } @@ -140,7 +140,7 @@ */ QGesture* HbTapGestureRecognizer::create(QObject *) -{ +{ return new HbTapGesture; } @@ -182,12 +182,11 @@ \return */ -HbTapAndHoldGestureRecognizer::HbTapAndHoldGestureRecognizer(int tapRadius) +HbTapAndHoldGestureRecognizer::HbTapAndHoldGestureRecognizer() : QGestureRecognizer(), HbTapAndHoldGestureLogic() -{ - HbTapAndHoldGestureLogic::mTapRadius = tapRadius; +{ DEBUG() << "Creating HbTapAndHoldGestureRecognizer" << this; } @@ -209,7 +208,7 @@ */ QGesture* HbTapAndHoldGestureRecognizer::create(QObject *) -{ +{ return new HbTapAndHoldGesture; } @@ -273,8 +272,14 @@ \return */ -QGesture* HbPinchGestureRecognizer::create(QObject *) +QGesture* HbPinchGestureRecognizer::create(QObject *target) { + if (target && target->isWidgetType()) { + static_cast(target)->setAttribute(Qt::WA_AcceptTouchEvents); + } + if (QGraphicsObject *o = qobject_cast(target)){ + o->setAcceptTouchEvents(true); + } return new HbPinchGesture; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbgesturerecognizers_p.h --- a/src/hbcore/gestures/hbgesturerecognizers_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbgesturerecognizers_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,7 +49,7 @@ class HB_CORE_PRIVATE_EXPORT HbTapGestureRecognizer : public QGestureRecognizer, public HbTapGestureLogic { public: - explicit HbTapGestureRecognizer(int tapRadius = HbDefaultTapRadius); + explicit HbTapGestureRecognizer(); virtual ~HbTapGestureRecognizer(); QGesture* create(QObject *); @@ -60,7 +60,7 @@ class HB_CORE_PRIVATE_EXPORT HbTapAndHoldGestureRecognizer : public QGestureRecognizer, public HbTapAndHoldGestureLogic { public: - explicit HbTapAndHoldGestureRecognizer(int tapRadius = HbDefaultTapRadius); + explicit HbTapAndHoldGestureRecognizer(); virtual ~HbTapAndHoldGestureRecognizer(); QGesture* create(QObject *); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbgestures_p.h --- a/src/hbcore/gestures/hbgestures_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbgestures_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,11 +30,20 @@ #include #include -const int HbDefaultPanThreshold = 30; -const int HbDefaultTapRadius = HbDefaultPanThreshold-1; +const qreal HbDefaultPanThreshold = 1.0; // mm +const qreal HbPanVelocityUpdateThreshold = 3.3; // mm + +const qreal HbDefaultTapRadius = 3.3; //mm -const qreal HbSwipeMinOffset = 100; -const qreal HbSwipeMinSpeed = 0.8; +const qreal HbSwipeMinOffset = 7.5; // mm +const qreal HbSwipeMinSpeed = 0.06; // mm / ms + +const int HbVelocitySampleTime = 80; // ms +const int HbVelocityStopTime = 70; // ms + +const int HbTapAndHoldTriggerTimeout = 150; // ms +const int HbTapAndHoldTimeout = 500; // ms + class HbGestureUtils { @@ -55,7 +64,7 @@ } return QPointF(); - } + } }; #endif // HBGESTURES_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbpangesture.cpp --- a/src/hbcore/gestures/hbpangesture.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbpangesture.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,12 +36,92 @@ @hbcore \class HbPanGesture - \brief HbPanGesture is an extension to Qt standard QPanGesture + \brief The HbPanGesture class provides support for receiving a dragging + (pan) gesture. + + HbPanGesture is an extension to the Qt standard QPanGesture. It is + optimized for mobile touch screens, and also supports recognition of + mouse events for development purposes. Moreover, HbPanGesture + adds some new properties (startPos and velocity) to the existing + QPanGesture properties, and also provides variants of all these expressed + in scene coordinates. This removes any need for manual conversions from + the screen (global) coordinates of the QPanGesture base class properties. + + A pan gesture is used in situations where the user drags content to a new + position. Make sure your application gives instant feedback to the user + with each gesture update by moving the content, not only when the gesture + is finished. + + \section _usecases_hbpangesture Using the HbPanGesture class + + This example shows how to make a custom widget recognize the pan + gesture. The custom widget in the example derives from HbWidget. + +
    +
  1. + Register for pan gestures by using the base class function + QGraphicsObject::grabGesture(). QGraphicsObject::grabGesture() can be + called several times with different arguments, if the widget is + interested in other gesture types as well. + + \code + // This widget is interested in pan and tap gestures. + grabGesture(Qt::PanGesture); + grabGesture(Qt::TapGesture); + \endcode +
  2. + +
  3. + Reimplement HbWidgetBase::gestureEvent() to handle gestures that are + meaningful for your custom widget. + + \code + void MyWidget::gestureEvent(QGestureEvent *event) + { + if (HbPanGesture *pan = qobject_cast + (event->gesture(Qt::PanGesture))) { + + switch (pan->state()) { + + case Qt::GestureStarted: + // Visualize the active state of the widget. + // Emit a signal to move the content + break; + case Qt::GestureUpdated: + // Emit a signal to move the content. + break; + case Qt::GestureCanceled: + // Visualize the non-active state of the widget. + // Emit a signal to return the content to the starting + // position. + break; + case Qt::GestureFinished: + // Visualize the non-active state of the widget. + // Emit a signal to move the content. + break; + default: + break; + } + } + + // Handle other gesture types that have been grabbed. There may be + // several, since all gestures that are active at the same moment + // are sent within the same gesture event. + if (HbTapGesture *tap = qobject_cast + (event->gesture(Qt::TapGesture))) { + // handle the tap gesture + } + + } + \endcode +
  4. +
+ \sa QPanGesture */ /*! - \brief HbPanGesture constructor + Constructor. \param parent Owner for gesture */ @@ -51,7 +131,7 @@ } /*! - \brief HbPanGesture constructor + Constructor required by the shared d-pointer paradigm. \param dd Private data \param parent Owner for gesture @@ -63,7 +143,7 @@ } /*! - \brief HbPanGesture destructor + Destructor. */ HbPanGesture::~HbPanGesture() { @@ -71,9 +151,8 @@ } /*! - \property startPos - \brief Starting position for gesture in global coordinates. - \sa HbPanGesture::sceneStartPos + Returns the starting position for the gesture in global coordinates. + \sa setStartPos(), sceneStartPos() */ QPointF HbPanGesture::startPos() const { @@ -81,6 +160,12 @@ return d->mStartPos; } +/*! + Sets the starting position for the gesture in global coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa startPos(), setSceneStartPos() +*/ void HbPanGesture::setStartPos(const QPointF &startPos) { Q_D(HbPanGesture); @@ -88,9 +173,9 @@ } /*! - \property velocity - \brief Panning velocity in global coordinates. - \sa HbPanGesture::sceneVelocity + Returns the panning velocity in global coordinates. + The unit is pixels per millisecond. + \sa setVelocity(), sceneVelocity() */ QPointF HbPanGesture::velocity() const { @@ -98,15 +183,21 @@ return HbVelocityCalculator( d->mAxisX, d->mAxisY ).velocity(QTime::currentTime()); } +/*! + Sets the panning velocity in global coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa velocity() +*/ void HbPanGesture::setVelocity(const QPointF &) { Q_ASSERT(false); } /*! - \property sceneLastOffset - \brief The total offset from start position to second last position in scene coordinates. - \sa QPanGesture::lastOffset() + Returns the total offset from start position to second last position + in scene coordinates. + \sa setSceneLastOffset(), QPanGesture::lastOffset() */ QPointF HbPanGesture::sceneLastOffset() const { @@ -114,6 +205,13 @@ return d->mSceneLastOffset; } +/*! + Sets the total offset from start position to second last position + in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneLastOffset(), QPanGesture::setLastOffset() +*/ void HbPanGesture::setSceneLastOffset(const QPointF &lastOffset) { Q_D(HbPanGesture); @@ -121,9 +219,9 @@ } /*! - \property sceneOffset - \brief The total offset from start position to current position in scene coordinates. - \sa QPanGesture::offset() + Returns the total offset from start position to current position + in scene coordinates. + \sa setSceneOffset(), QPanGesture::offset() */ QPointF HbPanGesture::sceneOffset() const { @@ -131,6 +229,13 @@ return d->mSceneOffset; } +/*! + Sets the total offset from start position to current position + in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneOffset(), QPanGesture::setOffset() +*/ void HbPanGesture::setSceneOffset(const QPointF &offset) { Q_D(HbPanGesture); @@ -138,9 +243,8 @@ } /*! - \property sceneStartPos - \brief Starting position for gesture in scene coordinates. - \sa HbPanGesture::startPos() + Returns the starting position for the gesture in scene coordinates. + \sa setSceneStartPos(), startPos() */ QPointF HbPanGesture::sceneStartPos() const { @@ -148,6 +252,12 @@ return d->mSceneStartPos; } +/*! + Sets the starting position for the gesture in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneStartPos(), setStartPos() +*/ void HbPanGesture::setSceneStartPos(const QPointF &startPos) { Q_D(HbPanGesture); @@ -155,9 +265,9 @@ } /*! - \property sceneVelocity - \brief Panning velocity in scene coordinates. - \sa HbPanGesture::velocity() + Returns the panning velocity in scene coordinates. + The unit is pixels per millisecond. + \sa velocity() */ QPointF HbPanGesture::sceneVelocity() const { @@ -166,8 +276,7 @@ } /*! - \property sceneAcceleration - \brief Panning acceleration in scene coordinates. + Returns the panning acceleration in scene coordinates. \sa QPanGesture::acceleration() */ QPointF HbPanGesture::sceneAcceleration() const @@ -176,8 +285,7 @@ } /*! - \property sceneDelta - \brief Distance between last two points in scene coordinates. + Returns the distance between the last two points in scene coordinates. \sa QPanGesture::delta() */ QPointF HbPanGesture::sceneDelta() const diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbpangesture_p.h --- a/src/hbcore/gestures/hbpangesture_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbpangesture_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -59,6 +59,8 @@ HbPointRecorder mAxisY; HbPointRecorder mSceneAxisX; HbPointRecorder mSceneAxisY; + + qreal mThresholdSquare; }; #endif // HBPANGESTURE_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbpangesturelogic_p.cpp --- a/src/hbcore/gestures/hbpangesturelogic_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbpangesturelogic_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,12 +27,14 @@ #include #include #include +#include + +#include #include "hbpangesture.h" #include "hbpangesture_p.h" #include "hbpangesturelogic_p.h" - -const int KPanThreshold = 20; +#include "hbnamespace_p.h" /*! @hbcore @@ -123,11 +125,17 @@ gesture->d_ptr->mSceneOffset = HbGestureUtils::mapToScene(watched, QPointF(0,0)); gesture->d_ptr->mSceneLastOffset = HbGestureUtils::mapToScene(watched, QPointF(0,0)); gesture->d_ptr->mLastTimeStamp = mCurrentTime; - - gesture->d_ptr->mAxisX.resetRecorder(HbDefaultPanThreshold); - gesture->d_ptr->mAxisY.resetRecorder(HbDefaultPanThreshold); - gesture->d_ptr->mSceneAxisX.resetRecorder(HbDefaultPanThreshold); - gesture->d_ptr->mSceneAxisY.resetRecorder(HbDefaultPanThreshold); + + + gesture->d_ptr->mThresholdSquare = HbDefaultPanThreshold * HbDeviceProfile::current().ppmValue(); + gesture->d_ptr->mThresholdSquare = gesture->d_ptr->mThresholdSquare * gesture->d_ptr->mThresholdSquare; + + qreal velocityThreshold = HbPanVelocityUpdateThreshold * HbDeviceProfile::current().ppmValue(); + + gesture->d_ptr->mAxisX.resetRecorder(velocityThreshold); + gesture->d_ptr->mAxisY.resetRecorder(velocityThreshold); + gesture->d_ptr->mSceneAxisX.resetRecorder(velocityThreshold); + gesture->d_ptr->mSceneAxisY.resetRecorder(velocityThreshold); gesture->d_ptr->mAxisX.record( me->globalPos().x(), mCurrentTime ); gesture->d_ptr->mAxisY.record( me->globalPos().y(), mCurrentTime ); gesture->d_ptr->mSceneAxisX.record( scenePos.x(), mCurrentTime ); @@ -155,8 +163,16 @@ QPointF offset = me->globalPos() - gesture->startPos().toPoint(); - if (gestureState == Qt::NoGesture && offset.manhattanLength() <= KPanThreshold ) - { + QGraphicsView* view = qobject_cast(watched->parent()); + if (view) { + QGraphicsScene* scene = view->scene(); + if (scene && scene->property(HbPrivate::OverridingGesture.latin1()).isValid() && + scene->property(HbPrivate::OverridingGesture.latin1()).toInt() != Qt::PanGesture) { + return QGestureRecognizer::MayBeGesture; + } + } + + if (gestureState == Qt::NoGesture && (offset.x() * offset.x() + offset.y() * offset.y()) <= gesture->d_ptr->mThresholdSquare) { return QGestureRecognizer::MayBeGesture; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbpinchgesture.cpp --- a/src/hbcore/gestures/hbpinchgesture.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbpinchgesture.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,12 +31,106 @@ @hbcore \class HbPinchGesture - \brief HbPinchGesture is an extension to Qt standard QPinchGesture + \brief The HbPinchGesture class provides multitouch support. + + HbPinchGesture is an extension to Qt standard QPinchGesture. It offers + convenience functions for handling the pinch gesture properties directly + in scene coordinates. This removes any need for manual conversions from + the screen (global) coordinates of the QPinchGesture base class + properties. + + You can use HbPinchGesture, for example, to let the user change an + image size in a photo application by dragging the two opposing corners + of the image at the same time. Another example would be rotating a widget + with two fingers. + + \section _usecases_hbpinchgesture Using the HbPinchGesture class + + This example shows how to make a custom widget recognize the pinch + gesture. The custom widget in the example derives from HbWidget. + +
    +
  1. + In order to receive touch events, which are required by the pinch gesture, + at least one widget in the scene needs to accept the QEvent::TouchBegin event. + To make sure this is done, you can do this in your widget by reimplementing + QGraphicsWidget::event(). + + \code + bool MyWidget::event(QEvent *e) + { + if (e->type() == QEvent::TouchBegin) { + return true; + } + return HbWidget::event(e); + } + \endcode +
  2. + +
  3. + Register for pinch gestures by using the base class function + QGraphicsObject::grabGesture(). QGraphicsObject::grabGesture() can be + called several times with different arguments, if the widget is + interested in other gesture types as well. + + \code + // This widget is interested in pinch and tap gestures. + grabGesture(Qt::PinchGesture); + grabGesture(Qt::TapGesture); + \endcode +
  4. + +
  5. + Reimplement HbWidgetBase::gestureEvent() to handle gestures that are + meaningful for your custom widget. + + \code + void MyWidget::gestureEvent(QGestureEvent *event) + { + if (HbPinchGesture *pinch = qobject_cast + (event->gesture(Qt::PinchGesture))) { + + switch (pinch->state()) { + + case Qt::GestureStarted: + // Visualize the active state of the widget. + // Emit a signal to move the content. + break; + case Qt::GestureUpdated: + // Emit a signal to move the content. + break; + case Qt::GestureCanceled: + // Visualize the non-active state of the widget. + // Emit a signal to return the content to the starting + // position. + break; + case Qt::GestureFinished: + // Visualize the non-active state of the widget. + // Emit a signal to move the content. + break; + default: + break; + } + } + + // Handle other gesture types that have been grabbed. There may be several, + // since all gestures that are active at the same moment are sent within + // the same gesture event. + if (HbTapGesture *tap = qobject_cast + (event->gesture(Qt::TapGesture))) { + // handle the tap gesture + } + + } + \endcode +
  6. +
+ \sa QPinchGesture */ /*! - \brief HbPinchGesture constructor + Constructor. \param parent Owner for gesture */ HbPinchGesture::HbPinchGesture(QObject *parent) @@ -50,7 +144,7 @@ } /*! - \brief HbPinchGesture constructor + Constructor required by the shared d-pointer paradigm. \param dd Private data \param parent Owner for gesture */ @@ -64,7 +158,7 @@ } /*! - \brief HbPinchGesture destructor + Destructor. */ HbPinchGesture::~HbPinchGesture() { @@ -72,9 +166,8 @@ } /*! - \property sceneTotalRotationAngle - \brief The total angle covered by the gesture in scene coordinates. - \sa QPinchGesture::totalRotationAngle() + Returns the total angle covered by the gesture in scene coordinates. + \sa setSceneTotalRotationAngle(), QPinchGesture::totalRotationAngle() */ qreal HbPinchGesture::sceneTotalRotationAngle() const { @@ -82,6 +175,12 @@ return d->mSceneTotalRotationAngle; } +/*! + Sets the total angle covered by the gesture in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneTotalRotationAngle(), QPinchGesture::setTotalRotationAngle() +*/ void HbPinchGesture::setSceneTotalRotationAngle(qreal value) { Q_D(HbPinchGesture); @@ -89,9 +188,9 @@ } /*! - \property sceneLastRotationAngle - \brief The last reported angle covered by the gesture motion in scene coordinates. - \sa QPinchGesture::lastRotationAngle() + Returns the last reported angle covered by the gesture in scene + coordinates. + \sa setSceneLastRotationAngle(), QPinchGesture::lastRotationAngle() */ qreal HbPinchGesture::sceneLastRotationAngle() const { @@ -99,6 +198,12 @@ return d->mSceneLastRotationAngle; } +/*! + Sets the last reported angle covered by the gesture in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneLastRotationAngle(), QPinchGesture::setLastRotationAngle() +*/ void HbPinchGesture::setSceneLastRotationAngle(qreal value) { Q_D(HbPinchGesture); @@ -106,9 +211,9 @@ } /*! - \property sceneRotationAngle - \brief The angle covered by the gesture motion in scene coordinates. - \sa QPinchGesture::rotationAngle() + Returns the angle covered by the gesture since last update + in scene coordinates. + \sa setSceneRotationAngle(), QPinchGesture::rotationAngle() */ qreal HbPinchGesture::sceneRotationAngle() const { @@ -116,6 +221,13 @@ return d->mSceneRotationAngle; } +/*! + Sets the angle covered by the gesture since last update + in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneRotationAngle(), QPinchGesture::setRotationAngle() +*/ void HbPinchGesture::setSceneRotationAngle(qreal value) { Q_D(HbPinchGesture); @@ -123,9 +235,8 @@ } /*! - \property sceneStartCenterPoint - \brief The starting position of the center point in scene coordinates. - \sa QPinchGesture::startCenterPoint() + Returns the starting position of the center point in scene coordinates. + \sa setSceneStartCenterPoint(), QPinchGesture::startCenterPoint() */ QPointF HbPinchGesture::sceneStartCenterPoint() const { @@ -133,6 +244,12 @@ return d->mSceneStartCenterPoint; } +/*! + Sets the starting position of the center point in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneStartCenterPoint(), QPinchGesture::setStartCenterPoint() +*/ void HbPinchGesture::setSceneStartCenterPoint(const QPointF &value) { Q_D(HbPinchGesture); @@ -140,9 +257,9 @@ } /*! - \property sceneLastCenterPoint - \brief The last position of the center point recorded for this gesture in scene coordinates. - \sa QPinchGesture::lastCenterPoint() + Returns the last position of the center point recorded for the gesture + in scene coordinates. + \sa setSceneLastCenterPoint(), QPinchGesture::lastCenterPoint() */ QPointF HbPinchGesture::sceneLastCenterPoint() const { @@ -150,6 +267,13 @@ return d->mSceneLastCenterPoint; } +/*! + Sets the last position of the center point recorded for the gesture + in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneLastCenterPoint(), QPinchGesture::setLastCenterPoint() +*/ void HbPinchGesture::setSceneLastCenterPoint(const QPointF &value) { Q_D(HbPinchGesture); @@ -157,9 +281,8 @@ } /*! - \property sceneCenterPoint - \brief The current center point in scene coordinates. - \sa QPinchGesture::centerPoint() + Returns the current center point in scene coordinates. + \sa setSceneCenterPoint(), QPinchGesture::centerPoint() */ QPointF HbPinchGesture::sceneCenterPoint() const { @@ -167,6 +290,12 @@ return d->mSceneCenterPoint; } +/*! + Sets the current center point in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneCenterPoint(), QPinchGesture::setCenterPoint() +*/ void HbPinchGesture::setSceneCenterPoint(const QPointF &value) { Q_D(HbPinchGesture); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbpinchgesturelogic_p.cpp --- a/src/hbcore/gestures/hbpinchgesturelogic_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbpinchgesturelogic_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -122,6 +122,10 @@ { HbPinchGesturePrivate *d = gesture->d_func(); + if (!watched->isWidgetType()) { + return QGestureRecognizer::Ignore; + } + const QTouchEvent *ev = static_cast(event); QGestureRecognizer::Result result; @@ -155,17 +159,7 @@ if (d->mIsNewSequence) { gesture->setStartCenterPoint(centerPoint); d->mSceneStartCenterPoint = mapToScene(watched, centerPoint); - } - else { - QLineF line1(p1.screenPos(), p1.lastScreenPos()); - QLineF line2(p2.screenPos(), p2.lastScreenPos()); - if (line1.length() < 3 && line2.length() < 3) { - result = QGestureRecognizer::Ignore; - break; - } - } - gesture->setLastCenterPoint(gesture->centerPoint()); d->mSceneLastCenterPoint = mapToScene(watched, gesture->centerPoint()); gesture->setCenterPoint(centerPoint); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbswipegesture.cpp --- a/src/hbcore/gestures/hbswipegesture.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbswipegesture.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -34,14 +34,86 @@ @hbcore \class HbSwipeGesture - \brief HbSwipeGesture is an extension to Qt standard HbSwipeGesture + \brief The HbSwipeGesture class provides support for receiving a swipe + (flick) gesture. + + HbSwipeGesture is an extension to Qt standard QSwipeGesture. It is + optimized for mobile touch screens, and also supports recognition of + mouse events for development purposes. Moreover, HbSwipeGesture + has convenience functions for handling the QSwipeGesture properties + (horizontalDirection, verticalDirection, swipeAngle) directly in scene + coordinates. They remove the need for any manual conversions from the + screen (global) coordinates offered by the QSwipeGesture base class + properties. + + The swipe gesture is designed to be used as a single-shot gesture which + is activated after a flick and release. No events are sent until the + gesture is finished. Swipe should be used when feedback during the + gesture is not possible or desired. + + \section _usecases_hbswipegesture Using the HbSwipeGesture class + + This example shows how to make a custom widget recognize the swipe + gesture. The custom widget in the example derives from HbWidget. + +
    +
  1. + Register for swipe gestures by using the base class function + QGraphicsObject::grabGesture(). QGraphicsObject::grabGesture() can be + called several times with different arguments, if the widget is + interested in other gesture types as well. + + \code + // This widget is interested in swipe and tap gestures. + grabGesture(Qt::SwipeGesture); + grabGesture(Qt::TapGesture); + \endcode +
  2. + +
  3. + Reimplement HbWidgetBase::gestureEvent() to handle gestures that are + meaningful for your custom widget. + + \code + void MyWidget::gestureEvent(QGestureEvent *event) + { + if (HbSwipeGesture *swipe = qobject_cast + (event->gesture(Qt::SwipeGesture))) { + + switch (swipe->state()) { + + case Qt::GestureStarted: // fall-through + case Qt::GestureUpdated: // fall-through + case Qt::GestureCanceled: + break; + case Qt::GestureFinished: + // Emit a signal to show the swipe movement. + break; + default: + break; + } + } + + // Handle other gesture types that have been grabbed. There may be + // several, since all gestures that are active at the same moment + // are sent within the same gesture event. + if (HbTapGesture *tap = qobject_cast + (event->gesture(Qt::TapGesture))) { + // handle the tap gesture + } + + } + \endcode +
  4. +
+ \sa QSwipeGesture */ const int KHbDirectionThreshold = 45; // degrees /*! - \brief HbSwipeGesture constructor + Constructor. \param parent Owner for gesture */ HbSwipeGesture::HbSwipeGesture(QObject *parent) @@ -52,7 +124,7 @@ } /*! - \brief HbSwipeGesture constructor + Constructor required by the shared d-pointer paradigm. \param dd Private data \param parent Owner for gesture */ @@ -63,7 +135,7 @@ } /*! - \brief HbSwipeGesture destructor + Destructor. */ HbSwipeGesture::~HbSwipeGesture() { @@ -71,8 +143,8 @@ } /*! - \property sceneHorizontalDirection - \brief Horizontal direction of swipe in scene coordinates. + Returns the horizontal direction of the swipe gesture + relative to scene coordinates. \sa QSwipeGesture::horizontalDirection() */ @@ -86,8 +158,8 @@ return QSwipeGesture::NoDirection; } /*! - \property sceneVerticalDirection - \brief Vertical direction of swipe in scene coordinates. + Returns the vertical direction of the swipe gesture + relative to scene coordinates. \sa QSwipeGesture::verticalDirection() */ QSwipeGesture::SwipeDirection HbSwipeGesture::sceneVerticalDirection() const @@ -101,15 +173,21 @@ } /*! - \property sceneSwipeAngle - \brief Angle for swipe in scene coordinates. - \sa QSwipeGesture::swipeAngle() + Returns the angle for the swipe gesture in degrees, + taking into account any scene transformations. + \sa setSceneSwipeAngle(), QSwipeGesture::swipeAngle() */ qreal HbSwipeGesture::sceneSwipeAngle() const { return d_ptr->mSceneSwipeAngle; } +/*! + Sets the angle for the swipe gesture. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa sceneSwipeAngle(), QSwipeGesture::setSwipeAngle() +*/ void HbSwipeGesture::setSceneSwipeAngle(qreal value) { d_ptr->mSceneSwipeAngle = value; @@ -118,7 +196,7 @@ /*! \deprecated - \property speed + Returns the speed. */ qreal HbSwipeGesture::speed() const { @@ -126,6 +204,10 @@ return 1; } +/*! + \deprecated + Sets the speed. +*/ void HbSwipeGesture::setSpeed(qreal speed) { Q_UNUSED (speed); @@ -134,7 +216,7 @@ /*! \deprecated - \property touchPointCount + Returns the touchPointCount. */ int HbSwipeGesture::touchPointCount() const { @@ -142,6 +224,10 @@ return 0; } +/*! + \deprecated + Sets the touchPointCount. +*/ void HbSwipeGesture::setTouchPointCount(int touchPointCount) { HB_DEPRECATED("HbSwipeGesture::setTouchPointCount is deprecated"); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbswipegesturelogic_p.cpp --- a/src/hbcore/gestures/hbswipegesturelogic_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbswipegesturelogic_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,6 +29,8 @@ #include "hbpointrecorder_p.h" #include "hbvelocitycalculator_p.h" +#include + #include #include #include @@ -147,6 +149,7 @@ \return */ +#include QGestureRecognizer::Result HbSwipeGestureLogic::handleMouseRelease( Qt::GestureState gestureState, HbSwipeGesture *gesture, @@ -161,16 +164,15 @@ return QGestureRecognizer::Ignore; } - QPointF totalOffset = me->globalPos() - gesture->d_func()->mStartPos.toPoint(); + QPoint totalOffset = me->globalPos() - gesture->d_func()->mStartPos.toPoint(); int deltaTime = gesture->d_func()->mStartTime.msecsTo(mCurrentTime); QPointF velocity = deltaTime != 0 ? totalOffset / deltaTime : QPointF(0,0); gesture->setSwipeAngle(QLineF(gesture->d_func()->mStartPos, me->globalPos()).angle()); - gesture->setSceneSwipeAngle(QLineF(gesture->d_func()->mSceneStartPos, HbGestureUtils::mapToScene(watched, me->globalPos())).angle()); - - bool movedEnough = totalOffset.manhattanLength() >= HbSwipeMinOffset; - bool fastEnough = velocity.manhattanLength() >= HbSwipeMinSpeed; + gesture->setSceneSwipeAngle(QLineF(gesture->d_func()->mSceneStartPos, HbGestureUtils::mapToScene(watched, me->globalPos())).angle()); + bool movedEnough = totalOffset.manhattanLength() >= (int)(HbSwipeMinOffset * HbDeviceProfile::current().ppmValue()); + bool fastEnough = velocity.manhattanLength() >= HbSwipeMinSpeed * HbDeviceProfile::current().ppmValue(); bool notStoppedAtEnd = HbVelocityCalculator(gesture->d_ptr->mAxisX, gesture->d_ptr->mAxisY).velocity(mCurrentTime) != QPointF(0,0); if (movedEnough && fastEnough && notStoppedAtEnd) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbtapandholdgesture.cpp --- a/src/hbcore/gestures/hbtapandholdgesture.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbtapandholdgesture.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,12 +33,90 @@ @hbcore \class HbTapAndHoldGesture - \brief HbTapAndHoldGesture is an extension to Qt standard QTapAndHoldGesture - \sa QTapAndHoldGesture + \brief The HbTapAndHoldGesture class provides support for receiving + tap-and-hold gestures. + + HbTapAndHoldGesture is an extension to Qt standard QTapAndHoldGesture. + It is optimized for mobile touch screens, and also supports recognition + of mouse events for development purposes. It also gives information about + the tap-and-hold gesture position directly in scene coordinates, removing + any need for manual conversions from the screen (global) coordinates + offered by QTapAndHoldGesture. + + Use HbTapAndHoldGesture for a custom widget that is only interested in + the tap-and-hold (long tap) gesture. If you want your custom widget to + receive both short and long taps, use HbTapGesture instead, since it + supports both. + + \section _usecases_hbtapandholdgesture Using the HbTapAndHoldGesture class + + This example shows how to make a custom widget recognize the tap-and-hold + gesture. The custom widget in the example derives from HbWidget. + +
    +
  1. + Register for tap-and-hold gestures by using the base class function + QGraphicsObject::grabGesture(). QGraphicsObject::grabGesture() can be + called several times with different arguments, if the widget is + interested in other gesture types as well. + + \code + // This widget is interested in tap-and-hold and pan gestures. + grabGesture(Qt::TapAndHoldGesture); + grabGesture(Qt::PanGesture); + \endcode +
  2. + +
  3. + Reimplement HbWidgetBase::gestureEvent() to handle gestures that are + meaningful for your custom widget. + + \code + void MyWidget::gestureEvent(QGestureEvent *event) + { + if (HbTapAndHoldGesture *tapAndHold = + qobject_cast + (event->gesture(Qt::TapAndHoldGesture))) { + + switch (tapAndHold->state()) { + + case Qt::GestureStarted: + // Visualize the active state of the widget. + break; + + // No GestureUpdated events are sent for this gesture type, + // so no handling is needed for those + + case Qt::GestureCanceled: + // Visualize the non-active state of the widget. + break; + case Qt::GestureFinished: + // Visualize the non-active state of the widget. + // Emit a long tap signal. + break; + default: + break; + } + } + + // Handle other gesture types that have been grabbed. There may be + // several, since all gestures that are active at the same moment + // are sent within the same gesture event. + if (HbPanGesture *pan = qobject_cast + (event->gesture(Qt::PanGesture))) { + // handle the pan gesture + } + + } + \endcode +
  4. +
+ + \sa HbTapGesture, QTapAndHoldGesture */ /*! - \brief HbTapAndHoldGesture constructor + Constructor. \param parent Parent for the gesture */ HbTapAndHoldGesture::HbTapAndHoldGesture(QObject* parent) @@ -49,7 +127,7 @@ } /*! - \brief HbTapAndHoldGesture constructor + Constructor required by the shared d-pointer paradigm. \param dd Custom private data \param parent Parent for the gesture */ @@ -62,7 +140,7 @@ } /*! - \brief HbTapAndHoldGesture destructor + Destructor. */ HbTapAndHoldGesture::~HbTapAndHoldGesture() { @@ -70,16 +148,20 @@ } /*! - \property scenePosition - - Current position of the gesture. - \sa QTapAndHoldGesture::position() + Returns the current position of the gesture in scene coordinates. + \sa setScenePosition(), QTapAndHoldGesture::position() */ QPointF HbTapAndHoldGesture::scenePosition() const { return priv->mScenePos; } +/*! + Sets the current position of the gesture in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + \sa scenePosition(), QTapAndHoldGesture::setPosition() +*/ void HbTapAndHoldGesture::setScenePosition(const QPointF& pos) { priv->mScenePos = pos; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbtapandholdgesture_p.h --- a/src/hbcore/gestures/hbtapandholdgesture_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbtapandholdgesture_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,10 +34,6 @@ #include #include -const qreal DELTA_TOLERANCE = 1.0; -const int HOLDTAP_ACTIVATION_USECS = 150; // usecs -const int HOLDTAP_DURATION_USECS = 500-HOLDTAP_ACTIVATION_USECS; // usecs - class HB_CORE_PRIVATE_EXPORT HbTapAndHoldGesturePrivate { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbtapandholdgesturelogic_p.cpp --- a/src/hbcore/gestures/hbtapandholdgesturelogic_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbtapandholdgesturelogic_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,6 +28,7 @@ #include "hbtapandholdgesture_p.h" #include "hbtapandholdgesturelogic_p.h" +#include #include #include #include @@ -84,27 +85,14 @@ QPointF startPos = gesture->property("startPos").toPointF(); QPointF lastPos = gesture->property("position").toPointF(); - int movementThreshold = HbTapAndHoldGestureLogic::mTapRadius; - if ( gesture->property("tapRadius").isValid() ) { - movementThreshold = gesture->property("tapRadius").toInt(); - } - - return QLineF(startPos, lastPos).length() > movementThreshold; -}; + QPointF delta = lastPos - startPos; -/*! - \internal - \brief Starts brand new timer. - \param msecs Timer runtime in microseconds - \return ID of the timer -*/ -int HbTapAndHoldGestureLogic::startTimer( - HbTapAndHoldGesture* gesture, - int msecs) -{ - gesture->priv->mRunningTime = msecs; - return gesture->startTimer(msecs); -} + int movementThresholdSquare = mTapRadius * mTapRadius; + if ( gesture->property("tapRadius").isValid() ) { + movementThresholdSquare = gesture->property("tapRadius").toInt() * gesture->property("tapRadius").toInt(); + } + return (delta.x() * delta.x() + delta.y() * delta.y()) > movementThresholdSquare; +}; /*! \internal @@ -113,18 +101,15 @@ */ void HbTapAndHoldGestureLogic::resetGesture(HbTapAndHoldGesture *gesture) -{ +{ if ( gesture->priv->mTimerID ) { gesture->killTimer(gesture->priv->mTimerID); - } - + gesture->priv->mTimerID = 0; + } gesture->setProperty("startPos", QPointF(0,0)); - gesture->setProperty("tapRadius", QPointF(0,0)); + gesture->setProperty("tapRadius", QVariant()); gesture->setProperty("position", QPointF(0,0)); gesture->setProperty("scenePosition", QPointF(0,0)); - - gesture->priv->mTimerID = 0; - gesture->priv->mRunningTime = 0; } /*! @@ -141,8 +126,7 @@ QObject *watched, QMouseEvent *me ) { - Q_UNUSED(gestureState); - + Q_UNUSED(gestureState); // Accept only press events from left mouse button. if ( me->button() != Qt::LeftButton ) { DEBUG() << gesture << QGestureRecognizer::Ignore; @@ -156,8 +140,13 @@ gesture->setProperty("startPos", me->globalPos()); gesture->setProperty("position", me->globalPos()); gesture->setProperty("scenePosition", HbGestureUtils::mapToScene(watched, me->globalPos())); - gesture->priv->mTimerID = startTimer(gesture, HOLDTAP_ACTIVATION_USECS); - + + Q_ASSERT(gesture->priv->mTimerID == 0); + Q_ASSERT(gestureState == Qt::NoGesture); + + gesture->priv->mTimerID = gesture->startTimer(HbTapAndHoldTriggerTimeout); + mTapRadius = (int)(HbDefaultTapRadius * HbDeviceProfile::current().ppmValue()); + DEBUG() << gesture << QGestureRecognizer::MayBeGesture; return QGestureRecognizer::MayBeGesture; } @@ -178,9 +167,13 @@ { Q_UNUSED(gestureState); - // Before anything, check if there is even left button pressed. - if (me->buttons() != Qt::LeftButton || !gesture->priv->mRunningTime){ - DEBUG() << gesture << QGestureRecognizer::Ignore; + // Before anything, check if there is left button pressed. + if (!(me->buttons() & Qt::LeftButton) ){ + return QGestureRecognizer::Ignore; + } + + // If timer is not running we can ignore move events + if(!gesture->priv->mTimerID) { return QGestureRecognizer::Ignore; } @@ -191,12 +184,12 @@ if (outsideThreshold(gesture)){ // Finger has moved outside, so cancel this gesture gesture->killTimer(gesture->priv->mTimerID); + gesture->priv->mTimerID = 0; + DEBUG() << gesture << "threshold exceeded"; return QGestureRecognizer::CancelGesture; } - - // Move events should be just ignored. - DEBUG() << gesture << QGestureRecognizer::MayBeGesture; - return QGestureRecognizer::MayBeGesture; + // moving within threshold + return QGestureRecognizer::Ignore; } /*! @@ -214,29 +207,32 @@ QObject *watched, QMouseEvent *me ) { - Q_UNUSED(gestureState); Q_UNUSED(me); Q_UNUSED(watched); + Q_UNUSED(gestureState); - // Check if the gesture is already been cancelled. This is an unknown state. - if (!gesture->priv->mRunningTime) { + // Before anything, check if left button was released. + if (!(me->button() == Qt::LeftButton) ){ DEBUG() << gesture << QGestureRecognizer::Ignore; return QGestureRecognizer::Ignore; } - // If release happens, before timer has expired, cancel the gesture. - if (gesture->priv->mTimerID) { + // make sure we not in invalid state + Q_ASSERT(!(gestureState == Qt::GestureFinished && !gesture->priv->mTimerID)); + + // Mouse release can only cancel or ignore gesture since timers handle + // triggering + + // If timer was started, kill it + if(gesture->priv->mTimerID) { gesture->killTimer(gesture->priv->mTimerID); + gesture->priv->mTimerID = 0; + // Gesture state in Gesture Manager is MaybeGesture return QGestureRecognizer::CancelGesture; - } else { - // Gesture has already been executed. Just ignore the event and don't - // bother UI about it. - gesture->priv->mTimerID = 0; - gesture->priv->mRunningTime = 0; + } + DEBUG() << gesture << QGestureRecognizer::Ignore; + return QGestureRecognizer::Ignore; - DEBUG() << gesture << QGestureRecognizer::Ignore; - return QGestureRecognizer::Ignore; - } } /*! @@ -252,43 +248,36 @@ \see HbTapAndHoldGestureLogic::HandleGesture() */ QGestureRecognizer::Result HbTapAndHoldGestureLogic::handleTimer( + Qt::GestureState gestureState, HbTapAndHoldGesture *gesture, - QTimerEvent* te) + QObject *watched, + QTimerEvent *te ) { - // React only to own timer event, please. - if ( gesture->priv->mTimerID == te->timerId() ) { - // Consume the timer event as nobody will be interested about this. - QGestureRecognizer::Result result = QGestureRecognizer::ConsumeEventHint; + Q_UNUSED(watched); + Q_UNUSED(te); - // Handle the event and consume the timer event as it doesn't belong - // to anybody else. - switch ( gesture->priv->mRunningTime ) - { - // Time to invoke the started event. - case HOLDTAP_ACTIVATION_USECS: - gesture->priv->mTimerID = startTimer(gesture, HOLDTAP_DURATION_USECS); - result |= QGestureRecognizer::TriggerGesture; - break; + // React only to own timer event + Q_ASSERT(gesture->priv->mTimerID == te->timerId()); - // Time to invoke finish event. - case HOLDTAP_DURATION_USECS: - gesture->priv->mTimerID = 0; - gesture->priv->mRunningTime = 0; - result |= QGestureRecognizer::FinishGesture; - break; + // Consume the timer event as nobody will be interested about this. + QGestureRecognizer::Result result = QGestureRecognizer::ConsumeEventHint; + gesture->killTimer(gesture->priv->mTimerID); + gesture->priv->mTimerID = 0; - default: - result |= QGestureRecognizer::Ignore; - break; - } + if(gestureState == Qt::NoGesture) { + const int remainingTime = HbTapAndHoldTimeout-HbTapAndHoldTriggerTimeout; + gesture->priv->mTimerID = gesture->startTimer(remainingTime); + result |= QGestureRecognizer::TriggerGesture; + } else if (gestureState == Qt::GestureStarted) { + result |= QGestureRecognizer::FinishGesture; + } else { + // invalid state + Q_ASSERT(false); + } - DEBUG() << gesture << result; - return result; - } else { - // Not our business. - DEBUG() << gesture << QGestureRecognizer::Ignore; - return QGestureRecognizer::Ignore; - } + DEBUG() << gesture << result; + return result; + } /*! @@ -305,34 +294,27 @@ HbTapAndHoldGesture *gesture, QObject *watched, QEvent *event ) -{ - if (!gesture || !watched || !event ) - { - DEBUG() << "WARNING: Ignoring tap and hold gesture because of invalid arguments from gesture fw."; - return QGestureRecognizer::Ignore; - } - +{ switch( event->type() ) { case QEvent::MouseButtonDblClick: case QEvent::MouseButtonPress: return handleMousePress( - gestureState, gesture, watched, static_cast(event)); + gestureState, gesture, watched, static_cast(event)); case QEvent::MouseMove: return handleMouseMove( - gestureState, gesture, watched, static_cast(event)); + gestureState, gesture, watched, static_cast(event)); case QEvent::MouseButtonRelease: return handleMouseRelease( - gestureState, gesture, watched, static_cast(event)); + gestureState, gesture, watched, static_cast(event)); case QEvent::Timer: - return handleTimer(gesture, static_cast(event)); + return handleTimer( + gestureState, gesture, watched, static_cast(event)); default: break; } - - DEBUG() << gesture << QGestureRecognizer::Ignore; return QGestureRecognizer::Ignore; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbtapandholdgesturelogic_p.h --- a/src/hbcore/gestures/hbtapandholdgesturelogic_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbtapandholdgesturelogic_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,7 +44,6 @@ ~HbTapAndHoldGestureLogic(); bool outsideThreshold(HbTapAndHoldGesture *gesture); - int startTimer(HbTapAndHoldGesture *gesture, int msecs); void resetGesture(HbTapAndHoldGesture *gesture); QGestureRecognizer::Result handleMousePress( @@ -54,7 +53,7 @@ QGestureRecognizer::Result handleMouseRelease( Qt::GestureState gestureState, HbTapAndHoldGesture *gesture, QObject *watched, QMouseEvent *me ); QGestureRecognizer::Result handleTimer( - HbTapAndHoldGesture *gesture, QTimerEvent* te); + Qt::GestureState gestureState, HbTapAndHoldGesture *gesture, QObject *watched, QTimerEvent* te); QGestureRecognizer::Result recognize( Qt::GestureState gestureState, HbTapAndHoldGesture *gesture, QObject *watched, QEvent* event ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbtapgesture.cpp --- a/src/hbcore/gestures/hbtapgesture.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbtapgesture.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -48,27 +48,136 @@ @hbcore \class HbTapGesture - \brief HbTapGesture is an extension to Qt standard QTapGesture. + \brief The HbTapGesture class provides support for widgets needing both + the tap and the tap-and-hold gestures. + + HbTapGesture is an extension to the Qt standard QTapGesture. It is + optimized for mobile touch screens, and also supports recognition of + mouse events for development purposes. Moreover, HbTapGesture extends + QTapGesture by supporting both tap and tap-and-hold gestures. Use of + Qt::TapAndHoldGesture in conjunction with Qt::TapGesture in the same + widget would make it difficult to handle state updates and finishes in + the widget. + + Compared to QTapGesture, HbTapGesture also provides additional information + about the tap gesture position. Moreover, it has convenience functions for + handling the position information directly in scene coordinates, without + any need for manual conversions from global to scene coordinates. + + Some of the existing Hb widgets (for example HbPushButton) already + support tap gestures by emitting a signal such as clicked() or longPress() + when they are tapped. If, however, you are implementing a custom widget + whose base class does not emit the needed signals, you need to add + tap gesture handling by using either QTapGesture or HbTapGesture. + HbTapGesture is a recommended choice if your widget needs both tap and + tap-and-hold gestures. + + HbTapGesture does not support double tap. + + \section _usecases_hbtapgesture Using the HbTapGesture class + + This example shows how to make a custom widget recognize the tap and + tap-and-hold gestures. The custom widget in the example derives from + HbWidget. - HbTapGesture extends QTapGesture with additional information related - to the tap gesture, but most important use for HbTapGesture is - in widgets needing both tap and tap-and-hold. HbTapGesture - provides both -- use of Qt::TapAndHoldGesture - in conjunction with Qt::TapGesture in the same widget makes it - difficult to handle state updates and finishes in the widget. - HbTapGesture::tapStylehint() can be used to query whether - the tap was a normal tap, or tap-and-hold at the time of Qt::GestureUpdated - of Qt::GestureFinished. A gesture update will be sent at the time - when the tap-and-hold timer triggers. No updates are sent - of the finger movement during the tap. +
    +
  1. + Register for tap gestures by using the base class function + QGraphicsObject::grabGesture(). QGraphicsObject::grabGesture() can be + called several times with different arguments, if the widget is interested + in other gesture types as well. + + \code + // This widget is interested in tap and pan gestures. + grabGesture(Qt::TapGesture); + grabGesture(Qt::PanGesture); + \endcode +
  2. + +
  3. + Reimplement HbWidgetBase::gestureEvent() to handle gestures that are + meaningful for your custom widget. + + HbTapGesture::tapStyleHint() can be used to query whether the tap was + a normal tap or tap-and-hold at the time of Qt::GestureUpdated or + Qt::GestureFinished. A gesture update will be sent at the time when + the tap-and-hold timer triggers. No updates are sent of the finger + movement during the tap. + + \code + void MyWidget::gestureEvent(QGestureEvent *event) + { + if (HbTapGesture *tap = qobject_cast + (event->gesture(Qt::TapGesture))) { + + switch (tap->state()) { + + case Qt::GestureStarted: + // Visualize the active state of the widget. + break; + case Qt::GestureUpdated: + + // Long tap is triggered if the gesture takes + // more than 0.5 seconds. Handle it here. + if (tap->tapStyleHint() == HbTapGesture::TapAndHold) { + // Emit a long tap signal. + } + + break; + case Qt::GestureCanceled: + // Visualize the non-active state of the widget. + break; + case Qt::GestureFinished: + + // Visualize the non-active state of the widget. + + // Short tap is handled when the gesture is finished. + if (tap->tapStyleHint() == HbTapGesture::Tap) { + // Emit a short tap signal. + } + + break; + default: + break; + } + } + + // Handle other gesture types that have been grabbed. There may be + // several, since all gestures that are active at the same moment + // are sent within the same gesture event. + if (HbPanGesture *pan = qobject_cast + (event->gesture(Qt::PanGesture))) { + // handle the pan gesture + } + + } + \endcode +
  4. +
- \sa QTapGesture, HbTapGesture::TapStyleHint + \sa TapStyleHint, QTapGesture */ /*! - \brief HbTapGesture constructor - \param parent Parent for the gesture + \enum HbTapGesture::TapStyleHint + Defines the tap style. +*/ + +/*! + \var HbTapGesture::TapStyleHint HbTapGesture::Tap + Normal (short) tap. +*/ + +/*! + \var HbTapGesture::TapStyleHint HbTapGesture::TapAndHold + Long press (tap-and-hold). +*/ + +/*! + Constructor. + + \param parent Parent for the gesture. */ HbTapGesture::HbTapGesture(QObject *parent) : QTapGesture(parent), d_ptr(new HbTapGesturePrivate) @@ -77,9 +186,9 @@ } /*! - \brief HbTapGesture constructor - \param dd Custom private data - \param parent Parent for the gesture + Constructor required by the shared d-pointer paradigm. + \param dd Custom private data. + \param parent Parent for the gesture. */ HbTapGesture::HbTapGesture( HbTapGesturePrivate &dd, QObject *parent ) @@ -89,7 +198,7 @@ } /*! - \brief HbTapGesture destructor + Destructor. */ HbTapGesture::~HbTapGesture() { @@ -98,8 +207,9 @@ } /*! - \property startPos - \brief Stores the starting position of the tap gesture in screen coordinates. + Returns the starting position of the tap gesture in screen coordinates. + + \sa setStartPos() */ QPointF HbTapGesture::startPos() const { @@ -107,6 +217,13 @@ return d->mStartPos; } +/*! + Sets the starting position of the tap gesture in screen coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + + \sa startPos() +*/ void HbTapGesture::setStartPos(const QPointF &startPos) { Q_D(HbTapGesture); @@ -114,8 +231,9 @@ } /*! - \property sceneStartPos - \brief Stores the starting position of the tap gesture in scene coordinates. + Returns the starting position of the tap gesture in scene coordinates. + + \sa setSceneStartPos() */ QPointF HbTapGesture::sceneStartPos() const { @@ -123,6 +241,13 @@ return d->mSceneStartPos; } +/*! + Sets the starting position of the tap gesture in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + + \sa sceneStartPos() +*/ void HbTapGesture::setSceneStartPos(const QPointF &startPos) { Q_D(HbTapGesture); @@ -130,9 +255,9 @@ } /*! - \property scenePosition - \brief Stores the current position of the tap gesture in scene coordinates. - \sa QTapGesture::position() + Returns the current position of the tap gesture in scene coordinates. + + \sa setScenePosition(), QTapGesture::position() */ QPointF HbTapGesture::scenePosition() const { @@ -140,6 +265,13 @@ return d->mScenePosition; } +/*! + Sets the current position of the tap gesture in scene coordinates. + This function is used by the framework gesture recognition logic, + and it should not be used by the widget receiving the gesture. + + \sa scenePosition(), QTapGesture::position() +*/ void HbTapGesture::setScenePosition(const QPointF &startPos) { Q_D(HbTapGesture); @@ -147,11 +279,11 @@ } /*! - \property tapStyleHint - \brief Indicates whether tap is normal tap or long press. + Returns information about whether the tap is a short tap or long press + (tap-and-hold). - TapStyleHint is by default Tap and in case of long press, the gesture - update event is sent and TapStyleHint changed to TapAndHold. + The tapStyleHint property is by default Tap and in case of long press, + a gesture update event is sent and tapStyleHint changed to TapAndHold. */ HbTapGesture::TapStyleHint HbTapGesture::tapStyleHint() const { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbtapgesture_p.h --- a/src/hbcore/gestures/hbtapgesture_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbtapgesture_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,8 +27,6 @@ #define HBTAPGESTURE_P_H #include "hbtapgesture.h" -const int HOLDTAP_DURATION_USECS = 500; - class HB_CORE_PRIVATE_EXPORT HbTapGesturePrivate { Q_DECLARE_PUBLIC(HbTapGesture) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbtapgesturelogic_p.cpp --- a/src/hbcore/gestures/hbtapgesturelogic_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbtapgesturelogic_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,9 @@ #include "hbtapgesturelogic_p.h" #include "hbtapgesture.h" #include "hbtapgesture_p.h" +#include "hbnamespace_p.h" +#include #include #include #include @@ -74,7 +76,10 @@ { gesture->setStartPos(QPointF()); gesture->setSceneStartPos(QPointF()); - gesture->setProperty("tapRadius", QVariant()); + gesture->setProperty(HbPrivate::TapRadius.latin1(), QVariant()); + gesture->setProperty(HbPrivate::ThresholdRect.latin1(), QVariant()); + gesture->setProperty(HbPrivate::VerticallyRestricted.latin1(), QVariant()); + gesture->setProperty(HbPrivate::HorizontallyRestricted.latin1(), QVariant()); } /*! @@ -98,11 +103,12 @@ gesture->setStartPos(me->globalPos()); gesture->setScenePosition(HbGestureUtils::mapToScene(watched, me->globalPos())); gesture->setSceneStartPos(HbGestureUtils::mapToScene(watched, me->globalPos())); + mTapRadius = (int)(HbDefaultTapRadius * HbDeviceProfile::current().ppmValue()); HbTapGesturePrivate* d_ptr = gesture->d_func(); d_ptr->mTapStyleHint = HbTapGesture::Tap; if ( d_ptr->mTimerId ) gesture->killTimer(d_ptr->mTimerId); - d_ptr->mTimerId = gesture->startTimer(HOLDTAP_DURATION_USECS); + d_ptr->mTimerId = gesture->startTimer(HbTapAndHoldTimeout); return QGestureRecognizer::TriggerGesture; } @@ -125,19 +131,46 @@ QObject *watched, QMouseEvent *me ) { - if(gestureState != Qt::NoGesture) { - int tapRadius(mTapRadius); - if(gesture->property("tapRadius").isValid()) { - qWarning("WARNING using widget specific properties in HbTapGestureRecognizer"); - tapRadius = gesture->property("tapRadius").toInt(); - } - + if(gestureState != Qt::NoGesture && gestureState != Qt::GestureCanceled) { gesture->setPosition(me->globalPos()); gesture->setScenePosition(HbGestureUtils::mapToScene(watched, me->globalPos())); gesture->setHotSpot(me->globalPos()); + + int tapRadiusSquare(mTapRadius * mTapRadius); + if(gesture->property(HbPrivate::TapRadius.latin1()).isValid()) { + qWarning("WARNING using widget specific properties in HbTapGestureRecognizer"); + int tapRadius = gesture->property(HbPrivate::TapRadius.latin1()).toInt(); + tapRadiusSquare = tapRadius * tapRadius; + } QPointF delta = me->globalPos() - gesture->startPos(); - if(delta.manhattanLength() > tapRadius) { - return QGestureRecognizer::CancelGesture; + + QRect thresholdRect = gesture->property(HbPrivate::ThresholdRect.latin1()).toRect(); + if (thresholdRect.isValid() && + !(gesture->property(HbPrivate::VerticallyRestricted.latin1()).toBool() && gesture->property(HbPrivate::HorizontallyRestricted.latin1()).toBool())) { + // cancel long press with radius + if((delta.x() * delta.x() + delta.y() * delta.y()) > tapRadiusSquare) { + if (gesture->d_func()->mTimerId) gesture->killTimer(gesture->d_func()->mTimerId); + gesture->d_func()->mTimerId = 0; + } + + thresholdRect.adjust(-mTapRadius, -mTapRadius, mTapRadius, mTapRadius); + + if (gesture->property(HbPrivate::VerticallyRestricted.latin1()).toBool()) { + thresholdRect.setTop(gesture->sceneStartPos().y() - mTapRadius); + thresholdRect.setBottom(gesture->sceneStartPos().y() + mTapRadius); + } + if (gesture->property(HbPrivate::HorizontallyRestricted.latin1()).toBool()){ + thresholdRect.setLeft(gesture->sceneStartPos().x() - mTapRadius); + thresholdRect.setRight(gesture->sceneStartPos().x() + mTapRadius); + } + + if (!thresholdRect.contains(gesture->scenePosition().toPoint())) { + return QGestureRecognizer::CancelGesture; + } + } else { + if((delta.x() * delta.x() + delta.y() * delta.y()) > tapRadiusSquare) { + return QGestureRecognizer::CancelGesture; + } } } return QGestureRecognizer::Ignore; @@ -182,21 +215,17 @@ QGestureRecognizer::Result HbTapGestureLogic::handleTimerEvent( Qt::GestureState gestureState, HbTapGesture *gesture, - QObject *watched) + QObject *) { - if (watched == gesture && gestureState == Qt::GestureStarted) { - QGestureRecognizer::Result result = QGestureRecognizer::ConsumeEventHint; - gesture->killTimer(gesture->d_func()->mTimerId); - gesture->d_func()->mTimerId = 0; - if(gestureState != Qt::NoGesture) { - gesture->d_func()->mTapStyleHint = HbTapGesture::TapAndHold; - result |= QGestureRecognizer::TriggerGesture; - } - - return result; + QGestureRecognizer::Result result = QGestureRecognizer::ConsumeEventHint; + gesture->killTimer(gesture->d_func()->mTimerId); + gesture->d_func()->mTimerId = 0; + if(gestureState != Qt::NoGesture) { + gesture->d_func()->mTapStyleHint = HbTapGesture::TapAndHold; + result |= QGestureRecognizer::TriggerGesture; } - return QGestureRecognizer::Ignore; + return result; } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gestures/hbvelocitycalculator_p.cpp --- a/src/hbcore/gestures/hbvelocitycalculator_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gestures/hbvelocitycalculator_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,6 +26,8 @@ #include "hbvelocitycalculator_p.h" #include "hbpointrecorder_p.h" +#include "hbgestures_p.h" + #include #include @@ -37,9 +39,6 @@ # define DEBUG qDebug #endif -const int KHbSampleTime = 80; // ms -const int KHbStopTime = 70; // ms - /*! @hbcore \internals @@ -99,7 +98,7 @@ } DEBUG() << "Stationary time: " << list.lastTime().msecsTo(time); - if (list.lastTime().msecsTo(time) > KHbStopTime) { + if (list.lastTime().msecsTo(time) >= HbVelocityStopTime) { return 0.0; } @@ -107,7 +106,7 @@ qreal delta = 0.0; int timeDelta = 0; int i = list.count(); - while (timeDelta < KHbSampleTime && i > 0) { + while (timeDelta < HbVelocitySampleTime && i > 0) { i--; timeDelta = list.at(i).second.msecsTo(time); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/gui.pri --- a/src/hbcore/gui/gui.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/gui.pri Thu Jul 22 16:36:53 2010 +0100 @@ -79,11 +79,14 @@ PRIVATE_HEADERS += $$PWD/hbwidgetsequentialshow_p.h PRIVATE_HEADERS += $$PWD/hbnativewindow_sym_p.h PRIVATE_HEADERS += $$PWD/hbsplash_p.h +PRIVATE_HEADERS += $$PWD/hbsplash_direct_symbian_p.h PRIVATE_HEADERS += $$PWD/hbfadeitem_p.h PRIVATE_HEADERS += $$PWD/hbcontentwidget_p.h PRIVATE_HEADERS += $$PWD/hbscreen_p.h PRIVATE_HEADERS += $$PWD/hbsplashdefs_p.h +PRIVATE_HEADERS += $$PWD/hbsplashscreen_generic_p.h PRIVATE_HEADERS += $$PWD/hblongpressvisualizer_p.h +PRIVATE_HEADERS += $$PWD/hbwindowobscured_p.h SOURCES += $$PWD/hbabstractbutton.cpp SOURCES += $$PWD/hbactionmanager.cpp @@ -123,6 +126,7 @@ SOURCES += $$PWD/hbcontentwidget.cpp SOURCES += $$PWD/hbscreen.cpp SOURCES += $$PWD/hblongpressvisualizer.cpp +SOURCES += $$PWD/hbwindowobscured_p.cpp symbian:SOURCES += $$PWD/hbdevicefadecontrolsym.cpp else:SOURCES += $$PWD/hbdevicefadecontrolwin.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbabstractbutton.cpp --- a/src/hbcore/gui/hbabstractbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbabstractbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,6 +29,7 @@ #include "hbstyleoption_p.h" #include "hbtooltip.h" #include "hbinstance.h" +#include "hbnamespace_p.h" #include #include #include @@ -210,11 +211,11 @@ //In that case, the distance in the direction will be used as significant score, //take also in account orthogonal distance in case two widget are in the same distance. int score; - if ((buttonRect.x() < target.right() && target.x() < buttonRect.right()) + if ( keyNavigation() && (buttonRect.x() < target.right() && target.x() < buttonRect.right()) && (key == Qt::Key_Up || key == Qt::Key_Down)) { //one item's is at the vertical of the other score = (qAbs(p.y() - goal.y()) << 16) + qAbs(p.x() - goal.x()); - } else if ((buttonRect.y() < target.bottom() && target.y() < buttonRect.bottom()) + } else if ( keyNavigation() && (buttonRect.y() < target.bottom() && target.y() < buttonRect.bottom()) && (key == Qt::Key_Left || key == Qt::Key_Right) ) { //one item's is at the horizontal of the other score = (qAbs(p.x() - goal.x()) << 16) + qAbs(p.y() - goal.y()); @@ -224,46 +225,45 @@ if (score > bestScore && candidate) continue; - - switch(key) { - case Qt::Key_Up: - if (p.y() < goal.y()) { - candidate = button; - bestScore = score; - } - break; - case Qt::Key_Down: - if (p.y() > goal.y()) { - candidate = button; - bestScore = score; + if ( keyNavigation()) { + switch(key) { + case Qt::Key_Up: + if (p.y() < goal.y()) { + candidate = button; + bestScore = score; + } + break; + case Qt::Key_Down: + if (p.y() > goal.y()) { + candidate = button; + bestScore = score; + } + break; + case Qt::Key_Left: + if (p.x() < goal.x()) { + candidate = button; + bestScore = score; + } + break; + case Qt::Key_Right: + if (p.x() > goal.x()) { + candidate = button; + bestScore = score; + } + break; } - break; - case Qt::Key_Left: - if (p.x() < goal.x()) { - candidate = button; - bestScore = score; - } - break; - case Qt::Key_Right: - if (p.x() > goal.x()) { - candidate = button; - bestScore = score; - } - break; } } } if (exclusive -#ifdef QT_KEYPAD_NAVIGATION - && !QApplication::keypadNavigationEnabled() -#endif + && !keyNavigation() && candidate && focusButton->isChecked() && candidate->isCheckable()) candidate->click(); - if (candidate) { + if ( keyNavigation() && candidate) { if (key == Qt::Key_Up || key == Qt::Key_Left) candidate->setFocus(Qt::BacktabFocusReason); else @@ -953,42 +953,47 @@ Q_D(HbAbstractButton); if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { - bool hit = hitButton(mapFromScene(event->mapToGraphicsScene(tap->position()))); + switch(tap->state()) { + case Qt::GestureStarted: + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + if (!tap->property(HbPrivate::ThresholdRect.latin1()).toRect().isValid()) { + tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); + } + setDown(true); + HbWidgetFeedback::triggered(this, Hb::InstantPressed); + updatePrimitives(); + d->emitPressed(); + + break; + case Qt::GestureCanceled: + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); - switch(tap->state()) { - case Qt::GestureStarted: - setDown(true); - HbWidgetFeedback::triggered(this, Hb::InstantPressed); - updatePrimitives(); - d->emitPressed(); - break; - case Qt::GestureCanceled: - if(d->down) { - HbWidgetFeedback::triggered(this, Hb::InstantReleased); - setDown(false); - d->longPress = false; - d->emitReleased(); - } - break; - case Qt::GestureFinished: - if (!d->down) { - return; - } - if ( hit && !d->longPress) { + if(d->down) { + HbWidgetFeedback::triggered(this, Hb::InstantReleased); + setDown(false); + d->longPress = false; + d->emitReleased(); + } + break; + case Qt::GestureFinished: + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + + if (!d->down){ + return; + } + HbWidgetFeedback::triggered(this, Hb::InstantClicked); - } - HbWidgetFeedback::triggered(this, Hb::InstantReleased); - if ( hit ) { + + d->repeatTimer.stop(); d->click(); - } else { - setDown(false); + + HbWidgetFeedback::triggered(this, Hb::InstantReleased); + d->longPress = false; + break; + default: + break; } - d->longPress = false; - break; - default: - break; - } } } #endif @@ -1014,26 +1019,28 @@ break; case Qt::Key_Up: case Qt::Key_Left: - next = false; + if ( d->keyNavigation() ) { + next = false; + } // fall through case Qt::Key_Right: case Qt::Key_Down: -#ifdef QT_KEYPAD_NAVIGATION - if (QApplication::keypadNavigationEnabled() && (event->key() == Qt::Key_Left || event->key() == Qt::Key_Right)) { - event->ignore(); - return; - } -#endif - if (d->autoExclusive) { - // ### Using qobject_cast to check if the parent is a viewport of - // QAbstractItemView is a crude hack, and should be revisited and - // cleaned up when fixing task 194373. It's here to ensure that we - // keep compatibility outside QAbstractItemView. - d->moveFocus(event->key()); - if (hasFocus()) // nothing happend, propagate + if ( d->keyNavigation() ) { + if ( d->keyNavigation() && (event->key() == Qt::Key_Left || event->key() == Qt::Key_Right)) { event->ignore(); - } else { - focusNextPrevChild(next); + return; + } + if (d->autoExclusive) { + // ### Using qobject_cast to check if the parent is a viewport of + // QAbstractItemView is a crude hack, and should be revisited and + // cleaned up when fixing task 194373. It's here to ensure that we + // keep compatibility outside QAbstractItemView. + d->moveFocus(event->key()); + if (hasFocus()) // nothing happend, propagate + event->ignore(); + } else { + focusNextPrevChild(next); + } } break; case Qt::Key_Escape: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbanchorarrowdrawer_p.cpp --- a/src/hbcore/gui/hbanchorarrowdrawer_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbanchorarrowdrawer_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,13 +25,12 @@ -#include +#include #include #include #include #include -#include -#include +#include #include #include #include @@ -42,8 +41,9 @@ const QString VALID_COLOR = "qtc_default_main_pane_normal"; const QString INVALID_COLOR = "qtc_view_visited_normal"; -HbAnchorArrowDrawer::HbAnchorArrowDrawer(HbMeshLayout* mesh, QGraphicsItem *parent) - : HbWidgetBase(parent), mLayout(mesh), mDrawOutlines(true), mDrawArrows(true), mDrawSpacers(true) +HbAnchorArrowDrawer::HbAnchorArrowDrawer(HbAnchorLayout *layout, QGraphicsItem *parent) + : HbWidgetBase(parent), + mLayout(layout), mDrawOutlines(true), mDrawArrows(true), mDrawSpacers(true) { #if defined(HB_DEVELOPER) || defined(CSS_INSPECTOR) updateColors(); @@ -81,9 +81,9 @@ setGeometry(item->sceneBoundingRect()); QGraphicsLayout *layout = widget->layout(); if (layout) { - HbMeshLayout *mesh = dynamic_cast(layout); - if (mesh) { - mLayout = mesh; + HbAnchorLayout *anchorlayout = dynamic_cast(layout); + if (anchorlayout) { + mLayout = anchorlayout; } } } @@ -92,7 +92,8 @@ #endif } -void HbAnchorArrowDrawer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void HbAnchorArrowDrawer::paint( + QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); Q_UNUSED(widget); @@ -103,18 +104,14 @@ } painter->save(); - QList anchors = HbMeshLayoutDebug::getAnchors(mLayout); + QList anchors = mLayout->effectiveAnchors(); // Draw boxes round anchored child items if (mDrawOutlines) { - QList anchoredChildren; + QSet anchoredChildren; foreach (const HbAnchor *anchor, anchors) { - if (!anchoredChildren.contains(anchor->mStartItem)) { - anchoredChildren.append(anchor->mStartItem); - } - if (!anchoredChildren.contains(anchor->mEndItem)) { - anchoredChildren.append(anchor->mEndItem); - } + anchoredChildren << anchor->startItem(); + anchoredChildren << anchor->endItem(); } painter->setPen(QPen(QBrush(mBoxColor), LINE_WIDTH)); painter->setBrush(Qt::NoBrush); @@ -125,180 +122,170 @@ if (mDrawSpacers) { painter->save(); - for (int li=0 ; licount(); li++) { - QGraphicsLayoutItem *layoutItem = mLayout->itemAt(li); - //if (!layoutItem->graphicsItem()) { - QRectF rectArea = layoutItem->geometry(); - if (rectArea.width() == 0 || rectArea.height() == 0) { - if (rectArea.height() == 0 && rectArea.width() > 0) { - rectArea.setHeight(contentsRect().height()); - bool overridden = false; - // find all the horizontal anchors - foreach(HbAnchor *anchor, anchors) { - if (anchor->mStartEdge == Hb::LeftEdge || anchor->mStartEdge == Hb::RightEdge ||anchor->mStartEdge == Hb::CenterHEdge) { - QGraphicsLayoutItem *other = 0; - if (anchor->mStartItem == layoutItem && anchor->mEndItem != mLayout) { - other = anchor->mEndItem; - } else if (anchor->mEndItem == layoutItem && anchor->mStartItem != mLayout) { - other = anchor->mStartItem; - } - if (other) { - if (overridden) { - rectArea.setTop(qMin(rectArea.top(), other->geometry().top())); - rectArea.setBottom(qMax(rectArea.bottom(), other->geometry().bottom())); - break; - } else { - rectArea.setTop(other->geometry().top()); - rectArea.setHeight(other->geometry().height()); - overridden = true; - } - } - } - } + foreach (const HbAnchor *anchor, anchors) { + if (anchor->anchorId().isEmpty()) { + // No anchor name set - not a spacer + continue; + } + QRectF drawArea; + + QGraphicsLayoutItem *srcToLayout = 0; + if (anchor->startItem() == mLayout) { + srcToLayout = anchor->endItem(); + } else if (anchor->endItem() == mLayout) { + srcToLayout = anchor->startItem(); + } - } - - if (rectArea.width() == 0 && rectArea.height() > 0) { - rectArea.setWidth(contentsRect().width()); - bool overridden = false; - // find all the vertical anchors - foreach(HbAnchor *anchor, anchors) { - if (anchor->mStartEdge == Hb::TopEdge || anchor->mStartEdge == Hb::BottomEdge ||anchor->mStartEdge == Hb::CenterVEdge) { - QGraphicsLayoutItem *other = 0; - if (anchor->mStartItem == layoutItem && anchor->mEndItem != mLayout) { - other = anchor->mEndItem; - } else if (anchor->mEndItem == layoutItem && anchor->mStartItem != mLayout) { - other = anchor->mStartItem; - } - if (other) { - if (overridden) { - rectArea.setLeft(qMin(rectArea.left(), other->geometry().left())); - rectArea.setRight(qMax(rectArea.right(), other->geometry().right())); - break; - } else { - rectArea.setLeft(other->geometry().left()); - rectArea.setWidth(other->geometry().width()); - overridden = true; - } - } - } - } - } - - painter->setOpacity(0.2); // so that we can see overlapping spacers - painter->fillRect(rectArea, QBrush(mInvalidColor, Qt::SolidPattern)); + if (srcToLayout) { + // Attached to layout + QRectF srcRect = srcToLayout->geometry(); + QRectF layoutRect = mLayout->geometry(); + drawArea = srcRect; + switch (anchor->endEdge()) { + case Hb::TopEdge: + drawArea.setTop(0); + drawArea.setBottom(srcRect.top() - ARROW_HEAD_SIZE*2); + break; + case Hb::BottomEdge: + drawArea.setTop(srcRect.bottom() + ARROW_HEAD_SIZE*2); + drawArea.setBottom(layoutRect.height()); + break; + case Hb::LeftEdge: + drawArea.setLeft(0); + drawArea.setRight(srcRect.left() - ARROW_HEAD_SIZE*2); + break; + case Hb::RightEdge: + drawArea.setLeft(srcRect.right() + ARROW_HEAD_SIZE*2); + drawArea.setRight(layoutRect.width()); + break; + case Hb::CenterVEdge: + drawArea.setTop(qMin(srcRect.top(), layoutRect.center().y())); + drawArea.setBottom(qMax(srcRect.bottom(), layoutRect.center().y())); + break; + case Hb::CenterHEdge: + drawArea.setLeft(qMin(srcRect.left(), layoutRect.center().x())); + drawArea.setRight(qMax(srcRect.right(), layoutRect.center().x())); + break; + }; + } else { + // Spacer between two items + QRectF startItemRect = anchor->startItem()->geometry(); + QRectF endItemRect = anchor->endItem()->geometry(); + drawArea.setLeft(qMin(startItemRect.left(), endItemRect.left())); + drawArea.setRight(qMax(startItemRect.right(), endItemRect.right())); + drawArea.setTop(qMin(startItemRect.top(), endItemRect.top())); + drawArea.setBottom(qMax(startItemRect.bottom(), endItemRect.bottom())); } + painter->setOpacity(0.2); // so that we can see overlapping spacers + painter->fillRect(drawArea, QBrush(mInvalidColor, Qt::SolidPattern)); } painter->restore(); } // End spacers - // Draw anchor lines if (mDrawArrows) { - Qt::LayoutDirection dir = HbLayoutUtils::visualDirection(mLayout); - for (int i=0; imStartItem) { - if (QGraphicsItem *asGraphicsItem = anchor->mStartItem->graphicsItem()) { - if (asGraphicsItem->isWidget()) { - const QGraphicsWidget *widget = static_cast(asGraphicsItem); + // Ignore frame and toucharea primitives + if (anchor->startItem()) { + if (QGraphicsItem *gItem = anchor->startItem()->graphicsItem()) { + if (gItem->isWidget()) { + const QGraphicsWidget *widget = static_cast(gItem); QString itemText(widget->metaObject()->className()); - if (itemText == "HbFrameItem" - || itemText == "HbTouchArea") { + if (itemText == "HbFrameItem" || itemText == "HbTouchArea") { continue; } } } } - // if edge is connected to parent on same edge, and if the gap is zero, then don't show an arrow head - if(anchor->mEndItem->isLayout() - && anchor->mStartEdge == anchor->mEndEdge - && anchor->mValue == 0) { - continue; + + // Vars from anchor + bool positiveDirection = anchor->direction() == HbAnchor::Positive; + Hb::Edge startEdge = anchor->startEdge(); + Hb::Edge endEdge = anchor->endEdge(); + qreal anchorLength = anchor->preferredLength(); + bool spacerAnchor = false; + + // Handle new anchor-based spacers + if (anchorLength == 0 && !anchor->anchorId().isEmpty()) { + anchorLength = (ARROW_HEAD_SIZE*2)+1; + spacerAnchor = true; } + + // if edge is connected to parent on same edge, and if the gap is zero, + // then don't show an arrow head + if(anchor->endItem()->isLayout() && startEdge == endEdge && anchorLength == 0) { + continue; + } + // Mirroring - if (dir == Qt::RightToLeft) { - if (anchor->mStartEdge == Hb::LeftEdge) { - anchor->mStartEdge = Hb::RightEdge; - anchor->mValue = -(anchor->mValue); - } else if (anchor->mStartEdge == Hb::RightEdge) { - anchor->mStartEdge = Hb::LeftEdge; - anchor->mValue = -(anchor->mValue); - } else if (anchor->mStartEdge == Hb::CenterHEdge) { - anchor->mValue = -(anchor->mValue); + if (layoutMirrored) { + if (startEdge == Hb::LeftEdge) { + startEdge = Hb::RightEdge; + } else if (startEdge == Hb::RightEdge) { + startEdge = Hb::LeftEdge; } - if (anchor->mEndEdge == Hb::LeftEdge) { - anchor->mEndEdge = Hb::RightEdge; - } else if (anchor->mEndEdge == Hb::RightEdge) { - anchor->mEndEdge = Hb::LeftEdge; + if (endEdge == Hb::LeftEdge) { + endEdge = Hb::RightEdge; + } else if (endEdge == Hb::RightEdge) { + endEdge = Hb::LeftEdge; } } - QRectF startRect = anchor->mStartItem->geometry(); - QRectF endRect = anchor->mEndItem->geometry(); - - // Fix non-pinned spacers issue - if (startRect.left() == 0 && startRect.width() == 0) { - startRect.adjust(endRect.left(), 0, endRect.left() + endRect.width(), 0); - } else if (startRect.top() == 0 && startRect.height() == 0) { - startRect.adjust(0, endRect.top(), 0, endRect.top() + endRect.height()); - } - if (endRect.left() == 0 && endRect.width() == 0) { - endRect.adjust(startRect.left(), 0, startRect.left() + startRect.width(), 0); - } else if (endRect.top() == 0 && endRect.height() == 0) { - endRect.adjust(0, startRect.top(), 0, startRect.top() + startRect.height()); - } + QRectF startRect = anchor->startItem()->geometry(); + QRectF endRect = anchor->endItem()->geometry(); + Hb::Edge arrowType; + QPointF startPt, start2Pt, endPt, end2Pt; // Work out the arrow line start point - switch (anchor->mStartEdge) { - case Hb::LeftEdge: start.rx() = startRect.left(); break; - case Hb::RightEdge: start.rx() = startRect.right(); break; - case Hb::CenterHEdge: start.rx() = startRect.center().x(); break; - case Hb::TopEdge: start.ry() = startRect.top(); break; - case Hb::BottomEdge: start.ry() = startRect.bottom(); break; - case Hb::CenterVEdge: start.ry() = startRect.center().y(); break; + switch (startEdge) { + case Hb::LeftEdge: startPt.rx() = startRect.left(); break; + case Hb::RightEdge: startPt.rx() = startRect.right(); break; + case Hb::CenterHEdge: startPt.rx() = startRect.center().x(); break; + case Hb::TopEdge: startPt.ry() = startRect.top(); break; + case Hb::BottomEdge: startPt.ry() = startRect.bottom(); break; + case Hb::CenterVEdge: startPt.ry() = startRect.center().y(); break; } - start2 = start; + start2Pt = startPt; - switch (anchor->mStartEdge) { + switch (startEdge) { case Hb::LeftEdge: case Hb::RightEdge: case Hb::CenterHEdge: { - // Set arrow end point - end.rx() = start.x() + anchor->mValue; - - // Set arrow direction - arrowType = anchor->mValue < 0 - ? Hb::LeftEdge - : Hb::RightEdge; + // Set arrow end point and arrow direction + positiveDirection ^= layoutMirrored; // XOR with layout direction + if (positiveDirection) { + arrowType = Hb::RightEdge; + endPt.rx() = startPt.x() + anchorLength; + } else { + arrowType = Hb::LeftEdge; + endPt.rx() = startPt.x() - anchorLength; + } // Set vertical centering and staggered line point qreal maxTop = qMax(startRect.top(), endRect.top()); qreal minBottom = qMin(startRect.bottom(), endRect.bottom()); if (maxTop < minBottom) { - start.ry() = (maxTop + minBottom) / 2; - start2.ry() = start.y(); + startPt.ry() = (maxTop + minBottom) / 2; + start2Pt.ry() = startPt.y(); } else { const bool startAboveEnd = startRect.top() > endRect.top(); - start.ry() = startAboveEnd ? endRect.bottom() : endRect.top(); - start2.ry() = startAboveEnd ? startRect.top() : startRect.bottom(); + startPt.ry() = startAboveEnd ? endRect.bottom() : endRect.top(); + start2Pt.ry() = startAboveEnd ? startRect.top() : startRect.bottom(); } - end.ry() = start.y(); - end2.ry() = start.y(); + endPt.ry() = startPt.y(); + end2Pt.ry() = startPt.y(); // Set end staggered point - if (anchor->mEndEdge == Hb::LeftEdge) { - end2.rx() = endRect.left(); - } else if (anchor->mEndEdge == Hb::RightEdge) { - end2.rx() = endRect.right(); + if (endEdge == Hb::LeftEdge) { + end2Pt.rx() = endRect.left(); + } else if (endEdge == Hb::RightEdge) { + end2Pt.rx() = endRect.right(); } else { - end2.rx() = endRect.center().x(); + end2Pt.rx() = endRect.center().x(); } } break; @@ -307,69 +294,64 @@ case Hb::BottomEdge: case Hb::CenterVEdge: { - // Set arrow end point - end.ry() = start.y() + anchor->mValue; - - // Set arrow direction - arrowType = anchor->mValue < 0 - ? Hb::TopEdge - : Hb::BottomEdge; + // Set arrow end point and arrow direction + if (positiveDirection) { + endPt.ry() = startPt.y() + anchorLength; + arrowType = Hb::BottomEdge; + } else { + endPt.ry() = startPt.y() - anchorLength; + arrowType = Hb::TopEdge; + } // Set horizontal centering and staggered line point qreal maxLeft = qMax(startRect.left(), endRect.left()); qreal minRight = qMin(startRect.right(), endRect.right()); if (maxLeft < minRight) { - start.rx() = (maxLeft + minRight) / 2; - start2.rx() = start.x(); + startPt.rx() = (maxLeft + minRight) / 2; + start2Pt.rx() = startPt.x(); } else { bool startLeftOfEnd = startRect.left() > endRect.left(); - start.rx() = startLeftOfEnd ? endRect.right() : endRect.left(); - start2.rx() = startLeftOfEnd ? startRect.left() : startRect.right(); + startPt.rx() = startLeftOfEnd ? endRect.right() : endRect.left(); + start2Pt.rx() = startLeftOfEnd ? startRect.left() : startRect.right(); } - end.rx() = start.x(); - end2.rx() = start.x(); + endPt.rx() = startPt.x(); + end2Pt.rx() = startPt.x(); // Set end staggered point - if (anchor->mEndEdge == Hb::TopEdge) { - end2.ry() = endRect.top(); - } else if (anchor->mEndEdge == Hb::BottomEdge) { - end2.ry() = endRect.bottom(); + if (endEdge == Hb::TopEdge) { + end2Pt.ry() = endRect.top(); + } else if (endEdge == Hb::BottomEdge) { + end2Pt.ry() = endRect.bottom(); } else { - end2.ry() = endRect.center().y(); + end2Pt.ry() = endRect.center().y(); } } break; - } + } // end switch(startEdge) // Start painting block - QPen myPen; - QColor arrowColor = mLayout->isValid() - ? mValidColor - : mInvalidColor; - QColor centerColor = Qt::yellow; + QColor arrowColor = mLayout->isValid() ? mValidColor : mInvalidColor; + QColor centerColor = Qt::yellow; //krazy:exclude=qenums + + painter->setPen(QPen(arrowColor, LINE_WIDTH, Qt::DashLine)); + //painter->drawLine(start2Pt, startPt); - myPen.setWidth(LINE_WIDTH); - myPen.setColor(arrowColor); - myPen.setStyle(Qt::DashLine); - painter->setPen(myPen); - painter->setBrush(arrowColor); - painter->drawLine(start2, start); + painter->setPen(QPen(arrowColor, LINE_WIDTH, Qt::SolidLine)); + painter->drawLine(startPt, endPt); - myPen.setStyle(Qt::SolidLine); - painter->setPen(myPen); - painter->drawLine(start, end); - - if (anchor->mStartEdge == Hb::CenterHEdge || anchor->mStartEdge == Hb::CenterVEdge) { + if (startEdge == Hb::CenterHEdge || startEdge == Hb::CenterVEdge) { painter->setBrush(centerColor); + } else { + painter->setBrush(arrowColor); } // Only draw the start box if the anchor is long enough to show 3 times the head size // (head, stalk, and tail) otherwise it turns into a mush, // so the best thing is to show the triangle which at least shows the direction - if (qAbs(anchor->mValue) > ARROW_HEAD_SIZE*3) { + if (anchorLength > ARROW_HEAD_SIZE*3) { painter->drawRect(QRectF( - start2.x() - ARROW_HEAD_SIZE, - start2.y() - ARROW_HEAD_SIZE, + start2Pt.x() - ARROW_HEAD_SIZE, + start2Pt.y() - ARROW_HEAD_SIZE, ARROW_HEAD_SIZE*2, ARROW_HEAD_SIZE*2)); } @@ -378,32 +360,30 @@ QPointF points[3] = { QPointF(0.0, 0.0), QPointF(0.0, 0.0), - QPointF(end.x(), end.y()) + QPointF(endPt.x(), endPt.y()) }; if (arrowType == Hb::RightEdge) { - points[0] = QPointF(end.x()-ARROW_HEAD_SIZE*2, end.y()-ARROW_HEAD_SIZE); - points[1] = QPointF(end.x()-ARROW_HEAD_SIZE*2, end.y()+ARROW_HEAD_SIZE); + points[0] = QPointF(endPt.x()-ARROW_HEAD_SIZE*2, endPt.y()-ARROW_HEAD_SIZE); + points[1] = QPointF(endPt.x()-ARROW_HEAD_SIZE*2, endPt.y()+ARROW_HEAD_SIZE); } else if (arrowType == Hb::LeftEdge) { - points[0] = QPointF(end.x()+ARROW_HEAD_SIZE*2, end.y()-ARROW_HEAD_SIZE); - points[1] = QPointF(end.x()+ARROW_HEAD_SIZE*2, end.y()+ARROW_HEAD_SIZE); + points[0] = QPointF(endPt.x()+ARROW_HEAD_SIZE*2, endPt.y()-ARROW_HEAD_SIZE); + points[1] = QPointF(endPt.x()+ARROW_HEAD_SIZE*2, endPt.y()+ARROW_HEAD_SIZE); } else if (arrowType == Hb::TopEdge) { - points[0] = QPointF(end.x()-ARROW_HEAD_SIZE, end.y()+ARROW_HEAD_SIZE*2); - points[1] = QPointF(end.x()+ARROW_HEAD_SIZE, end.y()+ARROW_HEAD_SIZE*2); - } else { - points[0] = QPointF(end.x()-ARROW_HEAD_SIZE, end.y()-ARROW_HEAD_SIZE*2); - points[1] = QPointF(end.x()+ARROW_HEAD_SIZE, end.y()-ARROW_HEAD_SIZE*2); + points[0] = QPointF(endPt.x()-ARROW_HEAD_SIZE, endPt.y()+ARROW_HEAD_SIZE*2); + points[1] = QPointF(endPt.x()+ARROW_HEAD_SIZE, endPt.y()+ARROW_HEAD_SIZE*2); + } else { // arrowType == Hb::BottomEdge + points[0] = QPointF(endPt.x()-ARROW_HEAD_SIZE, endPt.y()-ARROW_HEAD_SIZE*2); + points[1] = QPointF(endPt.x()+ARROW_HEAD_SIZE, endPt.y()-ARROW_HEAD_SIZE*2); } painter->drawPolygon(points, 3); // Draw invalid difference - if (end != end2) { - myPen.setColor(mInvalidColor); - myPen.setStyle(Qt::DashLine); - painter->setPen(myPen); - painter->drawLine(end, end2); + if (endPt != end2Pt && !spacerAnchor) { + painter->setPen(QPen(mInvalidColor, LINE_WIDTH, Qt::DashLine)); + painter->drawLine(endPt, end2Pt); } - } // End anchors for loop + } // End anchors foreach loop } painter->restore(); #else diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbanchorarrowdrawer_p.h --- a/src/hbcore/gui/hbanchorarrowdrawer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbanchorarrowdrawer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,15 +28,15 @@ #include #include -QT_FORWARD_DECLARE_CLASS(QGraphicsItem) -QT_FORWARD_DECLARE_CLASS(HbMeshLayout) + +class HbAnchorLayout; class HB_CORE_PRIVATE_EXPORT HbAnchorArrowDrawer : public HbWidgetBase { Q_OBJECT public: - HbAnchorArrowDrawer(HbMeshLayout* mesh, QGraphicsItem *parent = 0); + explicit HbAnchorArrowDrawer(HbAnchorLayout *layout, QGraphicsItem *parent = 0); virtual ~HbAnchorArrowDrawer(); public slots: @@ -51,7 +51,7 @@ void updateColors(); private: - HbMeshLayout* mLayout; + HbAnchorLayout* mLayout; bool mDrawOutlines; bool mDrawArrows; bool mDrawSpacers; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbbackgrounditem.cpp --- a/src/hbcore/gui/hbbackgrounditem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbbackgrounditem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,39 +23,31 @@ ** ****************************************************************************/ -#include -#include -#include -#include - #include "hbbackgrounditem_p.h" #include "hbwidget_p.h" #include "hbinstance.h" #include "hbdeviceprofile.h" #include "hbevent.h" #include "hbmainwindow_p.h" - -#ifndef HB_NVG_CS_ICON -#define ENABLE_FAST_PAINT_ -#endif +#include +#include +#include +#include /* \class HbBackgroundItem - \brief HbBackgroundItem draws background + \brief Draws the background. \internal */ HbBackgroundItem::HbBackgroundItem(HbMainWindow *mainWindow, QGraphicsWidget *parent) : - HbWidget(parent), - mMainWindow(mainWindow) + HbWidget(parent), + mMainWindow(mainWindow), + mImageMode(Hb::ScaleBackgroundToFit) { -#ifdef ENABLE_FAST_PAINT_ - setAttribute(Qt::WA_NoSystemBackground); // Disable clearing of background -#endif - setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored ); - + setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); mPrtImageName = defaultImageName(Qt::Vertical); mLscImageName = defaultImageName(Qt::Horizontal); updateBackgroundImage(); @@ -92,8 +84,21 @@ QString HbBackgroundItem::defaultImageName(Qt::Orientation orientation) const { return orientation == Qt::Vertical - ? QLatin1String("qtg_graf_screen_bg_prt") - : QLatin1String("qtg_graf_screen_bg_lsc"); + ? QLatin1String("qtg_graf_screen_bg_prt") + : QLatin1String("qtg_graf_screen_bg_lsc"); +} + +void HbBackgroundItem::setImageMode(Hb::BackgroundImageMode mode) +{ + if (mode != mImageMode) { + mImageMode = mode; + updateBackgroundImage(); + } +} + +Hb::BackgroundImageMode HbBackgroundItem::imageMode() const +{ + return mImageMode; } void HbBackgroundItem::updateBackgroundImage() @@ -103,12 +108,20 @@ QSizeF size(HbDeviceProfile::profile(mMainWindow).logicalSize()); mBoundingRect.setWidth(size.width()); mBoundingRect.setHeight(size.height()); - mBackground.setSize(size); if (mMainWindow->orientation() == Qt::Vertical) { mBackground.setIconName(mPrtImageName); } else { mBackground.setIconName(mLscImageName); } + if (mImageMode == Hb::KeepOriginalBackgroundSize + || mImageMode == Hb::KeepOriginalBackgroundSizeIfSmaller) { + QSizeF imageSize = mBackground.defaultSize(); + if (mImageMode == Hb::KeepOriginalBackgroundSize + || (imageSize.width() <= size.width() && imageSize.height() <= size.height())) { + size = imageSize; + } + } + mBackground.setSize(size); } } @@ -147,17 +160,28 @@ void HbBackgroundItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { - Q_UNUSED(widget) - Q_UNUSED(option) + Q_UNUSED(widget); + Q_UNUSED(option); + + if (mImageMode == Hb::DoNotDrawBackground) { + return; + } + + // Note: No optimizations to disable alpha blending etc. The background + // image may be anything, it can have transparent parts too. -#ifdef ENABLE_FAST_PAINT_ - QPainter::CompositionMode compositionMode = painter->compositionMode(); - painter->setCompositionMode( QPainter::CompositionMode_Source ); // Do not use alpha blending.. -#endif + Qt::AspectRatioMode aspRatMode; + switch (mImageMode) { + case Hb::ScaleBackgroundToFitWithoutExpanding: + aspRatMode = Qt::KeepAspectRatio; + break; + case Hb::StretchBackgroundToFit: + aspRatMode = Qt::IgnoreAspectRatio; + break; + default: + aspRatMode = Qt::KeepAspectRatioByExpanding; + break; + } - mBackground.paint(painter, mBoundingRect, Qt::KeepAspectRatioByExpanding); - -#ifdef ENABLE_FAST_PAINT_ - painter->setCompositionMode( compositionMode ); // restore old composition mode -#endif + mBackground.paint(painter, mBoundingRect, aspRatMode, Qt::AlignCenter); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbbackgrounditem_p.h --- a/src/hbcore/gui/hbbackgrounditem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbbackgrounditem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,8 +32,9 @@ class HB_CORE_PRIVATE_EXPORT HbBackgroundItem : public HbWidget { Q_OBJECT + public: - HbBackgroundItem(HbMainWindow *mainWindow, QGraphicsWidget *parent = 0); + explicit HbBackgroundItem(HbMainWindow *mainWindow, QGraphicsWidget *parent = 0); ~HbBackgroundItem(); void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); @@ -41,12 +42,17 @@ bool event(QEvent *e); enum { Type = HbPrivate::ItemType_BackgroundItem }; - int type() const { return Type; } + int type() const { + return Type; + } void setImageName(Qt::Orientation orientation, const QString &name); QString imageName(Qt::Orientation orientation) const; QString defaultImageName(Qt::Orientation orientation) const; + void setImageMode(Hb::BackgroundImageMode mode); + Hb::BackgroundImageMode imageMode() const; + void updateBackgroundImage(); private: @@ -58,6 +64,7 @@ HbMainWindow *mMainWindow; QString mPrtImageName; QString mLscImageName; + Hb::BackgroundImageMode mImageMode; }; #endif // HBBACKGROUNDITEM_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbcontentwidget.cpp --- a/src/hbcore/gui/hbcontentwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbcontentwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -42,28 +42,29 @@ \internal */ -HbContentWidget::HbContentWidget(HbMainWindow *mainWindow,QGraphicsItem *parent /*= 0*/): +HbContentWidget::HbContentWidget(HbMainWindow *mainWindow, QGraphicsItem *parent /*= 0*/): HbStackedWidget(parent), mViewSwitchRunning(false), mTargetView(0), mHidingView(0), mMainWindow(mainWindow) { + // Do not defer this, it causes invalidation and updating. + setFocusPolicy(Qt::StrongFocus); } QSizeF HbContentWidget::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const { Q_UNUSED(constraint); - QSizeF size; + QSizeF size; switch (which) { case Qt::MinimumSize: size = QSizeF(0, 0); break; - - case Qt::PreferredSize: - { + + case Qt::PreferredSize: { HbDeviceProfile profile(HbDeviceProfile::profile(this)); size = profile.logicalSize(); if (!size.isValid()) { @@ -81,11 +82,6 @@ return size; } -void HbContentWidget::delayedConstruction() -{ - setFocusPolicy(Qt::StrongFocus); -} - void HbContentWidget::setTargetView(HbView *view) { mTargetView = view; @@ -200,7 +196,7 @@ // 2nd param (hideOld): We still want to see the old view (normally setCurrentWidget would hide it). // 3rd param (showNew): The new view is not yet needed (the effect will take care of making it visible). setCurrentWidget(mTargetView, false, false); - + mHidingView = viewToHide; mViewSwitchFlags = flags; @@ -208,7 +204,7 @@ if (effectTarget) { mMainWindow->setInteractive(false); // disable input while the effects are running QString event = getEffectEvent("hide", flags, viewToHide, mTargetView); - HbEffectInternal::EffectFlags effectFlags = + HbEffectInternal::EffectFlags effectFlags = HbEffectInternal::ClearEffectWhenFinished // the effect must not be persistent | HbEffectInternal::HideRegItemBeforeClearingEffect; // to prevent unlikely, but possible flicker HbEffectInternal::start(viewToHide, effectTarget, effectFlags, diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbcontentwidget_p.h --- a/src/hbcore/gui/hbcontentwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbcontentwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,10 +41,11 @@ ~HbContentWidget() {} QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; - void delayedConstruction(); void setTargetView(HbView *view); void runViewSwitchEffectHide(HbView *viewToHide, Hb::ViewSwitchFlags flags); - bool isSwitchingViews() const { return mViewSwitchRunning; } + bool isSwitchingViews() const { + return mViewSwitchRunning; + } private slots: void hideEffectFinished(HbEffect::EffectStatus status); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbcssinspector_p.cpp --- a/src/hbcore/gui/hbcssinspector_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbcssinspector_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,15 +26,21 @@ #include "hbcssinspector_p.h" #ifdef HB_CSS_INSPECTOR -#include +#include #include #include #include #include +#include +#include +#include #include #include -#include +#include +#include #include +#include +#include #include #include #include @@ -45,20 +51,25 @@ #include #include #include -#include #include +#include +#include #include #include #include #include #include +#include +#include #include +#include +#include #include - +#include #define NODEPTR_N(x) HbCss::StyleSelector::NodePtr n = {n.ptr = (void *)x}; -const QString CSS_HTML_HEADER = ""; -const QString WIDGETML_HTML_HEADER = ""); +const QString WIDGETML_HTML_HEADER("
";
-const QString WIDGETML_HTML_FOOTER = "
"; +
");
+const QString WIDGETML_HTML_FOOTER("
"); -const int ITEMNAME = 0xfffe; // Copied from hbstyle.cpp!! +const QStringList SKIPPED_CHILD_ITEMS(QStringList() << "HbTextItem" << "HbTouchArea" + << "HbIconItem" << "HbFrameItem" << "HbSpacerItem" << "HbWidgetBase" + << "HbMarqueeItem" << "QGraphicsWidget" << "QGraphicsItem"); + +const QStringList SKIPPED_GLOBAL_ITEMS(QStringList() << "HbPopupLayoutManager" << "HbAnchorArrowDrawer" << "HbCssInfoDrawer"); + const qreal HOVER_BOX_PEN_WIDTH = 2.0; const qreal GUIDE_LINE_WIDTH = 1.0; const QChar BIG_NUMBER_CHAR = 0x221E; -const QString TEXT_COLOR = "qtc_default_main_pane_normal"; -const QString LINE_COLOR = "qtc_view_visited_normal"; +const QString TEXT_COLOR("qtc_default_main_pane_normal"); +const QString LINE_COLOR("qtc_view_visited_normal"); const int ABOVE_POPUP_ZVALUE = 5000; +const qreal SIZE_PREF_DRAW_SIZE = 7.0; +const qreal SIZE_PREF_MINIMUM_THRESHOLD = 4.0 * SIZE_PREF_DRAW_SIZE; +const qreal SIZE_PREF_LINE_WIDTH = 1.0; +const qreal SIZE_PREF_ALLOWED_OVERLAP = 2.0; +const qreal SIZE_PREF_BOX_SIZE = 0.4 * SIZE_PREF_DRAW_SIZE; +static QString itemClass(const QGraphicsItem *item) +{ + if (item && item->isWidget()) { + const QGraphicsWidget *widget = static_cast(item); + return widget->metaObject()->className(); + } + return "QGraphicsItem"; +} + +static QString objName(const QGraphicsItem *item) +{ + if (item && item->isWidget()) { + const QGraphicsWidget *widget = static_cast(item); + return widget->objectName(); + } + return QString(); +} + +static QString itemValue(const QGraphicsItem *item) +{ + QString itemClassName(itemClass(item)); + if (itemClassName == "HbIconItem") { + const HbIconItem *icon = static_cast(item); + return icon->iconName(); + } else if (itemClassName == "HbTextItem") { + const HbTextItem *text = static_cast(item); + return text->text(); + } else if (itemClassName == "HbFrameItem") { + const HbFrameItem *frame = static_cast(item); + return frame->frameDrawer().frameGraphicsName(); + } else if (itemClassName == "HbMarqueeItem") { + const HbMarqueeItem *marquee = static_cast(item); + return marquee->text(); + } + return QString(); +} + +static bool parentHasAnchorLayout(const QGraphicsItem *item) +{ + if (item) { + if (const QGraphicsItem *parent = item->parentItem()) { + if (const QGraphicsWidget *widget = static_cast(parent)) { + if (const QGraphicsLayout *layout = widget->layout()) { + if (const HbAnchorLayout *anchor = dynamic_cast(layout)) { + Q_UNUSED(anchor) + return true; + } + } + } + } + } + return false; +} + +static QString itemInParentLayout(const QGraphicsItem *item) +{ + static QMap > itemCache; + if (item) { + if (const QGraphicsWidget *widget = static_cast(item->parentItem())) { + QGraphicsLayout *layout = widget->layout(); + QSet itemsInLayout; + if (itemCache.contains(layout)) { + itemsInLayout = itemCache[layout]; + } else { + HbAnchorLayout *anchorLayout = dynamic_cast(layout); + if (!anchorLayout) { + return QString(); // Non-anchor layout + } else { + foreach (HbAnchor *anchor, anchorLayout->effectiveAnchors()) { + itemsInLayout << anchor->startItem()->graphicsItem(); + itemsInLayout << anchor->endItem()->graphicsItem(); + } + itemCache[layout] = itemsInLayout; + } + } + return itemsInLayout.contains(item) ? "Yes" : "No"; + } + } + return QString(); // Non-widget parent +} static QString cssItemText(const QGraphicsItem *item) { - QString txt; - if (item->isWidget()) { - const QGraphicsWidget *widget = static_cast(item); - // Add classname - txt += widget->metaObject()->className(); - + QString txt(itemClass(item)); + if (item && item->isWidget()) { // Add objectname - QString objName = widget->objectName(); - if (objName.length() > 0) { + QString objectName(objName(item)); + if (objectName.length() > 0) { txt.append("#"); - txt.append(objName); + txt.append(objectName); } - - // Add itemname - QString itemName = widget->data(ITEMNAME).toString(); - if (itemName.length() > 0) { - txt.append("::"); - txt.append(itemName); - } + } + // Add itemname + QString name(HbStyle::itemName(item)); + if (name.length() > 0) { + txt.append("::"); + txt.append(name); } return txt; } @@ -112,15 +208,14 @@ static QString convertMeasurementToText(const QGraphicsItem *item, qreal hint) { - QString hintText; qreal unit = HbDeviceProfile::profile(item).unitValue(); - + if (unit != 0) { hint = (hint / unit); } - hintText = QString::number(hint, 'g', 2); + QString hintText(QString::number(hint, 'g', 2)); if (hintText.contains('+')) { - hintText = BIG_NUMBER_CHAR; + hintText = BIG_NUMBER_CHAR; } else { if (hint !=0 && unit != 0) { hintText += "un"; @@ -131,35 +226,65 @@ static QString convertEffectiveSizeHintToText(const QGraphicsWidget *item, Qt::SizeHint which) { - QString hintText("("); - const QSizeF &size = item->effectiveSizeHint(which); - hintText += convertMeasurementToText(item, size.width()) + ","; - hintText += convertMeasurementToText(item, size.height()) + ")"; + QString hintText('('); + if (item) { + const QSizeF &size = item->effectiveSizeHint(which); + hintText += convertMeasurementToText(item, size.width()) + ','; + hintText += convertMeasurementToText(item, size.height()); + } + hintText += ')'; return hintText; } static QString cssItemHintText(const QGraphicsItem *item) { QString sizeHint; - if (item->isWidget()) { + if (item && item->isWidget()) { const QGraphicsWidget *widget = static_cast(item); - sizeHint += convertEffectiveSizeHintToText(widget, Qt::MinimumSize)+"|"; - sizeHint += convertEffectiveSizeHintToText(widget, Qt::PreferredSize)+"|"; + sizeHint += convertEffectiveSizeHintToText(widget, Qt::MinimumSize)+'|'; + sizeHint += convertEffectiveSizeHintToText(widget, Qt::PreferredSize)+'|'; sizeHint += convertEffectiveSizeHintToText(widget, Qt::MaximumSize); } return sizeHint; } -static QRectF cssItemHintRect(const QGraphicsItem *item) +static QString cssSizePolicyText(const QGraphicsItem *item, Qt::Orientation dir) +{ + if (!item || !item->isWidget()) { + return QString(); + } + const HbWidget *widget = static_cast(item); + QSizePolicy::Policy pol = dir == Qt::Vertical + ? widget->sizePolicy().verticalPolicy() + : widget->sizePolicy().horizontalPolicy(); + + if (pol == QSizePolicy::Fixed) { + return "Fixed"; + } else if (pol == QSizePolicy::Minimum) { + return "Minimum"; + } else if (pol == QSizePolicy::Maximum) { + return "Maximum"; + } else if (pol == QSizePolicy::Preferred) { + return "Preferred"; + } else if (pol == QSizePolicy::MinimumExpanding) { + return "Minimum expanding"; + } else if (pol == QSizePolicy::Expanding) { + return "Expanding"; + } else if (pol == QSizePolicy::Ignored) { + return "Ignored"; + } else { + return "[Unrecognised]"; + } +} + +static QRectF cssItemHintRect(const QGraphicsItem *item, Qt::SizeHint which) { QRectF hintRect; - if (item->isWidget()) { - if (item->isWidget()) { - const QGraphicsWidget *widget = static_cast(item); - const QSizeF &size = widget->effectiveSizeHint(Qt::PreferredSize); - hintRect.setWidth(size.width()); - hintRect.setHeight(size.height()); - } + if (item && item->isWidget()) { + const QGraphicsWidget *widget = static_cast(item); + const QSizeF &size = widget->effectiveSizeHint(which); + hintRect.setWidth(size.width()); + hintRect.setHeight(size.height()); } return hintRect; } @@ -180,10 +305,33 @@ return name; } +QString HbCssInspectorWindow::anchorItemName(QGraphicsLayoutItem* item, QGraphicsLayout* layout, bool& isIdBased) +{ + isIdBased = true; + QString name; + if ( item != layout ) { + QGraphicsItem *gItem = item->graphicsItem(); + if ( gItem ) { + name = HbStyle::itemName( gItem ); + if (name.isEmpty()) { + isIdBased = false; + name = objName(gItem); + if (name.isEmpty()) { + name = QString("<%1>").arg(itemClass(gItem)); + } + } + } + if ( name.isEmpty() ) { + name = QString(""); + } + } -QString HbCssInspectorWindow::meshItemsToHtmlInfo(HbMeshLayout *mesh, const QString itemName, const QString layoutName) + return name; +} + + +QString HbCssInspectorWindow::anchorsToHtmlInfo(HbAnchorLayout *anchorLayout, const QString itemName, const QString layoutName) { - QString html; QString widgetML; QXmlStreamWriter xmlWriter(&widgetML); xmlWriter.setAutoFormatting(true); @@ -192,69 +340,59 @@ QString str = syntax.lexemValue(HbXmlLoaderAbstractSyntax::TYPE_HBWIDGET); xmlWriter.writeStartElement(syntax.lexemValue(HbXmlLoaderAbstractSyntax::TYPE_HBWIDGET)); - xmlWriter.writeAttribute(syntax.lexemValue(HbXmlLoaderAbstractSyntax::ATTR_VERSION), HbWidgetLoaderSyntax::version()); + xmlWriter.writeAttribute( + syntax.lexemValue(HbXmlLoaderAbstractSyntax::ATTR_VERSION), + HbWidgetLoaderSyntax::version()); xmlWriter.writeAttribute(syntax.lexemValue(HbXmlLoaderAbstractSyntax::ATTR_TYPE), itemName); xmlWriter.writeStartElement(syntax.lexemValue(HbXmlLoaderAbstractSyntax::TYPE_LAYOUT)); xmlWriter.writeAttribute(syntax.lexemValue(HbXmlLoaderAbstractSyntax::ATTR_NAME), layoutName); - xmlWriter.writeAttribute(syntax.lexemValue(HbXmlLoaderAbstractSyntax::ATTR_TYPE), syntax.lexemValue(HbXmlLoaderAbstractSyntax::LAYOUT_MESH)); - - if (mesh) { - QList anchors = HbMeshLayoutDebug::getAnchors(mesh); - for (int i=0; imStartItem->graphicsItem()); - QString endName = HbStyle::itemName(anchor->mEndItem->graphicsItem()); - QString spacingText; - - QGraphicsItem *asGraphicsItem = mesh->parentLayoutItem()->graphicsItem(); - if ( asGraphicsItem && asGraphicsItem->isWidget() ){ - HbWidget *asWidget = qobject_cast( static_cast(asGraphicsItem) ); - if( asWidget ) { - HbWidgetPrivate*priv = static_cast(HbWidgetBasePrivate::d_ptr(asWidget)); + if (anchorLayout) { + foreach (HbAnchor *anchor, anchorLayout->effectiveAnchors()) { + bool startIdBased, endIdBased; + QString startName(anchorItemName(anchor->startItem(), anchorLayout, startIdBased)); + QString endName(anchorItemName(anchor->endItem(), anchorLayout, endIdBased)); - if (startName.isEmpty()) { - startName = priv->mSpacers.key(anchor->mStartItem); - } - if (endName.isEmpty()) { - endName = priv->mSpacers.key(anchor->mEndItem); - } - - if(qAbs(anchor->mValue) > 0.01) - spacingText = convertMeasurementToText(asWidget, anchor->mValue); - } + xmlWriter.writeStartElement(syntax.lexemValue(HbXmlLoaderAbstractSyntax::AL_ANCHOR)); + xmlWriter.writeAttribute( + syntax.lexemValue( startIdBased + ? HbXmlLoaderAbstractSyntax::AL_SRC_ID + : HbXmlLoaderAbstractSyntax::AL_SRC_NAME), + startName); + xmlWriter.writeAttribute( + syntax.lexemValue(HbXmlLoaderAbstractSyntax::AL_SRC_EDGE), + anchorEdgeName(anchor->startEdge())); + xmlWriter.writeAttribute( + syntax.lexemValue( endIdBased + ? HbXmlLoaderAbstractSyntax::AL_DST_ID + : HbXmlLoaderAbstractSyntax::AL_DST_NAME), + endName); + xmlWriter.writeAttribute( + syntax.lexemValue(HbXmlLoaderAbstractSyntax::AL_DST_EDGE), + anchorEdgeName(anchor->endEdge())); + if ( !anchor->anchorId().isEmpty() ) { + xmlWriter.writeAttribute( + syntax.lexemValue(HbXmlLoaderAbstractSyntax::AL_SPACER), + anchor->anchorId()); } - - xmlWriter.writeStartElement(syntax.lexemValue(HbXmlLoaderAbstractSyntax::ML_MESHITEM)); - - xmlWriter.writeAttribute( - syntax.lexemValue(HbXmlLoaderAbstractSyntax::ML_SRC_NAME), startName); - xmlWriter.writeAttribute( - syntax.lexemValue(HbXmlLoaderAbstractSyntax::ML_SRC_EDGE), anchorEdgeName(anchor->mStartEdge)); - xmlWriter.writeAttribute( - syntax.lexemValue(HbXmlLoaderAbstractSyntax::ML_DST_NAME), endName); - xmlWriter.writeAttribute( - syntax.lexemValue(HbXmlLoaderAbstractSyntax::ML_DST_EDGE), anchorEdgeName(anchor->mEndEdge)); - if ( !spacingText.isEmpty() ) { - xmlWriter.writeAttribute( - syntax.lexemValue(HbXmlLoaderAbstractSyntax::ML_SPACING), spacingText); - } - xmlWriter.writeEndElement(); // meshitem + xmlWriter.writeEndElement(); // anchoritem } } xmlWriter.writeEndElement(); // layout xmlWriter.writeEndElement(); // widgetml - html = widgetML; - html.remove(0, html.indexOf("<")); // trim whitespace - html.replace("<", "<"); - html.replace(">", ">"); + QString html(widgetML.trimmed()); + html.replace('<', "<"); + html.replace('>', ">"); html.replace(QRegExp("\"([^\"]*)\""), "\"\\1\""); // Add span elements around things in quotes - html.replace("\"", """); + html.replace('\"', """); html.replace("\n\n", "\n"); - html.replace("\n", "
"); + html.replace('\n', "
"); html.insert(0, WIDGETML_HTML_HEADER); html.append(WIDGETML_HTML_FOOTER); @@ -268,14 +406,12 @@ -HbCssInfoDrawer::HbCssInfoDrawer(QGraphicsItem *parent) - : HbWidgetBase(parent), - mShowItemText(true), - mShowHintText(true), - mShowBox(true), - mShowHintBox(true), - mDrawGuideLines(true), - mItemRect(0,0,0,0) +HbCssInfoDrawer::HbCssInfoDrawer(QGraphicsItem *parent) : + HbWidgetBase(parent), + mItemRect(0,0,0,0), + mMinHintRect(0,0,0,0), + mPrefHintRect(0,0,0,0), + mMaxHintRect(0,0,0,0) { updateColors(); setVisible(false); @@ -310,11 +446,14 @@ mItemRect = item->sceneBoundingRect(); mItemText = cssItemText(item); mHintText = cssItemHintText(item); - mHintRect = cssItemHintRect(item); + mMinHintRect = cssItemHintRect(item, Qt::MinimumSize); + mPrefHintRect = cssItemHintRect(item, Qt::PreferredSize); + mMaxHintRect = cssItemHintRect(item, Qt::MaximumSize); // Make sure this is in the same place in the scene as the window if (item->isWidget()) { const HbWidget *obj = static_cast(item); this->setGeometry(obj->mainWindow()->rect()); + mItemPolicy = obj->sizePolicy(); } } else { this->setVisible(false); @@ -324,13 +463,172 @@ void HbCssInfoDrawer::paintRect(QPainter *painter, QRectF rect) { - rect.adjust( - HOVER_BOX_PEN_WIDTH/2, HOVER_BOX_PEN_WIDTH/2, - -HOVER_BOX_PEN_WIDTH/2, -HOVER_BOX_PEN_WIDTH/2); - painter->drawRect(rect); + rect.adjust( + HOVER_BOX_PEN_WIDTH/2, HOVER_BOX_PEN_WIDTH/2, + -HOVER_BOX_PEN_WIDTH/2, -HOVER_BOX_PEN_WIDTH/2); + painter->drawRect(rect); +} + +static QPolygonF createTrianglePoints(const QPointF &pointPos, Qt::ArrowType dir) +{ + const qreal size = SIZE_PREF_DRAW_SIZE; + const qreal half = size / 2.0; + const qreal x = pointPos.x(); + const qreal y = pointPos.y(); + + QPolygonF points; + points << pointPos; + + switch (dir) { + case Qt::LeftArrow: + points << QPointF(x+size, y-half); + points << QPointF(x+size, y+half); + break; + case Qt::RightArrow: + points << QPointF(x-size, y-half); + points << QPointF(x-size, y+half); + break; + case Qt::UpArrow: + points << QPointF(x-half, y+size); + points << QPointF(x+half, y+size); + break; + case Qt::DownArrow: + points << QPointF(x-half, y-size); + points << QPointF(x+half, y-size); + break; + default: // Set points to same position to avoid drawing to origin + points << pointPos; + points << pointPos; + } + return points; } -void HbCssInfoDrawer::paint(QPainter *painter, +enum LayoutPosition { + RegularLayout, + MirroredLayout +}; + +enum ArrowDirection { + RegularArrow, + MirroredArrow +}; + +static void drawTriangle(QPainter *painter, Qt::Orientation dir, const QRectF &bRect, + int iconsFromEdge, qreal linePos, LayoutPosition layout, ArrowDirection arrowDir) +{ + QPointF point; + + qreal posFromEdge = iconsFromEdge * SIZE_PREF_DRAW_SIZE; + if (arrowDir == MirroredArrow) { + posFromEdge += SIZE_PREF_DRAW_SIZE; + } + + Qt::ArrowType arrow = Qt::NoArrow; + if (dir == Qt::Vertical) { + if (layout == MirroredLayout) { + posFromEdge += bRect.top(); + arrow = (arrowDir == MirroredArrow) ? Qt::DownArrow : Qt::UpArrow; + } else { + posFromEdge = bRect.bottom() - posFromEdge; + arrow = (arrowDir == MirroredArrow) ? Qt::UpArrow : Qt::DownArrow; + } + point = QPointF(linePos, posFromEdge); + } else { + if (layout == MirroredLayout) { + posFromEdge = bRect.right() - posFromEdge; + arrow = (arrowDir == MirroredArrow) ? Qt::LeftArrow : Qt::RightArrow; + } else { + posFromEdge += bRect.left(); + arrow = (arrowDir == MirroredArrow) ? Qt::RightArrow : Qt::LeftArrow; + } + point = QPointF(posFromEdge, linePos); + } + + painter->drawPolygon(createTrianglePoints(point, arrow)); +} + + +static void drawPolicyIcons( + QPainter *painter, Qt::Orientation direction, QSizePolicy policy, const QRectF &itemRect) +{ + bool vert = direction == Qt::Vertical; + QSizePolicy::Policy pol = vert ? policy.verticalPolicy() : policy.horizontalPolicy(); + + const QBrush fillBrush(Qt::gray, Qt::SolidPattern); //krazy:exclude=qenums + const QBrush hollowBrush(Qt::white, Qt::SolidPattern); + const QRectF rect = itemRect.adjusted(HOVER_BOX_PEN_WIDTH/2, HOVER_BOX_PEN_WIDTH/2, + -HOVER_BOX_PEN_WIDTH/2, -HOVER_BOX_PEN_WIDTH/2); + + const qreal vLinePos = rect.left() + (rect.width() * 0.8); + const qreal hLinePos = rect.top() + (rect.height() * 0.2); + const qreal linePos = qFloor(vert ? vLinePos : hLinePos); // floor to force consistent rounding + + bool drawSecondIcons; + if (vert) { + drawSecondIcons = (3*SIZE_PREF_DRAW_SIZE) + rect.top() <= + hLinePos + SIZE_PREF_ALLOWED_OVERLAP; + painter->drawLine((int)linePos, (int)(rect.top()), (int)linePos, (int)(rect.bottom())); + } else { + drawSecondIcons = rect.right() - (3*SIZE_PREF_DRAW_SIZE) >= + vLinePos - SIZE_PREF_ALLOWED_OVERLAP; + painter->drawLine((int)(rect.left()), (int)linePos, (int)(rect.right()), (int)linePos); + } + + // Ignore icons have different rules + if (pol & QSizePolicy::IgnoreFlag) { + // Draw outer triangle + painter->setBrush(fillBrush); + drawTriangle(painter, direction, rect, 0, linePos, RegularLayout, RegularArrow); + if (drawSecondIcons) { + drawTriangle(painter, direction, rect, 0, linePos, MirroredLayout, RegularArrow); + } + // Draw inner triangle + painter->setBrush(hollowBrush); + drawTriangle(painter, direction, rect, 2, linePos, RegularLayout, RegularArrow); + if (drawSecondIcons) { + drawTriangle(painter, direction, rect, 2, linePos, MirroredLayout, RegularArrow); + } + } else { + // Draw outer triangle + if (pol & QSizePolicy::GrowFlag) { + painter->setBrush(pol & QSizePolicy::ExpandFlag ? fillBrush : hollowBrush); + drawTriangle(painter, direction, rect, 0, linePos, RegularLayout, RegularArrow); + if (drawSecondIcons) { + drawTriangle(painter, direction, rect, 0, linePos, MirroredLayout, RegularArrow); + } + } + // Draw box + painter->setBrush(pol & QSizePolicy::ExpandFlag ? hollowBrush : fillBrush); + QRectF boxRect(0, 0, SIZE_PREF_DRAW_SIZE, SIZE_PREF_DRAW_SIZE); + qreal midPoint = (1 + 0.5) * SIZE_PREF_DRAW_SIZE; // Middle of the second icon + if (vert) { + boxRect.setHeight(SIZE_PREF_BOX_SIZE); + boxRect.moveCenter(QPointF(linePos, rect.bottom() - midPoint)); + } else { + boxRect.setWidth(SIZE_PREF_BOX_SIZE); + boxRect.moveCenter(QPointF(rect.left() + midPoint, linePos)); + } + painter->drawRect(boxRect); + if (drawSecondIcons) { + if (vert) { + boxRect.moveCenter(QPointF(linePos, rect.top() + midPoint)); + } else { + boxRect.moveCenter(QPointF(rect.right() - midPoint, linePos)); + } + painter->drawRect(boxRect); + } + // Draw inner triangle + if (pol & QSizePolicy::ShrinkFlag) { + painter->setBrush(hollowBrush); + drawTriangle(painter, direction, rect, 2, linePos, RegularLayout, MirroredArrow); + if (drawSecondIcons) { + drawTriangle(painter, direction, rect, 2, linePos, MirroredLayout, MirroredArrow); + } + } + } +} + +void HbCssInfoDrawer::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); @@ -344,11 +642,23 @@ painter->setPen(QPen(mBoxColor, HOVER_BOX_PEN_WIDTH)); paintRect(painter, mItemRect); } - if (mShowHintBox) { - painter->setPen(QPen(Qt::green, HOVER_BOX_PEN_WIDTH)); - QRectF prefRect = mHintRect; - prefRect.moveCenter(mItemRect.center()); - paintRect(painter, prefRect); + if (mShowMinHintBox) { + painter->setPen(QPen(Qt::blue, HOVER_BOX_PEN_WIDTH)); //krazy:exclude=qenums + QRectF rect = mMinHintRect; + rect.moveCenter(mItemRect.center()); + paintRect(painter, rect); + } + if (mShowPrefHintBox) { + painter->setPen(QPen(Qt::green, HOVER_BOX_PEN_WIDTH)); //krazy:exclude=qenums + QRectF rect = mPrefHintRect; + rect.moveCenter(mItemRect.center()); + paintRect(painter, rect); + } + if (mShowMaxHintBox) { + painter->setPen(QPen(Qt::red, HOVER_BOX_PEN_WIDTH)); //krazy:exclude=qenums + QRectF rect = mMaxHintRect; + rect.moveCenter(mItemRect.center()); + paintRect(painter, rect); } painter->setPen(mTextColor); @@ -382,6 +692,17 @@ painter->drawLine(0, (int)mItemRect.bottom(), (int)br.width(), (int)mItemRect.bottom()); } + // Draw the size prefs icons + if (mShowSizePrefs) { + painter->setPen(QPen(Qt::gray, SIZE_PREF_LINE_WIDTH)); //krazy:exclude=qenums + if (mItemRect.height() > SIZE_PREF_MINIMUM_THRESHOLD) { + drawPolicyIcons(painter, Qt::Horizontal, mItemPolicy, mItemRect); + } + if (mItemRect.width() > SIZE_PREF_MINIMUM_THRESHOLD) { + drawPolicyIcons(painter, Qt::Vertical, mItemPolicy, mItemRect); + } + } + painter->setLayoutDirection(prevDirection); painter->setPen(prevPen); } @@ -390,7 +711,213 @@ /******************************************************************************************/ +CodeWidget::CodeWidget(const QString &title, QWidget *parent) + : QWidget(parent), mLabel(0), mTextBox(0) +{ + mLabel = new QLabel(title, this); + mTextBox = new QTextEdit(this); + mTextBox->setReadOnly(true); + QVBoxLayout *layout = new QVBoxLayout(this); + layout->setContentsMargins(0,0,0,0); + layout->addWidget(mLabel); + layout->addWidget(mTextBox); + setLayout(layout); +} +CodeWidget::~CodeWidget() +{ +} + +void CodeWidget::setText(const QString &text) +{ + mTextBox->setText(text); +} + +void CodeWidget::setHtml(const QString &html) +{ + mTextBox->setHtml(html); +} + +void CodeWidget::setLayoutDirection(Qt::LayoutDirection dir) +{ + mLabel->setLayoutDirection(dir); + mTextBox->setLayoutDirection(dir); +} + + + +/******************************************************************************************/ +CssInspectorModelItem::CssInspectorModelItem(QGraphicsItem *item, int row, CssInspectorModelItem *parent) + : mItem(item), mParent(parent), mRow(row) +{ +} + +CssInspectorModelItem::~CssInspectorModelItem() +{ + QHash::iterator it; + for (it = mChildren.begin(); it!= mChildren.end(); ++it) + delete it.value(); +} + +CssInspectorModelItem* CssInspectorModelItem::child(int i) +{ + if (mChildren.contains(i)) + return mChildren[i]; + + if (i>=0 && i < mItem->childItems().count()) { + QGraphicsItem *child = mItem->childItems().at(i); + CssInspectorModelItem *childItem = new CssInspectorModelItem(child, i, this); + mChildren[i] = childItem; + return childItem; + } + return 0; +} + +CssInspectorModelItem* CssInspectorModelItem::parent() +{ + return mParent; +} + +QGraphicsItem* CssInspectorModelItem::data() +{ + return mItem; +} + +int CssInspectorModelItem::row() +{ + return mRow; +} + +/******************************************************************************************/ +CssInspectorModel::CssInspectorModel(HbMainWindow *win, QObject *parent) + : QAbstractItemModel(parent), mWin(win), mRootItem(0) +{ + QGraphicsItem *screen = HbMainWindowPrivate::d_ptr(win)->mClippingItem; + mRootItem = new CssInspectorModelItem(screen, 0); +} + +CssInspectorModel::~CssInspectorModel() +{ + delete mRootItem; +} + +QVariant CssInspectorModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid() || role != Qt::DisplayRole) + return QVariant(); + + CssInspectorModelItem *item = static_cast(index.internalPointer()); + QGraphicsItem *graphicsItem = item->data(); + + switch (index.column()) { + case 0: return itemClass(graphicsItem); + case 1: return objName(graphicsItem); + case 2: return HbStyle::itemName(graphicsItem); + case 3: return itemValue(graphicsItem); + case 4: return itemInParentLayout(graphicsItem); + } + return QVariant(); +} + +QVariant CssInspectorModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (orientation == Qt::Horizontal && role == Qt::DisplayRole) { + switch (section) { + case 0: return "Classname"; + case 1: return "Objectname"; + case 2: return "Itemname"; + case 3: return "Value"; + case 4: return "In layout"; + } + } + return QVariant(); +} + +QModelIndex CssInspectorModel::index(int row, int column, const QModelIndex &parent) const +{ + if (!hasIndex(row, column, parent)) + return QModelIndex(); + + CssInspectorModelItem *parentItem; + if (!parent.isValid()) + parentItem = mRootItem; + else + parentItem = static_cast(parent.internalPointer()); + + CssInspectorModelItem *childItem = parentItem->child(row); + if (childItem) + return createIndex(row, column, childItem); + else + return QModelIndex(); +} + +QModelIndex CssInspectorModel::parent(const QModelIndex &child) const +{ + if (!child.isValid()) + return QModelIndex(); + + CssInspectorModelItem* childItem = static_cast(child.internalPointer()); + CssInspectorModelItem* parentItem = childItem->parent(); + + if (!parentItem || parentItem == mRootItem) + return QModelIndex(); + + return createIndex(parentItem->row(), 0, parentItem); +} + +int CssInspectorModel::rowCount(const QModelIndex &parent) const +{ + if (parent.column() > 0) + return 0; + + CssInspectorModelItem *parentItem; + + if (!parent.isValid()) + parentItem = mRootItem; + else + parentItem = static_cast(parent.internalPointer()); + + return parentItem->data()->childItems().count(); +} + +int CssInspectorModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent) + return 5; +} + + +ItemColorDelegate::ItemColorDelegate(QObject *parent) + : QStyledItemDelegate(parent) +{ +} + +ItemColorDelegate::~ItemColorDelegate() +{ +} + +const int ITEMNAME_COLUMN = 2; +const int INLAYOUT_COLUMN = 4; + +void ItemColorDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const +{ + if (index.column() == ITEMNAME_COLUMN) { + if (index.data().toString() == "") { + CssInspectorModelItem *modelItem = static_cast(index.internalPointer()); + QGraphicsItem *item = modelItem->data(); + if (parentHasAnchorLayout(item)) { + painter->fillRect(option.rect, Qt::red); + } + } + } else if (index.column() == INLAYOUT_COLUMN) { + if (index.data().toString() == "No") { + painter->fillRect(option.rect, Qt::red); + } + } + QStyledItemDelegate::paint(painter, option, index); +} +/******************************************************************************************/ HbCssInspectorWindow *HbCssInspectorWindow::instance() { @@ -418,99 +945,191 @@ mInstalledFilters.clear(); } +void HbCssInspectorWindow::updateFromTreeView(const QModelIndex &index) +{ + CssInspectorModelItem *modelItem = static_cast(index.internalPointer()); + QGraphicsItem *item = modelItem->data(); + updateFocusItem(item); + foreach (HoveredWidgetFilter *filter, mInstalledFilters) { + filter->mCssInfoDrawer->updateFocusItem(item); + filter->mArrowDrawer->updateFocusItem(item); + } +} + +void HbCssInspectorWindow::updateColumnSizes(const QModelIndex &index) +{ + Q_UNUSED(index) + mTreeView->header()->resizeSections(QHeaderView::ResizeToContents); +} void HbCssInspectorWindow::addFilters() { foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + mTreeView->setModel(new CssInspectorModel(window)); + HoveredWidgetFilter *filter = new HoveredWidgetFilter(window->scene()); window->scene()->installEventFilter(filter); mInstalledFilters.append(filter); - connect(filter, SIGNAL(newItemHovered(const QGraphicsItem*)), SLOT(updateFocusItem(const QGraphicsItem*))); - connect(mNameCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, SLOT(setItemTextVisible(bool))); - connect(mSizeHintCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, SLOT(setHintTextVisible(bool))); - connect(mHintOutlinesCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, SLOT(setHintBoxVisible(bool))); - connect(mGuideLinesCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, SLOT(setGuideLinesVisible(bool))); - connect(mArrowsCheck, SIGNAL(toggled(bool)), filter->mArrowDrawer, SLOT(setDrawArrows(bool))); - connect(mOutlinesCheck, SIGNAL(toggled(bool)), filter->mArrowDrawer, SLOT(setDrawOutlines(bool))); - connect(mSpacersCheck, SIGNAL(toggled(bool)), filter->mArrowDrawer, SLOT(setDrawSpacers(bool))); - connect(mLiveRadio, SIGNAL(toggled(bool)), filter, SLOT(setLiveMode(bool))); + connect(filter, SIGNAL(newItemHovered(const QGraphicsItem*)), + SLOT(updateFocusItem(const QGraphicsItem*))); + + connect(mObjectNameCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, + SLOT(setItemTextVisible(bool))); + connect(mAnchorArrowsCheck, SIGNAL(toggled(bool)), filter->mArrowDrawer, + SLOT(setDrawArrows(bool))); + connect(mSubitemOutlinesCheck, SIGNAL(toggled(bool)), filter->mArrowDrawer, + SLOT(setDrawOutlines(bool))); + connect(mSpacersCheck, SIGNAL(toggled(bool)), filter->mArrowDrawer, + SLOT(setDrawSpacers(bool))); + connect(mGuideLinesCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, + SLOT(setGuideLinesVisible(bool))); + + connect(mSizeHintTextCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, + SLOT(setHintTextVisible(bool))); + connect(mMinSizeHintCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, + SLOT(setMinHintBoxVisible(bool))); + connect(mPrefSizeHintCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, + SLOT(setPrefHintBoxVisible(bool))); + connect(mMaxSizeHintCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, + SLOT(setMaxHintBoxVisible(bool))); + connect(mSizePrefCheck, SIGNAL(toggled(bool)), filter->mCssInfoDrawer, + SLOT(setSizePrefsVisible(bool))); + + connect(mHoverRadio, SIGNAL(toggled(bool)), filter, SLOT(setHoverMode(bool))); connect(mBlockRadio, SIGNAL(toggled(bool)), filter, SLOT(setBlockingMode(bool))); - } + + filter->mCssInfoDrawer->setItemTextVisible(mObjectNameCheck->isChecked()); + filter->mArrowDrawer->setDrawArrows(mAnchorArrowsCheck->isChecked()); + filter->mArrowDrawer->setDrawOutlines(mSubitemOutlinesCheck->isChecked()); + filter->mArrowDrawer->setDrawSpacers(mSpacersCheck->isChecked()); + filter->mCssInfoDrawer->setGuideLinesVisible(mGuideLinesCheck->isChecked()); + filter->mCssInfoDrawer->setHintTextVisible(mSizeHintTextCheck->isChecked()); + filter->mCssInfoDrawer->setMinHintBoxVisible(mMinSizeHintCheck->isChecked()); + filter->mCssInfoDrawer->setPrefHintBoxVisible(mPrefSizeHintCheck->isChecked()); + filter->mCssInfoDrawer->setMaxHintBoxVisible(mMaxSizeHintCheck->isChecked()); + filter->mCssInfoDrawer->setSizePrefsVisible(mSizePrefCheck->isChecked()); + filter->setHoverMode(mHoverRadio->isChecked()); + filter->setBlockingMode(mBlockRadio->isChecked()); + } } HbCssInspectorWindow::HbCssInspectorWindow(QWidget *parent) - : QWidget(parent), mLayoutWidgetMLBox(0), mLayoutCssBox(0), mColorsCssBox(0) + : QWidget(parent) { - QGroupBox *settings = new QGroupBox(tr("Settings"), this); - QGridLayout *settingLayout = new QGridLayout(settings); - mArrowsCheck = new QCheckBox(tr("Draw arrows"), this); - mOutlinesCheck = new QCheckBox(tr("Draw subitem outlines"), this); - mHintOutlinesCheck = new QCheckBox(tr("Draw sizehint outlines"), this); + QGroupBox *generalGroup = new QGroupBox(tr("General"), this); + QVBoxLayout *genLayout = new QVBoxLayout(this); + generalGroup->setLayout(genLayout); + mObjectNameCheck = new QCheckBox(tr("Show object name"), this); + mAnchorArrowsCheck = new QCheckBox(tr("Draw arrows"), this); + mSubitemOutlinesCheck = new QCheckBox(tr("Draw subitem outlines"), this); mSpacersCheck = new QCheckBox(tr("Draw spacers"), this); - mNameCheck = new QCheckBox(tr("Show object name"), this); - mSizeHintCheck = new QCheckBox(tr("Show size hint"), this); mGuideLinesCheck = new QCheckBox(tr("Draw guide lines"), this); - mLiveRadio = new QRadioButton(tr("Live mode"), this); + genLayout->addWidget(mObjectNameCheck); + genLayout->addWidget(mAnchorArrowsCheck); + genLayout->addWidget(mSubitemOutlinesCheck); + genLayout->addWidget(mSpacersCheck); + genLayout->addWidget(mGuideLinesCheck); + + QGroupBox *sizeHintOptsGroup = new QGroupBox(tr("Size Hints"), this); + QVBoxLayout *shLayout = new QVBoxLayout(this); + sizeHintOptsGroup->setLayout(shLayout); + mSizeHintTextCheck = new QCheckBox(tr("Show size hint"), this); + mMinSizeHintCheck = new QCheckBox(tr("Min size hint outline"), this); + mPrefSizeHintCheck = new QCheckBox(tr("Pref size hint outline"), this); + mMaxSizeHintCheck = new QCheckBox(tr("Max size hint outline"), this); + mSizePrefCheck = new QCheckBox(tr("Size preferences"), this); + shLayout->addWidget(mSizeHintTextCheck); + shLayout->addWidget(mMinSizeHintCheck); + shLayout->addWidget(mPrefSizeHintCheck); + shLayout->addWidget(mMaxSizeHintCheck); + shLayout->addWidget(mSizePrefCheck); + + QGroupBox *eventModeGroup = new QGroupBox(tr("Event mode"), this); + QVBoxLayout *eventLayout = new QVBoxLayout(this); + eventModeGroup->setLayout(eventLayout); + mHoverRadio = new QRadioButton(tr("Hover mode"), this); mClickRadio = new QRadioButton(tr("Click locking mode"), this); - mBlockRadio = new QRadioButton(tr("Click locking mode (block events)"), this); - settingLayout->addWidget(mArrowsCheck, 0, 0); - settingLayout->addWidget(mOutlinesCheck, 1, 0); - settingLayout->addWidget(mHintOutlinesCheck, 2, 0); - settingLayout->addWidget(mSpacersCheck, 3, 0); - settingLayout->addWidget(mNameCheck, 0, 1); - settingLayout->addWidget(mSizeHintCheck, 1, 1); - settingLayout->addWidget(mGuideLinesCheck, 2, 1); - settingLayout->addWidget(mLiveRadio, 0, 2); - settingLayout->addWidget(mClickRadio, 1, 2); - settingLayout->addWidget(mBlockRadio, 2, 2); - mArrowsCheck->setChecked(true); - mOutlinesCheck->setChecked(true); - mHintOutlinesCheck->setChecked(true); - mSpacersCheck->setChecked(true); - mNameCheck->setChecked(true); - mSizeHintCheck->setChecked(true); - mGuideLinesCheck->setChecked(true); - mLiveRadio->setChecked(true); + mBlockRadio = new QRadioButton(tr("Blocked locking mode"), this); + eventLayout->addWidget(mHoverRadio); + eventLayout->addWidget(mClickRadio); + eventLayout->addWidget(mBlockRadio); + + QHBoxLayout *settingLayout = new QHBoxLayout; + settingLayout->addWidget(generalGroup); + settingLayout->addWidget(sizeHintOptsGroup); + settingLayout->addWidget(eventModeGroup); - QLabel *lblWidgetML = new QLabel(tr("WidgetML"), this); - mLayoutWidgetMLBox = new QTextEdit(this); - mLayoutWidgetMLBox->setReadOnly(true); + QGroupBox *sizeHintGroup = new QGroupBox(tr("Size hint"), this); + QHBoxLayout *sizeHLayout = new QHBoxLayout; + sizeHintGroup->setLayout(sizeHLayout); + mSizeHintLabel = new QLabel("", this); + sizeHLayout->addWidget(mSizeHintLabel); + + QGroupBox *sizePolicyGroup = new QGroupBox(tr("Size Policies"), this); + QHBoxLayout *sizePolicyLayout = new QHBoxLayout; + sizePolicyGroup->setLayout(sizePolicyLayout); + mSizePolicyHoriz = new QLabel(this); + mSizePolicyVert = new QLabel(this); + sizePolicyLayout->addWidget(mSizePolicyHoriz); + sizePolicyLayout->addWidget(mSizePolicyVert); + + QHBoxLayout *sizeLayout = new QHBoxLayout; + sizeLayout->setContentsMargins(0,0,0,0); + sizeLayout->addWidget(sizeHintGroup); + sizeLayout->addWidget(sizePolicyGroup); - QLabel *lblLayout = new QLabel(tr("Layouts CSS stack (+all)"), this); - mLayoutCssBox = new QTextEdit(this); - mLayoutCssBox->setReadOnly(true); - - QLabel *lblColors = new QLabel(tr("Colors CSS stack (+all)"), this); - mColorsCssBox = new QTextEdit(this); - mColorsCssBox->setReadOnly(true); - - mPathLabel = new QLabel("", this); - mSizeHintLabel = new QLabel("", this); - mSizeHintLabel->setAlignment(Qt::AlignRight); + QWidget *treeContainer = new QWidget(this); + QVBoxLayout *treeLayout = new QVBoxLayout; + treeLayout->setContentsMargins(0,0,0,0); + treeContainer->setLayout(treeLayout); + mTreeView = new QTreeView(this); + mTreeView->setItemDelegate(new ItemColorDelegate); + QLabel *treeLabel = new QLabel(tr("Item tree")); + treeLayout->addWidget(treeLabel); + treeLayout->addWidget(mTreeView); + + connect(mTreeView, SIGNAL(collapsed(const QModelIndex&)), this, SLOT(updateColumnSizes(const QModelIndex&))); + connect(mTreeView, SIGNAL(expanded(const QModelIndex&)), this, SLOT(updateColumnSizes(const QModelIndex&))); + connect(mTreeView, SIGNAL(clicked(const QModelIndex&)), this, SLOT(updateFromTreeView(const QModelIndex&))); - QGridLayout *layout = new QGridLayout(this); - layout->addWidget(settings, 0, 0, 1, 4); - layout->addWidget(lblWidgetML, 1, 0); - layout->addWidget(mLayoutWidgetMLBox, 2, 0, 1, 4); - layout->addWidget(lblLayout, 3, 0, 1, 2); - layout->addWidget(lblColors, 3, 2, 1, 2); - layout->addWidget(mLayoutCssBox, 4, 0, 1, 2); - layout->addWidget(mColorsCssBox, 4, 2, 1, 2); - layout->addWidget(mPathLabel, 5, 0, 1, 3); - layout->addWidget(mSizeHintLabel, 5, 3, 1, 1); - layout->setRowStretch(2, 2); - layout->setRowStretch(4, 3); + QSplitter *widgetSplitter = new QSplitter(this); + mWidgetMLBox = new CodeWidget(tr("WidgetML"), this); + widgetSplitter->addWidget(treeContainer); + widgetSplitter->addWidget(mWidgetMLBox); + + QSplitter *cssSplitter = new QSplitter(this); + mLayoutCssBox = new CodeWidget(tr("Layouts CSS stack (+all)"), this); + mColorsCssBox = new CodeWidget(tr("Colors CSS stack (+all)"), this); + cssSplitter->addWidget(mLayoutCssBox); + cssSplitter->addWidget(mColorsCssBox); + + QSplitter *vertSplit = new QSplitter(Qt::Vertical, this); + vertSplit->addWidget(widgetSplitter); + vertSplit->addWidget(cssSplitter); + + mPathLabel = new QLabel(this); + + QVBoxLayout *mainLayout = new QVBoxLayout(this); + mainLayout->addLayout(settingLayout); + mainLayout->addLayout(sizeLayout); + mainLayout->addWidget(vertSplit); + mainLayout->addWidget(mPathLabel); // Lock in left-to-right mode mSizeHintLabel->setLayoutDirection(Qt::LeftToRight); - lblColors->setLayoutDirection(Qt::LeftToRight); - lblLayout->setLayoutDirection(Qt::LeftToRight); mLayoutCssBox->setLayoutDirection(Qt::LeftToRight); mColorsCssBox->setLayoutDirection(Qt::LeftToRight); - mLayoutWidgetMLBox->setLayoutDirection(Qt::LeftToRight); + mWidgetMLBox->setLayoutDirection(Qt::LeftToRight); - setLayout(layout); + // Set default options + mObjectNameCheck->setChecked(true); + mAnchorArrowsCheck->setChecked(true); + mSubitemOutlinesCheck->setChecked(true); + mSpacersCheck->setChecked(true); + mHoverRadio->setChecked(true); + + setLayout(mainLayout); } @@ -537,10 +1156,12 @@ NODEPTR_N(widget); HbDeviceProfile profile(HbDeviceProfile::profile(widget)); - HbLayeredStyleLoader *layoutStack = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Layouts); + HbLayeredStyleLoader *layoutStack = + HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Layouts); if (layoutStack) { // Update layout CSS box - HbVector layoutRules = layoutStack->styleRulesForNode(n, profile.orientation()); + HbVector layoutRules = + layoutStack->styleRulesForNode(n, profile.orientation()); mLayoutCssBox->setHtml(CSS_HTML_HEADER + HbCssFormatter::styleRulesToHtml(layoutRules)); // Get layoutname from CSS @@ -550,27 +1171,30 @@ HbCss::ValueExtractor extractor(decls, profile); QString layoutName; QString sectionName; - extractor.extractLayout(&layoutName, §ionName); + extractor.extractLayout(layoutName, sectionName); // Update widgetML box QString html; if (widget->layout()) { - QString itemName = widget->metaObject()->className(); - HbMeshLayout *mesh = dynamic_cast(widget->layout()); - html = meshItemsToHtmlInfo(mesh, itemName, layoutName); + HbAnchorLayout *anchorLayout = dynamic_cast(widget->layout()); + html = anchorsToHtmlInfo(anchorLayout, itemClass(widget), layoutName); } - mLayoutWidgetMLBox->setHtml(html); + mWidgetMLBox->setHtml(html); } // Update colours CSS box - HbLayeredStyleLoader *colorsStack = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); + HbLayeredStyleLoader *colorsStack = + HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); if (colorsStack) { - HbVector colorRules = colorsStack->styleRulesForNode(n, profile.orientation()); + HbVector colorRules = + colorsStack->styleRulesForNode(n, profile.orientation()); mColorsCssBox->setHtml(CSS_HTML_HEADER + HbCssFormatter::styleRulesToHtml(colorRules)); } // Update text labels mSizeHintLabel->setText(cssItemHintText(item)); + mSizePolicyHoriz->setText("Horizontal: " + cssSizePolicyText(item, Qt::Horizontal)); + mSizePolicyVert->setText("Vertical: " + cssSizePolicyText(item, Qt::Vertical)); const QGraphicsItem *pathItem = item; QString cssPath = cssItemText(pathItem); while (pathItem->parentItem()) { @@ -579,12 +1203,55 @@ cssPath.prepend(cssItemText(pathItem)); } mPathLabel->setText(cssPath); + + // Set focus in tree view + QList ancestorItems; + const QGraphicsItem *ancestor = item; + while (ancestor) { + ancestorItems << ancestor; + ancestor = ancestor->parentItem(); + } + bool foundRoot = false; + QModelIndex index; + for (int i=ancestorItems.count() -1; i>=0; i--) { + const QGraphicsItem *thisItem = ancestorItems.at(i); + if (!foundRoot) { + const QGraphicsWidget *wid = static_cast(thisItem); + if (wid) { + QString name = wid->metaObject()->className(); + if (name == "HbScreen") { + foundRoot = true; + } + } + } else { + // Find and open tree node for item + CssInspectorModel *model = static_cast(mTreeView->model()); + if (model) { + int rowCount = model->rowCount(index); + for (int row=0; rowindex(row, 0, index); + CssInspectorModelItem *modelItem = static_cast(idx.internalPointer()); + QGraphicsItem *graphicsItem = modelItem->data(); + if (graphicsItem == thisItem) { + index = idx; + break; + } + } + } + } + } + mTreeView->collapseAll(); + mTreeView->scrollTo(index, QAbstractItemView::EnsureVisible); + mTreeView->expand(index); + } else { - mLayoutWidgetMLBox->setText(""); + mWidgetMLBox->setText(""); mLayoutCssBox->setText(""); mColorsCssBox->setText(""); mPathLabel->setText(""); mSizeHintLabel->setText(""); + mSizePolicyHoriz->setText(""); + mSizePolicyVert->setText(""); } } @@ -592,67 +1259,44 @@ /******************************************************************************************/ - - bool HoveredWidgetFilter::eventFilter(QObject *obj, QEvent *event) { - if ((event->type() == QEvent::GraphicsSceneMouseMove && mLiveMode) - || (event->type() == QEvent::GraphicsSceneMousePress && !mLiveMode)){ + if ((event->type() == QEvent::GraphicsSceneMouseMove && mHoverMode) + || (event->type() == QEvent::GraphicsSceneMousePress && !mHoverMode)){ QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); QPointF eventPos = mouseEvent->scenePos(); // Skip the drawn box/texts, arrow drawers, and popup managers QList items = mScene->items(eventPos); - QGraphicsItem *item = 0; + QGraphicsItem *hoveredItem = 0; foreach (QGraphicsItem *thisItem, items) { - QString widgetName; - if (thisItem->isWidget()) { - const QGraphicsWidget *widget = static_cast(thisItem); - widgetName = widget->metaObject()->className(); - if (thisItem != mCssInfoDrawer - && thisItem != mArrowDrawer - && widgetName != "HbPopupLayoutManager" - && widgetName != "HbAnchorArrowDrawer") { - item = thisItem; - break; - } + if (!SKIPPED_GLOBAL_ITEMS.contains(itemClass(thisItem))) { + hoveredItem = thisItem; + break; } } - if (item) { - const QGraphicsWidget *widget = static_cast(item); - QString itemText(widget->metaObject()->className()); - + if (hoveredItem) { // Ignore primitives - while (itemText == "QGraphicsWidget" - || itemText == "HbWidgetBase" - || itemText == "HbTextItem" - || itemText == "HbIconItem" - || itemText == "HbFrameItem" - || itemText == "HbMarqueeItem" - || itemText == "HbSpacerItem") { - item = item->parentItem(); - widget = static_cast(item); - itemText = widget ? widget->metaObject()->className() : ""; - } + while (hoveredItem && SKIPPED_CHILD_ITEMS.contains(itemClass(hoveredItem))) + hoveredItem = hoveredItem->parentItem(); - if (item && item != mCurrentItem) { - mCurrentItem = item; - emit newItemHovered(item); + if (hoveredItem && hoveredItem != mCurrentItem) { + mCurrentItem = hoveredItem; + emit newItemHovered(hoveredItem); } } if (mBlockingMode) { return true; } - } else if(event->type() == QEvent::Leave && mLiveMode) { + } else if(event->type() == QEvent::Leave && mHoverMode) { emit newItemHovered(0); mCurrentItem = 0; #ifdef HB_GESTURE_FW } else if(mBlockingMode && event->type() == QEvent::Gesture) { QGestureEvent *gesEvent = static_cast(event); - QGesture *tap = gesEvent->gesture(Qt::TapGesture); - if (tap) { + if (gesEvent->gesture(Qt::TapGesture)) { return true; } #endif @@ -662,7 +1306,8 @@ } HoveredWidgetFilter::HoveredWidgetFilter(QGraphicsScene *scene) - : mScene(scene), mCurrentItem(0), mArrowDrawer(0), mCssInfoDrawer(0), mLiveMode(true), mBlockingMode(false) + : mScene(scene), mCurrentItem(0), mArrowDrawer(0), + mCssInfoDrawer(0), mHoverMode(true), mBlockingMode(false) { mCssInfoDrawer = new HbCssInfoDrawer(0); mScene->addItem(mCssInfoDrawer); @@ -673,8 +1318,10 @@ mCssInfoDrawer->setZValue(HbPrivate::PopupZValueRangeEnd + ABOVE_POPUP_ZVALUE); mArrowDrawer->setZValue(HbPrivate::PopupZValueRangeEnd + ABOVE_POPUP_ZVALUE); - connect(this, SIGNAL(newItemHovered(const QGraphicsItem*)), mCssInfoDrawer, SLOT(updateFocusItem(const QGraphicsItem*))); - connect(this, SIGNAL(newItemHovered(const QGraphicsItem*)), mArrowDrawer, SLOT(updateFocusItem(const QGraphicsItem*))); + connect(this, SIGNAL(newItemHovered(const QGraphicsItem*)), + mCssInfoDrawer, SLOT(updateFocusItem(const QGraphicsItem*))); + connect(this, SIGNAL(newItemHovered(const QGraphicsItem*)), + mArrowDrawer, SLOT(updateFocusItem(const QGraphicsItem*))); } HoveredWidgetFilter::~HoveredWidgetFilter() @@ -685,4 +1332,4 @@ delete mArrowDrawer; } -#endif +#endif // HB_CSS_INSPECTOR diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbcssinspector_p.h --- a/src/hbcore/gui/hbcssinspector_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbcssinspector_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,17 +27,20 @@ #define HBCSSINSPECTOR_P_H #ifdef HB_CSS_INSPECTOR +#include +#include #include #include #include -QT_FORWARD_DECLARE_CLASS(QTextEdit) +QT_FORWARD_DECLARE_CLASS(QCheckBox) +QT_FORWARD_DECLARE_CLASS(QGraphicsItem) QT_FORWARD_DECLARE_CLASS(QGraphicsScene) -QT_FORWARD_DECLARE_CLASS(QGraphicsItem) QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QCheckBox) QT_FORWARD_DECLARE_CLASS(QRadioButton) +QT_FORWARD_DECLARE_CLASS(QTreeView) +QT_FORWARD_DECLARE_CLASS(QTextEdit) QT_FORWARD_DECLARE_CLASS(HbAnchorArrowDrawer) -QT_FORWARD_DECLARE_CLASS(HbMeshLayout) +QT_FORWARD_DECLARE_CLASS(HbMainWindow) class HbCssInfoDrawer : public HbWidgetBase @@ -49,12 +52,17 @@ virtual ~HbCssInfoDrawer(); public slots: - void setItemTextVisible(bool visible) { mShowItemText = visible; }; - void setHintTextVisible(bool visible) { mShowHintText = visible; }; + void updateFocusItem(const QGraphicsItem* item); + void setBoxVisible(bool visible) { mShowBox = visible; }; - void setHintBoxVisible(bool visible) { mShowHintBox = visible; }; + void setItemTextVisible(bool visible) { mShowItemText = visible; }; void setGuideLinesVisible(bool visible) { mDrawGuideLines = visible; }; - void updateFocusItem(const QGraphicsItem* item); + + void setHintTextVisible(bool visible) { mShowHintText = visible; }; + void setMinHintBoxVisible(bool visible) { mShowMinHintBox = visible; }; + void setPrefHintBoxVisible(bool visible) { mShowPrefHintBox = visible; }; + void setMaxHintBoxVisible(bool visible) { mShowMaxHintBox = visible; }; + void setSizePrefsVisible(bool visible) { mShowSizePrefs = visible; }; protected: void changeEvent(QEvent *event); @@ -63,17 +71,25 @@ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); private: - bool mShowItemText; - bool mShowHintText; - bool mShowBox; - bool mShowHintBox; - bool mDrawGuideLines; QColor mTextColor; QColor mBoxColor; QString mItemText; QString mHintText; QRectF mItemRect; - QRectF mHintRect; + QSizePolicy mItemPolicy; + QRectF mMinHintRect; + QRectF mPrefHintRect; + QRectF mMaxHintRect; + + bool mShowBox; + bool mShowItemText; + bool mDrawGuideLines; + + bool mShowHintText; + bool mShowMinHintBox; + bool mShowPrefHintBox; + bool mShowMaxHintBox; + bool mShowSizePrefs; }; @@ -89,7 +105,7 @@ void newItemHovered(const QGraphicsItem* item); public slots: - void setLiveMode(bool enabled) { mLiveMode = enabled; }; + void setHoverMode(bool enabled) { mHoverMode = enabled; }; void setBlockingMode(bool enabled) { mBlockingMode = enabled; }; protected: @@ -100,13 +116,81 @@ QGraphicsItem *mCurrentItem; HbAnchorArrowDrawer *mArrowDrawer; HbCssInfoDrawer *mCssInfoDrawer; - bool mLiveMode; + bool mHoverMode; bool mBlockingMode; friend class HbCssInspectorWindow; }; +class CodeWidget : public QWidget +{ + Q_OBJECT + +public: + explicit CodeWidget(const QString &title, QWidget *parent=0); + virtual ~CodeWidget(); +public slots: + void setText(const QString &text); + void setHtml(const QString &html); + void setLayoutDirection(Qt::LayoutDirection dir); +private: + QLabel *mLabel; + QTextEdit *mTextBox; +}; + + +class CssInspectorModelItem +{ +public: + CssInspectorModelItem(QGraphicsItem *item, int row, + CssInspectorModelItem *parent=0); + ~CssInspectorModelItem(); + CssInspectorModelItem *child(int i); + CssInspectorModelItem *parent(); + QGraphicsItem *data(); + int row(); +private: + QGraphicsItem *mItem; + QHash mChildren; + CssInspectorModelItem *mParent; + int mRow; +}; + + +class CssInspectorModel : public QAbstractItemModel +{ + Q_OBJECT +public: + CssInspectorModel(HbMainWindow *win=0, QObject *parent=0); + ~CssInspectorModel(); + + QVariant data(const QModelIndex &index, int role) const; + QVariant headerData(int section, Qt::Orientation orientation, + int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, + const QModelIndex &parent = QModelIndex()) const; + QModelIndex parent(const QModelIndex &child) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const; + int columnCount(const QModelIndex &parent = QModelIndex()) const; + +private: + HbMainWindow *mWin; + CssInspectorModelItem *mRootItem; +}; + + +class ItemColorDelegate : public QStyledItemDelegate +{ + Q_OBJECT +public: + ItemColorDelegate(QObject *parent=0); + ~ItemColorDelegate(); + void paint(QPainter *painter, const QStyleOptionViewItem &option, + const QModelIndex &index) const; +}; + + class HbCssInspectorWindow : public QWidget { Q_OBJECT @@ -123,26 +207,41 @@ private: void removeFilters(); void addFilters(); - static QString meshItemsToHtmlInfo(HbMeshLayout *mesh, const QString itemName, const QString layoutName); + static QString anchorsToHtmlInfo(HbAnchorLayout *anchorLayout, const QString itemName, const QString layoutName); + static QString anchorItemName(QGraphicsLayoutItem* item, QGraphicsLayout* layout, bool& isIdBased); + +private slots: + void updateFromTreeView(const QModelIndex &index); + void updateColumnSizes(const QModelIndex &index); private: explicit HbCssInspectorWindow(QWidget *parent = 0); - QTextEdit *mLayoutWidgetMLBox; - QTextEdit *mLayoutCssBox; - QTextEdit *mColorsCssBox; + QVector mInstalledFilters; + + CodeWidget *mWidgetMLBox; + CodeWidget *mLayoutCssBox; + CodeWidget *mColorsCssBox; + QTreeView *mTreeView; QLabel *mPathLabel; QLabel *mSizeHintLabel; - QCheckBox *mArrowsCheck; - QCheckBox *mOutlinesCheck; - QCheckBox *mHintOutlinesCheck; + QLabel *mSizePolicyHoriz; + QLabel *mSizePolicyVert; + + QCheckBox *mObjectNameCheck; + QCheckBox *mAnchorArrowsCheck; + QCheckBox *mSubitemOutlinesCheck; QCheckBox *mSpacersCheck; - QCheckBox *mNameCheck; - QCheckBox *mSizeHintCheck; QCheckBox *mGuideLinesCheck; - QRadioButton *mLiveRadio; + + QCheckBox *mSizeHintTextCheck; + QCheckBox *mMinSizeHintCheck; + QCheckBox *mPrefSizeHintCheck; + QCheckBox *mMaxSizeHintCheck; + QCheckBox *mSizePrefCheck; + + QRadioButton *mHoverRadio; QRadioButton *mClickRadio; QRadioButton *mBlockRadio; - QVector mInstalledFilters; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbdevice.cpp --- a/src/hbcore/gui/hbdevice.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbdevice.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,13 +32,13 @@ } HbDeviceView::HbDeviceView(HbMainWindow *window, QWidget *parent) : -QGraphicsView(parent), mMainWindow(window), mAngle(0), mLastPos(0,0), -mMouseMove(false) + QGraphicsView(parent), mMainWindow(window), mAngle(0), mLastPos(0, 0), + mMouseMove(false) { Q_UNUSED(parent); //Set background - setBackgroundBrush(QBrush(QColor(0,0,0),Qt::SolidPattern/*Qt::VerPattern*/)); + setBackgroundBrush(QBrush(QColor(0, 0, 0), Qt::SolidPattern/*Qt::VerPattern*/)); //Take scene from window setScene(mMainWindow->scene()); @@ -48,12 +48,12 @@ qreal y = mMainWindow->rect().y(); int h = profile.logicalSize().height(); int w = profile.logicalSize().width(); - + //Centralize setSceneRect(x, y, w, h); setDragMode(QGraphicsView::NoDrag/*QGraphicsView::ScrollHandDrag*/); - connect(mMainWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); + connect(mMainWindow, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); } HbDeviceView::~HbDeviceView() @@ -63,22 +63,22 @@ void HbDeviceView::rotateDevice(int angle) { //Store angle and block turning more than 90 or -90 degrees - mAngle = mAngle+angle; - if ( mAngle < -90 || mAngle > 90 ){ + mAngle = mAngle + angle; + if (mAngle < -90 || mAngle > 90) { if (mAngle < -90) { mAngle = -90; } else { - mAngle = 90; + mAngle = 90; } return; } rotate(angle); - // For special purpose, if needed.. - if (mAngle == 0) { - }else if (mAngle == 90) { - }else if (mAngle == -90) { +// For special purpose, if needed.. + if (mAngle == 0) { + } else if (mAngle == 90) { + } else if (mAngle == -90) { } } @@ -92,8 +92,8 @@ //This is needed to centralize mMainWindow setSceneRect(0, 0, w, h); - if(!mMouseMove) { - resize(w+5, h+5); + if (!mMouseMove) { + resize(w + 5, h + 5); } } @@ -101,12 +101,12 @@ //Remove black "frames" void HbDeviceView::compressDevice() { - if(mAngle <0 ) { - rotate(+(-mAngle)); + if (mAngle < 0) { + rotate(+(-mAngle)); mAngle = 0; } else { - rotate(-(+mAngle)); - mAngle = 0; + rotate(-(+mAngle)); + mAngle = 0; } HbDeviceProfile profile = HbDeviceProfile::profile(mMainWindow); @@ -114,31 +114,30 @@ int w = profile.logicalSize().width(); setSceneRect(0, 0, w, h); - resize(w+5, h+5); + resize(w + 5, h + 5); } //Catch mouse move event and rotate this view void HbDeviceView::mouseMoveEvent(QMouseEvent *event) -{ +{ if (!mMouseMove || itemAt(event->pos())) { return; - } - if ((event->buttons() & Qt::LeftButton)) { + } + if ((event->buttons() & Qt::LeftButton)) { if (event->pos().x() < mLastPos.x()) { rotateDevice(-10); - }else if (event->pos().x() > mLastPos.x()) { + } else if (event->pos().x() > mLastPos.x()) { rotateDevice(10); } - mLastPos = event->pos(); + mLastPos = event->pos(); } } void HbDeviceView::keyPressEvent(QKeyEvent *event) { //If "Ctrl+D" is pressed, enable or disable rotate - if(event->modifiers() == Qt::ControlModifier && event->key() == Qt::Key_D ) - { - if(!mMouseMove) { + if (event->modifiers() == Qt::ControlModifier && event->key() == Qt::Key_D) { + if (!mMouseMove) { mMouseMove = true; enableDevice(true); } else { @@ -150,7 +149,7 @@ void HbDeviceView::enableDevice(bool enable) { - if(enable) { + if (enable) { resize(900, 900); } else { compressDevice(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbdevice_p.h --- a/src/hbcore/gui/hbdevice_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbdevice_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,23 +27,23 @@ #include #include -#ifndef HBDEVICE_VIEW_H -#define HBDEVICE_VIEW_H +#ifndef HBDEVICE_P_H +#define HBDEVICE_P_H class HbMainWindow; class HbDeviceView: public QGraphicsView { + Q_OBJECT - Q_OBJECT public: HbDeviceView(); - HbDeviceView(HbMainWindow *window, QWidget *parent = 0); + explicit HbDeviceView(HbMainWindow *window, QWidget *parent = 0); virtual ~HbDeviceView(); protected: void mouseMoveEvent(QMouseEvent *event); - void keyPressEvent(QKeyEvent *event); + void keyPressEvent(QKeyEvent *event); public slots: void orientationChanged(Qt::Orientation orientation); @@ -60,4 +60,4 @@ bool mMouseMove; }; -#endif //HBDEVICE_VIEW_H +#endif // HBDEVICE_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbdevicefadecontrolsym.cpp --- a/src/hbcore/gui/hbdevicefadecontrolsym.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbdevicefadecontrolsym.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -41,8 +41,8 @@ { public: struct FadeControl { - int fadeOff:1; // command for application to unfade - int spare:31; + int fadeOff: 1; // command for application to unfade + int spare: 31; }; public: @@ -87,6 +87,7 @@ CActiveScheduler::Add(this); start(); } + process.Close(); } HbDeviceFadeControlPrivate::~HbDeviceFadeControlPrivate() diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbdialog.cpp --- a/src/hbcore/gui/hbdialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbdialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,6 @@ #include #include #include -#include #include // krazy:exclude=qclasses #include @@ -70,12 +69,49 @@ An example of how to handle dialog signals from previous example. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,53} + An example of how to handle if finished(int) is connected instead of finished(HbAction*) in above example. + \snippet{ultimatecodesnipped/ultimatecodesnippet.cpp,55} + An example of how to create a non-modal dialog and show it. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,26} */ /*! + \fn void HbDialog::finished( int code ) + + This signal is emitted when the dialog is closed. + This will have the HbDialog::DialogCode as the parameter code. + + \sa done(), accept(), reject() +*/ +/*! + \fn void HbDialog::finished( HbAction *action ) + + This signal is emitted when an action has been triggered in a dialog. + The parameter will be the triggered action. + */ +/*! + \fn void HbDialog::accepted( ) + + This signal is emitted when the dialog is closed and the user + has accepted the dialog. which implies that either action has triggered + or through function call the accept method is called, causing this signal. + + \sa done(), accept(), reject() +*/ +/*! + \fn void HbDialog::rejected( ) + + This signal is emitted when the dialog is closed and the user + has rejected the dialog. which implies that either action triggered + or through function call the reject method is called, causing this signal. + + \sa done(), accept(), reject() +*/ + + +/*! \reimp \fn int HbDialog::type() const */ @@ -83,7 +119,6 @@ HbDialogPrivate::HbDialogPrivate( ) : contentWidget(0), headingWidget(0), - mainLayout(new QGraphicsLinearLayout(Qt::Vertical)), primaryAction(0), secondaryAction(0), closingAction(0), @@ -95,39 +130,7 @@ { } -void HbDialogPrivate::init() -{ - Q_Q(HbDialog); - - // Content is responsible of adding spacings & margins - mainLayout->setSpacing(0); - mainLayout->setContentsMargins(0,0,0,0); - - q->setLayout(mainLayout); - mainLayout->setMinimumSize(0, 0); -} - -void HbDialogPrivate::setWidget(int layoutIndex, QGraphicsWidget *&destWidget, QGraphicsWidget *widget) -{ - Q_Q(HbDialog); - if (destWidget != widget) { - if (destWidget) { - mainLayout->removeItem(destWidget); - delete destWidget; - destWidget = 0; - } - if (widget) { - destWidget = widget; - destWidget->setParentItem(q); - mainLayout->insertItem(layoutIndex, widget); - mainLayout->setAlignment(widget, Qt::AlignCenter); - } - - doLayout(); - } -} - -/* +/*! Relayouts the popup. If expandSize is true it the new calculated size of the popup cannot be smaller than the current size. */ @@ -150,6 +153,19 @@ q->updateGeometry(); } +/*! + Utility function removes the spaces from string if any +*/ +void HbDialogPrivate::removeSpaces(QString& string) +{ + QString tempStr(string); + string.clear(); + foreach(QChar ch, tempStr) + { + if(!ch.isSpace()) + string.append(ch); + } +} /*! Constructs a dialog with given \a parent graphics item.\n @@ -161,7 +177,7 @@ { Q_D(HbDialog); d->q_ptr = this; - d->init(); + d->timeout = HbPopupPrivate::timeoutValue(HbPopup::NoTimeout); } /*! @@ -172,7 +188,7 @@ { Q_D(HbDialog); d->q_ptr = this; - d->init(); + d->timeout = HbPopupPrivate::timeoutValue(HbPopup::NoTimeout); } /*! @@ -200,8 +216,19 @@ void HbDialog::setHeadingWidget(QGraphicsWidget *headingWidget) { Q_D(HbDialog); - HbStyle::setItemName(headingWidget,"heading"); - d->setWidget(0, d->headingWidget, headingWidget); + if (d->headingWidget == headingWidget) + return; + if (d->headingWidget) + delete d->headingWidget; + d->headingWidget = headingWidget; + if (headingWidget) { + setProperty("heading_layout", true); + headingWidget->setParentItem(this); + HbStyle::setItemName(headingWidget,"heading"); + } else { + setProperty("heading_layout", false); + } + repolish(); } /*! @@ -224,9 +251,19 @@ */ void HbDialog::setContentWidget(QGraphicsWidget *contentWidget) { - Q_D(HbDialog); - HbStyle::setItemName(contentWidget,"content"); - d->setWidget((d->headingWidget?1:0), d->contentWidget, contentWidget); + Q_D(HbDialog); + + if (d->contentWidget == contentWidget) + return; + if (d->contentWidget) + delete d->contentWidget; + prepareGeometryChange(); // needed to paint screen properly + d->contentWidget = contentWidget; + if (contentWidget) { + contentWidget->setParentItem(this); + HbStyle::setItemName(contentWidget,"content"); + } + repolish(); } /*! @@ -300,12 +337,21 @@ } /*! + This is a slot which shows the dialog and returns immediately. + + \sa open(QObject*,const char*) +*/ +void HbDialog::open() +{ + open(0,0); +} +/*! Shows the dialog as modal dialog returning immediately. - Connects finished(HbAction*) signal to the slot specified by \a receiver and + Connects finished(HbAction*) or finished(int) signal to the slot specified by \a receiver and \a member. The signal will be disconnected from the slot when the - popup is closed. + popup is closed. disambiguation between which method to connect to is done at runtime. For non modal popups, use show(). */ @@ -314,7 +360,15 @@ { Q_D(HbDialog); if ( receiver && member ) { - connect( this, SIGNAL(finished(HbAction*)), receiver, member ); + + QString myStr(member); + d->removeSpaces(myStr); + if(myStr.contains("(int)")) { + connect( this, SIGNAL(finished(int)), receiver, member ); + } + else { + connect( this, SIGNAL(finished(HbAction*)), receiver, member ); + } d->receiverToDisconnectOnClose = receiver; d->memberToDisconnectOnClose = member; } else { @@ -323,6 +377,56 @@ } show(); } +/*! + Closes the dialog and emits finished ,accepted and rejected signals appropriately. + + If the dialog is accepted the code is HbDialog::Accepted, if it is rejected code + is HbDialog::Rejected. + As with HbWidget::close(), done() deletes the dialog if the + Qt::WA_DeleteOnClose flag is set. + + \sa accept(), reject() +*/ +void HbDialog::done( int code ) +{ + HbAction *action=qobject_cast(sender()); + if(!action) { + close(); + //if there is no sender or if there is some sender which is not hbaction + //then we need to close the dialog when done is called. + } + else if(actions().contains(action)==false) { + close(); + //if our actions done have this HbAction. then we need to call the + //close method explicitly. + } //otherwise close will be called automatically due to connection in base class + + emit finished(code); + if(code == Accepted) { + emit accepted(); + } + else if(code == Rejected) { + emit rejected(); + } +} +/*! + Hides the modal dialog and emits finished(HbDialog::Accepted),accepted() and finished(HbAction*) signals. + + \sa reject(), done() +*/ +void HbDialog::accept() +{ + done(Accepted); +} +/*! + Hides the modal dialog and emits finished(HbDialog::Rejected),rejected() and finished(HbAction*) signals. + + \sa accept(), done() +*/ +void HbDialog::reject() +{ + done(Rejected); +} /*! \reimp @@ -384,21 +488,20 @@ bool HbDialog::event(QEvent *event) { Q_D(HbDialog); - event->accept(); + if(event->type() != QEvent::ShortcutOverride && event->type() != QEvent::GestureOverride) + event->accept(); if (event->type() == QEvent::ActionAdded) { if (!d->toolBar) { // TODO: HbToolBar private interface should make it possible to choose // different graphics for tool buttons. d->toolBar = new HbToolBar(); + d->toolBar->setParentItem(this); HbStyle::setItemName(d->toolBar ,"controls"); - d->toolBar->setParentItem(this); + setProperty("controls_layout", true); d->toolBar->setOrientation(Qt::Horizontal); HbToolBarPrivate::d_ptr(d->toolBar)->mDialogToolBar = true; - // prevent stretching buttons, should the content be small - // but dialog size forcibly large - d->mainLayout->addStretch(); - d->mainLayout->addItem(d->toolBar); + repolish(); } QActionEvent *actionEvent = static_cast(event); d->toolBar->insertAction (actionEvent->before(), actionEvent->action()); @@ -422,9 +525,9 @@ if (d->toolBar) { d->toolBar->removeAction(actionEvent->action()); if (!d->toolBar->actions().count()) { - d->mainLayout->removeItem(d->toolBar); d->toolBar->deleteLater(); d->toolBar = 0; + setProperty("controls_layout", false); } } d->doLayout(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbdialog.h --- a/src/hbcore/gui/hbdialog.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbdialog.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,6 +37,8 @@ Q_OBJECT public: + enum DialogCode { Rejected, Accepted }; + explicit HbDialog( QGraphicsItem *parent = 0 ); virtual ~HbDialog(); @@ -52,14 +54,22 @@ HbAction *secondaryAction() const; void setSecondaryAction( HbAction *action ); + void open( QObject* receiver, const char* member ); + enum { Type = Hb::ItemType_Dialog }; // TODO: Hb::ItemType_Dialog int type() const { return Type; } public slots: - void open( QObject* receiver = 0, const char* member = 0 ); + void open(); + virtual void done(int code); + virtual void accept(); + virtual void reject(); - signals: +signals: void finished(HbAction*); + void finished(int); + void accepted(); + void rejected(); protected: HbDialog( HbDialogPrivate &dd, QGraphicsItem *parent ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbdialog_p.h --- a/src/hbcore/gui/hbdialog_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbdialog_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,6 @@ QT_FORWARD_DECLARE_CLASS(QEventLoop) QT_FORWARD_DECLARE_CLASS(QGraphicsWidget) -QT_FORWARD_DECLARE_CLASS(QGraphicsLinearLayout) QT_FORWARD_DECLARE_CLASS(QGraphicsSceneMouseEvent) class HB_CORE_PRIVATE_EXPORT HbDialogPrivate :public HbPopupPrivate @@ -47,14 +46,12 @@ public: HbDialogPrivate( ); virtual ~HbDialogPrivate(); - void init(); - void setWidget(int layoutIndex, QGraphicsWidget *&destWidget, QGraphicsWidget *widget); void doLayout(); + void removeSpaces(QString& string); QGraphicsWidget *contentWidget; QGraphicsWidget *headingWidget; - QGraphicsLinearLayout *mainLayout; HbAction *primaryAction; HbAction *secondaryAction; HbAction *closingAction; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbdockwidget.cpp --- a/src/hbcore/gui/hbdockwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbdockwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -78,6 +78,7 @@ Q_D(HbDockWidget); d->q_ptr = this; setFlag( QGraphicsItem::ItemClipsChildrenToShape, true ); + setFlag(QGraphicsItem::ItemHasNoContents, true); } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbfadeitem.cpp --- a/src/hbcore/gui/hbfadeitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbfadeitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -41,8 +41,8 @@ { Q_DECLARE_PUBLIC(HbFadeItem) - public: - HbFadeItemPrivate( ); +public: + HbFadeItemPrivate(); virtual ~HbFadeItemPrivate(); void init(); @@ -67,7 +67,7 @@ { Q_Q(HbFadeItem); - q->setBackgroundItem(HbStyle::P_Fade_background); + setBackgroundItem(HbStyle::P_Fade_background); q->setAcceptHoverEvents(true); // This is needed to be able to block moving the focus to items behind background item by @@ -75,7 +75,7 @@ q->setFlag(QGraphicsItem::ItemIsFocusable); } -HbFadeItem::HbFadeItem( QGraphicsItem *parent ) : HbWidget(*new HbFadeItemPrivate, parent) +HbFadeItem::HbFadeItem(QGraphicsItem *parent) : HbWidget(*new HbFadeItemPrivate, parent) { Q_D(HbFadeItem); d->q_ptr = this; @@ -92,12 +92,12 @@ QRectF HbFadeItem::boundingRect() const { Q_D(const HbFadeItem); - if(!d->mRect.isValid()){ + if (!d->mRect.isValid()) { // set size so that it is big enough // to cover the screen both landscape and portrait mode const QSizeF screenSize = HbDeviceProfile::profile(this).logicalSize(); qreal dim = qMax(screenSize.width(), screenSize.height()); - d->mRect.adjust(0,0,dim,dim); + d->mRect.adjust(0, 0, dim, dim); } return d->mRect; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbfadeitem_p.h --- a/src/hbcore/gui/hbfadeitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbfadeitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,12 +36,14 @@ Q_OBJECT public: - HbFadeItem( QGraphicsItem *parent = 0 ); + HbFadeItem(QGraphicsItem *parent = 0); QRectF boundingRect() const; enum { Type = HbPrivate::ItemType_FadeItem }; - int type() const { return Type; } + int type() const { + return Type; + } protected: HbFadeItem(HbFadeItemPrivate &dd, QGraphicsItem *parent = 0); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hblongpressvisualizer_p.h --- a/src/hbcore/gui/hblongpressvisualizer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hblongpressvisualizer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,6 +23,9 @@ ** ****************************************************************************/ +#ifndef HBLONGPRESSVISUALIZER_P_H +#define HBLONGPRESSVISUALIZER_P_H + #include #include #include @@ -51,3 +54,5 @@ QTimer mTimer; QPointF mPos; }; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmainwindow.cpp --- a/src/hbcore/gui/hbmainwindow.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmainwindow.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,6 +23,9 @@ ** ****************************************************************************/ +#include "hbmainwindow.h" +#include "hbmainwindow_p.h" + #include #include #include @@ -35,8 +38,6 @@ #include "hbinstance.h" #include "hbinstance_p.h" #include "hbgraphicsscene.h" -#include "hbmainwindow.h" -#include "hbmainwindow_p.h" #include "hbnamespace.h" #include "hbnamespace_p.h" #include "hbtitlebar_p.h" @@ -58,11 +59,14 @@ #include "hbcontentwidget_p.h" #include "hbscreen_p.h" #include "hbmainwindoworientation_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #include "hboogmwatcher_p.h" +#include "hbwindowobscured_p.h" +#include "hbsleepmodelistener_p.h" #ifdef Q_OS_SYMBIAN #include +#include #include "hbnativewindow_sym_p.h" #endif @@ -92,14 +96,13 @@ really visible. HbMainWindow has a signalling mechanism for helping control the - application's view construction. viewReady()-signal is emitted - when view's internal construction is completed and basic parts of - view are already drawn. Same signal is also emitted when current - view is switched. This helps applications to split the view - construction to reasonable tasks. For example the lower priority - tasks like opening network connection or preparing other currently - hidden application views can happen on background when first view - is already drawn. + application's view construction. The viewReady() signal is emitted when a + view's internal construction is completed and basic parts of view are + already drawn. Same signal is also emitted when current view has + changed. This helps applications to split the view construction to + reasonable tasks. For example the lower priority tasks like opening network + connection or preparing other currently hidden application views can happen + on background when first view is already drawn. Example of simple Hb application constructing HbMainWindow: @@ -172,6 +175,21 @@ This signal is emitted first time when window content is drawn on screen. It will only be emitted again when current view is changed and drawn on screen. + This means that this signal is emitted in the following cases: + + - When the mainwindow is fully constructed, this happens shortly after + painting it for the first time. + + - When a new view is added using addView() or insertView() after the + mainwindow is fully constructed and the newly added view becomes the + current view. It will not be emitted when calling addView() or + insertView() before showing the mainwindow or entering the event loop + because in that case the signal will anyway be emitted later, when the + mainwindow becomes ready. It is also not emitted when the newly added view + does not become the current view. + + - When the current view is changed using setCurrentView(). + If the view switch is animated, the signal is emitted only after the effect has completed. @@ -181,6 +199,61 @@ */ /*! + \fn void HbMainWindow::obscured() + + This signal is emited whenever the window is completely overlaped by another + window. + + Application developers can use this signal to pause or stop painting when + the window is not visible to the user at all. + + This signal has real implementation only for Symbian and X11 platforms. On + desktop platforms it is simulated via a settings window option. + + The typical use case is to use the obscured() and revealed() signals in + connection with device dialogs (global pop-ups): When such a dialog is + shown, the application loses foreground (focus), but it may still be + partially visible because the dialogs will not fill the entire screen. To + get notified about such cases, combine your application's + foreground-background handling with handling also these signals. + + Consider this as a best-effort solution only, the exact behavior depends on + the platform and may have limitations. For example on Symbian transparent + windows will never obscure another window, regardless of the content. + + These signals are not a replacement to the focus-based ApplicationActivate + and ApplicationDeactivate events. An application may lose the focus + completely (i.e. lose foreground) even when it is still partially visible to + the user. + + \sa revealed() + \sa isObscured() +*/ + +/*! + \fn void HbMainWindow::revealed() + + This signal is emited whenever the window is visible to the user partially + or completely. + + This signal has real implementation only for Symbian and X11 platforms. On + desktop platforms it is simulated via the settings option. + + Consider this as a best-effort solution only, the exact behavior depends on + the platform and may have limitations. For example on Symbian transparent + windows may cause the revealed signal to be emitted even when the content is + not really visible. + + These signals are not a replacement to the focus-based ApplicationActivate + and ApplicationDeactivate events. An application may lose the focus + completely (i.e. lose foreground) even when it is still partially visible to + the user. + + \sa obscured() + \sa isObscured() +*/ + +/*! \class HbRootItem \brief The parent of all graphics items (including the clipping item (HbScreen) @@ -193,7 +266,7 @@ class HbRootItem : public HbWidget { public: - explicit HbRootItem( QGraphicsItem *parent = 0 ); + explicit HbRootItem(QGraphicsItem *parent = 0); ~HbRootItem() {} private: bool event(QEvent *event); @@ -201,21 +274,20 @@ /*! Constructs an HbMainWindow object with \a parent. - + \a windowFlags can be used for specifying special functionality to HbMainWindow. - + \sa Hb::WindowFlag */ HbMainWindow::HbMainWindow(QWidget *parent, Hb::WindowFlags windowFlags): - QGraphicsView(parent), d_ptr(new HbMainWindowPrivate) + QGraphicsView(parent), d_ptr(new HbMainWindowPrivate) { Q_D(HbMainWindow); d->q_ptr = this; // No need for any default (e.g. blank white) background for this window. - // Setting this attribute is mandatory in order to have a flicker-less - // startup (both with and without splash screen). setAttribute(Qt::WA_NoSystemBackground); + setOptimizationFlag(QGraphicsView::DontSavePainterState); // Continue with basic initialization. Note: Prefer doing everything that is // not absolutely compulsory in _q_delayedConstruction instead. @@ -251,7 +323,7 @@ d->mAutomaticOrientationSwitch = true; } else { d->mOrientation = d->mDefaultOrientation; - d->mAutomaticOrientationSwitch = false; + d->mAutomaticOrientationSwitch = false; } #if defined(Q_WS_S60) || defined(HB_Q_WS_MAEMO) @@ -260,7 +332,7 @@ setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - setFrameShape(QFrame::NoFrame); + setFrameStyle(QFrame::NoFrame); // create scene and style d->mScene = new HbGraphicsScene(this); @@ -268,7 +340,7 @@ // workaround for problems with BSP tree implementation in Qt d->mScene->setItemIndexMethod(QGraphicsScene::NoIndex); - d->mScene->setSceneRect(0, 0, pSize.width(), pSize.height()); + d->mScene->setSceneRect(0, 0, pSize.width(), pSize.height()); setScene(d->mScene); // add root item @@ -292,10 +364,10 @@ d->mClippingItem->setStackWidget(d->mViewStackWidget); connect(d->mViewStackWidget, SIGNAL(currentChanged(int)), this, SLOT(_q_viewChanged())); - connect(d->mViewStackWidget, SIGNAL(widgetRemoved(QGraphicsWidget*)), - this, SLOT(_q_viewRemoved(QGraphicsWidget*))); + connect(d->mViewStackWidget, SIGNAL(widgetRemoved(QGraphicsWidget *)), + this, SLOT(_q_viewRemoved(QGraphicsWidget *))); - // create Titlebar (container for indicators, titlepane and secondary softkey + // create Titlebar (container for indicator button, titlepane and navigation button d->mTitleBar = new HbTitleBar(this, d->mClippingItem); d->mTitleBar->setZValue(HbPrivate::TitleBarZValue); @@ -306,9 +378,9 @@ // At this point the mainwindow is considered more or less fully constructed. HbInstancePrivate::d_ptr()->addWindow(this); - QRectF rect(0,0,pSize.width(),pSize.height()); + QRectF rect(0, 0, pSize.width(), pSize.height()); resize(pSize); - d->mLayoutRect = rect; + d->mLayoutRect = rect; d->mRootItem->setGeometry(rect); d->mClippingItem->setGeometry(rect); setSceneRect(0, 0, pSize.width(), pSize.height()); @@ -323,6 +395,11 @@ // are routed to it properly). HbOogmWatcher::instance(); + // Make sure the sleep mode listener instance is created. + HbSleepModeListener::instance(); + + HbWindowObscured::installWindowEventFilter(); + #ifdef HB_GESTURE_FW // @todo remove after view auto-subscribes to gestures viewport()->grabGesture(Qt::TapGesture); @@ -361,9 +438,9 @@ delete d_ptr; // to workaround problem when creating/destroying multiple hbmainwindow's in unit tests (win env) - #ifdef Q_OS_WIN - destroy(); - #endif +#ifdef Q_OS_WIN + destroy(); +#endif } /*! @@ -371,20 +448,43 @@ \a widget creates an empty HbView. The \a widget can be either a HbView or QGraphicsWidget. If it is - the QGraphicsWidget then HbMainWindow will create a HbView and set - \a widget as the new HbView's content widget. + a QGraphicsWidget (or any subclass that is not HbView) then + HbMainWindow will create a HbView and set \a widget as the new + HbView's content widget. + + When \a widget is a HbView, use HbView::setWidget() to set the content + widget for the view. Note that you should never attach child items or set a layout + directly to the HbView instance, even though HbView is also a HbWidget. + Instead, create a content widget, set it to the view via HbView::setWidget(), + and attach children or set a layout to that. + + Use setCurrentView() to switch between the added views. (only one of them is visible at a time) + The view-specific decorators (toolbar, Options menu, title in the titlebar) and of course + the visibility of the view's content widgets will be updated and managed automatically by the framework + when switching views. + + For a detailed description of views see the HbView class. + + Note that using view switching (i.e. several HbView instances, setCurrentView(), etc.) in + Hb applications is not mandatory, it is purely optional. For applications that are not really + view based (e.g. because they only have one screen of content or because they have more "fluid" UI where + the traditional view separation does not make that much sense) it may sometimes be better (and may provide more freedom) + to have just one view and manage the content entirely via the content widget of that one view. + (one can still use HbStackedLayout and manual visibility management of child widgets to achieve a traditional view-like look, + even when the Hb view management is not used) + + After calling addView() the caller does not need to care about + destroying \a widget, the framework will take care of that by + reparenting \a widget if needed. A HbMainWindow should only have one of each view and adding a view it already has will not cause the same view to be in the HbMainWindow twice. - After calling addView() the caller does not need to care about - destroying \a widget, the framework will take care of that by - reparenting \a widget if needed. - \return the new view - \sa insertView removeView + \sa insertView() removeView() setCurrentView() + \sa HbView HbStackedLayout */ HbView *HbMainWindow::addView(QGraphicsWidget *widget) { @@ -408,6 +508,12 @@ d->mViewStackWidget->insertWidget(-1, view); + // If the newly added view becomes the current one then emit the viewReady + // signal (unless the delayed construction is still pending). + if (d->mDelayedConstructionHandled && currentView() == view) { + QMetaObject::invokeMethod(this, "_q_viewReady", Qt::QueuedConnection); + } + return view; } @@ -424,7 +530,7 @@ \sa addView removeView */ HbView *HbMainWindow::insertView(int index, QGraphicsWidget *widget) -{ +{ Q_D(HbMainWindow); HbView *view = 0; if (!widget) { @@ -436,8 +542,15 @@ view->setWidget(widget); } } + d->mViewStackWidget->insertWidget(index, view); + // If the newly inserted view becomes the current one then emit the + // viewReady signal (unless the delayed construction is still pending). + if (d->mDelayedConstructionHandled && currentView() == view) { + QMetaObject::invokeMethod(this, "_q_viewReady", Qt::QueuedConnection); + } + return view; } @@ -466,8 +579,8 @@ d->mViewStackWidget->removeWidget(view); } else { // Check if it is a widget inside a view and delete that view - for (int n=0; nmViewStackWidget->count(); n++) { - HbView *tempView = qobject_cast(d->mViewStackWidget->widgetAt(n)); + for (int n = 0; n < d->mViewStackWidget->count(); n++) { + HbView *tempView = qobject_cast(d->mViewStackWidget->widgetAt(n)); if (tempView->widget() == widget) { d->mViewStackWidget->removeWidget(tempView); // Take a widget out from the view, before deleting it. @@ -534,8 +647,9 @@ // If animation is disabled or there is no view set currently then change // without animation. d->mViewStackWidget->setCurrentWidget(view); - if (d->mDelayedConstructionHandled) + if (d->mDelayedConstructionHandled) { QMetaObject::invokeMethod(this, "_q_viewReady", Qt::QueuedConnection); + } } } } @@ -548,15 +662,15 @@ { Q_D(const HbMainWindow); HbContentWidget *stackWidget = d->mViewStackWidget; - + const int n = stackWidget->count(); QList result; - for ( int i=0; i(stackWidget->widgetAt(i)); Q_ASSERT_X(view, "HbMainWindow::views()", "HbView was expected"); result.append(view); } - + return result; } @@ -603,8 +717,9 @@ if (!d->mAutomaticOrientationSwitch) { d->mAutomaticOrientationSwitch = true; d->mUserOrientationSwitch = false; - if(HbMainWindowOrientation::instance()->isEnabled()) + if (HbMainWindowOrientation::instance()->isEnabled()) { d->setTransformedOrientation(HbMainWindowOrientation::instance()->sensorOrientation(), animate); + } } } @@ -661,14 +776,14 @@ /*! Returns the rectangle which is used for layouting HbMainWindow contents. Updates on orientation change and is up to date - after HbMainWindow orientationChanged() signal. Note that this is not the same thing as QGraphicsView (HbMainWindow) geometry. + after HbMainWindow orientationChanged() signal. Note that this is not the same thing as QGraphicsView (HbMainWindow) geometry. HbMainWindow geometry does not update on orientation change since the contents are only transformed with a rotate transform. - + */ QRectF HbMainWindow::layoutRect() const { Q_D(const HbMainWindow); - return d->mLayoutRect; + return d->mLayoutRect; } /*! @@ -699,9 +814,38 @@ } /*! + Sets the background image drawing mode. This setting controls how + the background image is displayed. + + By default the mode is set to Hb::ScaleBackgroundToFit. + + \sa backgroundImageMode() + \sa Hb::BackgroundImageMode + */ +void HbMainWindow::setBackgroundImageMode(Hb::BackgroundImageMode mode) +{ + Q_D(HbMainWindow); + if (d->mBgItem) { + d->mBgItem->setImageMode(mode); + } +} + +/*! + Returns the currently set background image drawing mode. + + \sa setBackgroundImageMode() + \sa Hb::BackgroundImageMode + */ +Hb::BackgroundImageMode HbMainWindow::backgroundImageMode() const +{ + Q_D(const HbMainWindow); + return d->mBgItem ? d->mBgItem->imageMode() : Hb::ScaleBackgroundToFit; +} + +/*! Sets the animations enabled when the orientation is changed automatically. By default animations are enabled. - + \sa automaticOrientationEffectEnabled() */ @@ -712,7 +856,7 @@ } /*! - Returns boolean value to signify whether animations enabled/disabled during + Returns boolean value to signify whether animations enabled/disabled during automatic orientation change. By default animations are enabled. \sa setAutomaticOrientationEffectEnabled() @@ -733,12 +877,12 @@ // Notify layout direction change to the icon framework HbLayoutDirectionNotifier::instance()->notifyLayoutDirectionChange(); - broadcastEvent( HbEvent::WindowLayoutDirectionChanged ); + broadcastEvent(HbEvent::WindowLayoutDirectionChanged); - foreach (QGraphicsItem *item, items()) { - if (item->isWidget() && !item->parentItem() ) { + foreach(QGraphicsItem * item, items()) { + if (item->isWidget() && !item->parentItem()) { QGraphicsWidget *widget = static_cast(item); - if (!widget->testAttribute(Qt::WA_SetLayoutDirection)){ + if (!widget->testAttribute(Qt::WA_SetLayoutDirection)) { widget->setLayoutDirection(layoutDirection()); widget->setAttribute(Qt::WA_SetLayoutDirection, false); } @@ -764,7 +908,7 @@ // pass the soft key press into the soft key decorator class HbAction *action = 0; - switch(event->key()) { + switch (event->key()) { #ifdef Q_OS_SYMBIAN case Qt::Key_Context1: @@ -820,19 +964,20 @@ { Q_D(HbMainWindow); - if ( !HbMainWindowPrivate::dragToResizeEnabled ) { + if (!HbMainWindowPrivate::dragToResizeEnabled) { // determine the default orientation width < height -> portrait - if (event->size().width() < event->size().height()) + if (event->size().width() < event->size().height()) { d->mDefaultOrientation = Qt::Vertical; - else + } else { d->mDefaultOrientation = Qt::Horizontal; + } d->mForceSetOrientation = true; d->setTransformedOrientation(d->mOrientation, false); d->mForceSetOrientation = false; } else { // RnD feature for resizing the window by dragging QSize newSize(event->size()); - setSceneRect(0,0,newSize.width(),newSize.height()); + setSceneRect(0, 0, newSize.width(), newSize.height()); d->mClippingItem->resize(newSize); if (d->mBgItem) { d->mBgItem->resize(newSize); @@ -843,41 +988,55 @@ /*! Reimplemented from QObject::customEvent(). */ -void HbMainWindow::customEvent( QEvent *event ) +void HbMainWindow::customEvent(QEvent *event) { Q_D(HbMainWindow); if (event->type() == HbMainWindowPrivate::IdleEvent) { // called asyncronously after the application start-up if (!d->mIdleEventHandled) { d->mIdleEventHandled = true; - if ( HbFeatureManager::instance()->featureStatus( HbFeatureManager::TheTestUtility ) ) { + if (HbFeatureManager::instance()->featureStatus(HbFeatureManager::TheTestUtility)) { // create the test utility - if ( !d->mTheTestUtility ) { + if (!d->mTheTestUtility) { d->mTheTestUtility = new HbTheTestUtility(this); } } - // get rid of the splash screen widget (it is not visible to the user anyway at this point) +#ifdef Q_OS_SYMBIAN + // Disable surface transparency unless we were really asked to be transparent. + // Must be done before destroying the splash screen widget. + if (!testAttribute(Qt::WA_TranslucentBackground)) { + RWindow *const window = static_cast(effectiveWinId()->DrawableWindow()); + window->SetSurfaceTransparency(false); + } +#endif + // Get rid of the splash screen widget. (it is not visible to the user anyway at this point) HbSplashScreen::destroy(); } // Notify that mainwindow is (most probably) ready. // The signal must be emitted always, even when there was no need to do anything. emit d->idleEventDispatched(); - } else if(event->type() == HbMainWindowPrivate::IdleOrientationEvent) { // complete the orientation change effect chain - if (d->mEffectItem && d->mOrientationChangeOngoing) { + } else if (event->type() == HbMainWindowPrivate::IdleOrientationEvent) { // complete the orientation change effect chain + if (d->mEffectItem && d->mOrientationChangeOngoing && d->mOrientationEffectFinished) { HbEffect::start(d->mEffectItem, "rootItemFinalPhase", this, "rootItemFinalPhaseDone"); } } else if (event->type() == HbMainWindowPrivate::IdleOrientationFinalEvent) { if (d->mAnimateOrientationSwitch) { HbEffect::start(d->mTitleBar, "titlebar", "appear_orient"); HbEffect::start(d->mStatusBar, "statusbar", "appear_orient"); - if (d->mCurrentToolbar) { + if (d->mCurrentToolbar) { HbToolBarPrivate *toolBarD = HbToolBarPrivate::d_ptr(d->mCurrentToolbar); toolBarD->startAppearOrientEffect(); + } else { + foreach(HbView * view, views()) { + view->toolBar()->resetTransform(); + view->toolBar()->setOpacity(1); + view->toolBar()->show(); + HbToolBarPrivate::d_ptr(view->toolBar())->mOrientationEffectsRunning = false; + } } - d->mOrientationChangeOngoing = false; + d->updateOrientationChangeStatus(); if (d->mAutomaticOrientationSwitch && HbMainWindowOrientation::instance()->isEnabled()) { d->setTransformedOrientation(HbMainWindowOrientation::instance()->sensorOrientation(), d->mAnimateOrientationSwitch); - } - else if (d->mRequestedOrientation != d->mOrientation) { + } else if (d->mRequestedOrientation != d->mOrientation) { d->setTransformedOrientation(d->mRequestedOrientation, d->mAnimateOrientationSwitch); } } else { @@ -915,6 +1074,27 @@ QGraphicsView::paintEvent(event); } +void HbMainWindow::showEvent(QShowEvent *event) +{ +#ifdef Q_OS_SYMBIAN + // Enable surface transparency if QWidget did not do it already. This is a + // workaround for having non-transparent surfaces filled automatically with + // black color. The showEvent is a suitable place because the native control + // is already created at this point, but it is not too late either. + if (!testAttribute(Qt::WA_TranslucentBackground)) { + RWindow *const window = static_cast(effectiveWinId()->DrawableWindow()); + window->SetSurfaceTransparency(true); + } +#endif + +#if defined(Q_WS_X11) + Q_D(HbMainWindow); + d->x11HandleShowEvent(event); +#endif // defined(Q_WS_X11) + + QGraphicsView::showEvent(event); +} + /*! Reimplemented from QAbstractScrollArea::scrollContentsBy(). */ @@ -932,12 +1112,35 @@ asynchronously. If the receiving widget has abstract items as child items, these will be informed - after the widget has received the event. + after the widget has received the event. */ -void HbMainWindow::broadcastEvent( int eventType ) +void HbMainWindow::broadcastEvent(int eventType) { Q_D(HbMainWindow); - d->broadcastEvent( eventType ); + d->broadcastEvent(eventType); +} + +/*! + True if the window is not visible to the user. False if one or more pixels are visible. +*/ +bool HbMainWindow::isObscured() const +{ + Q_D(const HbMainWindow); + + return d->mObscuredState; +} + +/* + // reimplemented from QWidget +*/ +bool HbMainWindow::event(QEvent *event) +{ + Q_D(HbMainWindow); + if (event->type() == HbEvent::WindowObscuredChanged) { + HbWindowObscuredChangedEvent *wosEvent = static_cast(event); + d->setObscuredState(wosEvent->obscuredState()); + } + return QGraphicsView::event(event); } HbRootItem::HbRootItem(QGraphicsItem *parent) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmainwindow.h --- a/src/hbcore/gui/hbmainwindow.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmainwindow.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,12 +43,14 @@ { Q_OBJECT - Q_PROPERTY(Qt::Orientation orientation + Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation RESET unsetOrientation NOTIFY orientationChanged) + Q_PROPERTY(bool obscuredState READ isObscured) + public: explicit HbMainWindow(QWidget *parent = 0, Hb::WindowFlags windowFlags = Hb::WindowFlagNone); ~HbMainWindow(); @@ -72,11 +74,16 @@ void setBackgroundImageName(Qt::Orientation orientation, const QString &name); QString backgroundImageName(Qt::Orientation orientation) const; + void setBackgroundImageMode(Hb::BackgroundImageMode mode); + Hb::BackgroundImageMode backgroundImageMode() const; + void setAutomaticOrientationEffectEnabled(bool enabled = true); bool automaticOrientationEffectEnabled() const; + bool isObscured() const; + public slots: - void broadcastEvent( int eventType ); + void broadcastEvent(int eventType); signals: void viewReady(); @@ -85,6 +92,8 @@ void aboutToChangeOrientation(); void aboutToChangeOrientation(Qt::Orientation newOrientation, bool animated); void orientationChanged(Qt::Orientation orientation); + void obscured(); + void revealed(); protected: void changeEvent(QEvent *event); @@ -95,15 +104,17 @@ void customEvent(QEvent *event); void scrollContentsBy(int dx, int dy); void paintEvent(QPaintEvent *event); + void showEvent(QShowEvent *event); + bool event(QEvent *event); HbMainWindowPrivate *const d_ptr; private: Q_DISABLE_COPY(HbMainWindow) Q_DECLARE_PRIVATE_D(d_ptr, HbMainWindow) - Q_PRIVATE_SLOT(d_func(), void rootItemFirstPhaseDone(const HbEffect::EffectStatus& status)) - Q_PRIVATE_SLOT(d_func(), void rootItemFinalPhaseDone(const HbEffect::EffectStatus& status)) - Q_PRIVATE_SLOT(d_func(), void orientationEffectFinished(const HbEffect::EffectStatus& status)) + Q_PRIVATE_SLOT(d_func(), void rootItemFirstPhaseDone(const HbEffect::EffectStatus &status)) + Q_PRIVATE_SLOT(d_func(), void rootItemFinalPhaseDone(const HbEffect::EffectStatus &status)) + Q_PRIVATE_SLOT(d_func(), void orientationEffectFinished(const HbEffect::EffectStatus &status)) Q_PRIVATE_SLOT(d_func(), void _q_viewChanged()) Q_PRIVATE_SLOT(d_func(), void _q_viewRemoved(QGraphicsWidget *)) Q_PRIVATE_SLOT(d_func(), void _q_viewTitleChanged(const QString &)) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmainwindow_p.cpp --- a/src/hbcore/gui/hbmainwindow_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmainwindow_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,15 +23,11 @@ ** ****************************************************************************/ -#include -#include -#include -#include +#include "hbmainwindow_p.h" #include "hbgraphicsscene.h" #include "hbindicatorbutton_p.h" #include "hbtitlebar_p.h" #include "hbstatusbar_p.h" -#include "hbmainwindow_p.h" #include "hbmenu.h" #include "hbnamespace.h" #include "hbnamespace_p.h" @@ -51,12 +47,24 @@ #include "hbcontentwidget_p.h" #include "hbscreen_p.h" #include "hbbackgrounditem_p.h" -#include "hbforegroundwatcher_p.h" +#include "hbcorepskeys_r.h" +#include +#include +#include #ifdef Q_OS_SYMBIAN #include "hbnativewindow_sym_p.h" -#endif +#include "hbdevicedialogserverdefs_p.h" +#include + +const TUid deviceDialogUid = {0x20022FC5}; +#endif //Q_OS_SYMBIAN + +#if defined(Q_WS_X11) +#include +#include +#endif // defined(Q_WS_X11) const int HbMainWindowPrivate::IdleEvent = QEvent::registerEventType(); const int HbMainWindowPrivate::IdleOrientationEvent = QEvent::registerEventType(); @@ -79,10 +87,16 @@ mTitleBar(0), mStatusBar(0), mFadeItem(0), - mRootItem(0), + mRootItem(0), + mPendingOrientationValue(0), mAutomaticOrientationSwitch(true), mUserOrientationSwitch(false), mOrientationChangeOngoing(false), + mRootItemFinalPhaseDone(false), + mOrientationEffectFinished(false), + mGVOrientationChangeEffectEnabled(false), + mPendingPsPublish(false), + mMainWindowActive(false), mOrientation(Qt::Vertical), mRequestedOrientation(Qt::Vertical), mCurrentToolbar(0), @@ -93,15 +107,20 @@ q_ptr(0), mTheTestUtility(0), mIdleEventHandled(false), - mNotifyOrientationChange(false), - mOrientationChangeNotified(false), mToolbarWasAdded(false), - mAutomaticOrientationChangeAnimation(true) + mAutomaticOrientationChangeAnimation(true), + mObscuredState(true) #ifdef Q_OS_SYMBIAN , - mNativeWindow(0) + mNativeWindow(0), + mDevDlgClientSession(0) #endif -{ +{ +#if !defined(Q_WS_X11) && !defined(Q_WS_S60) + mObscuredState = false; //For non-x11 and non-symbian we start with revealed state. +#endif + + qApp->installEventFilter(this); } HbMainWindowPrivate::~HbMainWindowPrivate() @@ -142,7 +161,7 @@ HbToolBar *HbMainWindowPrivate::toolBar() const { HbView *view = qobject_cast(mViewStackWidget->currentWidget()); - return view?HbViewPrivate::d_ptr(view)->toolBar:0; + return view ? HbViewPrivate::d_ptr(view)->toolBar : 0; } void HbMainWindowPrivate::addToolBarToLayout(HbToolBar *toolBar) @@ -159,16 +178,16 @@ toolBar->setParentItem(0); HbView *currentView = q->currentView(); if (toolBar->scene() != mScene - && currentView - && currentView->isItemVisible(Hb::ToolBarItem)) { // check just to avoid warnings + && currentView + && currentView->isItemVisible(Hb::ToolBarItem)) { // check just to avoid warnings // Update the toolbar to use the current orientation // and layout direction. if (toolBar->layoutDirection() != q->layoutDirection() && - !toolBar->testAttribute(Qt::WA_SetLayoutDirection)){ + !toolBar->testAttribute(Qt::WA_SetLayoutDirection)) { toolBar->setLayoutDirection(q->layoutDirection()); toolBar->setAttribute(Qt::WA_SetLayoutDirection, false); - } + } HbToolBarPrivate *toolBarD = HbToolBarPrivate::d_ptr(toolBar); toolBarD->mDoLayout = false; // No "appear" effect when changing views or when the first @@ -187,9 +206,12 @@ } toolBar->setZValue(HbPrivate::ToolBarZValue); - toolBar->setParentItem( mClippingItem ); + toolBar->setParentItem(mClippingItem); mClippingItem->setToolBar(toolBar); mCurrentToolbar = toolBar; + + toolBar->resetTransform(); + toolBar->show(); } } } @@ -198,7 +220,7 @@ { Q_Q(HbMainWindow); if (mCurrentToolbar && mCurrentToolbar->scene() && mCurrentToolbar == toolBar) { - mClippingItem->setToolBar( 0 ); + mClippingItem->setToolBar(0); mScene->removeItem(mCurrentToolbar); mCurrentToolbar->disconnect(q); mCurrentToolbar = 0; @@ -208,7 +230,7 @@ HbDockWidget *HbMainWindowPrivate::dockWidget() const { HbView *view = qobject_cast(mViewStackWidget->currentWidget()); - return view?HbViewPrivate::d_ptr(view)->dockWidget:0; + return view ? HbViewPrivate::d_ptr(view)->dockWidget : 0; } void HbMainWindowPrivate::addDockWidgetToLayout(HbDockWidget *dockWidget) @@ -223,16 +245,16 @@ if (dockWidget) { dockWidget->setParentItem(0); if (dockWidget->scene() != mScene) { - HbView* currentView = q->currentView(); + HbView *currentView = q->currentView(); if (currentView && currentView->isItemVisible(Hb::DockWidgetItem)) { mScene->addItem(dockWidget); // top level } } - + dockWidget->setZValue(HbPrivate::DockWidgetZValue); - dockWidget->setParentItem( mClippingItem ); - mClippingItem->setDockWidget(dockWidget); + dockWidget->setParentItem(mClippingItem); + mClippingItem->setDockWidget(dockWidget); mCurrentDockWidget = dockWidget; } } @@ -242,7 +264,7 @@ { Q_Q(HbMainWindow); if (mCurrentDockWidget && mCurrentDockWidget->scene() && mCurrentDockWidget == dockWidget) { - mClippingItem->setDockWidget( 0 ); + mClippingItem->setDockWidget(0); mScene->removeItem(mCurrentDockWidget); mCurrentDockWidget->disconnect(q); mCurrentDockWidget = 0; @@ -255,31 +277,48 @@ mRequestedOrientation = orientation; if (mOrientationChangeOngoing) { - return; + if (!mForceSetOrientation && !mUserOrientationSwitch) { + return; + } else if (mOrientation != orientation) { + HbEffectInternal::cancelAll(); + // Possibly posted idle events must not be delivered, + // there will be new ones due to this new orientation switch. + QCoreApplication::removePostedEvents(q); + } } - if ( (mOrientation == orientation) && !mForceSetOrientation && mEffectItem) { + + if (mOrientation == orientation && !mForceSetOrientation && mEffectItem) { return; } // skip transition if graphicsview is not visible mAnimateOrientationSwitch = animate; - if (!q->isVisible()) + if (!q->isVisible()) { mAnimateOrientationSwitch = false; + } // calling due to resize, orientation remains the same -> no signalling - if ( !((mOrientation == orientation) && mForceSetOrientation) ) { + if (!((mOrientation == orientation) && mForceSetOrientation)) { // cancel all effects HbEffectInternal::cancelAll(); mOrientationChangeOngoing = true; - mNotifyOrientationChange = false; - mOrientationChangeNotified = false; + mRootItemFinalPhaseDone = false; + mOrientationEffectFinished = false; emit q->aboutToChangeOrientation(); emit q->aboutToChangeOrientation(orientation, mAnimateOrientationSwitch); - } + + // Notify settingproxy only when orientation is actually changing, when this + // happens the animate flag is enabled. This is quick fix to prevent wrong keyboard + // from opening after splashscreen update. Better and final solution needs to be + // designed. + if (animate) { + HbInputSettingProxy::instance()->notifyScreenOrientationChange(); + } + } mOrientation = orientation; - + if (!mAnimateOrientationSwitch) { HbEffect::disable(mEffectItem); HbEffect::disable(&mGVWrapperItem); @@ -287,13 +326,17 @@ HbEffect::enable(mEffectItem); HbEffect::enable(&mGVWrapperItem); } - + // Sets graphicsview rotation effect to either 90/270 degrees updateRotationEffects(); //For mirroring case changeSceneSize(); - + +#ifdef Q_OS_SYMBIAN + updateForegroundOrientationPSKey(); +#endif + HbEffect::start(mEffectItem, "rootItemFirstPhase", q, "rootItemFirstPhaseDone"); if (mAnimateOrientationSwitch) { @@ -312,9 +355,10 @@ void HbMainWindowPrivate::changeSceneSize() { - // no need to perform the scene size change if there's no (rotation) effect for graphicsview - if (!mGVOrientationChangeEffectEnabled) + // no need to perform the scene size change if there's no (rotation) effect for graphicsview + if (!mGVOrientationChangeEffectEnabled) { return; + } Q_Q(HbMainWindow); HbDeviceProfile profile = HbDeviceProfile::profile(q); @@ -344,17 +388,16 @@ HbDeviceProfile o = HbDeviceProfile::profile(q); mOrientationAngle = o.orientationAngle(); - + // Effects for GraphicsView (HbMainWindow) bool ret(true); bool ret2(true); - // wrapper item holds the degree value for optimisation purposes (set effect only once) - if (mOrientationAngle == 270 && (mGVWrapperItem.transformDegrees != 270) ) { + // wrapper item holds the degree value for optimization purposes (set effect only once) + if (mOrientationAngle == 270 && (mGVWrapperItem.transformDegrees != 270)) { mGVWrapperItem.transformDegrees = 270; ret = HbEffectInternal::add(&mGVWrapperItem, "toDefaultOrientation270", "toDefault"); ret2 = HbEffectInternal::add(&mGVWrapperItem, "toRotatedOrientation270", "toRotated"); - } - else if(mOrientationAngle == 90 &&(mGVWrapperItem.transformDegrees != 90)) { + } else if (mOrientationAngle == 90 && (mGVWrapperItem.transformDegrees != 90)) { mGVWrapperItem.transformDegrees = 90; ret = HbEffectInternal::add(&mGVWrapperItem, "toDefaultOrientation90", "toDefault"); ret2 = HbEffectInternal::add(&mGVWrapperItem, "toRotatedOrientation90", "toRotated"); @@ -362,7 +405,7 @@ mGVOrientationChangeEffectEnabled = true; if (!ret || !ret2) { - HbEffectInternal::remove(&mGVWrapperItem); + HbEffectInternal::remove(&mGVWrapperItem); mGVOrientationChangeEffectEnabled = false; } } @@ -388,7 +431,7 @@ // if setting the same orientation send the profile changed event here since the setTransformedOrientation won't do it if ((mOrientation == profile.orientation()) && - mClippingItem->size() == profile.logicalSize()) { + mClippingItem->size() == profile.logicalSize()) { HbDeviceProfileChangedEvent *event = new HbDeviceProfileChangedEvent(profile, oldProfile); broadcastEvent(event); } @@ -407,53 +450,54 @@ { HbDeviceProfile result = profile; if (!result.isNull() && result.orientation() != mOrientation) { - if(mAlternateProfile.isNull()) { + if (mAlternateProfile.isNull()) { mAlternateProfile = HbDeviceProfile(profile.alternateProfileName()); return mAlternateProfile; + } else { + return mAlternateProfile; } - else { - return mAlternateProfile; - } - } - return result; + } + return result; } -void HbMainWindowPrivate::orientationEffectFinished(const HbEffect::EffectStatus& status) +void HbMainWindowPrivate::orientationEffectFinished(const HbEffect::EffectStatus &status) { Q_UNUSED(status); Q_Q(HbMainWindow); + mOrientationEffectFinished = true; QSize newSize; - + HbDeviceProfile o = HbDeviceProfile::profile(q); - newSize = o.logicalSize(); + newSize = o.logicalSize(); // do some sanity checking for the size got from device profile - if( newSize.isNull() || ((newSize.width()*newSize.height()) < QVga_res) ) { // the resolution must be at least QVGA.. + if (newSize.isNull() || ((newSize.width()*newSize.height()) < QVga_res)) { // the resolution must be at least QVGA.. qWarning("Orient. change error: size from device profile is faulty!"); } - - q->setSceneRect(0,0,newSize.width(),newSize.height()); - - if (mBgItem) + + q->setSceneRect(0, 0, newSize.width(), newSize.height()); + + if (mBgItem) { mBgItem->updateBackgroundImage(); + } // re-layouting, skip if size does not change if (mClippingItem->size() != newSize) { mClippingItem->resize(newSize); - mLayoutRect = QRectF(QPointF(0,0), newSize); + mLayoutRect = QRectF(QPointF(0, 0), newSize); // reset transformation q->resetTransform(); // if not default rotation, rotate to the defined angle no matter what the effect did - if( mOrientation != mDefaultOrientation) + if (mOrientation != mDefaultOrientation) { q->rotate(mOrientationAngle); + } // handle actual orientation change only if the orientation really changes (not just a resize) - if (mOrientationChangeOngoing || mNotifyOrientationChange) { - mOrientationChangeNotified = true; + if (mOrientationChangeOngoing) { // signal only if layout changes (=orientation changes) // Background item is re-layouted from device profile changed event emit q->orientationChanged(mOrientation); @@ -464,36 +508,46 @@ HbInputSettingProxy::instance()->setScreenOrientation(mOrientation); } } - mNotifyOrientationChange = false; + updateOrientationChangeStatus(); } -void HbMainWindowPrivate::rootItemFirstPhaseDone(const HbEffect::EffectStatus& status) +void HbMainWindowPrivate::rootItemFirstPhaseDone(const HbEffect::EffectStatus &status) { Q_UNUSED(status) Q_Q(HbMainWindow); - if (mOrientation == mDefaultOrientation) - HbEffect::start(&mGVWrapperItem,"toDefault", q, "orientationEffectFinished"); - else - HbEffect::start(&mGVWrapperItem,"toRotated", q, "orientationEffectFinished"); + if (mOrientation == mDefaultOrientation) { + HbEffect::start(&mGVWrapperItem, "toDefault", q, "orientationEffectFinished"); + } else { + HbEffect::start(&mGVWrapperItem, "toRotated", q, "orientationEffectFinished"); + } } -void HbMainWindowPrivate::rootItemFinalPhaseDone(const HbEffect::EffectStatus& status) +void HbMainWindowPrivate::rootItemFinalPhaseDone(const HbEffect::EffectStatus &status) { Q_UNUSED(status); - if (mEffectItem) { - HbEffect::enable(mEffectItem); - // make sure effect does not leave anything in wrong state - mEffectItem->setOpacity(1.0f); - mEffectItem->resetTransform(); + if (mOrientationChangeOngoing) { + mRootItemFinalPhaseDone = true; + if (mEffectItem) { + HbEffect::enable(mEffectItem); + // make sure effect does not leave anything in wrong state + mEffectItem->setOpacity(1.0f); + mEffectItem->resetTransform(); + } + + HbEffect::enable(&mGVWrapperItem); + + postIdleEvent(HbMainWindowPrivate::IdleOrientationFinalEvent); + updateOrientationChangeStatus(); } - - HbEffect::enable(&mGVWrapperItem); +} - postIdleEvent(HbMainWindowPrivate::IdleOrientationFinalEvent); - mNotifyOrientationChange = !mOrientationChangeNotified && mOrientationChangeOngoing; - mOrientationChangeOngoing = false; +void HbMainWindowPrivate::updateOrientationChangeStatus() +{ + if (mOrientationChangeOngoing && mRootItemFinalPhaseDone && mOrientationEffectFinished) { + mOrientationChangeOngoing = false; + } } void HbMainWindowPrivate::addOrientationChangeEffects() @@ -502,9 +556,10 @@ // If effect loading fails, remove both effects. bool ret = HbEffectInternal::add(mEffectItem, "rootitem_orientation_firstPhase", "rootItemFirstPhase"); bool ret2 = HbEffectInternal::add(mEffectItem, "rootitem_orientation_finalPhase", "rootItemFinalPhase"); - - if (!ret || !ret2) + + if (!ret || !ret2) { HbEffectInternal::remove(mEffectItem); + } mOrientationChangeEffectItems.append(mEffectItem); mOrientationChangeEffectItems.append(&mGVWrapperItem); @@ -516,18 +571,18 @@ // Use HbEffectInternal and the HB_ prefix to prevent general overriding of these effects. // Instead, view switch effects can be overridden on a per-instance basis. bool ok = HbEffectInternal::add( - QStringList() << "HB_view" << "HB_view" << "HB_view" << "HB_view", - QStringList() << "view_show_normal" << "view_hide_normal" << "view_show_back" << "view_hide_back", - QStringList() << "show" << "hide" << "show_back" << "hide_back"); + QStringList() << "HB_view" << "HB_view" << "HB_view" << "HB_view", + QStringList() << "view_show_normal" << "view_hide_normal" << "view_show_back" << "view_hide_back", + QStringList() << "show" << "hide" << "show_back" << "hide_back"); if (!ok) { qWarning("HbMainWindow: addViewEffects: atomic registration for show/hide effects failed"); } // Register the alternative default. ok = HbEffectInternal::add( - QStringList() << "HB_view" << "HB_view" << "HB_view" << "HB_view", - QStringList() << "view_show_normal_alt" << "view_hide_normal_alt" << "view_show_back_alt" << "view_hide_back_alt", - QStringList() << "show_alt" << "hide_alt" << "show_alt_back" << "hide_alt_back"); + QStringList() << "HB_view" << "HB_view" << "HB_view" << "HB_view", + QStringList() << "view_show_normal_alt" << "view_hide_normal_alt" << "view_show_back_alt" << "view_hide_back_alt", + QStringList() << "show_alt" << "hide_alt" << "show_alt_back" << "hide_alt_back"); if (!ok) { qWarning("HbMainWindow: addViewEffects: atomic registration for alternative show/hide effects failed"); } @@ -535,18 +590,18 @@ // Register titlebar effects. // These should be overridable in general (so we use HbEffect and no HB_ prefix). ok = HbEffect::add( - QStringList() << "titlebar" << "titlebar" << "titlebar" << "titlebar", - QStringList() << "titlebar_disappear" << "titlebar_appear" << "titlebar_orient_disappear" << "titlebar_orient_appear", - QStringList() << "disappear" << "appear" << "disappear_orient" << "appear_orient"); + QStringList() << "titlebar" << "titlebar" << "titlebar" << "titlebar", + QStringList() << "titlebar_disappear" << "titlebar_appear" << "titlebar_orient_disappear" << "titlebar_orient_appear", + QStringList() << "disappear" << "appear" << "disappear_orient" << "appear_orient"); if (!ok) { qWarning("HbMainWindow: addViewEffects: atomic registration for titlebar effects failed"); } // Register statusbar effects. ok = HbEffect::add( - QStringList() << "statusbar" << "statusbar" << "statusbar" << "statusbar", - QStringList() << "statusbar_disappear" << "statusbar_appear" << "statusbar_orient_disappear" << "statusbar_orient_appear", - QStringList() << "disappear" << "appear" << "disappear_orient" << "appear_orient"); + QStringList() << "statusbar" << "statusbar" << "statusbar" << "statusbar", + QStringList() << "statusbar_disappear" << "statusbar_appear" << "statusbar_orient_disappear" << "statusbar_orient_appear", + QStringList() << "disappear" << "appear" << "disappear_orient" << "appear_orient"); if (!ok) { qWarning("HbMainWindow: addViewEffects: atomic registration for statusbar effects failed"); } @@ -560,8 +615,8 @@ Q_Q(HbMainWindow); HbView *view = qobject_cast(mViewStackWidget->currentWidget()); - if (view) { - if(!HbViewPrivate::d_ptr(view)->mVisited) { + if (view) { + if (!HbViewPrivate::d_ptr(view)->mVisited) { HbViewPrivate::d_ptr(view)->mVisited = true; // connect signals when the view is first time visited QObject::connect(view, SIGNAL(titleChanged(QString)), q, SLOT(_q_viewTitleChanged(QString))); @@ -587,7 +642,7 @@ Q_Q(HbMainWindow); widget->disconnect(q); - HbView *view = qobject_cast(widget); + HbView *view = qobject_cast(widget); if (view) { // Reset view visit flag HbViewPrivate::d_ptr(view)->mVisited = false; @@ -621,7 +676,7 @@ Q_Q(HbMainWindow); HbView *view = qobject_cast(q->sender()); if (view) { - if(view == q->currentView()) { + if (view == q->currentView()) { addDockWidgetToLayout(HbViewPrivate::d_ptr(view)->dockWidget); } } @@ -630,7 +685,7 @@ /* Launches the menu of the current view at given pos. */ -void HbMainWindowPrivate::_q_launchMenu(const QPointF& pos) // TODO - pos unused! +void HbMainWindowPrivate::_q_launchMenu(const QPointF &pos) // TODO - pos unused! { Q_Q(HbMainWindow); Q_UNUSED(pos); @@ -640,7 +695,7 @@ if (!menu->isEmpty()) { q->connect(menu, SIGNAL(aboutToClose()), q, SLOT(_q_restoreTitlePane())); menu->setTimeout(HbPopup::NoTimeout); - menu->open( this, SLOT(menuClosed())); + menu->open(this, SLOT(menuClosed())); } else { _q_restoreTitlePane(); } @@ -677,7 +732,7 @@ } /* - Updates the layout of current view when fullscreen + Updates the layout of current view when fullscreen property has been toggled. */ void HbMainWindowPrivate::_q_contentFullScreenChanged() @@ -696,10 +751,9 @@ */ void HbMainWindowPrivate::fadeScreen(qreal zValue) { - if (mFadeItem) { - mFadeItem->setZValue(zValue); - mFadeItem->show(); - } + initFadeItem(); + mFadeItem->setZValue(zValue); + mFadeItem->show(); } /* @@ -709,8 +763,20 @@ */ void HbMainWindowPrivate::unfadeScreen() { - if (mFadeItem) { + initFadeItem(); + mFadeItem->hide(); +} + +/* + Creates the fade item. +*/ +void HbMainWindowPrivate::initFadeItem() +{ + if (!mFadeItem) { + mFadeItem = new HbFadeItem; + mFadeItem->setZValue(HbPrivate::FadingItemZValue); mFadeItem->hide(); + mScene->addItem(mFadeItem); } } @@ -725,7 +791,8 @@ if (view) { const Hb::SceneItems visibleItems(view->visibleItems()); view->setTitleBarVisible(visibleItems & Hb::TitleBarItem); // also handles updating of the navigation button - + view->setStatusBarVisible(visibleItems & Hb::StatusBarItem); + // ToolBar is a special case, since it depens on the current view's toolbar if (visibleItems & Hb::ToolBarItem) { if (q->currentView()) { @@ -757,13 +824,13 @@ */ void HbMainWindowPrivate::_q_themeChanged() { - broadcastEvent( HbEvent::ThemeChanged ); + broadcastEvent(HbEvent::ThemeChanged); } static void informWidget(HbMainWindowPrivate::BroadcastItem &bcItem, QGraphicsWidget *widget); /* - Sends event of \eventType to all items in the \inform list + Sends event of \eventType to all items in the \inform list excluding ones in the \a ignoreItems list. Invible widgets will be added onto \deferredItems list which will be @@ -771,16 +838,16 @@ */ static void informItems(HbMainWindowPrivate::BroadcastItem &bcItem, QList &inform) { - if ( inform.count() ) { - foreach( QGraphicsItem *item, inform ) { - if ( item->isWidget() ) { + if (inform.count()) { + foreach(QGraphicsItem * item, inform) { + if (item->isWidget()) { QGraphicsWidget *widget = static_cast(item); - if ( item->isVisible() ) { + if (item->isVisible()) { informWidget(bcItem, widget); } else { - bcItem.mPending.append(QPointer( widget )); + bcItem.mPending.append(QPointer(widget)); } - } + } } } } @@ -802,11 +869,11 @@ /* Broadcasts event of type \a eventType into all widgets in the scene. - - This is a convenince method for void broadcastEvent( QEvent * ). + + This is a convenince method for void broadcastEvent( QEvent * ). */ -void HbMainWindowPrivate::broadcastEvent( int eventType ) +void HbMainWindowPrivate::broadcastEvent(int eventType) { HbEvent *event = new HbEvent(eventType); broadcastEvent(event); @@ -821,14 +888,14 @@ Invisible child items are added into mPending array which will be handled asynchronously. */ -void HbMainWindowPrivate::broadcastEvent( QEvent *event ) +void HbMainWindowPrivate::broadcastEvent(QEvent *event) { Q_Q(HbMainWindow); int type = event->type(); - bool previousEvent(mBroadcastItems.contains( type )); + bool previousEvent(mBroadcastItems.contains(type)); - BroadcastItem& broadcastItem = mBroadcastItems[type]; + BroadcastItem &broadcastItem = mBroadcastItems[type]; broadcastItem.mEvent = event; // cancel previous requests @@ -838,29 +905,29 @@ // create high priority items QList priorityItems; - if ( type == HbEvent::ThemeChanged ) { - if ( q->currentView() ) { - priorityItems.append( q->currentView() ); + if (type == HbEvent::ThemeChanged) { + if (q->currentView()) { + priorityItems.append(q->currentView()); } } - + // inform prority items now informItems(broadcastItem, priorityItems); // inform root items in the scene QList sceneItems = mScene->items(); QList rootItems; - foreach( QGraphicsItem *item, sceneItems ) { - if ( !item->parentItem() && !priorityItems.contains(item)) { - rootItems.append( item ); + foreach(QGraphicsItem * item, sceneItems) { + if (!item->parentItem() && !priorityItems.contains(item)) { + rootItems.append(item); } } informItems(broadcastItem, rootItems); // create asynchronous broadcast loop if needed. - if ( broadcastItem.mPending.count() ) { + if (broadcastItem.mPending.count()) { Q_Q(HbMainWindow); - QMetaObject::invokeMethod( q, "_q_continueBroadcasting", Qt::QueuedConnection, Q_ARG(int, type) ); + QMetaObject::invokeMethod(q, "_q_continueBroadcasting", Qt::QueuedConnection, Q_ARG(int, type)); } else { // no pending items left, remove the broadcast item delete mBroadcastItems[type].mEvent; @@ -869,9 +936,9 @@ } /* - For asynchronous event broadcasting. + For asynchronous event broadcasting. - Items in the mPending array are informed. + Items in the mPending array are informed. */ void HbMainWindowPrivate::_q_continueBroadcasting(int type) { @@ -880,22 +947,22 @@ return; } - BroadcastItem& broadcastItem = mBroadcastItems[type]; + BroadcastItem &broadcastItem = mBroadcastItems[type]; // take a copy and then clear the pending items QList informItems = broadcastItem.mPending; broadcastItem.mPending.clear(); - foreach( QPointer widgetPtr, informItems ) { - if ( !widgetPtr.isNull() ) { + foreach(QPointer widgetPtr, informItems) { + if (!widgetPtr.isNull()) { informWidget(broadcastItem, widgetPtr.data()); } } // create another broadcast loop if needed. - if ( broadcastItem.mPending.count() ) { + if (broadcastItem.mPending.count()) { Q_Q(HbMainWindow); - QMetaObject::invokeMethod( q, "_q_continueBroadcasting", Qt::QueuedConnection, Q_ARG(int, type) ); + QMetaObject::invokeMethod(q, "_q_continueBroadcasting", Qt::QueuedConnection, Q_ARG(int, type)); } else { // no pending items left, remove the broadcast item delete mBroadcastItems[type].mEvent; @@ -912,7 +979,7 @@ void HbMainWindowPrivate::_q_delayedConstruction() { - if (!mDelayedConstructionHandled){ + if (!mDelayedConstructionHandled) { Q_Q(HbMainWindow); mDelayedConstructionHandled = true; @@ -926,13 +993,11 @@ addViewEffects(); mClippingItem->delayedConstruction(); - mViewStackWidget->delayedConstruction(); + connect(hbInstance->theme(), SIGNAL(changed()), + q, SLOT(_q_themeChanged())); - connect(hbInstance->theme(), SIGNAL(changed()), - q, SLOT(_q_themeChanged()) ); - - connect(q, SIGNAL(currentViewChanged(HbView*)), - mClippingItem, SLOT(currentViewChanged(HbView*))); + connect(q, SIGNAL(currentViewChanged(HbView *)), + mClippingItem, SLOT(currentViewChanged(HbView *))); mTitleBar->delayedConstruction(); connect(mTitleBar->titlePane(), SIGNAL(visibilityChanged()), @@ -945,11 +1010,17 @@ mTitleBar, SIGNAL(activated(const QList &))); connect(mStatusBar, SIGNAL(deactivated(const QList &)), mTitleBar, SIGNAL(deactivated(const QList &))); + connect(mStatusBar, SIGNAL(allActivated(const QList &)), + mTitleBar, SIGNAL(allActivated(const QList &))); - mFadeItem = new HbFadeItem; - mFadeItem->setZValue(HbPrivate::FadingItemZValue); - mFadeItem->hide(); - mScene->addItem(mFadeItem); + initFadeItem(); + +#ifdef Q_OS_SYMBIAN + mDevDlgConnectHelper = new HbDeviceDialogConnectHelper(this); + connect(mDevDlgConnectHelper, SIGNAL(sessionEstablished(RHbDeviceDialogClientSession *)), + this, SLOT(deviceDialogConnectionReady(RHbDeviceDialogClientSession *))); + mDevDlgConnectHelper->connect(); +#endif //Q_OS_SYMBIAN _q_viewReady(); @@ -959,18 +1030,19 @@ void HbMainWindowPrivate::_q_viewReady() { - Q_Q(HbMainWindow); - emit q->viewReady(); + Q_Q(HbMainWindow); + emit q->viewReady(); } QGraphicsWidget *HbMainWindowPrivate::element(HbMainWindowPrivate::Element element) const { - if( element == HbMainWindowPrivate::RootItem ) + if (element == HbMainWindowPrivate::RootItem) { return mRootItem; - else if( element == HbMainWindowPrivate::ViewportItem ) + } else if (element == HbMainWindowPrivate::ViewportItem) { return mClippingItem; - else if( element == HbMainWindowPrivate::BackgroundItem ) + } else if (element == HbMainWindowPrivate::BackgroundItem) { return mBgItem; + } return 0; } @@ -992,5 +1064,106 @@ } } +void HbMainWindowPrivate::setViewportSize(const QSizeF &newSize) +{ + mClippingItem->resize(newSize); + mLayoutRect = QRectF(QPointF(0, 0), newSize); + mViewStackWidget->resize(newSize); +} +QSizeF HbMainWindowPrivate::viewPortSize() const +{ + return mClippingItem->size(); +} + +/* + Sets the obscured state of the window and emits a signal if nessasary. +*/ +void HbMainWindowPrivate::setObscuredState(bool state) +{ + Q_Q(HbMainWindow); + if (state == true) { + if (mObscuredState == false) { + mObscuredState = true; + emit q->obscured(); + } + } else { + if (mObscuredState == true) { + mObscuredState = false; + emit q->revealed(); + } + } +} + +bool HbMainWindowPrivate::eventFilter(QObject *watched, QEvent *event) +{ + switch (event->type()) { + case QEvent::ApplicationActivate: + mMainWindowActive = true; +#ifdef Q_OS_SYMBIAN + updateForegroundOrientationPSKey(); +#endif + break; + case QEvent::ApplicationDeactivate: + mMainWindowActive = false; + break; + default: + break; + } + return QObject::eventFilter(watched, event); +} + +#if defined(Q_WS_X11) +bool HbMainWindowPrivate::x11HandleShowEvent(QShowEvent *) +{ + Q_Q(HbMainWindow); + Display *dpy = QX11Info::display(); + WId id = q->effectiveWinId(); + XWindowAttributes attr; + if (XGetWindowAttributes(dpy, id, &attr)) { + long allEventMask = attr.all_event_masks; + allEventMask |= VisibilityChangeMask; + XSelectInput(dpy, id, allEventMask); + } + return false; +} +#endif //Q_WS_X11 + +#ifdef Q_OS_SYMBIAN +void HbMainWindowPrivate::updateForegroundOrientationPSKey() +{ + RProcess process; + if (process.SecureId().iId != deviceDialogUid.iUid && mMainWindowActive) { + if (mDevDlgClientSession && !mPendingPsPublish) { + int orie = mOrientation; + if (!mAutomaticOrientationSwitch) { + orie |= KHbFixedOrientationMask; + } + mDevDlgClientSession->SendSyncRequest(EHbSrvPublishOrientation, orie); + } else if (mDevDlgClientSession && mPendingPsPublish) { + mDevDlgClientSession->SendSyncRequest(EHbSrvPublishOrientation, mPendingOrientationValue); + mPendingPsPublish = false; + mPendingOrientationValue = 0; + } else if (!mDevDlgClientSession && !mPendingPsPublish) { + mPendingOrientationValue = mOrientation; + if (!mAutomaticOrientationSwitch) { + mPendingOrientationValue |= KHbFixedOrientationMask; + } + mPendingPsPublish = true; + } + } + process.Close(); +} +#endif + +#ifdef Q_OS_SYMBIAN +void HbMainWindowPrivate::deviceDialogConnectionReady(RHbDeviceDialogClientSession *clientSession) +{ + mDevDlgClientSession = clientSession; + if (mPendingPsPublish) { + updateForegroundOrientationPSKey(); + } +} + +#endif //Q_OS_SYMBIAN // end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmainwindow_p.h --- a/src/hbcore/gui/hbmainwindow_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmainwindow_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,6 +41,10 @@ #include "hbdeviceprofile.h" #include "hbeffect.h" #include "hbeffectinternal_p.h" +#ifdef Q_OS_SYMBIAN +#include +#include +#endif class HbBackgroundItem; class HbGraphicsScene; @@ -52,6 +56,7 @@ class HbDockWidget; class HbContentWidget; class HbTheTestUtility; +class CssInspectorModel; #ifdef Q_OS_SYMBIAN class HbNativeWindow; @@ -86,18 +91,20 @@ QRectF contentRect() const; void setTransformedOrientation(Qt::Orientation orientation, bool animate = true); qreal rotation() const; - + bool eventFilter(QObject *watched, QEvent *event); + void select(const HbDeviceProfile &profile, HbDeviceProfile *oldGlobalProfile = 0); HbDeviceProfile profile() const; HbDeviceProfile adjustedProfile(const HbDeviceProfile &profile) const; void broadcastEvent(int eventType); - void broadcastEvent(QEvent* event); + void broadcastEvent(QEvent *event); void changeSceneSize(); void updateRotationEffects(); void addBackgroundItem(); void removeBackgroundItem(); + void initFadeItem(); void postIdleEvent(int eventId); @@ -105,9 +112,13 @@ void unfadeScreen(); void _q_viewReady(); - + QGraphicsWidget *element(HbMainWindowPrivate::Element element) const; + void setObscuredState(bool state); +#if defined(Q_WS_X11) + bool x11HandleShowEvent(QShowEvent *event); +#endif HbGraphicsScene *mScene; HbBackgroundItem *mBgItem; HbScreen *mClippingItem; @@ -118,14 +129,19 @@ QGraphicsWidget *mRootItem; QGraphicsWidget *mEffectItem; Qt::Orientation mDefaultOrientation; + int mPendingOrientationValue; qreal mOrientationAngle; - QList mItemList; - QList mOrientationChangeEffectItems; + QList mItemList; + QList mOrientationChangeEffectItems; bool mAutomaticOrientationSwitch; bool mUserOrientationSwitch; bool mOrientationChangeOngoing; + bool mRootItemFinalPhaseDone; + bool mOrientationEffectFinished; bool mAnimateOrientationSwitch; bool mGVOrientationChangeEffectEnabled; + bool mPendingPsPublish; + bool mMainWindowActive; Qt::Orientation mOrientation; Qt::Orientation mRequestedOrientation; HbToolBar *mCurrentToolbar; @@ -147,19 +163,20 @@ QRectF mLayoutRect; mutable HbDeviceProfile mAlternateProfile; QPointer mMenuView; - bool mNotifyOrientationChange; - bool mOrientationChangeNotified; bool mToolbarWasAdded; bool mAutomaticOrientationChangeAnimation; QTranslator mCommonTranslator; + bool mObscuredState; #ifdef Q_OS_SYMBIAN HbNativeWindow *mNativeWindow; + RHbDeviceDialogClientSession *mDevDlgClientSession; + HbDeviceDialogConnectHelper *mDevDlgConnectHelper; #endif + void rootItemFirstPhaseDone(const HbEffect::EffectStatus &status); + void rootItemFinalPhaseDone(const HbEffect::EffectStatus &status); + void orientationEffectFinished(const HbEffect::EffectStatus &status); - void rootItemFirstPhaseDone(const HbEffect::EffectStatus& status); - void rootItemFinalPhaseDone(const HbEffect::EffectStatus& status); - void orientationEffectFinished(const HbEffect::EffectStatus& status); - + void updateOrientationChangeStatus(); void addOrientationChangeEffects(); void addViewEffects(); void _q_viewChanged(); @@ -182,33 +199,28 @@ static const int IdleOrientationEvent; static const int IdleOrientationFinalEvent; + void setViewportSize(const QSizeF &newSize); + QSizeF viewPortSize() const; + + static HbMainWindowPrivate *d_ptr(HbMainWindow *mainWindow) { + Q_ASSERT(mainWindow); + return mainWindow->d_func(); + } + signals: void idleEventDispatched(); public slots: void menuClosed(); +#ifdef Q_OS_SYMBIAN + void updateForegroundOrientationPSKey(); + void deviceDialogConnectionReady(RHbDeviceDialogClientSession *clientSession); +#endif -private: - static HbMainWindowPrivate *d_ptr(HbMainWindow *mainWindow) { - Q_ASSERT(mainWindow); - return mainWindow->d_func(); - } - friend class HbPopupManagerPrivate; - friend class HbInstance; - friend class HbInstancePrivate; - friend class HbDeviceProfileManager; - friend class HbDeviceProfile; - friend class HbView; - friend class HbVgEffectPrivate; - friend class HbContentWidget; - friend class HbSplashGenerator; - friend class TestHbDeviceProfile; - friend class TestHbGridView; - friend class TestHbMainWindow; - friend class HbMainWindowOrientation; - friend class HbScreen; - friend class HbSettingsWindow; - friend class TestHbSensorOrientation; + friend class HbShrinkingVkbHostPrivate; + friend class HbForegroundWatcher; + friend class HbDeviceDialogConnectHelperPrivate; + friend class CssInspectorModel; }; #endif // HBMAINWINDOW_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmenu.cpp --- a/src/hbcore/gui/hbmenu.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmenu.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -46,14 +46,14 @@ menuItemView(0), subMenuAction(0), activeSubMenu(0), - resultAction(0), actionTriggered(false), menuType(HbMenu::ContextMenu), mSubMenuItem(0), mRightMargin(0.0), mDownMargin(0.0), delayMenuConstruction(true), - receiverToDisconnectOnClose(0) + receiverToDisconnectOnClose(0), + mNumberOfColumns(1) { } @@ -88,11 +88,6 @@ if (hasEffects) { hasEffects = HbEffectInternal::add("HB_menuitem", "menuitem_press", "clicked"); } - if (hasEffects ) { - hasEffects = HbEffectInternal::add("HB_POPUP", - "dialog_rotate", - "orientationswitch"); - } } #endif } @@ -108,15 +103,13 @@ } #endif HbAction *hbAction = qobject_cast(currentItem->action()); + q->setActiveAction(hbAction); if (hbAction && hbAction->menu() && !actionTriggered) { hbAction->trigger(); stopTimeout(); openSubmenu(currentItem); } else { q->close(); - - resultAction = hbAction; - if (!actionTriggered) { // prevent duplicate events currentItem->action()->trigger(); } @@ -257,7 +250,6 @@ } if (activeItem && activeItem->action() && activeItem->action()->isEnabled()) { HbAction *hbAction = qobject_cast(activeItem->action()); - q->setActiveAction(hbAction); if (!hbAction) return; HbMenu *subMenu = hbAction->menu(); @@ -291,7 +283,7 @@ } } -void HbMenuPrivate::_q_handleMenuAfterOrientationChange() +void HbMenuPrivate::_q_handleMenuClose() { Q_Q(HbMenu); if ( menuType == HbMenu::ContextMenu || menuType == HbMenu::OptionsMenu ) { @@ -307,17 +299,21 @@ } /*! - closes the menu after Orientation change + Handles menu close */ -void HbMenuPrivate::closeMenuAfterOrientationChange() +void HbMenuPrivate::closeMenu() { Q_Q(HbMenu); HbMainWindow* w(q->mainWindow()); if ( w ){ QObject::disconnect( w, SIGNAL(aboutToChangeOrientation()), - q, SLOT(_q_handleMenuAfterOrientationChange())); + q, SLOT(_q_handleMenuClose())); QObject::connect( w, SIGNAL(aboutToChangeOrientation()), - q, SLOT(_q_handleMenuAfterOrientationChange())); + q, SLOT(_q_handleMenuClose())); + QObject::disconnect( w, SIGNAL(aboutToChangeView(HbView*, HbView*)), + q, SLOT(_q_handleMenuClose())); + QObject::connect( w, SIGNAL(aboutToChangeView(HbView*, HbView*)), + q, SLOT(_q_handleMenuClose())); } } @@ -421,18 +417,11 @@ The receiver is notifed when the action is triggered (QAction::triggered()). HbMenu also has a triggered() menu signal, which signals which HbAction was triggered in the menu. - Context menu example: - - A menu and a few actions are created. The triggered() signal of the menu is connected to - the mute() function of the enclosing class (implementation not shown). - The exec() function shows the menu. + An example of how to create an option menu. + \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,2} - User needs to connect to "longPress" signal and implement corresponding slot. This enables - longpress events to be received from list. - - \dontinclude decoratorlistdemo/contentwidget.cpp - \skip // Create new menu - \until ( coords ); + An example of how to create and show a context menu from the gesture. + \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,54} \sa HbDialog, HbView */ @@ -498,6 +487,9 @@ setTitle(title); } +/*! + Protected constructor. +*/ HbMenu::HbMenu(HbMenuPrivate &dd, QGraphicsItem *parent) : HbPopup(dd, parent) { @@ -617,7 +609,9 @@ */ HbAction *HbMenu::addSeparator() { - return insertSeparator(0); + //functionality removed for now + //return insertSeparator(0); + return 0; } /*! @@ -629,12 +623,15 @@ */ HbAction *HbMenu::insertSeparator(HbAction *before) { - HbAction *action = new HbAction(this); + Q_UNUSED(before); + //functionality removed for now + /*HbAction *action = new HbAction(this); action->setSeparator(true); action->setEnabled(true); action->setVisible(true); insertAction(before, action); - return action; + return action;*/ + return 0; } /*! @@ -681,7 +678,9 @@ } /*! - \return the menu title. For a sub-menu, the title is the sub-menu action text. + Returns the menu title. For a sub-menu, the title is the sub-menu action text. + + \return the menu title. \sa setTitle() */ @@ -691,7 +690,9 @@ } /*! - \return the menu type. By default a menu is a context menu. + Returns the menu type. By default a menu is a context menu. + + \return the menu type. */ HbMenu::MenuType HbMenu::menuType() const { @@ -707,14 +708,13 @@ Q_D(HbMenu); if (change == QGraphicsItem::ItemSceneHasChanged) { - d->closeMenuAfterOrientationChange(); + d->closeMenu(); } if (change == QGraphicsItem::ItemVisibleChange) { if (value.toBool() && d->delayMenuConstruction) { d->delayedLayout(); } if (value.toBool()) { - d->resultAction = 0; d->actionTriggered = false; } else if (!value.toBool() && !d->menuItemView){ @@ -754,9 +754,15 @@ return HbPopup::event(event); } +/*! + \reimp + */ void HbMenu::polish(HbStyleParameters ¶ms) { Q_D(HbMenu); + const QString NumberOfCols = "number-of-columns"; + params.addParameter(NumberOfCols); + if (d->mSubMenuItem) { const QString RightMargin = "submenu-right-offset"; const QString DownMargin = "submenu-bottom-margin"; @@ -775,20 +781,31 @@ } else { HbPopup::polish(params); } + + if (!params.value(NumberOfCols).isNull()) { + int cols = params.value(NumberOfCols).toInt(); + if (d->mNumberOfColumns != cols) { + d->mNumberOfColumns = cols; + if (d->menuItemView) { + d->menuItemView->updateContainer(); + } + } + } } +/*! + \reimp + Returns the shape of this item as a QPainterPath. + */ QPainterPath HbMenu::shape() const { - /* - QRectF sceneRect = mapRectToScene(QRectF(-0.5, -0.5, boundingRect().width() + 0.5, boundingRect().height() + 0.5)); - QRectF clipRect = sceneRect.intersected(QRectF(pos().x() - 0.5, pos().y() - 0.5, size().width() + 0.5, size().height() + 0.5)); + /*QRectF rect = QRectF(-1.0, -1.0, boundingRect().width() + 1.0, boundingRect().height() + 1.0); + QRectF clipRect = rect.intersected(mapRectFromParent(QRectF(pos().x() - 1.0, pos().y() - 1.0, size().width() + 1.0, size().height() + 1.0))); QPainterPath path; - path.addRect(mapRectFromScene(clipRect)); + path.addRect(clipRect); - return path.intersected(HbPopup::shape()); - */ - + return path;*/ return HbPopup::shape(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmenu.h --- a/src/hbcore/gui/hbmenu.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmenu.h Thu Jul 22 16:36:53 2010 +0100 @@ -98,7 +98,7 @@ Q_PRIVATE_SLOT(d_func(), void _q_onActionTriggered()) Q_PRIVATE_SLOT(d_func(), void _q_subMenuItemTriggered(HbAction *action)) Q_PRIVATE_SLOT(d_func(), void _q_subMenuTimedOut()) - Q_PRIVATE_SLOT(d_func(), void _q_handleMenuAfterOrientationChange()) + Q_PRIVATE_SLOT(d_func(), void _q_handleMenuClose()) }; #endif // HBMENU_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmenu_p.h --- a/src/hbcore/gui/hbmenu_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmenu_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,14 +54,14 @@ void changeToOptionsMenu(); HbMenuItem *subMenuItem(); void setSubMenuItem(HbMenuItem *menuItem); - void closeMenuAfterOrientationChange(); + void closeMenu(); void closeMenuRecursively(HbAction* menuAction); void _q_triggerAction(HbMenuItem *currentItem); void _q_onActionTriggered(); void _q_subMenuItemTriggered(HbAction *action); void _q_subMenuTimedOut(); - void _q_handleMenuAfterOrientationChange(); + void _q_handleMenuClose(); void actionAdded(QActionEvent *actionEvent); void actionRemoved(QActionEvent *actionEvent); void actionChanged(QActionEvent *actionEvent); @@ -71,13 +71,12 @@ HbMenuListView *menuItemView; HbAction *subMenuAction; - HbMenu *activeSubMenu; - HbAction *resultAction; + QPointer activeSubMenu; bool actionTriggered; bool menuTimedOut(HbMenu* menu); HbMenu::MenuType menuType; - HbMenuItem *mSubMenuItem; + QPointer mSubMenuItem; qreal mRightMargin; qreal mDownMargin; @@ -85,6 +84,7 @@ QPointer receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; + int mNumberOfColumns; private: static bool menuEffectsLoaded; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmenucontainer_p.cpp --- a/src/hbcore/gui/hbmenucontainer_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmenucontainer_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,8 +31,7 @@ #include "hbinstance.h" #include #include -#include -#include +#include HbMenuContainerPrivate::HbMenuContainerPrivate(HbMenu *menu) : menu(menu), actionManager(0) @@ -45,7 +44,7 @@ void HbMenuContainerPrivate::init() { Q_Q(HbMenuContainer); - mLayout = new QGraphicsLinearLayout(Qt::Vertical, q); + mLayout = new QGraphicsGridLayout(q); mLayout->setContentsMargins(0.0, 0.0, 0.0, 0.0); mLayout->setSpacing(0.0); @@ -98,11 +97,11 @@ void HbMenuContainer::removeActionItem(QAction *action) { Q_D(HbMenuContainer); - for (int i = 0; d->mItems.count(); i++) { + for (int i = 0; i < d->mItems.count(); i++) { HbMenuItem *item = d->mItems.at(i); if (item->action() == action) { d->mItems.removeAt(i); - d->mLayout->removeItem(item); + reLayout(); delete item; break; } @@ -121,6 +120,32 @@ } } +/*! + Reforms the menu layout when needed, e.g. after an orientation change. +*/ +void HbMenuContainer::reLayout() +{ + Q_D(HbMenuContainer); + + int layoutItems = d->mLayout->count(); + for ( int i = 0; i < layoutItems; i++ ) { + d->mLayout->removeAt(0); + } + + int pos = 0; + int numCols = (HbMenuPrivate::d_ptr(d->menu))->mNumberOfColumns; + + for ( int i = 0; i < d->mItems.count(); i++ ) { + int row = pos / numCols; + int col = pos % numCols; + + if (!d->mItems.at(i)->action()->isSeparator()) { + d->mLayout->addItem(d->mItems.at(i), row, col, Qt::AlignCenter); + pos++; + } + } +} + //creates new menu items if needed. This is called when actionadded event is received by hbmenu. void HbMenuContainer::addItem(QAction *action, HbMenuItem *item) { @@ -142,12 +167,8 @@ if (castedAction && castedAction->menu()) { HbMenuPrivate::d_ptr(castedAction->menu())->setSubMenuItem(item); } - /* Workaround for layout flushing problem */ - if (item->action()->isSeparator()) - item->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); - /* Workaround ends */ d->mItems.insert(pos, item); - d->mLayout->insertItem(pos, item); + reLayout(); } //this is called when an existing items visibility has changed. @@ -163,7 +184,7 @@ d->mItems.removeAt(i); item->recycleItem(); item->setVisible(false); - d->mLayout->removeItem(item); + reLayout(); d->mBufferItems.insert(action, item); } } @@ -280,149 +301,6 @@ } } -/*! - \reimp -*/ -void HbMenuListView::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ -#ifdef HB_GESTURE_FW - Q_UNUSED(event); - HbScrollArea::mousePressEvent(event); - event->accept(); -#else - Q_D(HbMenuListView); - d->mHitItem = itemAt(event->scenePos()); - if (d->mHitItem){ - Hb::InteractionModifiers modifiers = 0; - if (d->mIsScrolling) { - modifiers |= Hb::ModifierScrolling; - d->mWasScrolling = true; - } - HbWidgetFeedback::triggered(d->mHitItem, Hb::InstantPressed, modifiers); - if (!d->mWasScrolling){ - ensureVisible(d->mHitItem->pos()); - if(!isFocusable(d->mHitItem->action())) - d->mHitItem = 0; - else - d->mHitItem->pressStateChanged(true); - } - else - d->mHitItem = 0; - } - HbScrollArea::mousePressEvent(event); - event->accept(); -#endif -} - -/*! - \reimp -*/ -void HbMenuListView::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ -#ifdef HB_GESTURE_FW - HbScrollArea::mouseReleaseEvent(event); -#else - Q_D(HbMenuListView); - - HbScrollArea::mouseReleaseEvent(event); - - HbMenuItem* hitItem = itemAt(event->scenePos()); - if (hitItem){ - Hb::InteractionModifiers modifiers = 0; - if (d->mWasScrolling) { - modifiers |= Hb::ModifierScrolling; - d->mWasScrolling = false; - } - HbWidgetFeedback::triggered(hitItem, Hb::InstantReleased, modifiers); - } - if (d->mHitItem){ - d->mHitItem->pressStateChanged(false); - if (d->mHitItem == hitItem) { - d->mCurrentItem = d->mHitItem; - d->mCurrentIndex = d->mContainer->items().indexOf(d->mCurrentItem); - HbMenuPrivate::d_ptr(d->mCurrentItem->menu())->_q_triggerAction(d->mCurrentItem); - - } - d->mHitItem = 0; - } - event->accept(); -#endif -} - -HbMenuItem *HbMenuListView::itemAt(const QPointF& position) const -{ - HbMenuItem *hitItem = 0; - const QList items = scene()->items(position); - - const int count(items.count()); - for (int current = 0; current < count; ++current) { - QGraphicsItem *item = items.at(current); - if (item && item->isWidget()) { - QGraphicsWidget *widget = static_cast(item); - - hitItem = qobject_cast(widget); - // Workaround for QT bug which is not returning all the scene items properly - if (!hitItem) { - QGraphicsItem *parent = widget->parentItem(); - while (parent && parent->isWidget()) { - hitItem = qobject_cast(static_cast(parent)); - if (hitItem) - break; - parent = parent->parentItem(); - } - } - //workaround ends - } - if (hitItem) - break; - } - return hitItem; -} - -/*! - \reimp -*/ -void HbMenuListView::upGesture(int value) -{ - Q_D(HbMenuListView); - - if (d->mHitItem) { - d->mHitItem->pressStateChanged(false); - d->mHitItem = 0; - } - - HbScrollArea::upGesture(value); -} - -/*! - \reimp -*/ -void HbMenuListView::downGesture(int value) -{ - Q_D(HbMenuListView); - - if (d->mHitItem) { - d->mHitItem->pressStateChanged(false); - d->mHitItem = 0; - } - - HbScrollArea::downGesture(value); -} - -/*! - \reimp -*/ -void HbMenuListView::panGesture(const QPointF &point) -{ - Q_D(HbMenuListView); - - if (d->mHitItem) { - d->mHitItem->pressStateChanged(false); - d->mHitItem = 0; - } - HbScrollArea::panGesture(point); -} - bool HbMenuListView::isFocusable(QAction *action)// krazy:exclude=qclasses { return action && action->isVisible() && !action->isSeparator() && action->isEnabled(); @@ -430,8 +308,15 @@ void HbMenuListView::doDelayedLayout() { - Q_D(HbMenuListView); - d->mContainer->delayedLayout(); + Q_D(HbMenuListView); + d->mContainer->delayedLayout(); +} + +void HbMenuListView::updateContainer() +{ + Q_D(HbMenuListView); + d->mContainer->reLayout(); + updateGeometry(); } /*! @@ -453,60 +338,8 @@ void HbMenuListView::gestureEvent(QGestureEvent *event) { - Q_D(HbMenuListView); HbScrollArea::gestureEvent(event); - //WORKAROUND for bug scene doesn't return all the items - if(QTapGesture *gesture = static_cast(event->gesture(Qt::TapGesture))) { - // Stop scrolling on tap - if (gesture->state() == Qt::GestureStarted) { - event->accept(); - d->mHitItem = itemAt(gesture->position()); - if (d->mHitItem){ - Hb::InteractionModifiers modifiers = 0; - if (d->mIsScrolling) { - modifiers |= Hb::ModifierScrolling; - d->mWasScrolling = true; - } - HbWidgetFeedback::triggered(d->mHitItem, Hb::InstantPressed, modifiers); - if (!d->mWasScrolling){ - ensureVisible(d->mHitItem->pos()); - if(!isFocusable(d->mHitItem->action())) - d->mHitItem = 0; - else - d->mHitItem->pressStateChanged(true); - } - else - d->mHitItem = 0; - } - } else if (gesture->state() == Qt::GestureFinished) { - HbMenuItem* hitItem = itemAt(gesture->position()); - if (hitItem){ - Hb::InteractionModifiers modifiers = 0; - if (d->mWasScrolling) { - modifiers |= Hb::ModifierScrolling; - d->mWasScrolling = false; - } - HbWidgetFeedback::triggered(hitItem, Hb::InstantReleased, modifiers); - } - if (d->mHitItem){ - d->mHitItem->pressStateChanged(false); - if (d->mHitItem == hitItem) { - d->mCurrentItem = d->mHitItem; - d->mCurrentIndex = d->mContainer->items().indexOf(d->mCurrentItem); - HbMenuPrivate::d_ptr(d->mCurrentItem->menu())->_q_triggerAction(d->mCurrentItem); - } - d->mHitItem = 0; - } - } else if (gesture->state() == Qt::GestureCanceled) { - if (d->mHitItem) { - d->mHitItem->pressStateChanged(false); - d->mHitItem = 0; - } - } - } - //WORKAROUND - if (QPanGesture *panGesture = qobject_cast(event->gesture(Qt::PanGesture))) { event->accept(panGesture); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmenucontainer_p.h --- a/src/hbcore/gui/hbmenucontainer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmenucontainer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,7 +32,7 @@ #include "hbscrollarea.h" #include "hbscrollarea_p.h" #include "hbactionmanager_p.h" -#include +#include #include class HbMenuContainer; @@ -53,21 +53,16 @@ void removeActionItem(QAction *Action); void updateActionItem(QAction *action); void doDelayedLayout(); + void updateContainer(); HbMenuItem* currentItem() const; void setCurrentItem(HbAction *action); enum { Type = HbPrivate::ItemType_MenuListView }; int type() const { return Type; } protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void upGesture(int value); - void downGesture(int value); - void panGesture(const QPointF &point); virtual void gestureEvent(QGestureEvent *event); QVariant itemChange(GraphicsItemChange change, const QVariant &value); private: - HbMenuItem* itemAt(const QPointF& position) const; void updateCurrentItem(); bool isFocusable(QAction *action); protected: @@ -104,6 +99,7 @@ void removeActionItem(QAction *Action); void visibleItemsChanged(); void updateVisibleActionList(); + void reLayout(); protected: void polish(HbStyleParameters ¶ms); @@ -120,7 +116,7 @@ explicit HbMenuContainerPrivate(HbMenu *menu); void init(); virtual ~HbMenuContainerPrivate(); - QGraphicsLinearLayout *mLayout; + QGraphicsGridLayout *mLayout; HbMenu *menu; HbActionManager *actionManager; QList mItems; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmenuitem_p.cpp --- a/src/hbcore/gui/hbmenuitem_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmenuitem_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,12 +35,17 @@ #include "hbevent.h" #include "hbcolorscheme.h" #include "hbwidgetfeedback.h" +#include "hbtapgesture.h" +#include "hbnamespace_p.h" + +#include #ifdef HB_GESTURE_FW #include #endif + Q_DECLARE_METATYPE (QAction*) -/* +/*! \class HbMenuItem \brief HbMenuItem is a menu item graphics widget. @@ -60,6 +65,16 @@ \brief */ +/*! + \primitives + \primitive{frame} HbFrameItem representing the background frame of the menu item. + \primitive{focus-indicator} HbFrameItem representing the background frame of the menu item when the item is focused. + \primitive{text} HbTextItem representing the menu item text. + \primitive{submenu-indicator} HbIconItem representing the icon that indicates that the menu item opens a sub-menu. + \primitive{check-indicator} HbIconItem representing the check icon of the menu item. + \primitive{separator} HbIconItem representing a menu separator. + */ + HbMenuItemPrivate::HbMenuItemPrivate() : HbWidgetPrivate(), action(0), @@ -172,7 +187,7 @@ } } -/* +/*! Constructs a new HbMenuItem with \a action and \a parent. Ownership of the \a action remains on it's parent. */ @@ -188,14 +203,14 @@ setAcceptedMouseButtons (Qt::NoButton); } -/* +/*! Destructs the menu item. */ HbMenuItem::~HbMenuItem() { } -/* +/*! Returns the action representing this menu item. */ QAction* HbMenuItem::action() const @@ -204,7 +219,7 @@ return d->action; } -/* +/*! Returns the menu which handles this item. */ HbMenu* HbMenuItem::menu() const @@ -213,7 +228,7 @@ return d->menu; } -/* +/*! \reimp */ void HbMenuItem::initStyleOption(HbStyleOptionMenuItem *option) const @@ -236,7 +251,7 @@ } -/* +/*! \reimp */ void HbMenuItem::changeEvent(QEvent *event) @@ -256,26 +271,34 @@ void HbMenuItem::gestureEvent(QGestureEvent *event) { //Q_D(HbMenuItem); - if(QTapGesture *gesture = qobject_cast(event->gesture(Qt::TapGesture))) { - if (gesture->state() == Qt::GestureStarted) { + if(HbTapGesture *gesture = qobject_cast(event->gesture(Qt::TapGesture))) { + if (gesture->state() == Qt::GestureStarted) { + if (scene()) + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + gesture->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); + // Tactile feedback HbWidgetFeedback::triggered(this, Hb::InstantPressed); pressStateChanged(true); event->accept(); } else if (gesture->state() == Qt::GestureFinished) { + if (scene()) + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); HbWidgetFeedback::triggered(this, Hb::InstantReleased); pressStateChanged(false); event->accept(); HbMenuPrivate::d_ptr(menu())->_q_triggerAction(this); } else if (gesture->state() == Qt::GestureCanceled) { + if (scene()) + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); pressStateChanged(false); } } } #endif -/* +/*! Sets the action,which is represented by the menu item. */ void HbMenuItem::setAction(QAction *action) @@ -298,7 +321,7 @@ } -/* +/*! This is for convienience.This functionality can be internal to menu item also and cal be done by following changed() signal emitted from action.But this gives more precise control for menu container.This is called when action has been made invisible and @@ -331,7 +354,7 @@ return (d->separatorItem != 0); } -/* +/*! Returns the type of the menu where menu item belongs. */ HbMenu::MenuType HbMenuItem::menuType() const diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbmenuitem_p.h --- a/src/hbcore/gui/hbmenuitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbmenuitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -70,6 +70,7 @@ #ifdef HB_GESTURE_FW void gestureEvent(QGestureEvent *event); #endif + private: Q_DECLARE_PRIVATE_D(d_ptr, HbMenuItem) Q_PRIVATE_SLOT(d_func(), void _q_updateItem()) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbnativewindow_sym.cpp --- a/src/hbcore/gui/hbnativewindow_sym.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbnativewindow_sym.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,7 +23,7 @@ ** ****************************************************************************/ -#include +#include #include #include "hbnativewindow_sym_p.h" @@ -47,6 +47,6 @@ ActivateL(); } -void HbNativeWindow::Draw( const TRect& /*aRect*/ ) const +void HbNativeWindow::Draw(const TRect& /*aRect*/) const { } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbnativewindow_sym_p.h --- a/src/hbcore/gui/hbnativewindow_sym_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbnativewindow_sym_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,7 +40,7 @@ void ConstructL(); protected: - void Draw(const TRect& aRect) const; + void Draw(const TRect &aRect) const; }; #endif // HBNATIVEWINDOW_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbpopup.cpp --- a/src/hbcore/gui/hbpopup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbpopup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -34,6 +34,7 @@ #include "hbtooltip.h" #include "hbglobal_p.h" #include "hbvgmaskeffect_p.h" +#include "hbvgchainedeffect_p.h" #include #include #include @@ -42,6 +43,7 @@ #include #include #include +#include #include // krazy:exclude=qclasses #include @@ -180,6 +182,18 @@ dismissed by the user or timeout. */ +/*! + \enum HbPopup::Placement + + Placement is the corner or edge to which position of the popup refers to. + */ + +/*! + \primitives + \primitive{background} HbFrameItem representing the popup background. The background can be weak or strong (different graphical styles) depending on popup type. + \primitive{P_Popup_heading_frame} HbFrameItem representing the popup heading text background + */ + static const struct { HbPopup::DefaultTimeout timeout; int value; } timeoutValues[] = { {HbPopup::NoTimeout,0}, @@ -281,13 +295,18 @@ preferredPosSet(false), mStartEffect(false), mScreenMargin(0.0), + mAutoLayouting(true), + mOriginalAutoLayouting(mAutoLayouting), mVgMaskEffect(0), + mOrientationEffectHide(false), timeoutTimerInstance(0) { } HbPopupPrivate::~HbPopupPrivate() { + stopTimeout(); + delete timeoutTimerInstance; } void HbPopupPrivate::init() @@ -298,7 +317,9 @@ // By default popups are focusable q->setFocusPolicy(Qt::StrongFocus); - q->setBackgroundItem(HbStyle::P_Popup_background); + setBackgroundItem(HbStyle::P_Popup_background); + q->updatePrimitives(); + // Only for popup without parent if (!q->parentItem()) { @@ -308,21 +329,23 @@ // Popup is invisible by default (explicit show or open call is required) q->setVisible(false); } - hidingInProgress = false; - - q->setFlag(QGraphicsItem::ItemClipsToShape); - q->setFlag(QGraphicsItem::ItemClipsChildrenToShape); - -#if QT_VERSION > 0x040602 - q->grabGesture(Qt::TapGesture); - q->grabGesture(Qt::TapAndHoldGesture); - q->grabGesture(Qt::PanGesture); - q->grabGesture(Qt::SwipeGesture); - q->grabGesture(Qt::PinchGesture); -#endif - + hidingInProgress = false; + QGraphicsItem::GraphicsItemFlags itemFlags = q->flags(); + itemFlags |= QGraphicsItem::ItemClipsToShape; + itemFlags |= QGraphicsItem::ItemClipsChildrenToShape; + itemFlags |= QGraphicsItem::ItemSendsGeometryChanges; + //itemFlags |= QGraphicsItem::ItemIsPanel; + q->setFlags(itemFlags); +} +void HbPopupPrivate::_q_appearEffectEnded(HbEffect::EffectStatus status) +{ + Q_UNUSED(status); } +CSystemToneService* HbPopupPrivate::systemToneService() +{ + return HbInstancePrivate::d_ptr()->systemTone(); +} /* Sets the priority for a popup. A popup with higher priority is always shown on top of a popup with lower priority. @@ -358,16 +381,33 @@ hidingInProgress = false; } -void HbPopupPrivate::_q_orientationChange(Qt::Orientation orient, bool animate) +void HbPopupPrivate::_q_orientationAboutToChange(Qt::Orientation orient, bool animate) { - Q_UNUSED(orient); - if (animate) { + Q_UNUSED(orient); Q_Q(HbPopup); - HbEffect::start(q, "HB_POPUP", "orientationswitch"); + if (animate && q->isVisible()) { + HbEffect::start(q, "HB_POPUP", "orient_disappear"); + mOrientationEffectHide = true; } +} + +#endif // HB_EFFECTS +void HbPopupPrivate::_q_orientationChanged() +{ + Q_Q(HbPopup); + if (q->isVisible()) { + QEvent userEvent(QEvent::ContextMenu); + QCoreApplication::sendEvent(q, &userEvent); + } +#ifdef HB_EFFECTS + if (mOrientationEffectHide) { + HbEffect::cancel(q); + HbEffect::start(q, "HB_POPUP", "orient_appear"); + mOrientationEffectHide = false; + } +#endif } -#endif // HB_EFFECTS void HbPopupPrivate::_q_timeoutFinished() { @@ -410,7 +450,7 @@ { Q_Q(HbPopup); if (!timeoutTimerInstance) { - timeoutTimerInstance = new QTimer(q); + timeoutTimerInstance = new QTimer(); timeoutTimerInstance->setSingleShot(true); q->connect(timeoutTimerInstance, SIGNAL(timeout()), q, SLOT(_q_timeoutFinished())); } @@ -514,9 +554,15 @@ } if (hasEffects ) { hasEffects = HbEffectInternal::add("HB_POPUP", - "dialog_rotate", - "orientationswitch"); + "popup_orient_disappear", + "orient_disappear"); } + if (hasEffects ) { + hasEffects = HbEffectInternal::add("HB_POPUP", + "popup_orient_appear", + "orient_appear"); + } + hasEffects = true; //Workaround until orient appear effects are in place #endif } @@ -540,23 +586,38 @@ { #if 0 Q_Q(HbPopup); + // Contrary to the name, HbVgMaskEffect has a software + // implementation too, and we will actually force the usage of + // that here, ignoring the pure OpenVG version. if (!mVgMaskEffect) { - mVgMaskEffect = new HbVgMaskEffect(); - mVgMaskEffect->install(q); + mVgMaskEffect = new HbVgMaskEffect; + // Masking does not work reliably on HW. + mVgMaskEffect->setForceSwMode(true); + // There may be children (like the scroll area in menus) that + // would mess up the masking so exclude those. + mVgMaskEffect->setIncludeSourceItemOnly(true); + if (!q->graphicsEffect()) { + // Attach the effect. Ownership is transferred to q. + mVgMaskEffect->install(q); + } else { + // Avoid replacing already set effects. Do not mask if + // this is not possible, otherwise we would unexpectedly + // delete the previously set graphics effect. + HbVgChainedEffect *c = qobject_cast(q->graphicsEffect()); + if (c) { + c->add(mVgMaskEffect); + } else { + delete mVgMaskEffect; + } + } } - QPixmap image(QSize(static_cast(q->backgroundItem()->boundingRect().width()), - static_cast(q->backgroundItem()->boundingRect().height()))); + static_cast(q->backgroundItem()->boundingRect().height()))); image.fill(Qt::transparent); - QPainter imagePainter(&image); - q->backgroundItem()->paint(&imagePainter, 0, 0); - imagePainter.end(); - mVgMaskEffect->setMask(image); - #endif } @@ -751,11 +812,11 @@ if ( d->frameType != frameType ) { switch( frameType ) { case HbPopup::Weak: - setBackgroundItem(HbStyle::P_Popup_background_weak); + d->setBackgroundItem(HbStyle::P_Popup_background_weak); break; case HbPopup::Strong: default: - setBackgroundItem(HbStyle::P_Popup_background); + d->setBackgroundItem(HbStyle::P_Popup_background); break; } d->frameType = frameType; @@ -792,7 +853,10 @@ { Q_D(HbPopup); - /*if (change == QGraphicsItem::ItemVisibleHasChanged) { + if (change == QGraphicsItem::ItemPositionChange) { + d->mAutoLayouting = false; + } + if (change == QGraphicsItem::ItemVisibleHasChanged) { if (value.toBool()) { if(d->hasEffects && boundingRect().isValid()) { @@ -801,14 +865,16 @@ -boundingRect().height(), boundingRect().width(), 0); - HbEffect::start(this, d->effectType, "appear", 0, 0, QVariant(), extRect); + d->mStartEffect = true; + HbEffect::cancel(this); + d->mStartEffect = false; + HbEffect::start(this, d->effectType, "appear", this, "_q_appearEffectEnded", QVariant(), extRect); #endif//HB_EFFECTS - d->mStartEffect = false; } else { d->mStartEffect = true; } } - }*/ + } if (change == QGraphicsItem::ItemVisibleChange) { if (value.toBool()) { @@ -830,6 +896,7 @@ if (d->delayedHide && // about to hide and we wanna delay hiding d->hasEffects && !parentItem()) { // only for popup without parent + bool hideDelayed = d->delayedHide; if (!d->hidingInProgress) { // Prevent reentrance d->hidingInProgress = true; #ifdef HB_EFFECTS @@ -837,14 +904,16 @@ -boundingRect().height(), boundingRect().width(), 0); + HbEffect::cancel(this); if (!HbEffect::start(this, d->effectType, "disappear", this, "_q_delayedHide", QVariant(), extRect)) { d->delayedHide = false; + return HbWidget::itemChange(change, value); } #endif } - if (d->delayedHide) { + if (hideDelayed) { return true; } else { d->delayedHide = d->hasEffects; @@ -856,21 +925,28 @@ } else if (change == QGraphicsItem::ItemSceneHasChanged) { HbMainWindow* w(mainWindow()); if ( w ){ - disconnect(this, SLOT(handlePopupPos())); + disconnect(this, SLOT(_q_orientationAboutToChange(Qt::Orientation, bool))); + connect( w, SIGNAL(aboutToChangeOrientation(Qt::Orientation, bool)), + this, SLOT(_q_orientationAboutToChange(Qt::Orientation, bool)) ); + disconnect(this, SLOT(_q_orientationChanged())); connect( w, SIGNAL(orientationChanged(Qt::Orientation)), - this, SLOT(handlePopupPos()) ); + this, SLOT(_q_orientationChanged()) ); } + } return HbWidget::itemChange(change, value); } /*! + \deprecated HbPopup::handlePopupPos() + is deprecated. This function should not be used from the application side. Handles the popup position when Orientation changes */ void HbPopup::handlePopupPos() { + HB_DEPRECATED("HbPopup::handlePopupPos() is deprecated."); QEvent userEvent(QEvent::ContextMenu); - QCoreApplication::sendEvent(this, &userEvent); + QCoreApplication::sendEvent(this, &userEvent); } /*! @@ -935,6 +1011,7 @@ if(d->addPopupToScene()) { d->duplicateShowEvent = true; } + //setActive(true); // Popup clears closed state d->closed = false; if (d->backgroundItem) { @@ -998,12 +1075,10 @@ { HbWidget::resizeEvent(event); updatePrimitives(); -#if 1 Q_D(HbPopup); if (d->polished) { d->calculateShape(); } -#endif } /*! @@ -1036,13 +1111,47 @@ HbWidget::closeEvent(event); } + +/* Currently, virtual keyboard must be able to position a popup + containing a editor to an arbitrary place. VKB does it's best to + reposition popup back to original position when needed. At least in + orientation switch the old position naturally is wrong, hence popup + must be relayouted. + + It would be unreasonable to make special checks for popup in vkb + side. It also would be unreasonable to do special checks for vkb in + popup side. Hence this semi-hidden dynamic property for + communicating this special case. + + WARNING: Do not count on this special behaviour, we might remove it + without prior notice. If you do require such a behavior, please + raise a feature request and we might make this a proper API. + */ +const char* KPositionManagedByVKB("PositionManagedByVKB"); + /*! \reimp */ bool HbPopup::event(QEvent *event) { -/* Q_D(HbPopup); - if (event->type() == QEvent::LayoutRequest) { + Q_D(HbPopup); + if ( event->type() == QEvent::DynamicPropertyChange ) { + QVariant v(property(KPositionManagedByVKB)); + if (v.isValid() ){ + if (v.toBool()) { + // position is now managed by vkb + d->mOriginalAutoLayouting = d->mAutoLayouting; + d->mAutoLayouting = false; + } else { + d->mAutoLayouting = d->mOriginalAutoLayouting; + + // vkb has finished, and we might be on totally wrong + // place. + QEvent layoutRequest = QEvent::LayoutRequest; + QApplication::sendEvent(this, &layoutRequest); + } + } + } else if (event->type() == QEvent::LayoutRequest) { //Workaround when showing first time #ifdef HB_EFFECTS if(d->mStartEffect && boundingRect().isValid()) { @@ -1052,17 +1161,14 @@ -boundingRect().height(), boundingRect().width(), 0); - HbEffect::start(this, d->effectType, "appear", 0, 0, QVariant(), extRect); - qDebug() << "effect start"; + d->mStartEffect = true; + HbEffect::cancel(this); + d->mStartEffect = false; + HbEffect::start(this, d->effectType, "appear", this, "_q_appearEffectEnded", QVariant(), extRect); } #endif//HB_EFFECTS //workaround ends } - qDebug() << "event: " << event;*/ - /*Q_D(HbPopup); - if (event->type() == QEvent::LayoutDirectionChange) { - d->calculateShape(); - }*/ return HbWidget::event(event); } @@ -1070,19 +1176,20 @@ Sets preferred position\a position for popup with \a placement as origin. + By default popup is placed in the middle of the screen. If other positions are needed please + ensure that the preferred position is working properly with different screen sizes. + \param position is the position at which the popup is shown. \param placement is the corner or edge which \a position refers to Example usage: \code - HbDialog popup; + HbPopup *popup = new HbPopup(); ... - popup.setPreferredPosition( QPointF(x,y), HbPopupBase::BottomEdgeCenter ); - popup.show(); + popup->setPreferredPosition( QPointF(x,y), HbPopupBase::BottomEdgeCenter ); + popup->show(); \endcode - */ - void HbPopup::setPreferredPos( const QPointF& preferredPos, HbPopup::Placement placement ) { @@ -1099,10 +1206,15 @@ d->preferredPosSet = true; //If position updated, informing layoutproxy with layoutrequest if (layoutFlag) { - QApplication::sendEvent(this, new QEvent(QEvent::LayoutRequest)); + QEvent layoutRequest = QEvent::LayoutRequest; + QApplication::sendEvent(this, &layoutRequest); } } +/*! + \reimp + Returns the shape of this item as a QPainterPath. + */ QPainterPath HbPopup::shape() const { #if 0 diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbpopup.h --- a/src/hbcore/gui/hbpopup.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbpopup.h Thu Jul 22 16:36:53 2010 +0100 @@ -143,7 +143,9 @@ Q_DISABLE_COPY(HbPopup) #ifdef HB_EFFECTS Q_PRIVATE_SLOT(d_func(), void _q_delayedHide(HbEffect::EffectStatus status)) - Q_PRIVATE_SLOT(d_func(), void _q_orientationChange(Qt::Orientation orient, bool animate)) + Q_PRIVATE_SLOT(d_func(), void _q_orientationAboutToChange(Qt::Orientation orient, bool animate)) + Q_PRIVATE_SLOT(d_func(), void _q_orientationChanged()) + Q_PRIVATE_SLOT(d_func(), void _q_appearEffectEnded(HbEffect::EffectStatus status)) #endif // HB_EFFECTS Q_PRIVATE_SLOT(d_func(), void _q_timeoutFinished()) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbpopup_p.h --- a/src/hbcore/gui/hbpopup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbpopup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,12 +30,13 @@ #include "hbpopup.h" #include "hbwidget_p.h" #include "hbnamespace_p.h" -#include "hbvgmaskeffect_p.h" #ifdef HB_EFFECTS #include "hbeffect.h" #endif // HB_EFFECTS +class HbVgMaskEffect; class HbPopupBackGround; +class CSystemToneService; QT_FORWARD_DECLARE_CLASS(QEventLoop) QT_FORWARD_DECLARE_CLASS(QTimer) @@ -62,6 +63,8 @@ AlwaysOnTop = 255 }; + CSystemToneService *systemToneService(); + // Private features public: quint8 priority() const { return priorityValue; } @@ -109,13 +112,17 @@ QPointer receiverToDisconnectOnClose; QByteArray memberToDisconnectOnClose; qreal mScreenMargin; + bool mAutoLayouting; + bool mOriginalAutoLayouting; public: #ifdef HB_EFFECTS void _q_delayedHide(HbEffect::EffectStatus status); - void _q_orientationChange(Qt::Orientation orient, bool animate); + virtual void _q_appearEffectEnded(HbEffect::EffectStatus status); + void _q_orientationAboutToChange(Qt::Orientation orient, bool animate); #endif // HB_EFFECTS void _q_timeoutFinished(); + void _q_orientationChanged(); bool addPopupToScene(); void handleBackgroundMousePressEvent(); @@ -134,6 +141,7 @@ void doSetModal( bool modal ); QString effectType; HbVgMaskEffect *mVgMaskEffect; + bool mOrientationEffectHide; private: static bool popupEffectsLoaded; static HbPopupPrivate *d_ptr(HbPopup *popup) { @@ -144,7 +152,6 @@ friend class HbPopupManagerPrivate; friend class HbPopupLayoutProxy; friend class HbDeviceDialogManagerPrivate; - // To be able to unit test private features friend class TestHbPopup; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbpopupmanager.cpp --- a/src/hbcore/gui/hbpopupmanager.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbpopupmanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -94,7 +94,7 @@ { if (!mPopup.isNull()) { const QSizeF popupPreferredSize = - mPopup->effectiveSizeHint(Qt::PreferredSize); + mPopup->effectiveSizeHint(Qt::PreferredSize); const QSizeF usedSize( qMin(rect.width(), popupPreferredSize.width() ), qMin( rect.height(), popupPreferredSize.height() ) ); QPointF usedPos(rect.left(), rect.top()); @@ -157,7 +157,12 @@ usedPos = QPointF(usedx, usedy); } - mPopup->setGeometry(QRectF(usedPos, usedSize)); + if (((HbPopupPrivate*)HbPopupPrivate::d_ptr(mPopup))->mAutoLayouting) { + mPopup->setGeometry(QRectF(usedPos, usedSize)); + ((HbPopupPrivate*)HbPopupPrivate::d_ptr(mPopup))->mAutoLayouting = true; + } else { + mPopup->resize(usedSize); + } } } @@ -177,14 +182,13 @@ { Q_UNUSED( obj ); switch( event->type() ) { - case QEvent::LayoutRequest: { + case QEvent::LayoutRequest: + case QEvent::ContextMenu: + case QEvent::Close: + { updateGeometry(); break; - } - case QEvent::ContextMenu: { - updateGeometry(); - break; - } + } default: break; } @@ -416,8 +420,7 @@ popup->metaObject()->className() != QLatin1String("HbExactWordPopup") && popup->metaObject()->className() != QLatin1String("HbInputSmileyPicker") && popup->metaObject()->className() != QLatin1String("Hb12KeyCustomKeypad") && - popup->metaObject()->className() != QLatin1String("HbInputThaiSpecialPopup") && - !popup->inherits("HbInputVkbWidget")) { + !popup->inherits("HbInputVkbWidget")) { setGeometryForPopup( popup ); } } @@ -432,8 +435,12 @@ if(!initialFocusedItem && scene) { initialFocusedItem = scene->focusItem(); } - - topLevelFocusablePopup->setFocus(); + + // an embedded graphics item is already having a + // focus so do not set focus as graphicsscene will automatically + // set the focus to the embedded item. + if (!topLevelFocusablePopup->focusItem()) + topLevelFocusablePopup->setFocus(); } updateFading(); @@ -485,7 +492,8 @@ // Move the focus to the initial focus item if there is no current focus item or // the ancestor of the current fucus item is popup - if( !scene->focusItem() || popup->hasFocus() || popup->isAncestorOf(scene->focusItem())) { + if( !scene->focusItem() || scene->focusItem() == popup || + popup->isAncestorOf(scene->focusItem())) { initialFocusedItem->setFocus(); initialFocusedItem = 0; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscreen.cpp --- a/src/hbcore/gui/hbscreen.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscreen.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,6 +32,8 @@ #include "hbview.h" #include "hbcontentwidget_p.h" #include "hbmainwindow.h" +#include "hbtooltip.h" +#include "hbgraphicsscene.h" #include "hbevent.h" #include "hbmainwindow_p.h" #include @@ -46,8 +48,8 @@ \internal */ -HbScreen::HbScreen() : - HbWidget(), +HbScreen::HbScreen() : + HbWidget(), mStack(0), mTb(0), mDock(0), @@ -57,14 +59,14 @@ { } -void HbScreen::setStackWidget(HbContentWidget *stack) +void HbScreen::setStackWidget(HbContentWidget *stack) { if (mStack != stack) { if (mStack) { HbStyle::setItemName(mTb, QString()); HbStyle::setItemName(mDock, QString()); } - mStack = stack; + mStack = stack; } } @@ -75,10 +77,10 @@ disconnect(&HbToolBarPrivate::d_ptr(mTb)->core, 0, this, 0); HbStyle::setItemName(mTb, QString()); } - mTb = tb; + mTb = tb; if (mTb) { - setToolBarOrientation(mTb->orientation()); - if (mDelayedConstructionHandled){ + setToolBarOrientation(mTb->orientation()); + if (mDelayedConstructionHandled) { connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(orientationChanged()), this, SLOT(toolBarOrientationChanged())); connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged())); } @@ -95,7 +97,7 @@ disconnect(&HbDockWidgetPrivate::d_ptr(mDock)->core, 0, this, 0); HbStyle::setItemName(mDock, QString()); } - mDock = dock; + mDock = dock; if (mDock && mDelayedConstructionHandled) { connect(&HbDockWidgetPrivate::d_ptr(mDock)->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged())); } @@ -117,13 +119,12 @@ //avoid unnecessary complications in setName function. if ((mTb->isVisible() || forced) && mTb->actions().count()) { HbStyle::setItemName(mTb, "toolbar"); - } - else { + } else { HbStyle::setItemName(mTb, QString()); } } -void HbScreen::polish(HbStyleParameters& params) +void HbScreen::polish(HbStyleParameters ¶ms) { if (!mScreenPolished) { mScreenOrientation = mainWindow()->orientation(); @@ -131,10 +132,10 @@ } if (mStack) { - HbView *currentView = qobject_cast(mStack->currentWidget()); + HbView *currentView = qobject_cast(mStack->currentWidget()); if (currentView && currentView->isContentFullScreen()) { setName(mStack, "mainfull"); - } else { + } else { setName(mStack, "main"); } } @@ -145,7 +146,7 @@ } if (mDock) { - setName(mDock,"dock"); + setName(mDock, "dock"); } mScreenPolished = true; @@ -158,17 +159,18 @@ layout()->activate(); } HbMainWindow *w = mainWindow(); - HbMainWindowPrivate::d_ptr(w)->postIdleEvent(HbMainWindowPrivate::IdleOrientationEvent); + HbMainWindowPrivate::d_ptr(w)->postIdleEvent(HbMainWindowPrivate::IdleOrientationEvent); } void HbScreen::delayedConstruction() { - if (mDelayedConstructionHandled) + if (mDelayedConstructionHandled) { return; + } mDelayedConstructionHandled = true; if (mTb) { - connect( &HbToolBarPrivate::d_ptr ( mTb )->core, SIGNAL(orientationChanged()), this, SLOT(toolBarOrientationChanged())); - connect( &HbToolBarPrivate::d_ptr ( mTb )->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged())); + connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(orientationChanged()), this, SLOT(toolBarOrientationChanged())); + connect(&HbToolBarPrivate::d_ptr(mTb)->core, SIGNAL(visibilityChanged()), this, SLOT(decoratorVisibilityChanged())); HbToolBarPrivate::d_ptr(mTb)->delayedConstruction(); } if (mDock) { @@ -176,13 +178,6 @@ } } -void HbScreen::setGeometry (const QRectF & rect) -{ - prepareGeometryChange(); - HbWidget::setGeometry(rect); -} - - Qt::Orientation HbScreen::toolBarOrientation() const { return (Qt::Orientation)mToolBarOrientation; @@ -197,11 +192,12 @@ { bool contentUnderTitleBar = false; if (mStack) { - HbView *currentView = qobject_cast(mStack->currentWidget()); - if (currentView && (currentView->viewFlags() - & (HbView::ViewTitleBarMinimized | HbView::ViewTitleBarFloating - | HbView::ViewTitleBarHidden))) { - contentUnderTitleBar = true; + HbView *currentView = qobject_cast(mStack->currentWidget()); + if (currentView && !(currentView->viewFlags() & HbView::ViewDisableRelayout)) { + if (currentView->viewFlags() & (HbView::ViewTitleBarMinimized + | HbView::ViewTitleBarFloating | HbView::ViewTitleBarHidden)) { + contentUnderTitleBar = true; + } } } return contentUnderTitleBar; @@ -211,10 +207,12 @@ { bool contentUnderStatusBar = false; if (mStack) { - HbView *currentView = qobject_cast(mStack->currentWidget()); - if (currentView && (currentView->viewFlags() - & (HbView::ViewStatusBarFloating | HbView::ViewStatusBarHidden))) { - contentUnderStatusBar = true; + HbView *currentView = qobject_cast(mStack->currentWidget()); + if (currentView && !(currentView->viewFlags() & HbView::ViewDisableRelayout)) { + if (currentView->viewFlags() & (HbView::ViewStatusBarFloating + | HbView::ViewStatusBarHidden)) { + contentUnderStatusBar = true; + } } } return contentUnderStatusBar; @@ -224,7 +222,7 @@ { bool titleBarMinimizable = false; if (mStack) { - HbView *currentView = qobject_cast(mStack->currentWidget()); + HbView *currentView = qobject_cast(mStack->currentWidget()); if (currentView && (currentView->viewFlags() & (HbView::ViewTitleBarMinimizable))) { titleBarMinimizable = true; } @@ -249,7 +247,7 @@ void HbScreen::setToolBarOrientation(Qt::Orientation orientation) { if (orientation != mToolBarOrientation) { - if (mTb){ + if (mTb) { HbToolBarPrivate::d_ptr(mTb)->mDoLayout = false; repolish(); } @@ -259,6 +257,12 @@ void HbScreen::decoratorVisibilityChanged() { + HbMainWindow *window = mainWindow(); + // Do not repolish if orientation is about to change + if (window && HbMainWindowPrivate::d_ptr(window)->mOrientationChangeOngoing + && mScreenOrientation != HbMainWindowPrivate::d_ptr(window)->mOrientation) { + return; + } if (mTb) { HbToolBarPrivate::d_ptr(mTb)->mDoLayout = false; } @@ -266,16 +270,17 @@ QCoreApplication::sendPostedEvents(this, QEvent::Polish); } -void HbScreen::currentViewChanged(HbView* view) +void HbScreen::currentViewChanged(HbView *view) { Q_UNUSED(view); + HbToolTip::hideText(qobject_cast(scene())); repolish(); } bool HbScreen::event(QEvent *e) { if (e->type() == HbEvent::DeviceProfileChanged) { - // supress polishEvent() [which is called in HbWidget::event()] into repolish() + // suppress polishEvent() [which is called in HbWidget::event()] into repolish() repolish(); return QGraphicsWidget::event(e); } else { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscreen_p.h --- a/src/hbcore/gui/hbscreen_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscreen_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,7 +54,6 @@ bool contentUnderStatusBar() const; bool titleBarMinimizable() const; void delayedConstruction(); - void setGeometry(const QRectF &rect); virtual bool event(QEvent *e); public slots: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscrollarea.cpp --- a/src/hbcore/gui/hbscrollarea.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscrollarea.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,6 +31,8 @@ #include #include #include "hbglobal_p.h" +#include +#include #include @@ -142,7 +144,7 @@ /*! \fn void HbScrollArea::scrollPositionChanged(QPointF newposition) - This signal is emitted when scroll position is changed. + This signal is emitted when scroll position is changed and someone is connected to the signal. */ /*! @@ -222,6 +224,14 @@ */ /*! + \primitives + \primitives{continuation-indicator-bottom} HbFrameItem representing the scrollarea continuation indicator on the bottom of the scrollarea. + \primitives{continuation-indicator-top} HbFrameItem representing the scrollarea continuation indicator on the top of the scrollarea. + \primitives{continuation-indicator-left} HbFrameItem representing the scrollarea continuation indicator on the left side of the scrollarea. + \primitives{continuation-indicator-right} HbFrameItem representing the scrollarea continuation indicator on the right side of the scrollarea. + */ + +/*! Constructor \sa HbScrollArea::HbScrollArea @@ -234,6 +244,9 @@ d->init(); } +/*! + Protected constructor. + */ HbScrollArea::HbScrollArea(HbScrollAreaPrivate &dd, QGraphicsItem *parent): HbWidget( dd, parent ) { @@ -430,7 +443,13 @@ bool isChanged = (d->mScrollDirections != value); - d->mScrollDirections = value; + d->mScrollDirections = value; + if (d->mContents && isChanged) { + QPointF pos = d->mContents->pos(); + QEvent layoutRequest(QEvent::LayoutRequest); + QCoreApplication::sendEvent(this, &layoutRequest); + d->mContents->setPos(pos); + } if (isChanged) { emit scrollDirectionsChanged( value ); @@ -619,9 +638,9 @@ HB_DEPRECATED("HbScrollArea::longPressGesture(const QPointF &) is deprecated. Use gesture FW."); } -/* +/*! \reimp -*/ + */ void HbScrollArea::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED (event); @@ -680,10 +699,18 @@ d->stopAnimating(); } } else if( event->type() == QEvent::GestureOverride ) { - if(static_cast(event)->gesture(Qt::TapGesture) && - d->mIsAnimating && !d->positionOutOfBounds() && !d->mMultiFlickEnabled) { - event->accept(); - return true; + if(HbTapGesture *tap = qobject_cast(static_cast(event)->gesture(Qt::TapGesture))) { + if (d->mIsAnimating && !d->positionOutOfBounds() && !d->mMultiFlickEnabled) { + event->accept(); + return true; + } else if (tap->state() == Qt::GestureStarted){ + if (d->mAbleToScrollY) { + tap->setProperty(HbPrivate::VerticallyRestricted.latin1(), true); + } + if (d->mAbleToScrollX){ + tap->setProperty(HbPrivate::HorizontallyRestricted.latin1(), true); + } + } } } else if (event->type() == QEvent::LayoutRequest) { if (d->mContents) { @@ -757,6 +784,14 @@ if (isVisible()) { d->adjustContent(); } + + if (d->mAbleToScrollX && d->mHorizontalScrollBar->isVisible()) { + d->updateScrollBar(Qt::Horizontal); + } + + if (d->mAbleToScrollY && d->mVerticalScrollBar->isVisible()) { + d->updateScrollBar(Qt::Vertical); + } } // no else return false; @@ -815,6 +850,7 @@ if (gesture->state() == Qt::GestureStarted) { if (d->mIsAnimating && !d->positionOutOfBounds() && !d->mMultiFlickEnabled) { d->stopAnimating(); + HbWidgetFeedback::triggered(this, Hb::InstantPressed, Hb::ModifierScrolling); event->accept(gesture); } else { event->ignore(gesture); @@ -838,7 +874,6 @@ \sa horizontalScrollBarPolicy(), setVerticalScrollBarPolicy() */ - HbScrollArea::ScrollBarPolicy HbScrollArea::verticalScrollBarPolicy() const { Q_D(const HbScrollArea); @@ -895,7 +930,6 @@ \sa verticalScrollBarPolicy(), setHorizontalScrollBarPolicy() */ - HbScrollArea::ScrollBarPolicy HbScrollArea::horizontalScrollBarPolicy() const { Q_D(const HbScrollArea); @@ -1040,16 +1074,19 @@ */ void HbScrollArea::scrollContentsTo (const QPointF& newPosition, int time) { Q_D(HbScrollArea); + + if (!contentWidget()) + return; + if (time > 0){ d->startTargetAnimation (newPosition, qMax (0, time)); } else { scrollByAmount(newPosition - (-d->mContents->pos())); d->stopScrolling(); - } } -/* +/*! \reimp */ void HbScrollArea::polish(HbStyleParameters& params) @@ -1097,4 +1134,45 @@ } } +/*! + \reimp + + */ +void HbScrollArea::timerEvent(QTimerEvent *event) +{ + Q_D(HbScrollArea); + if (event->timerId() == d->mScrollTimerId) { + d->_q_animateScrollTimeout(); + } else if (event->timerId() == d->mScrollBarHideTimerId) { + d->_q_hideScrollBars(); + } +} + +/*! + \reimp +*/ +void HbScrollArea::disconnectNotify (const char *signal) +{ + Q_D(HbScrollArea); + if (d->mEmitPositionChangedSignal && + QLatin1String(signal) == SIGNAL(scrollPositionChanged(QPointF))) { + if (receivers(SIGNAL(scrollPositionChanged(QPointF))) == 0) { + d->mEmitPositionChangedSignal = false; + } + } + HbWidget::disconnectNotify(signal); +} + +/*! + \reimp +*/ +void HbScrollArea::connectNotify(const char * signal) +{ + Q_D(HbScrollArea); + if (!d->mEmitPositionChangedSignal && + QLatin1String(signal) == SIGNAL(scrollPositionChanged(QPointF))) { + d->mEmitPositionChangedSignal = true; + } + HbWidget::connectNotify(signal); +} #include "moc_hbscrollarea.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscrollarea.h --- a/src/hbcore/gui/hbscrollarea.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscrollarea.h Thu Jul 22 16:36:53 2010 +0100 @@ -127,7 +127,10 @@ virtual void focusOutEvent(QFocusEvent *event); virtual bool scrollByAmount(const QPointF &delta); virtual void polish(HbStyleParameters ¶ms); + virtual void timerEvent(QTimerEvent *event); virtual bool eventFilter(QObject *obj, QEvent *event); + virtual void connectNotify(const char *signal); + virtual void disconnectNotify(const char *signal); #ifdef HB_GESTURE_FW virtual void gestureEvent(QGestureEvent *event); #endif @@ -148,8 +151,6 @@ private: Q_DECLARE_PRIVATE_D(d_ptr, HbScrollArea) - Q_PRIVATE_SLOT(d_func(), void _q_animateScrollTimeout()) - Q_PRIVATE_SLOT(d_func(), void _q_hideScrollBars()) Q_PRIVATE_SLOT(d_func(), void _q_thumbPositionChanged(qreal value, Qt::Orientation orientation)) Q_PRIVATE_SLOT(d_func(), void _q_groovePressed(qreal value, Qt::Orientation orientation)) Q_PRIVATE_SLOT(d_func(), void _q_thumbPressed()) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscrollarea_p.cpp --- a/src/hbcore/gui/hbscrollarea_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscrollarea_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -85,7 +85,7 @@ mIsScrolling(false), mIsAnimating(false), mScrollSpeed (QPointF (0,0)), - mScrollTimer(0), + mScrollTimerId(0), mScrollElapsedTime(), mLastElapsedTime(0.0), mTargetAnimationInProgress(false), @@ -94,7 +94,7 @@ mTargetDelta(QPointF(0,0)), mAnimationInitialPosition (QPointF(0,0)), mAnimationShape (0), - mScrollBarHideTimer(0), + mScrollBarHideTimerId(0), mFrictionEnabled(true), mResetAlignment(true), mClampingStyle(HbScrollArea::BounceBackClamping), @@ -105,6 +105,7 @@ mLayoutDirection(Qt::LeftToRight), mAlignment(Qt::AlignLeft | Qt::AlignTop), mContinuationIndicators(false), + mEmitPositionChangedSignal(false), continuationIndicatorTopItem(0), continuationIndicatorBottomItem(0), continuationIndicatorLeftItem(0), @@ -123,16 +124,13 @@ HbScrollAreaPrivate::~HbScrollAreaPrivate() { + delete mAnimationShape; } void HbScrollAreaPrivate::init() { Q_Q( HbScrollArea ); - mScrollTimer.setParent(q); - mScrollBarHideTimer.setParent(q); - mScrollBarHideTimer.setSingleShot(true); - q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); q->setFlag( QGraphicsItem::ItemClipsChildrenToShape, true ); q->setFocusPolicy(Qt::StrongFocus); @@ -151,6 +149,13 @@ // make sure the scrollbar is on top mHorizontalScrollBar->setZValue(q->zValue() + 1); +#if QT_VERSION >= 0x040700 + q->grabGesture(Qt::PanGesture, Qt::ReceivePartialGestures | Qt::IgnoredGesturesPropagateToParent); +#else + q->grabGesture(Qt::PanGesture, Qt::ReceivePartialGestures); +#endif + q->grabGesture(Qt::TapGesture); + } void HbScrollAreaPrivate::doLazyInit() @@ -165,11 +170,7 @@ QObject::connect(mHorizontalScrollBar, SIGNAL(valueChanged(qreal, Qt::Orientation)), q, SLOT(_q_thumbPositionChanged(qreal, Qt::Orientation))); QObject::connect(mHorizontalScrollBar, SIGNAL(valueChangeRequested(qreal, Qt::Orientation)), q, SLOT(_q_groovePressed(qreal, Qt::Orientation))); - QObject::connect(&(mScrollTimer), SIGNAL(timeout()), q, SLOT(_q_animateScrollTimeout())); - QObject::connect(&(mScrollBarHideTimer), SIGNAL(timeout()), q, SLOT(_q_hideScrollBars())); - q->grabGesture(Qt::PanGesture, Qt::ReceivePartialGestures); - q->grabGesture(Qt::TapGesture); } void HbScrollAreaPrivate::replaceScrollBar(Qt::Orientation orientation, HbScrollBar *scrollBar) @@ -212,8 +213,7 @@ { Q_Q( HbScrollArea ); - if ( mContents == 0 || - ( qIsNull(qAbs( delta.x() )) && qIsNull(qAbs( delta.y() ) ) ) ) + if ( qIsNull(qAbs( delta.y() )) && qIsNull(qAbs( delta.x() ) ) ) return false; QPointF currentPosition = -mContents->pos(); @@ -276,11 +276,14 @@ mBoundaryReached = false; } - + setContentPosition(-newPosition); + //Its important to setcontents position first as thats used in updateScrollbar.displayScrollbar calls + //updateScrollbar internally.Other wise we need to update scrollbars twice with different positions. if (!mIsScrolling) { - mIsScrolling = true; - emit q->scrollingStarted(); - + if (mAbleToScrollX || mAbleToScrollY) { + mIsScrolling = true; + emit q->scrollingStarted(); + } if (mAbleToScrollX && mHorizontalScrollBarPolicy == HbScrollArea::ScrollBarAutoHide) { displayScrollBar(Qt::Horizontal); } @@ -288,24 +291,21 @@ if (mAbleToScrollY && mVerticalScrollBarPolicy == HbScrollArea::ScrollBarAutoHide) { displayScrollBar(Qt::Vertical); } - } + stopScrollbarHideTimer(); - setContentPosition(-newPosition); + } else { - if (mAbleToScrollX && mHorizontalScrollBar->isVisible()) { - updateScrollBar(Qt::Horizontal); - } + if (mAbleToScrollX && mHorizontalScrollBar->isVisible()) { + updateScrollBar(Qt::Horizontal); + } - if (mAbleToScrollY && mVerticalScrollBar->isVisible()) { - updateScrollBar(Qt::Vertical); + if (mAbleToScrollY && mVerticalScrollBar->isVisible()) { + updateScrollBar(Qt::Vertical); + } } - - bool positionChanged = currentPosition != newPosition; - if (positionChanged && mScrollBarHideTimer.isActive()) { - mScrollBarHideTimer.stop(); - } - - return (positionChanged); + //if we are here than content position has changed.i.e delta is not zero or + //we havent reached the boundaries. + return true; } void HbScrollAreaPrivate::animateScroll(QPointF speed) @@ -352,11 +352,18 @@ void HbScrollAreaPrivate::startAnimating() { // Launch the animation timer - if (!mScrollTimer.isActive()) { - mScrollElapsedTime.restart(); - mLastElapsedTime = 0.0; - mScrollTimer.start(ANIMATION_INTERVAL); - mIsAnimating = true; + if (!mContents) + return; + if (mScrollTimerId == 0) { + Q_Q( HbScrollArea ); + mScrollTimerId = q->startTimer(ANIMATION_INTERVAL); + + //make sure we where able to start the timer + if (mScrollTimerId != 0) { + mScrollElapsedTime.restart(); + mLastElapsedTime = 0.0; + mIsAnimating = true; + } } } @@ -365,7 +372,7 @@ Q_Q( HbScrollArea ); if (mHorizontalScrollBarPolicy == HbScrollArea::ScrollBarAutoHide || mVerticalScrollBarPolicy == HbScrollArea::ScrollBarAutoHide) { - mScrollBarHideTimer.start(SCROLLBAR_HIDE_TIMEOUT); + startScrollbarHideTimer(); } if (mIsScrolling) { if (mScrollFeedbackOngoing) { @@ -380,11 +387,37 @@ void HbScrollAreaPrivate::stopAnimating() { - mScrollTimer.stop(); + if (mIsAnimating) { + Q_Q( HbScrollArea ); + q->killTimer(mScrollTimerId); + mScrollTimerId = 0; + mIsAnimating = false; + stopScrolling(); + } +} + +void HbScrollAreaPrivate::startScrollbarHideTimer() +{ + if (mScrollBarHideTimerId == 0){ + Q_Q( HbScrollArea ); + mScrollBarHideTimerId = q->startTimer(INITIAL_SCROLLBAR_HIDE_TIMEOUT); + } - mIsAnimating = false; +} - stopScrolling(); +void HbScrollAreaPrivate::stopScrollbarHideTimer() +{ + if (mScrollBarHideTimerId != 0) { + Q_Q( HbScrollArea ); + q->killTimer(mScrollBarHideTimerId); + mScrollBarHideTimerId = 0; + } +} + +void HbScrollAreaPrivate::reStartScrollbarHideTimer() +{ + stopScrollbarHideTimer(); + startScrollbarHideTimer(); } /* @@ -394,9 +427,9 @@ void HbScrollAreaPrivate::_q_animateScrollTimeout() { Q_Q( HbScrollArea ); - qreal elapsedTime = qreal(mScrollElapsedTime.elapsed()); + qreal elapsedTime(qreal(mScrollElapsedTime.elapsed())); - qreal timeDifference = elapsedTime - mLastElapsedTime; + qreal timeDifference(elapsedTime - mLastElapsedTime); // if no time has elapsed, just return // this sometimes happens if the timer accuracy is not that great @@ -417,38 +450,40 @@ mTargetAnimationInProgress = false; } } else { - + qreal simulationStepInTime; + QPointF overAllDist(0,0); + QPointF currentPosition(-mContents->pos()); + bool stopVerticalAnimation(false); + bool stopHorizontalAnimation(false); // calculations are split so that the same amount of simulation steps // are made in varying framerates. do { - qreal simulationStepInTime = qMin ( MAX_TIMEDIF_FOR_SIMULATION, timeDifference); - - // Calculate new velocity to horizontal movement - mScrollSpeed.setX( calculateVelocity ( simulationStepInTime, - mScrollSpeed.x(), - -mContents->pos().x(), - leftBoundary(), - rightBoundary() ) ); + simulationStepInTime = qMin ( MAX_TIMEDIF_FOR_SIMULATION, timeDifference); + currentPosition = -mContents->pos(); + if (mAbleToScrollX) { + // Calculate new velocity to horizontal movement + mScrollSpeed.setX( calculateVelocity ( simulationStepInTime, + mScrollSpeed.x(), + currentPosition.x(), + leftBoundary(), + rightBoundary() ) ); - // Calculate new velocity to vertical movement - mScrollSpeed.setY( calculateVelocity ( simulationStepInTime, - mScrollSpeed.y(), - -mContents->pos().y(), - topBoundary(), - bottomBoundary() ) ); - - QPointF overAllDist = mScrollSpeed * simulationStepInTime; - - bool stopVerticalAnimation = false; - if ( qAbs( mScrollSpeed.y() ) < MIN_SPEED_PER_MILLISECOND ) { - stopVerticalAnimation = clampToBoundaries ( overAllDist.ry(), -mContents->pos().y(), topBoundary(), bottomBoundary() ); + if ( qAbs( mScrollSpeed.x() ) < MIN_SPEED_PER_MILLISECOND ) { + stopHorizontalAnimation = clampToBoundaries ( overAllDist.rx(), currentPosition.x(), leftBoundary(), rightBoundary() ); + } } - - bool stopHorizontalAnimation = false; - if ( qAbs( mScrollSpeed.x() ) < MIN_SPEED_PER_MILLISECOND ) { - stopHorizontalAnimation = clampToBoundaries ( overAllDist.rx(), -mContents->pos().x(), leftBoundary(), rightBoundary() ); + if (mAbleToScrollY) { + // Calculate new velocity to vertical movement + mScrollSpeed.setY( calculateVelocity ( simulationStepInTime, + mScrollSpeed.y(), + currentPosition.y(), + topBoundary(), + bottomBoundary() ) ); + if ( qAbs( mScrollSpeed.y() ) < MIN_SPEED_PER_MILLISECOND ) { + stopVerticalAnimation = clampToBoundaries ( overAllDist.ry(), currentPosition.y(), topBoundary(),bottomBoundary() ); + } } - + overAllDist = mScrollSpeed * simulationStepInTime; q->scrollByAmount ( -overAllDist ); if ( ( !mAbleToScrollY || stopVerticalAnimation ) && @@ -551,6 +586,7 @@ Q_Q(HbScrollArea); mContents->setPos(newPosition); + if (mEmitPositionChangedSignal) emit q->scrollPositionChanged(-newPosition); } } @@ -578,6 +614,8 @@ */ bool HbScrollAreaPrivate::pan(QPanGesture* panGesture) { + if (!mContents) + return false; Q_Q ( HbScrollArea ); HbPanGesture *hbPanGesture = qobject_cast(panGesture); @@ -684,6 +722,10 @@ { if(mContents) { Q_Q(HbScrollArea); + // if contentwidget size has changed, xxxBoundary() functions + // won't work without this + QCoreApplication::sendPostedEvents(q, QEvent::LayoutRequest); + QPointF currentPosition = -mContents->pos(); QPointF newPosition = currentPosition; @@ -763,20 +805,14 @@ if (orientation == Qt::Horizontal) { // Set handle size - mHorizontalScrollBar->setPageSize( qBound ( qreal(0.0), - qreal (q->boundingRect().width()) - / qreal (mContents->boundingRect().width()), - qreal(1.0))); - + mHorizontalScrollBar->setPageSize(q->boundingRect().width() + / mContents->boundingRect().width()); updateScrollBar(orientation); } else { // Set handle size - mVerticalScrollBar->setPageSize(qBound ( qreal(0.0), - qreal (q->boundingRect().height()) - / qreal (mContents->boundingRect().height()), - qreal(1.0))); - + mVerticalScrollBar->setPageSize(q->boundingRect().height() + / mContents->boundingRect().height()); updateScrollBar(orientation); } } @@ -786,49 +822,33 @@ Q_Q( HbScrollArea ); qreal thumbPosition(0); - + qreal normalizingValue(0); + // The scrollbar "thumb" position is the current position of the contents widget divided + // by the difference between the width of the contents widget and the width of the scroll area. + // This formula assumes that the "thumb" of the the scroll bar is sized proportionately to + // the width of the contents widget. if ((orientation == Qt::Horizontal) && mHorizontalScrollBar) { - // The scrollbar "thumb" position is the current position of the contents widget divided - // by the difference between the width of the contents widget and the width of the scroll area. - // This formula assumes that the "thumb" of the the scroll bar is sized proportionately to - // the width of the contents widget. - - //if (mLayoutDirection == Qt::LeftToRight) - //{ - if (!qIsNull(mContents->boundingRect().width() - - q->boundingRect().width())) { - thumbPosition = qAbs( leftBoundary() + qMin ( -leftBoundary(), mContents->pos().x() ) ) - / (mContents->boundingRect().width() - - q->boundingRect().width()); + if (mAbleToScrollX) { + normalizingValue = mContents->boundingRect().width() + - q->boundingRect().width(); + qreal lBoundary(leftBoundary()); + if (!qIsNull(normalizingValue)) { + thumbPosition = qAbs( lBoundary + qMin ( -lBoundary, mContents->pos().x() ) ) + / (normalizingValue); + } } - /* } - else - thumbPosition = (mContents->boundingRect().width() - + mContents->pos().x()) - / (mContents->boundingRect().width() - - q->boundingRect().width());*/ - - if (thumbPosition < 0.0) - thumbPosition = 0.0; - else if (thumbPosition > 1.0) - thumbPosition = 1.0; mHorizontalScrollBar->setValue(thumbPosition); } else if (mVerticalScrollBar) { - // The scrollbar "thumb" position is the current position of the contents widget divided - // by the difference between the height of the contents widget and the height of the scroll area. - // This formula assumes that the "thumb" of the the scroll bar is sized proportionately to - // the height of the contents widget. - if (!qIsNull(mContents->boundingRect().height() - - q->boundingRect().height())) { - thumbPosition = qAbs( topBoundary() + qMin ( -topBoundary(), mContents->pos().y() ) ) - / (mContents->boundingRect().height() - - q->boundingRect().height()); + if (mAbleToScrollY) { + normalizingValue = mContents->boundingRect().height() + - q->boundingRect().height(); + qreal tBoundary(topBoundary()); + if (!qIsNull(normalizingValue)) { + thumbPosition = qAbs( tBoundary + qMin ( -tBoundary, mContents->pos().y() ) ) + / (normalizingValue); + } } - if (thumbPosition < 0.0) - thumbPosition = 0.0; - else if (thumbPosition > 1.0) - thumbPosition = 1.0; mVerticalScrollBar->setValue(thumbPosition); } } @@ -858,8 +878,8 @@ mVerticalScrollBar->setVisible(false); } - if (scrollBarsVisible && !mScrollBarHideTimer.isActive()) { - mScrollBarHideTimer.start(INITIAL_SCROLLBAR_HIDE_TIMEOUT); + if (scrollBarsVisible) { + startScrollbarHideTimer(); } } @@ -914,9 +934,10 @@ if (mHorizontalScrollBar && mHorizontalScrollBarPolicy == HbScrollArea::ScrollBarAutoHide) { if (HbScrollBarPrivate::d_ptr(mHorizontalScrollBar)->isPressed() || (mVerticalScrollBar && HbScrollBarPrivate::d_ptr(mVerticalScrollBar)->isPressed())) { - mScrollBarHideTimer.start(); + startScrollbarHideTimer(); } else if(mHorizontalScrollBarPolicy != HbScrollArea::ScrollBarAlwaysOn && mHorizontalScrollBar->isVisible()){ + stopScrollbarHideTimer(); mHorizontalScrollBar->setVisible(false); } @@ -924,9 +945,10 @@ if (mVerticalScrollBar && mVerticalScrollBarPolicy == HbScrollArea::ScrollBarAutoHide) { if (HbScrollBarPrivate::d_ptr(mVerticalScrollBar)->isPressed() || (mHorizontalScrollBar && HbScrollBarPrivate::d_ptr(mHorizontalScrollBar)->isPressed())) { - mScrollBarHideTimer.start(); + startScrollbarHideTimer(); } else if(mVerticalScrollBarPolicy != HbScrollArea::ScrollBarAlwaysOn && mVerticalScrollBar->isVisible()){ + stopScrollbarHideTimer(); mVerticalScrollBar->setVisible(false); } } @@ -955,10 +977,7 @@ setContentPosition(value, orientation, false); - if (mScrollBarHideTimer.isActive()) { - mScrollBarHideTimer.stop(); - mScrollBarHideTimer.start(); - } + reStartScrollbarHideTimer(); if (mContinuationIndicators) { updateIndicators(-mContents->pos()); } @@ -984,10 +1003,7 @@ setContentPosition(value, orientation, true); - if (mScrollBarHideTimer.isActive()) { - mScrollBarHideTimer.stop(); - mScrollBarHideTimer.start(); - } + reStartScrollbarHideTimer(); if (mContinuationIndicators) { updateIndicators(-mContents->pos()); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscrollarea_p.h --- a/src/hbcore/gui/hbscrollarea_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscrollarea_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -73,6 +73,9 @@ void startAnimating(); void stopAnimating(); + void startScrollbarHideTimer(); + void stopScrollbarHideTimer(); + void reStartScrollbarHideTimer(); virtual void stopScrolling(); void animateScroll(QPointF speed); // speed in pixels per millisecond @@ -157,7 +160,7 @@ bool mIsAnimating; QPointF mScrollSpeed; // in pixels per ms - QTimer mScrollTimer; + int mScrollTimerId; QTime mScrollElapsedTime; qreal mLastElapsedTime; @@ -168,10 +171,9 @@ QPointF mAnimationInitialPosition; QEasingCurve* mAnimationShape; - QTimer mScrollBarHideTimer; + int mScrollBarHideTimerId; bool mFrictionEnabled; - bool mScrollbarVisible; bool mResetAlignment; HbScrollArea::ClampingStyle mClampingStyle; @@ -193,6 +195,7 @@ Qt::Alignment mAlignment; bool mContinuationIndicators; + bool mEmitPositionChangedSignal; QGraphicsItem *continuationIndicatorTopItem; QGraphicsItem *continuationIndicatorBottomItem; QGraphicsItem *continuationIndicatorLeftItem; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscrollbar.cpp --- a/src/hbcore/gui/hbscrollbar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscrollbar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -68,9 +68,24 @@ /*! \fn void HbScrollBar::valueChanged( qreal value, Qt::Orientation orientation ) - This signal is emitted when thumb position is changed from user interaction. + This signal is emitted when thumb position is changed by the user. */ +/*! + \fn void valueChangeRequested( qreal value, Qt::Orientation orientation ); + + This signal is emitted when the user presses scrollbar groove. + + \param value, the new value of scrollbar after the change + */ + +/*! + \primitives + \primitive{groove} HbFrameItem representing the groove of a scrollbar. + \primitive{handle} HbFrameItem representing the handle of a scrollbar. + \primitive{toucharea} HbTouchArea representing the scrollbar toucharea. + */ + HbScrollBarPrivate::HbScrollBarPrivate(): mOrientation(Qt::Vertical), mCurrentPosition(0.5), @@ -83,7 +98,8 @@ grooveItem(0), handleItem(0), mTouchArea(0), - mBoundingRect(QRectF(0,0,0,0)), + mLimitingFactor(0.0), + mTopLeft(0.0), lastEmittedPos(QPointF()), emittedPos(false) { @@ -123,13 +139,11 @@ void HbScrollBarPrivate::updatePosition() { - if(!mHandleGeometry.isValid() || !handleItem) - return; if (handleItem){ if (mOrientation == Qt::Vertical) { - handleItem->setPos(mHandleGeometry.topLeft().x(), mCurrentPosition * (mBoundingRect.height() - mHandleGeometry.height())); + handleItem->setPos(mTopLeft, mCurrentPosition * mLimitingFactor); } else { - handleItem->setPos(mCurrentPosition * (mBoundingRect.width() - mHandleGeometry.width()), mHandleGeometry.topLeft().y()); + handleItem->setPos(mCurrentPosition * mLimitingFactor, mTopLeft); } } } @@ -141,22 +155,25 @@ Q_Q(HbScrollBar); if(handleItem){ HbFrameItem *item = qgraphicsitem_cast(handleItem); - mBoundingRect = q->boundingRect(); + QRectF bRect = q->boundingRect(); if(item){ if (mOrientation == Qt::Vertical) { - qreal height(mPageSize * mBoundingRect.height()); + qreal height(mPageSize * bRect.height()); if(!qFuzzyCompare(item->preferredHeight(),height)){ item->setPreferredHeight(height); item->resize(item->size().width(), height); } + mLimitingFactor = bRect.height() - item->geometry().height(); + mTopLeft = item->geometry().topLeft().x(); } else { - qreal width(mPageSize * mBoundingRect.width()); + qreal width(mPageSize * bRect.width()); if(!qFuzzyCompare(item->preferredWidth(),width)){ item->setPreferredWidth(width); item->resize(width, item->size().height()); } + mLimitingFactor = bRect.width() - item->geometry().width(); + mTopLeft = item->geometry().topLeft().y(); } - mHandleGeometry = item->geometry(); updatePosition(); } } @@ -239,7 +256,7 @@ The value corresponds to the position of the thumb. \sa HbScrollBar::setValue() -*/ + */ qreal HbScrollBar::value() const { Q_D( const HbScrollBar ); @@ -253,7 +270,7 @@ The size is in range of 0.0 to 1.0. \sa HbScrollBar::setPageSize() -*/ + */ qreal HbScrollBar::pageSize() const { Q_D( const HbScrollBar ); @@ -264,7 +281,7 @@ Returns the orientation of scrollbar. \sa HbScrollBar::setOrientation() -*/ + */ Qt::Orientation HbScrollBar::orientation() const { Q_D( const HbScrollBar ); @@ -317,7 +334,7 @@ { Q_D(HbScrollBar); - value = qBound(static_cast(0.0), value, static_cast(1.0)); + value = qBound(qreal(0.0), value, qreal(1.0)); if( !qFuzzyCompare(d->mCurrentPosition,value )) { d->mCurrentPosition = value; d->updatePosition(); @@ -335,7 +352,7 @@ void HbScrollBar::setPageSize( qreal size ) { Q_D(HbScrollBar); - size = qBound(static_cast(0.0), size, static_cast(1.0)); + size = qBound(qreal(0.0), size, qreal(1.0)); if(!qFuzzyCompare(d->mPageSize,size)) { d->mPageSize = size; @@ -601,7 +618,14 @@ Q_D(HbScrollBar); if (d->handleItem) { HbFrameItem* item = (qgraphicsitem_cast(d->handleItem)); - d->mHandleGeometry = item->geometry(); + QRectF geo = item->geometry(); + if (d->mOrientation == Qt::Vertical) { + d->mTopLeft = geo.topLeft().x(); + d->mLimitingFactor = boundingRect().height() - geo.height(); + } else { + d->mTopLeft = geo.topLeft().y(); + d->mLimitingFactor = boundingRect().width() - geo.width(); + } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbscrollbar_p.h --- a/src/hbcore/gui/hbscrollbar_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbscrollbar_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -74,8 +74,8 @@ QGraphicsItem *grooveItem; QGraphicsItem *handleItem; QGraphicsItem *mTouchArea; - QRectF mBoundingRect; - QRectF mHandleGeometry; + qreal mLimitingFactor; + qreal mTopLeft; bool hasEffects; QPointF lastEmittedPos; bool emittedPos; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsettingswindow_p.cpp --- a/src/hbcore/gui/hbsettingswindow_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbsettingswindow_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,14 +36,14 @@ #include "hbgraphicsscene_p.h" #include "hbeffectinternal_p.h" -#include -#include -#include -#include -#include -#include -#include -#include +#include //krazy:exclude=qclasses +#include //krazy:exclude=qclasses +#include //krazy:exclude=qclasses +#include //krazy:exclude=qclasses +#include //krazy:exclude=qclasses +#include //krazy:exclude=qclasses +#include //krazy:exclude=qclasses +#include //krazy:exclude=qclasses #include #ifdef HB_CSS_INSPECTOR @@ -86,6 +86,7 @@ { mLights = true; mAnimation = true; + mCustomViewPortSize = false; windowComboBox = new QComboBox(this); windowComboBox->hide(); @@ -93,14 +94,17 @@ directionComboBox = new QComboBox(this); dragToResizeComboBox = new QComboBox(this); mSensorComboBox = new QComboBox(this); - mGeneralSettingsForSensorsComboBox = new QComboBox(this); - mUnsetOrientationButton = new QPushButton(tr("&Unset orientation"), this); + mGeneralSettingsForSensorsComboBox = new QComboBox(this); //krazy:exclude=qclasses + mUnsetOrientationButton = new QPushButton(tr("&Unset orientation"), this); //krazy:exclude=qclasses mLights = true; HbIcon icon("qtg_mono_light"); - mLightsButton = new QPushButton(icon.pixmap(), "", this); + mLightsButton = new QPushButton(icon.pixmap(), "", this); //krazy:exclude=qclasses + mAnimationButton = new QPushButton(tr("&Animation on"), this); //krazy:exclude=qclasses + mViewPortSizeButton = new QPushButton(tr("&Set custom ViewPortSize"), this); //krazy:exclude=qclasses - mAnimationButton = new QPushButton(tr("&Animation on"), this); + mWindowObscured = false; + mWindowObscuredButton = new QPushButton(tr("Obscure"), this); resolutionComboBox->addItems(HbDeviceProfile::profileNames()); directionComboBox->addItems(QStringList() << tr("Left to right") << tr("Right to left")); @@ -118,21 +122,24 @@ connect(mUnsetOrientationButton, SIGNAL(pressed()), SLOT(unsetOrientation())); connect(mLightsButton, SIGNAL(pressed()), SLOT(toggleLights())); connect(mAnimationButton, SIGNAL(pressed()), SLOT(toggleAnimation())); + connect(mViewPortSizeButton, SIGNAL(pressed()), SLOT(resizeViewPort())); + connect(mWindowObscuredButton, SIGNAL(pressed()), SLOT(toggleWindowObscured())); + QVBoxLayout *boxLayout = new QVBoxLayout(this); //krazy:exclude=qclasses - QVBoxLayout *boxLayout = new QVBoxLayout(this); - - QGroupBox *mainGroup = new QGroupBox(this); - QFormLayout *layout = new QFormLayout(mainGroup); + QGroupBox *mainGroup = new QGroupBox(this); //krazy:exclude=qclasses + QFormLayout *layout = new QFormLayout(mainGroup); //krazy:exclude=qclasses layout->addRow(tr("&Window"), windowComboBox); layout->addRow(tr("&Resolution"), resolutionComboBox); layout->addRow(tr("&Direction"), directionComboBox); layout->addRow(tr("&Drag to resize"), dragToResizeComboBox); + layout->addRow(mViewPortSizeButton); + layout->addRow(mWindowObscuredButton); mainGroup->setLayout(layout); boxLayout->addWidget(mainGroup); - - QGroupBox *sensorGroup = new QGroupBox(tr("Sensor handling"), this); - QFormLayout *sensorLayout = new QFormLayout(sensorGroup); + + QGroupBox *sensorGroup = new QGroupBox(tr("Sensor handling"), this); //krazy:exclude=qclasses + QFormLayout *sensorLayout = new QFormLayout(sensorGroup); //krazy:exclude=qclasses sensorLayout->addRow(tr("&Sensors"), mSensorComboBox); sensorLayout->addRow(tr("&GS sensors"), mGeneralSettingsForSensorsComboBox); @@ -143,28 +150,28 @@ mainGroup->setLayout(sensorLayout); boxLayout->addWidget(sensorGroup); - QGroupBox *globalGroup = new QGroupBox(tr("Global debug drawing"), this); - QFormLayout *globalLayout = new QFormLayout(globalGroup); - + QGroupBox *globalGroup = new QGroupBox(tr("Global debug drawing"), this); //krazy:exclude=qclasses + QFormLayout *globalLayout = new QFormLayout(globalGroup); //krazy:exclude=qclasses + touchAreaComboBox = new QComboBox(this); touchAreaComboBox->addItems(QStringList() << tr("Invisible") << tr("Visible")); connect(touchAreaComboBox, SIGNAL(currentIndexChanged(int)), SLOT(changeTouchArea(int))); - globalLayout->addRow(tr("&Touch areas"), touchAreaComboBox); - + globalLayout->addRow(tr("&Touch areas"), touchAreaComboBox); + textBoxesComboBox = new QComboBox(this); textBoxesComboBox->addItems(QStringList() << tr("Invisible") << tr("Visible")); connect(textBoxesComboBox, SIGNAL(currentIndexChanged(int)), SLOT(changeTextBoxes(int))); - globalLayout->addRow(tr("&Text items"), textBoxesComboBox); - + globalLayout->addRow(tr("&Text items"), textBoxesComboBox); + iconBoxesComboBox = new QComboBox(this); iconBoxesComboBox->addItems(QStringList() << tr("Invisible") << tr("Visible")); connect(iconBoxesComboBox, SIGNAL(currentIndexChanged(int)), SLOT(changeIconBoxes(int))); - globalLayout->addRow(tr("&Icon items"), iconBoxesComboBox); - + globalLayout->addRow(tr("&Icon items"), iconBoxesComboBox); + fpsCounterComboBox = new QComboBox(this); fpsCounterComboBox->addItems(QStringList() << tr("Invisible") << tr("Visible")); connect(fpsCounterComboBox, SIGNAL(currentIndexChanged(int)), SLOT(changeFpsCounter(int))); - globalLayout->addRow(tr("&Fps counter"), fpsCounterComboBox); + globalLayout->addRow(tr("&Fps counter"), fpsCounterComboBox); globalGroup->setLayout(globalLayout); boxLayout->addWidget(globalGroup); @@ -173,14 +180,14 @@ QGroupBox *cssGroup = new QGroupBox(tr("CSS Debugging"), this); QHBoxLayout *cssLayout = new QHBoxLayout(cssGroup); - cssWindowButton = new QPushButton(tr("Show CSS inspector"), this); + cssWindowButton = new QPushButton(tr("Show CSS inspector"), this); //krazy:exclude=qclasses connect(cssWindowButton, SIGNAL(pressed()), HbCssInspectorWindow::instance(), SLOT(show())); cssLayout->addWidget(cssWindowButton); cssGroup->setLayout(cssLayout); boxLayout->addWidget(cssGroup); #endif - initStartUpValues(); + initStartUpValues(); } HbSettingsWindow::~HbSettingsWindow() @@ -193,7 +200,7 @@ QStringList windows; windows << tr("Global"); - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { windows << windowName(window); } @@ -224,15 +231,15 @@ HbMainWindow *window = getWindow(windowComboBox->currentIndex()); if (!window) { // global - + // resize all windows - QListIterator iterator(hbInstance->allMainWindows()); + QListIterator iterator(hbInstance->allMainWindows()); while (iterator.hasNext()) { HbMainWindow *window = iterator.next(); window->resize(profile.logicalSize()); HbDeviceProfileManager::select(*window, profile); } - + } else { // window specific window->resize(profile.logicalSize()); @@ -244,14 +251,14 @@ void HbSettingsWindow::changeDirection(int index) { HbMainWindow *window = getWindow(windowComboBox->currentIndex()); - if(!window){ + if (!window) { Qt::LayoutDirection dir = HbApplication::layoutDirection(); HbApplication::setLayoutDirection(dir == Qt::LeftToRight ? Qt::RightToLeft : Qt::LeftToRight); - }else{ + } else { Qt::LayoutDirection dir = index == 0 ? Qt::LeftToRight : Qt::RightToLeft; - if(dir != HbApplication::layoutDirection()){ + if (dir != HbApplication::layoutDirection()) { window->setLayoutDirection(dir); - }else{ + } else { window->unsetLayoutDirection(); } } @@ -260,47 +267,47 @@ void HbSettingsWindow::changeTouchArea(int index) { HbTouchAreaPrivate::setOutlineDrawing(index > 0); - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { // Force window to redraw QEvent event(QEvent::WindowActivate); - QApplication::sendEvent(window, &event); + QApplication::sendEvent(window, &event); //krazy:exclude=qclasses } } void HbSettingsWindow::changeTextBoxes(int index) { HbTextItemPrivate::outlinesEnabled = index > 0; - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { // Force window to redraw QEvent event(QEvent::WindowActivate); - QApplication::sendEvent(window, &event); - } + QApplication::sendEvent(window, &event); //krazy:exclude=qclasses + } } void HbSettingsWindow::changeIconBoxes(int index) { HbIconItemPrivate::outlinesEnabled = index > 0; - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { // Force window to redraw QEvent event(QEvent::WindowActivate); - QApplication::sendEvent(window, &event); - } + QApplication::sendEvent(window, &event); //krazy:exclude=qclasses + } } void HbSettingsWindow::changeFpsCounter(int index) { HbGraphicsScenePrivate::fpsCounterEnabled = index > 0; - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { // Force window to redraw QEvent event(QEvent::WindowActivate); - QApplication::sendEvent(window, &event); - } + QApplication::sendEvent(window, &event); //krazy:exclude=qclasses + } } void HbSettingsWindow::changeDragToResize(int index) { resolutionComboBox->setEnabled(index == 0); - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { HbDeviceProfile profile = HbDeviceProfile::profile(window); window->resize(profile.logicalSize()); } @@ -309,38 +316,40 @@ void HbSettingsWindow::changeSensorValue(int index) { - if (mSensorComboBox->count() == 3 && (index == 0 || index == 1)) + if (mSensorComboBox->count() == 3 && (index == 0 || index == 1)) { mSensorComboBox->removeItem(2); + } - QSettings mSettings( "Nokia", "HbStartUpDeskTopSensors"); - switch(index) { - case 0: - HbMainWindowOrientation::instance()->mSensorListener->setSensorOrientation(Qt::Horizontal); - mSettings.setValue("Orientation", 1); + QSettings mSettings("Nokia", "HbStartUpDeskTopSensors"); + switch (index) { + case 0: + HbMainWindowOrientation::instance()->mSensorListener->setSensorOrientation(Qt::Horizontal); + mSettings.setValue("Orientation", 1); break; - case 1: - HbMainWindowOrientation::instance()->mSensorListener->setSensorOrientation(Qt::Vertical); - mSettings.setValue("Orientation", 2); + case 1: + HbMainWindowOrientation::instance()->mSensorListener->setSensorOrientation(Qt::Vertical); + mSettings.setValue("Orientation", 2); break; - case 2: //Empty + case 2: //Empty break; - case 3: //Initialize - if (mSettings.value("Orientation").toInt() == 1) - mSensorComboBox->setCurrentIndex(0); - else - mSensorComboBox->setCurrentIndex(1); - break; - default: - break; + case 3: //Initialize + if (mSettings.value("Orientation").toInt() == 1) { + mSensorComboBox->setCurrentIndex(0); + } else { + mSensorComboBox->setCurrentIndex(1); + } + break; + default: + break; } } void HbSettingsWindow::changeGSettingsForSensors(int index) { QSettings mSettings("Nokia", "HbStartUpDeskTopSensors"); - if (index == 3){ //Initialize + if (index == 3) { //Initialize mGeneralSettingsForSensorsComboBox->setCurrentIndex(mSettings.value("SensorsEnabled").toBool()); - } else { + } else { mSettings.setValue("SensorsEnabled", (bool)index); HbMainWindowOrientation::instance()->mSensorListener->enableSensors(index, true); } @@ -348,7 +357,7 @@ void HbSettingsWindow::unsetOrientation() { - foreach (HbMainWindow *window, hbInstance->allMainWindows()) { + foreach(HbMainWindow * window, hbInstance->allMainWindows()) { if (!HbMainWindowPrivate::d_ptr(window)->mAutomaticOrientationSwitch) { window->unsetOrientation(); } @@ -362,13 +371,13 @@ for (int i = 0; i < mainWindowList.count(); ++i) { if (mLights) { icon.setIconName("qtg_mono_light_off"); - mainWindowList[i]->broadcastEvent(HbEvent::SleepModeEnter); - mLights = false; + mainWindowList[i]->broadcastEvent(HbEvent::SleepModeEnter); + mLights = false; mainWindowList[i]->setForegroundBrush(QBrush(Qt::black, Qt::Dense1Pattern)); } else { icon.setIconName("qtg_mono_light"); mainWindowList[i]->broadcastEvent(HbEvent::SleepModeExit); - mLights = true; + mLights = true; mainWindowList[i]->setForegroundBrush(Qt::NoBrush); } mLightsButton->setIcon(icon.pixmap()); @@ -388,3 +397,39 @@ } } + +void HbSettingsWindow::resizeViewPort() +{ + HbMainWindow *window = hbInstance->allMainWindows().at(0); + if (!mCustomViewPortSize) { + mViewPortOriginalSize = window->size(); + QSizeF newSize = mViewPortOriginalSize; + newSize.scale(mViewPortOriginalSize.width(), mViewPortOriginalSize.height() - 150, Qt::IgnoreAspectRatio); + HbMainWindowPrivate::d_ptr(window)->setViewportSize(newSize); + mCustomViewPortSize = true; + mViewPortSizeButton->setText(tr("&Set original ViewPortSize")); + } else { + HbMainWindowPrivate::d_ptr(window)->setViewportSize(mViewPortOriginalSize); + mCustomViewPortSize = false; + mViewPortSizeButton->setText(tr("&Set custom ViewPortSize")); + } + +} + +void HbSettingsWindow::toggleWindowObscured() +{ + if (!mWindowObscured) { + mWindowObscured = true; + mWindowObscuredButton->setText(tr("Reveal")); + } else { + mWindowObscured = false; + mWindowObscuredButton->setText(tr("Obscure")); + } + + QList mainWindowList = hbInstance->allMainWindows(); + for (int i = 0; i < mainWindowList.count(); ++i) { + HbEvent *obscureChangedEvent = new HbWindowObscuredChangedEvent(mWindowObscured); + QCoreApplication::postEvent(mainWindowList[i], obscureChangedEvent); + } +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsettingswindow_p.h --- a/src/hbcore/gui/hbsettingswindow_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbsettingswindow_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -57,6 +57,8 @@ void unsetOrientation(); void toggleLights(); void toggleAnimation(); + void resizeViewPort(); + void toggleWindowObscured(); private: void initStartUpValues(); @@ -77,8 +79,13 @@ QPushButton *mUnsetOrientationButton; QPushButton *mLightsButton; QPushButton *mAnimationButton; + QPushButton *mViewPortSizeButton; + QPushButton *mWindowObscuredButton; bool mLights; bool mAnimation; + bool mCustomViewPortSize; + bool mWindowObscured; + QSizeF mViewPortOriginalSize; #ifdef HB_CSS_INSPECTOR QPushButton *cssWindowButton; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsplash.cpp --- a/src/hbcore/gui/hbsplash.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbsplash.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,20 +24,23 @@ ****************************************************************************/ #include "hbsplash_p.h" +#include "hbsplash_direct_symbian_p.h" #include #include #include +#include #ifdef Q_OS_SYMBIAN #include #include +#include #include "hborientationstatus_p.h" #include "hbsplashdefs_p.h" #endif /*! \class HbSplash - + \brief Class with utility functions for accessing splash screens. \internal @@ -61,8 +64,7 @@ return QString("prt"); } -struct Params -{ +struct Params { int *w; int *h; int *bpl; @@ -72,6 +74,8 @@ QString screenId; HbSplash::AllocFunc allocFunc; void *allocFuncParam; + quint32 extra; + bool forceFile; }; struct File { @@ -94,18 +98,30 @@ #endif } -static uchar *readSpl(File &f, const Params ¶ms) +static uchar *readSpl(File &f, Params ¶ms) { - int w = 0, h = 0, bpl = 0; + quint32 w = 0, h = 0, bpl = 0; QImage::Format fmt = QImage::Format_Invalid; - f.read((char *) &w, sizeof(int)); - f.read((char *) &h, sizeof(int)); - f.read((char *) &bpl, sizeof(int)); - f.read((char *) &fmt, sizeof(QImage::Format)); + // Have to read the header in one piece in order to minimize the + // number of read() calls. + const int headerLength = sizeof(quint32) * 5; + char headerBuf[headerLength]; + qMemSet(headerBuf, 0, headerLength); + f.read(headerBuf, headerLength); + quint32 *headerPtr = reinterpret_cast(headerBuf); + w = *headerPtr++; + h = *headerPtr++; + bpl = *headerPtr++; + fmt = (QImage::Format) * headerPtr++; + params.extra = *headerPtr; if (fmt != QImage::Format_ARGB32_Premultiplied) { - qWarning("HbSplash: image format for %s is not ARGB32_PRE (is %d instead)", + qWarning("[hbsplash] Image format for %s is not ARGB32_PRE (is %d instead)", qPrintable(f.mFullName), fmt); } + if (fmt < 0 || fmt >= QImage::NImageFormats) { + qWarning("[hbsplash] Image format is invalid"); + return 0; + } qint64 sz = h * bpl; uchar *data = 0; if (w > 0 && h > 0 && bpl > 0 && sz > 0 && sz <= image_bytes_limit) { @@ -116,20 +132,20 @@ data = new uchar[sz]; } if (data) { - qint64 bytesRead = f.read((char *) data, sz); + qint64 bytesRead = f.read(reinterpret_cast(data), sz); if (bytesRead != sz) { - qWarning("HbSplash: file %s is invalid", qPrintable(f.mFullName)); + qWarning("[hbsplash] File %s is invalid", qPrintable(f.mFullName)); if (!params.allocFunc) { - delete data; + delete[] data; } data = 0; } } } catch (const std::bad_alloc &) { - qWarning("HbSplash: failed to allocate image buffer"); + qWarning("[hbsplash] Failed to allocate image buffer"); } } else { - qWarning("HbSplash: image in file %s is too big", qPrintable(f.mFullName)); + qWarning("[hbsplash] Image in file %s is too big", qPrintable(f.mFullName)); } *params.w = w; *params.h = h; @@ -140,13 +156,27 @@ #ifdef Q_OS_SYMBIAN +// Symbian-specific implementation to get splash screens either by +// reading from a file opened on the server side or by using bitmaps +// shared via fbserv. + class HbSplashSrvClient : public RSessionBase { public: HbSplashSrvClient(); ~HbSplashSrvClient(); bool Connect(); - bool getSplash(RFile &f, const QString &ori, const QString &appId, const QString &screenId); + + bool getSplashFileHandle(RFile &f, + const QString &ori, + const QString &appId, + const QString &screenId); + + uchar *getSplashFromBitmap(const QString &ori, + const QString &appId, + const QString &screenId, + Params ¶ms); + private: RMutex mMutex; bool mMutexOk; @@ -185,9 +215,8 @@ if (err == KErrNone) { ok = true; break; -/* } else if (err == KErrNotFound || err == KErrServerTerminated) { - qDebug("[hbsplash] Server not running"); + qDebug("[hbsplash] server not running"); TFindServer findServer(hbsplash_server_name); TFullName name; if (findServer.Next(name) != KErrNone) { @@ -211,15 +240,14 @@ qWarning("[hbsplash] Rendezvous failed (%d)", status.Int()); break; } - qDebug("[hbsplash] Server started"); + qDebug("[hbsplash] server started"); } -*/ } else { break; } } if (!ok) { - qWarning("[hbsplash] cannot connect to splashgen server"); + qWarning("[hbsplash] Cannot connect to splashgen server"); } if (mMutexOk) { mMutex.Signal(); @@ -227,8 +255,10 @@ return ok; } -bool HbSplashSrvClient::getSplash(RFile &f, const QString &ori, - const QString &appId, const QString &screenId) +bool HbSplashSrvClient::getSplashFileHandle(RFile &f, + const QString &ori, + const QString &appId, + const QString &screenId) { TPtrC oriDes(static_cast(ori.utf16()), ori.length()); TPtrC appIdDes(static_cast(appId.utf16()), appId.length()); @@ -236,11 +266,62 @@ TInt fileHandle; TPckg fileHandlePckg(fileHandle); TIpcArgs args(&oriDes, &appIdDes, &screenIdDes, &fileHandlePckg); - TInt fsHandle = SendReceive(HbSplashSrvGetSplash, args); + TInt fsHandle = SendReceive(HbSplashSrvGetSplashFile, args); return f.AdoptFromServer(fsHandle, fileHandle) == KErrNone; } -static uchar *load_symbian(const Params ¶ms) +uchar *HbSplashSrvClient::getSplashFromBitmap(const QString &ori, + const QString &appId, + const QString &screenId, + Params ¶ms) +{ + TPtrC oriDes(static_cast(ori.utf16()), ori.length()); + TPtrC appIdDes(static_cast(appId.utf16()), appId.length()); + TPtrC screenIdDes(static_cast(screenId.utf16()), screenId.length()); + TInt bitmapHandle; + TPckg bitmapHandlePckg(bitmapHandle); + TIpcArgs args(&oriDes, &appIdDes, &screenIdDes, &bitmapHandlePckg); + if (SendReceive(HbSplashSrvGetSplashData, args) == KErrNone) { + QScopedPointer bmp(new CFbsBitmap); + if (bmp->Duplicate(bitmapHandle) == KErrNone) { + TSize size = bmp->SizeInPixels(); + TDisplayMode mode = bmp->DisplayMode(); + if (size.iWidth > 0 && size.iHeight > 0 && mode == EColor16MAP) { + int bpl = CFbsBitmap::ScanLineLength(size.iWidth, mode); + const QImage::Format fmt = QImage::Format_ARGB32_Premultiplied; + int len = bpl * size.iHeight; + uchar *data = 0; + try { + if (params.allocFunc) { + data = params.allocFunc(size.iWidth, size.iHeight, + bpl, fmt, params.allocFuncParam); + } else { + data = new uchar[len]; + } + if (data) { + memcpy(data, bmp->DataAddress(), len); + *params.w = size.iWidth; + *params.h = size.iHeight; + *params.bpl = bpl; + *params.fmt = fmt; + qDebug("[hbsplash] bitmap data received"); + return data; + } + } catch (const std::bad_alloc &) { + qWarning("[hbsplash] Failed to allocate image buffer"); + } + } else { + qWarning("[hbsplash] Invalid bitmap (%d %d %d)", + size.iWidth, size.iHeight, mode); + } + } else { + qWarning("[hbsplash] Cannot duplicate bitmap"); + } + } + return 0; +} + +static uchar *load_symbian(Params ¶ms) { HbSplashSrvClient client; if (!client.Connect()) { @@ -252,15 +333,20 @@ if (appIdStr.isEmpty()) { RProcess process; appIdStr = QString::number(process.SecureId().iId, 16); + process.Close(); } uchar *data = 0; - File f; - f.mFullName = "[unavailable]"; - if (client.getSplash(f.mFile, oriStr, appIdStr, params.screenId)) { - qDebug("[hbsplash] got handle from server"); - data = readSpl(f, params); - f.mFile.Close(); + if (!params.forceFile) { + data = client.getSplashFromBitmap(oriStr, appIdStr, params.screenId, params); + } else { + File f; + f.mFullName = "[unavailable]"; + if (client.getSplashFileHandle(f.mFile, oriStr, appIdStr, params.screenId)) { + qDebug("[hbsplash] got handle from server"); + data = readSpl(f, params); + f.mFile.Close(); + } } client.Close(); @@ -269,7 +355,11 @@ #else -static uchar *read_file_generic(const QString &name, const Params ¶ms) +// Generic cross-platform implementation, reads the pixel data +// directly from files. Not suitable for Symbian due to platsec and +// performance reasons. + +static uchar *read_file_generic(const QString &name, Params ¶ms) { uchar *data = 0; File f; @@ -282,7 +372,7 @@ return data; } -static uchar *load_generic(const Params ¶ms) +static uchar *load_generic(Params ¶ms) { QString appSpecificName("splash_%1_%2.spl"); QString appAndScreenSpecificName("splash_%1_%2_%3.spl"); @@ -361,9 +451,65 @@ params.screenId = screenId; params.allocFunc = allocFunc; params.allocFuncParam = allocFuncParam; + params.forceFile = false; // use CFbsBitmap-based sharing on Symbian #ifdef Q_OS_SYMBIAN return load_symbian(params); #else return load_generic(params); #endif } + +#ifdef Q_OS_SYMBIAN +static uchar *fbsBitmapAllocFunc(int w, int h, int bpl, QImage::Format fmt, void *param) +{ + if (fmt != QImage::Format_ARGB32_Premultiplied) { + qWarning("[hbsplash] fbsBitmapAllocFunc: unsupported format %d", fmt); + return 0; + } + TDisplayMode mode = EColor16MAP; + CFbsBitmap *bmp = static_cast(param); + if (bmp->Create(TSize(w, h), mode) == KErrNone) { + int bmpBpl = CFbsBitmap::ScanLineLength(w, mode); + if (bpl == bmpBpl) { + return reinterpret_cast(bmp->DataAddress()); + } else { + qWarning("[hbsplash] fbsBitmapAllocFunc: bpl mismatch (%d - %d)", bpl, bmpBpl); + } + } else { + qWarning("[hbsplash] fbsBitmapAllocFunc: bitmap Create() failed"); + } + return 0; +} +#endif + +void *HbSplashDirectSymbian::load(void *file, int *extra) +{ +#ifdef Q_OS_SYMBIAN + // Read the data directly into a CFbsBitmap. `file' is assumed to + // be a ptr to an already Open()'ed RFile. + QScopedPointer bmp(new CFbsBitmap); + int w, h, bpl; + QImage::Format fmt; + Params params; + // Everything is ignored except the alloc-func and its param. + params.w = &w; + params.h = &h; + params.bpl = &bpl; + params.fmt = &fmt; + params.flags = HbSplashScreen::Default; + params.allocFunc = fbsBitmapAllocFunc; + params.allocFuncParam = bmp.data(); + File f; + f.mFile = *static_cast(file); + if (readSpl(f, params)) { + if (extra) { + *extra = params.extra; + } + return bmp.take(); + } +#else + Q_UNUSED(file); + Q_UNUSED(extra); +#endif + return 0; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsplash_direct_symbian_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/gui/hbsplash_direct_symbian_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,37 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBSPLASH_DIRECT_SYMBIAN_P_H +#define HBSPLASH_DIRECT_SYMBIAN_P_H + +#include "hbsplash_p.h" + +class HB_CORE_PRIVATE_EXPORT HbSplashDirectSymbian : public HbSplash +{ +public: + static void *load(void *file, int *extra); +}; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsplash_p.h --- a/src/hbcore/gui/hbsplash_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbsplash_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include -class HB_AUTOTEST_EXPORT HbSplash +class HB_CORE_PRIVATE_EXPORT HbSplash { public: typedef uchar *(*AllocFunc)(int w, int h, int bpl, QImage::Format fmt, void *param); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsplashdefs_p.h --- a/src/hbcore/gui/hbsplashdefs_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbsplashdefs_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,7 +39,8 @@ const TUid hbsplash_server_uid3 = { 0x2002E68B }; enum HbSplashServerFuncs { - HbSplashSrvGetSplash = 1 + HbSplashSrvGetSplashFile = 1, + HbSplashSrvGetSplashData }; enum HbSplashServerPanics { @@ -49,4 +50,8 @@ #endif // Q_OS_SYMBIAN +enum HbSplashStoredExtraFlags { + HbSplashNonStandardStatusBar = 1 +}; + #endif // HBSPLASHDEFS_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsplashscreen.cpp --- a/src/hbcore/gui/hbsplashscreen.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbsplashscreen.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,30 +24,10 @@ ****************************************************************************/ #include "hbsplashscreen.h" +#include "hbsplashscreen_generic_p.h" #include "hbsplash_p.h" #include -#include #include -#include -#include - -// To play nice with GPU resources it may be beneficial to avoid using QWidget -// for showing the splash screen. (each top-level widget results in creating a -// new window surface which consumes gpu memory) Instead, we can create & show a -// CCoeControl which draws using the traditional Symbian GC methods. (And thus -// uses the "legacy" surface which is still available currently. However if some -// day it is removed then this solution will not work anymore.) -#ifdef Q_OS_SYMBIAN -// Do not enable for now, may cause some flickering. -// The system transition effects may not like this solution anyway. -//#define HB_SPLASH_USE_SYMBIAN_LEGACY_SURFACE -#endif - -#ifdef HB_SPLASH_USE_SYMBIAN_LEGACY_SURFACE -#include -#include -#include -#endif /*! @stable @@ -90,50 +70,6 @@ result the splash screen will also be forced to horizontal orientation. */ -class HbSplashScreenInterface -{ -public: - virtual ~HbSplashScreenInterface() {} - virtual void start(HbSplashScreen::Flags flags) = 0; - virtual void release() = 0; -}; - -class HbSplashScreenGeneric : public QWidget, public HbSplashScreenInterface -{ -public: - HbSplashScreenGeneric(); - ~HbSplashScreenGeneric(); - - void start(HbSplashScreen::Flags flags); - void release(); - -private: - void paintEvent(QPaintEvent *event); - void repaint(); - - uchar *mImageData; - QPixmap mContents; -}; - -#ifdef HB_SPLASH_USE_SYMBIAN_LEGACY_SURFACE - -class HbSplashScreenSymbian : public CCoeControl, public HbSplashScreenInterface -{ -public: - HbSplashScreenSymbian(); - ~HbSplashScreenSymbian(); - - void start(HbSplashScreen::Flags flags); - void release(); - -private: - void Draw(const TRect &rect) const; - - CFbsBitmap *mContents; -}; - -#endif // HB_SPLASH_USE_SYMBIAN_LEGACY_SURFACE - static HbSplashScreenInterface *splashScreen = 0; struct RequestProps { @@ -153,13 +89,7 @@ void HbSplashScreen::start(Flags flags) { if (!splashScreen) { - splashScreen = -#ifdef HB_SPLASH_USE_SYMBIAN_LEGACY_SURFACE - new HbSplashScreenSymbian -#else - new HbSplashScreenGeneric -#endif - ; + splashScreen = new HbSplashScreenGeneric; } splashScreen->start(flags | requestProps()->mSplashFlags); } @@ -244,6 +174,8 @@ requestProps()->mScreenId = screenId; } +const int auto_stop_interval = 10000; // 10 sec + HbSplashScreenGeneric::HbSplashScreenGeneric() : QWidget(0, Qt::SplashScreen), mImageData(0) { @@ -251,7 +183,10 @@ HbSplashScreenGeneric::~HbSplashScreenGeneric() { - delete mImageData; + if (mImageData) { + qDebug("[hbsplash] destroying splash screen"); + delete mImageData; + } } void HbSplashScreenGeneric::release() @@ -269,19 +204,27 @@ mImageData = HbSplash::load(w, h, bpl, fmt, flags, props->mAppId, props->mScreenId); if (mImageData) { - QImage img(mImageData, w, h, bpl, fmt); - mContents = QPixmap::fromImage(img); + mContents = QImage(mImageData, w, h, bpl, fmt); resize(mContents.size()); } } if (!mContents.isNull()) { + qDebug("[hbsplash] splash screen initialized"); #ifdef Q_OS_SYMBIAN - showFullScreen(); + showFullScreen(); // krazy:exclude=qmethods #else show(); #endif QApplication::processEvents(); QApplication::flush(); + // The splash screen must be destroyed automatically when + // loosing foreground. + if (QApplication::instance()) { + QApplication::instance()->installEventFilter(this); + } + // The splash screen must be destroyed automatically after + // a certain amount of time. + mTimerId = startTimer(auto_stop_interval); } } catch (const std::bad_alloc &) { } @@ -291,7 +234,7 @@ { Q_UNUSED(event); QPainter painter(this); - painter.drawPixmap(QPointF(0, 0), mContents); + painter.drawImage(QPointF(0, 0), mContents); } void HbSplashScreenGeneric::repaint() @@ -300,84 +243,23 @@ QApplication::flush(); } -#ifdef HB_SPLASH_USE_SYMBIAN_LEGACY_SURFACE - -HbSplashScreenSymbian::HbSplashScreenSymbian() - : mContents(0) -{ -} - -HbSplashScreenSymbian::~HbSplashScreenSymbian() -{ - delete mContents; -} - -void HbSplashScreenSymbian::release() +void HbSplashScreenGeneric::timerEvent(QTimerEvent *event) { - delete this; -} - -static uchar *fbsBitmapAllocFunc(int w, int h, int bpl, QImage::Format fmt, void *param) -{ - if (fmt != QImage::Format_ARGB32_Premultiplied) { - qWarning("HbSplash: fbsBitmapAllocFunc: unsupported format %d", fmt); - return 0; - } - TDisplayMode mode = EColor16MAP; - CFbsBitmap *bmp = static_cast(param); - if (bmp->Create(TSize(w, h), mode) == KErrNone) { - int bmpBpl = CFbsBitmap::ScanLineLength(w, mode); - if (bpl == bmpBpl) { - return reinterpret_cast(bmp->DataAddress()); - } else { - qWarning("HbSplash: fbsBitmapAllocFunc: bpl mismatch (%d - %d)", bpl, bmpBpl); - } + if (event->timerId() == mTimerId) { + qDebug("[hbsplash] timeout while splash screen is active"); + deleteLater(); + splashScreen = 0; } else { - qWarning("HbSplash: fbsBitmapAllocFunc: bitmap Create() failed"); - } - return 0; -} - -void HbSplashScreenSymbian::start(HbSplashScreen::Flags flags) -{ - try { - if (!mContents) { - mContents = new CFbsBitmap; - int w, h, bpl; - QImage::Format fmt; - RequestProps *props = requestProps(); - if (HbSplash::load(w, h, bpl, fmt, flags, - props->mAppId, props->mScreenId, - fbsBitmapAllocFunc, mContents)) - { - TRect rect(TPoint(0, 0), TSize(w, h)); - TRAPD(err, { - CreateWindowL(); - RWindow *window = static_cast(DrawableWindow()); - window->SetSurfaceTransparency(ETrue); - SetRect(rect); - ActivateL(); }); - if (err == KErrNone) { - MakeVisible(ETrue); - DrawNow(); - } else { - qWarning("HbSplash: symbian control init failed (%d)", err); - } - } else { - delete mContents; - mContents = 0; - } - } - } catch (const std::bad_alloc &) { + QWidget::timerEvent(event); } } -void HbSplashScreenSymbian::Draw(const TRect &rect) const +bool HbSplashScreenGeneric::eventFilter(QObject *obj, QEvent *event) { - Q_UNUSED(rect); - if (mContents) { - SystemGc().BitBlt(TPoint(0, 0), mContents); + if (event->type() == QEvent::ApplicationDeactivate) { + qDebug("[hbsplash] foreground lost while splash screen is active"); + deleteLater(); + splashScreen = 0; } + return QWidget::eventFilter(obj, event); } - -#endif // HB_SPLASH_USE_SYMBIAN_LEGACY_SURFACE diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbsplashscreen_generic_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/gui/hbsplashscreen_generic_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBSPLASHSCREENGENERIC_P_H +#define HBSPLASHSCREENGENERIC_P_H + +#include "hbsplashscreen.h" +#include +#include + +class HbSplashScreenInterface +{ +public: + virtual ~HbSplashScreenInterface() {} + virtual void start(HbSplashScreen::Flags flags) = 0; + virtual void release() = 0; +}; + +class HbSplashScreenGeneric : public QWidget, public HbSplashScreenInterface +{ +public: + HbSplashScreenGeneric(); + ~HbSplashScreenGeneric(); + + void start(HbSplashScreen::Flags flags); + void release(); + +private: + void paintEvent(QPaintEvent *event); + void repaint(); + void timerEvent(QTimerEvent *event); + bool eventFilter(QObject *obj, QEvent *event); + + uchar *mImageData; + QImage mContents; + int mTimerId; +}; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbstackedwidget.cpp --- a/src/hbcore/gui/hbstackedwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbstackedwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,14 +32,14 @@ @hbcore \class HbStackedWidget \brief HbStackedWidget manages geometries of stacked layout contents. - + HbStackedLayout is a simple container that allows client add several widgets - and then select one widget to be shown. This widget will manage visibility - and focus in addition to size and position. + and then select one widget to be shown. This widget will manage visibility + and focus in addition to size and position. Example code: \snippet{stackedwidgetsample.cpp,1} - + \sa HbStackedLayout */ @@ -52,7 +52,7 @@ HbStackedWidgetPrivate() : mCurrentIndex(-1), mLayout(0) {} void setCurrentIndex(int index, QGraphicsWidget *prev, bool hideOld = true, bool showNew = true); - + int mCurrentIndex; HbStackedLayout *mLayout; }; @@ -71,10 +71,11 @@ } QGraphicsWidget *next = q->widgetAt(index); - if (next == prev) + if (next == prev) { return; + } - QGraphicsWidget* focused = 0; + QGraphicsWidget *focused = 0; if (prev) { focused = prev->focusWidget(); // Set previous widget invisible. Focus will be reset after this statement. @@ -105,7 +106,7 @@ d->q_ptr = this; HbStackedLayout *layout = new HbStackedLayout; - setLayout( layout ); + setLayout(layout); d->mLayout = layout; } @@ -163,13 +164,13 @@ { Q_D(HbStackedWidget); int addedIndex = d->mLayout->insertItem(index, widget); // this will usually reparent 'widget' - if ( addedIndex != -1 ) { + if (addedIndex != -1) { // Need to store current index, since it might change // during "widgetAdded" signal (someone might call back // e.g. "setCurrentIndex". int currentIndex = d->mCurrentIndex; emit widgetAdded(addedIndex); - if ( currentIndex == d->mCurrentIndex ) { + if (currentIndex == d->mCurrentIndex) { // Current index not touched from outside. if (d->mCurrentIndex < 0) { setCurrentIndex(addedIndex); @@ -203,23 +204,23 @@ { Q_D(HbStackedWidget); int index = indexOf(widget); - if ( index == -1 ) { + if (index == -1) { return; } d->mLayout->removeAt(index); - if ( index == d->mCurrentIndex ) { + if (index == d->mCurrentIndex) { d->mCurrentIndex = -1; int c = count(); - if ( c > 0 ) { - int newIndex = (index == c) ? index-1 : index; + if (c > 0) { + int newIndex = (index == c) ? index - 1 : index; d->setCurrentIndex(newIndex, widget); } else { // The last widget was removed. widget->setVisible(false); - emit currentChanged( -1 ); + emit currentChanged(-1); } - } else if ( index <= d->mCurrentIndex ) { + } else if (index <= d->mCurrentIndex) { d->mCurrentIndex--; emit currentChanged(d->mCurrentIndex); } @@ -241,7 +242,7 @@ QGraphicsWidget *HbStackedWidget::removeAt(int index) { QGraphicsWidget *widget = widgetAt(index); - if ( widget ) { + if (widget) { removeWidget(widget); } return widget; @@ -275,7 +276,7 @@ QGraphicsWidget *HbStackedWidget::widgetAt(int index) const { Q_D(const HbStackedWidget); - return static_cast(d->mLayout->itemAt(index)); + return static_cast(d->mLayout->itemAt(index)); } /*! @@ -315,14 +316,14 @@ \param index position of the new current widget. */ - /*! - \brief Sets current widget from specified index. +/*! + \brief Sets current widget from specified index. - This method will set the widget at given \a index visible and - the previous widget invisible. + This method will set the widget at given \a index visible and + the previous widget invisible. - \param index position of desired widget. - */ + \param index position of desired widget. +*/ void HbStackedWidget::setCurrentIndex(int index) { Q_D(HbStackedWidget); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtestabilitysignal.cpp --- a/src/hbcore/gui/hbtestabilitysignal.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtestabilitysignal.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,9 +27,9 @@ HbTestabilitySignal_p::HbTestabilitySignal_p(QObject *parent) : QObject(parent), testabilitySignal(false), - enabledChangeObserver(0), observerParam(0) + enabledChangeObserver(0), observerParam(0) { - setObjectName("HbTestabilitySignal"); + setObjectName("HbTestabilitySignal"); } HbTestabilitySignal_p::~HbTestabilitySignal_p() @@ -38,18 +38,18 @@ void HbTestabilitySignal_p::enableSignal(bool enabled) { - testabilitySignal = enabled; - if (enabledChangeObserver) { - enabledChangeObserver(enabled, observerParam); - } + testabilitySignal = enabled; + if (enabledChangeObserver) { + enabledChangeObserver(enabled, observerParam); + } } bool HbTestabilitySignal_p::signalEnabled() const { - return testabilitySignal; + return testabilitySignal; } -void HbTestabilitySignal_p::notifySignalEnabled(void (*observer)(bool, void*), void *param) +void HbTestabilitySignal_p::notifySignalEnabled(void (*observer)(bool, void *), void *param) { enabledChangeObserver = observer; observerParam = param; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtestabilitysignal_p.h --- a/src/hbcore/gui/hbtestabilitysignal_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtestabilitysignal_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -35,18 +35,18 @@ Q_OBJECT public: - HbTestabilitySignal_p(QObject *parent = 0); - ~HbTestabilitySignal_p(); - void enableSignal(bool enabled = false); - bool signalEnabled() const; - void notifySignalEnabled(void (*observer)(bool, void*), void *param); - + HbTestabilitySignal_p(QObject *parent = 0); + ~HbTestabilitySignal_p(); + void enableSignal(bool enabled = false); + bool signalEnabled() const; + void notifySignalEnabled(void (*observer)(bool, void *), void *param); + signals: - void propertyChanges(QGraphicsItem::GraphicsItemChange change, const QVariant &value); + void propertyChanges(QGraphicsItem::GraphicsItemChange change, const QVariant &value); private: - bool testabilitySignal; - void (*enabledChangeObserver)(bool, void*); + bool testabilitySignal; + void (*enabledChangeObserver)(bool, void *); void *observerParam; friend class HbWidget; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtoolbar.cpp --- a/src/hbcore/gui/hbtoolbar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtoolbar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -57,20 +57,30 @@ \class HbToolBar \brief HbToolBar is a toolbar decorator. - The HbToolBar class represents an HbView toolbar. It provides the interface for adding actions - to the toolbar. + The HbToolBar class represents an HbView toolbar. It provides the + interface for adding actions to the toolbar. + Toolbar actions are added using one of the addAction() methods. - Calling addAction() adds an HbToolButton to the toolbar and triggers the action when the button - is pressed. The image and text specified with the action are applied to the toolbar button. + Calling addAction() adds an HbToolButton to the toolbar and + triggers the action when the button is pressed. The image and text + specified with the action are applied to the toolbar button. - HbToolBar also provides methods for adding pop-up toolbar extensions, represented by - HbToolBarExtension objects. + HbToolBar also provides methods for adding pop-up toolbar + extensions, represented by HbToolBarExtension objects. Example usage: \dontinclude ultimatecodesnippet/ultimatecodesnippet.cpp \skip Start of snippet 1 \until End of snippet 1 + Note: calling hide() or setVisible(bool) on toolbar is not + recommended. Instead, use \a HbView::setItemVisible(), as in + this example: + \dontinclude ultimatecodesnippet/ultimatecodesnippet.cpp + \skip Start of snippet 59 + \until End of snippet 59 + + */ /*! @@ -271,28 +281,39 @@ d->delayedHide = d->hasEffects; } } else { - if (d->mVisibleToolButtons.count()){ - d->emitVisibilityChangeSignal = true; - QMetaObject::invokeMethod(&d->core, "visibilityChanged", Qt::QueuedConnection); - } if(d->moreExtension && d->moreExtension->isVisible()){ d->moreExtension->setVisible(false); } + bool hideDelayed = d->delayedHide; if (d->delayedHide && d->hasEffects) { // about to hide and we wanna delay hiding - if (!d->hidingInProgress) { // Prevent reentrance - d->hidingInProgress = true; - d->startDisappearEffect(); + // This check solves the situation where toolbar is hidden by its parent. + // Delayed hide changes explicit bit in qgraphicsitem which makes + // toolbar to stay hidden when parent becomes visible again. + // There is a small misbehaviour when parentItem is hidden and hide was explicitely + // called for toolbar. In this case toolbar hides without the effect. + if ((!parentItem() || (parentItem() && parentItem()->isVisible()))) { + if (!d->hidingInProgress) { // Prevent reentrance + d->hidingInProgress = true; + d->startDisappearEffect(); + d->delayedHide = false; + } + } else { + d->delayedHide = false; } } - if (d->delayedHide) { + if (hideDelayed) { return true; } else { d->delayedHide = d->hasEffects; d->hidingInProgress = false; #ifdef HB_EFFECTS - HbEffect::cancel(this, QString(), true); + HbEffect::cancel(this, QString(), true); #endif } + if (d->mVisibleToolButtons.count()){ + d->emitVisibilityChangeSignal = true; + QMetaObject::invokeMethod(&d->core, "visibilityChanged", Qt::QueuedConnection); + } } break; default: @@ -332,16 +353,13 @@ */ void HbToolBar::hideEvent(QHideEvent *event) { - Q_D(HbToolBar); - if (d->mPressedDownButton && d->mPressedDownButton->isDown()) { - d->mPressedDownButton->setDown(false); - d->mPressedDownButton = 0; - d->mPreviouslyPressedDownButton = d->mPressedDownButton; - } HbWidget::hideEvent(event); } /*! + \reimp + */ +/*! \reimp */ bool HbToolBar::event(QEvent *event) @@ -387,4 +405,16 @@ } } +/*! + \reimp + */ +void HbToolBar::polish(HbStyleParameters ¶ms) +{ + Q_D(HbToolBar); + HbWidget::polish(params); + if (d->mDoLayoutPending) { + d->doLayout(); + } +} + #include "moc_hbtoolbar.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtoolbar.h --- a/src/hbcore/gui/hbtoolbar.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtoolbar.h Thu Jul 22 16:36:53 2010 +0100 @@ -72,6 +72,7 @@ void resizeEvent( QGraphicsSceneResizeEvent *event ); void hideEvent(QHideEvent *event); bool event( QEvent *event ); + virtual void polish(HbStyleParameters ¶ms); private: Q_DECLARE_PRIVATE_D( d_ptr, HbToolBar ) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtoolbar_p.cpp --- a/src/hbcore/gui/hbtoolbar_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtoolbar_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ +#include "hbtoolbar_p.h" #include "hbtoolbar.h" -#include "hbtoolbar_p.h" #include "hbaction.h" #include "hbtoolbutton.h" #include "hbtoolbutton_p.h" @@ -44,7 +44,6 @@ #include // for QWIDGETSIZE_MAX #include #include -#include #ifdef HB_EFFECTS #include "hbeffectinternal_p.h" @@ -52,6 +51,10 @@ bool HbToolBarPrivate::effectsLoaded = false; #endif +//If minimum button size cannot be calculated +//more button will appear after default button count is exceeded +static const int DEFAULT_TOOLBUTTON_COUNT = 5; + HbToolBarPrivate::HbToolBarPrivate() : mLayout(0), mPressedDownButton(0), @@ -89,8 +92,6 @@ void HbToolBarPrivate::init() { - Q_Q(HbToolBar); - q->grabGesture(Qt::PanGesture); } void HbToolBarPrivate::doLazyInit() @@ -172,7 +173,7 @@ void HbToolBarPrivate::calculateMaximumButtons() { Q_Q(HbToolBar); - maxToolBarButtons = 2; + maxToolBarButtons = DEFAULT_TOOLBUTTON_COUNT; if (!minimumToolButtonSize.isEmpty()) { if (mOrientation == Qt::Horizontal) { if ((q->size().width() > 0) && (q->size().width() > minimumToolButtonSize.width())) @@ -233,7 +234,7 @@ } } -//This is called when toolbar recives resizeevent. +//This is called when toolbar receives resize event. //we check if a full layout is needed than call doLayout. //if maxVisiblebuttons have changed than also we do a complete //layout @@ -248,9 +249,11 @@ calculateMaximumButtons(); if (currentMaxButtons == maxToolBarButtons) return; + if (mVisibleToolButtons.count()<=maxToolBarButtons && (!moreExtensionButton || - (moreExtensionButton && !moreExtensionButton->action()->isVisible()))) { + (moreExtensionButton && + !HbToolButtonPrivate::d_ptr(moreExtensionButton)->action->isVisible()))) { return; } doLayout(); @@ -262,13 +265,16 @@ if (maxToolBarButtons == -1 || !minimumToolButtonSize.isValid() || !mLayout) return true; int totalButtons = mVisibleToolButtons.count()-1; + if (totalButtons>maxToolBarButtons -1 && (!moreExtensionButton || - (moreExtensionButton && !moreExtensionButton->action()->isVisible()))) { + (moreExtensionButton && + !HbToolButtonPrivate::d_ptr(moreExtensionButton)->action->isVisible()))) { return true; } if (totalButtons<=maxToolBarButtons && - (moreExtensionButton && moreExtensionButton->action()->isVisible())) { + (moreExtensionButton && + HbToolButtonPrivate::d_ptr(moreExtensionButton)->action->isVisible())) { return true; } return false; @@ -307,7 +313,8 @@ setExtensionLayout(button, true); if (!button->parentItem() || button->parentItem() != moreExtension->contentWidget()){ button->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred)); - QObject::connect(button->action(), SIGNAL(triggered(bool)), + QAction *action = HbToolButtonPrivate::d_ptr(button)->action; + QObject::connect(action, SIGNAL(triggered(bool)), moreExtension, SLOT(close())); button->setParentItem(moreExtension->contentWidget()); } @@ -328,7 +335,8 @@ button->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored)); if (movingFromExtension){ - QObject::disconnect(button->action(), SIGNAL(triggered(bool) ), + QAction *action = HbToolButtonPrivate::d_ptr(button)->action; + QObject::disconnect(action, SIGNAL(triggered(bool) ), moreExtension, SLOT(close())); HbToolButtonPrivate::d_ptr(button)->setExtensionBackgroundVisible(false); polishButtons = true; @@ -341,13 +349,14 @@ } } -//resets all visible buttons list.This is called when actionChange event is recieved +//resets all visible buttons list.This is called when actionChange event is received //by toolbar and from doLayout when mDoLayoutPending is true void HbToolBarPrivate::resetVisibleButtonsList() { mVisibleToolButtons.clear(); foreach(HbToolButton *button, mToolButtons) { - if (button->action()->isVisible()) { + QAction *action = HbToolButtonPrivate::d_ptr(button)->action; + if (action->isVisible()) { mVisibleToolButtons.append(button); button->setVisible(true); } else { @@ -358,55 +367,64 @@ //creates a new toolbutton and calls actionAdded if update is true. //update can be true in cases where toolbar is polished and actionAdded -//event is recieved by toolbar. +//event is received by toolbar. //we emit visibilitychanged signal here if this is the firstAction added in cases //after toolbar is polished and visible. -void HbToolBarPrivate::createToolButton(QAction *Action, bool update) +void HbToolBarPrivate::createToolButton(QAction *newAction, bool update) { Q_Q(HbToolBar); - if(!Action) + if(!newAction) return; - HbAction* action = qobject_cast(Action); + + HbAction* hbAction = qobject_cast(newAction); - if (action) { - // Find out index where to insert button - int index = q->actions().indexOf(Action); + // Find out index where to insert button + int index = q->actions().indexOf(newAction); + HbToolButton *button = new HbToolButton; + + if (hbAction) { // Lets give the action manager possibility to calculate position for the action - if (action->commandRole() != HbAction::NoRole) { + if (hbAction->commandRole() != HbAction::NoRole) { // Create action manager when needed if (!actionManager) { actionManager = new HbActionManager(HbView::ToolBar, q, q->mainWindow()); } if (actionManager){ - index = actionManager->position(action, q->actions(), mVisibleToolButtons.count()); + index = actionManager->position(hbAction, q->actions(), mVisibleToolButtons.count()); } } - HbToolButton *button = new HbToolButton(action); - HbToolButtonPrivate::d_ptr(button)->mDialogToolBar = mDialogToolBar; - setButtonLayoutDirection(*button); - mToolButtons.insert(index, button); - if (action->isVisible()){ - int visibleIndex = 0; - for (int i = 0; i < index; i++) { - if (mToolButtons.at(i)->action()->isVisible()) - visibleIndex++; + button->setAction(hbAction); + } + else { + // The new action's type is QAction. + HbToolButtonPrivate::d_ptr(button)->action = newAction; + QObject::connect(newAction, SIGNAL(triggered()), button, SLOT(_q_actionTriggered())); + QObject::connect(newAction, SIGNAL(changed()), button, SLOT(_q_actionChanged())); + } + + HbToolButtonPrivate::d_ptr(button)->mDialogToolBar = mDialogToolBar; + setButtonLayoutDirection(*button); + mToolButtons.insert(index, button); + if (newAction->isVisible()){ + int visibleIndex = 0; + for (int i = 0; i < index; i++) { + QAction *action = HbToolButtonPrivate::d_ptr(mToolButtons.at(i))->action; + if (action->isVisible()) + visibleIndex++; + } + mVisibleToolButtons.insert(visibleIndex, button); + if (update){ + if (emitVisibilityChangeSignal) { + delayedStartEffects = !mSuppressNextAppearEffect; + QMetaObject::invokeMethod(&core, "visibilityChanged"); + emitVisibilityChangeSignal = false; } - mVisibleToolButtons.insert(visibleIndex, button); - if (update){ - if (emitVisibilityChangeSignal) { - delayedStartEffects = !mSuppressNextAppearEffect; - QMetaObject::invokeMethod(&core, "visibilityChanged"); - emitVisibilityChangeSignal = false; - } - actionAdded(visibleIndex); - } + actionAdded(visibleIndex); } } - else { - qWarning() << "Use HbAction instead of QAction!"; - } + } //called from doLayout.We update the more button and extension as needed @@ -416,7 +434,7 @@ if (moreExtension) { HbToolBarExtensionPrivate::d_ptr(moreExtension)->mToolButtons.clear(); HbToolBarExtensionPrivate::d_ptr(moreExtension)->contentWidget->setLayout(0); - moreExtensionButton->action()->setVisible(moreButtonNeeded); + HbToolButtonPrivate::d_ptr(moreExtensionButton)->action->setVisible(moreButtonNeeded); moreExtensionButton->setVisible(moreButtonNeeded); } else if (moreButtonNeeded && !moreExtension) { @@ -540,7 +558,8 @@ bool moreButtonNeeded = visibleItemsCount > maxToolBarButtons; if (moreButtonNeeded || - (moreExtensionButton && moreExtensionButton->action()->isVisible() != moreButtonNeeded)) { + (moreExtensionButton && + HbToolButtonPrivate::d_ptr(moreExtensionButton)->action->isVisible() != moreButtonNeeded)) { updateExtension(moreButtonNeeded); } @@ -620,7 +639,7 @@ HbToolButton *button = 0; for (int i = 0; i < mToolButtons.count(); i++) { button = mToolButtons.at(i); - if (button->action() == event->action()) { + if (button && HbToolButtonPrivate::d_ptr(button)->action == event->action()) { mToolButtons.removeAt(i); // Emit signal when the only action is removed if (mToolButtons.count() == 0) { @@ -636,20 +655,21 @@ QMetaObject::invokeMethod(&core, "visibilityChanged", Qt::QueuedConnection); return; } + int index = mVisibleToolButtons.indexOf(button); + if (index != -1){ + mVisibleToolButtons.removeAt(index); + if (mVisibleToolButtons.isEmpty()){ + q->setLayout(0); + mLayout = 0; + } + else + actionRemoved(index,button); + } + delete button; + break; } } - int index = mVisibleToolButtons.indexOf(button); - if (index != -1){ - mVisibleToolButtons.removeAt(index); - if (mVisibleToolButtons.isEmpty()){ - q->setLayout(0); - mLayout = 0; - } - else - actionRemoved(index,button); - } - delete button; } void HbToolBarPrivate::updateButtonStyle(HbToolButton *button,bool notInExtension) @@ -664,11 +684,14 @@ Qt::Orientation buttonOrientation = q->orientation() == Qt::Vertical ? Qt::Horizontal : Qt::Vertical; HbToolButtonPrivate::d_ptr(button)->setOrientation( buttonOrientation ); - if (!button->action()->icon().isNull()) { + QAction *qAction = HbToolButtonPrivate::d_ptr(button)->action; + HbAction *hbAction = qobject_cast(qAction); + + if ((hbAction && !hbAction->icon().isNull()) || !qAction->icon().isNull()) { if ((notInExtension) && q->orientation() == Qt::Vertical) { button->setToolButtonStyle(HbToolButton::ToolButtonIcon); - } else if (!button->action()->text().isEmpty()) { + } else if (!HbToolButtonPrivate::d_ptr(button)->action->text().isEmpty()) { button->setToolButtonStyle(HbToolButton::ToolButtonTextAndIcon); } else { button->setToolButtonStyle(HbToolButton::ToolButtonIcon); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtoolbarextension.cpp --- a/src/hbcore/gui/hbtoolbarextension.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtoolbarextension.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,6 @@ #include #include #include -#include #include /*! @@ -69,6 +68,11 @@ \fn int HbToolBarExtension::type() const */ +/*! + \primitives + \primitive{background} HbFrameItem representing the extension background. + */ + HbToolBarExtensionPrivate::HbToolBarExtensionPrivate() : HbDialogPrivate(), mToolButtons(), @@ -107,9 +111,8 @@ void HbToolBarExtensionPrivate::doLazyInit() { - Q_Q(HbToolBarExtension); if ( !lazyInitDone ) { - q->setBackgroundItem( HbStyle::P_ToolBarExtension_background ); + setBackgroundItem(HbStyle::P_ToolBarExtension_background); #ifdef HB_EFFECTS if (!extensionEffectsLoaded){ HbEffectInternal::add("HB_TBE", "tbe_button_click", "clicked"); @@ -152,7 +155,7 @@ return; foreach (HbToolButton* button, mToolButtons) { - button->setVisible(button->action()->isVisible()); + button->setVisible(HbToolButtonPrivate::d_ptr(button)->action->isVisible()); } mLayout = new QGraphicsGridLayout(); @@ -160,7 +163,7 @@ mLayout->setSpacing(0.0); // if non zero spacing needed, add to css for ( int i(0), j(0), ie(mToolButtons.count()); i < ie; ++i ) { HbToolButton *button = mToolButtons.at(i); - if ( button->action()->isVisible() ) { + if ( HbToolButtonPrivate::d_ptr(button)->action->isVisible() ) { // Calculate the row and column indices column = ( j % columns ); row = ( (j - column) / columns ); @@ -204,38 +207,46 @@ { Q_Q(HbToolBarExtension); - HbAction *action = qobject_cast( event->action() ); - - if (action) { - HbToolButton *button = new HbToolButton(action, q->contentWidget()); + HbToolButton *button = 0; - if (!button->action()->icon().isNull()) { - if (button->action()->text().isEmpty()) { - button->setToolButtonStyle(HbToolButton::ToolButtonIcon); - } else { - button->setToolButtonStyle(HbToolButton::ToolButtonTextAndIcon); - } - } else { - button->setToolButtonStyle(HbToolButton::ToolButtonText); - } + HbAction *hbAction = qobject_cast( event->action() ); - button->setProperty("toolbutton_extension_layout", true); - button->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, - QSizePolicy::Preferred) ); - - // Find out index where to insert button - int index = q->actions().indexOf( event->action() ); + if (hbAction) { + if (!q->contentWidget()) { + initialiseContent(); // create now to prevent mem leak below + } + button = new HbToolButton(hbAction, q->contentWidget()); + } else { + button = new HbToolButton(q->contentWidget()); + HbToolButtonPrivate::d_ptr(button)->action = event->action(); + QObject::connect(event->action(), SIGNAL(triggered()), button, SLOT(_q_actionTriggered())); + QObject::connect(event->action(), SIGNAL(changed()), button, SLOT(_q_actionChanged())); + } - mToolButtons.insert( index, button ); - - q->connect(button, SIGNAL(clicked()), q, SLOT(_q_animateButtonClicked())); - q->connect(action, SIGNAL(triggered()), q, SLOT(close())); - - if (contentWidget){ - doLayout(); + if ((hbAction && !hbAction->icon().isNull()) || !event->action()->icon().isNull()) { + if (HbToolButtonPrivate::d_ptr(button)->action->text().isEmpty()) { + button->setToolButtonStyle(HbToolButton::ToolButtonIcon); + } else { + button->setToolButtonStyle(HbToolButton::ToolButtonTextAndIcon); } } else { - qWarning() << "Use HbAction instead of QAction!"; + button->setToolButtonStyle(HbToolButton::ToolButtonText); + } + + button->setProperty("toolbutton_extension_layout", true); + button->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, + QSizePolicy::Preferred) ); + + // Find out index where to insert button + int index = q->actions().indexOf( event->action() ); + + mToolButtons.insert( index, button ); + + q->connect(button, SIGNAL(clicked()), q, SLOT(_q_animateButtonClicked())); + q->connect(event->action(), SIGNAL(triggered()), q, SLOT(close())); + + if (contentWidget){ + doLayout(); } } @@ -243,7 +254,7 @@ { for ( int i(0); i < mToolButtons.count(); ++i ) { HbToolButton *button = mToolButtons.at(i); - if ( button->action() == event->action() ) { + if ( HbToolButtonPrivate::d_ptr(button)->action == event->action() ) { mToolButtons.removeAt(i); if (contentWidget) { mLayout->removeAt(i); @@ -304,7 +315,7 @@ Q_Q(HbToolBarExtension); HbToolButton *button = static_cast(q->sender()); if (button) { - HbEffect::start(button, "TBEButtonClicked", "clicked"); + HbEffect::start(button, "HB_TBE", "clicked"); } #endif } @@ -328,7 +339,6 @@ */ HbToolBarExtension::~HbToolBarExtension() { - disconnect(); } /*! @@ -444,6 +454,9 @@ return HbDialog::event(event); } +/*! + \reimp + */ void HbToolBarExtension::polish( HbStyleParameters ¶ms ) { Q_D(HbToolBarExtension); @@ -460,9 +473,7 @@ params.addParameter( ColsPortrait ); params.addParameter( ColsLandscape ); d->initialiseContent(); - if (d->mDefaultContentWidget) { - QGraphicsWidget *tbeContentWidget = contentWidget(); - style()->setItemName( tbeContentWidget, "HbToolBarExtension" ); + if (d->mDefaultContentWidget) { HbDialog::polish(params); if ( params.value( Margins ).isValid() && params.value( RowsPortrait ).isValid() diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtoolbutton.cpp --- a/src/hbcore/gui/hbtoolbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtoolbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -42,6 +42,7 @@ #include #include +#include /*! @stable @@ -120,6 +121,13 @@ \fn int HbToolButton::type() const */ +/*! + \primitives + \primitive{background} HbFrameItem representing the background frame of the button. + \primitive{icon} HbIconItem representing the icon of the button. + \primitive{text} HbTextItem representing button text. + */ + HbToolButtonPrivate::HbToolButtonPrivate() : action(0), textItem(0), @@ -235,24 +243,30 @@ Q_Q(HbToolButton); mRepolishRequested = true; polishPending = false; - q->updateGeometry(); - QSizeF size = q->minimumSize(); //Workaround (causing extra polish) mSizeHintPolish = false; //workaround ends + q->updateGeometry(); + QCoreApplication::sendPostedEvents(q, QEvent::LayoutRequest); + QSizeF size = q->minimumSize(); return size; } void HbToolButtonPrivate::_q_actionTriggered() { Q_Q(HbToolButton); - emit q->triggered(action); + // Only emit triggered signal for HbActions, not QActions. + // triggered(QAction*) requires an API change we don't want to do right now. + HbAction *hbAction = qobject_cast(action); + if (hbAction) + emit q->triggered(hbAction); } void HbToolButtonPrivate::_q_actionChanged() { Q_Q(HbToolButton); - if (!action->icon().isNull()) { + HbAction *hbAction = qobject_cast(action); + if ((hbAction && !hbAction->icon().isNull()) || !action->icon().isNull()) { if (orientation == Qt::Horizontal) { buttonStyle = HbToolButton::ToolButtonIcon; } else if (!action->text().isEmpty()) { @@ -265,7 +279,8 @@ } // action text/icon may have changed, if (polished) { - q->repolish(); + q->repolish(); + QCoreApplication::sendPostedEvents(q, QEvent::Polish); } } @@ -314,7 +329,7 @@ HbAction *HbToolButton::action() const { Q_D(const HbToolButton); - return d->action; + return qobject_cast(d->action); } /*! @@ -336,7 +351,7 @@ disconnect(d->action, SIGNAL(changed()), this, SLOT(_q_actionChanged())); } - HbAction *oldAction = d->action; + QAction *oldAction = d->action; d->action = action; if (d->action) { connect(action, SIGNAL(triggered()), this, SLOT(_q_actionTriggered())); @@ -480,14 +495,16 @@ } if (d->iconItem) { style()->updatePrimitive(d->iconItem, HbStyle::P_ToolButton_icon, &option); - if (d->action && d->action->icon().flags() & HbIcon::Colorized) { - static_cast(d->iconItem)->setFlags(HbIcon::Colorized); + HbAction *hbAction = qobject_cast(d->action); + if (hbAction) { + if (hbAction->icon().flags() & HbIcon::Colorized) { + static_cast(d->iconItem)->setFlags(HbIcon::Colorized); + } + if (hbAction->icon().mirroringMode() != HbIcon::Default) { + HbIconItem *iconItem = static_cast(d->iconItem); + iconItem->setMirroringMode( hbAction->icon().mirroringMode() ); + } } - if (d->action && d->action->icon().mirroringMode() != HbIcon::Default) { - HbIconItem *iconItem = static_cast(d->iconItem); - iconItem->setMirroringMode( d->action->icon().mirroringMode() ); - } - } } @@ -518,7 +535,12 @@ if (d->action) { option->text = d->action->text(); - option->icon = d->action->icon(); + HbAction *hbAction = qobject_cast(d->action); + if (hbAction) + option->icon = hbAction->icon(); + else + option->icon = d->action->icon(); + option->isToolBarExtension = d->toolbarExtensionFrame; } } @@ -541,8 +563,9 @@ if (event->newSize() != event->oldSize() && d->polished && isVisible()) { updatePrimitives(); } - if (action() && action()->toolBarExtension()) { - HbToolBarExtensionPrivate::d_ptr(action()->toolBarExtension())->placeToolBarExtension(); + HbAction *hbAction = qobject_cast(d->action); + if ( hbAction && hbAction->toolBarExtension()) { + HbToolBarExtensionPrivate::d_ptr(hbAction->toolBarExtension())->placeToolBarExtension(); } } @@ -556,9 +579,10 @@ if (!d->action) { return; } - if ( d->action->toolBarExtension() ) { - HbToolBarExtensionPrivate::d_ptr(d->action->toolBarExtension())->mExtendedButton = this; - d->action->toolBarExtension()->show(); + HbAction *hbAction = qobject_cast(d->action); + if ( hbAction && hbAction->toolBarExtension() ) { + HbToolBarExtensionPrivate::d_ptr(hbAction->toolBarExtension())->mExtendedButton = this; + hbAction->toolBarExtension()->show(); } d->action->trigger(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtoolbutton_p.h --- a/src/hbcore/gui/hbtoolbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtoolbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,6 @@ class HbToolButton; class HbStyle; class HbTextItem; -class HbAction; class HbToolButtonPrivate : public HbAbstractButtonPrivate { @@ -63,7 +62,7 @@ void setLayoutProperty(const char *name, bool value); QSizeF getMinimumSize(); - QPointer action; + QPointer action; HbTextItem *textItem; //Workaround should be QGraphicsItem QGraphicsItem *iconItem; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtooltip.cpp --- a/src/hbcore/gui/hbtooltip.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtooltip.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -138,7 +138,12 @@ void HbToolTip::hideText( HbGraphicsScene *scene ) { if ( scene && scene->d_ptr->mToolTip) { - scene->d_ptr->mToolTip->hide(); + if (scene->d_ptr->mToolTip->isVisible()) { + scene->d_ptr->mToolTip->hide(); + } else { + //reset tooltip timers + scene->d_ptr->mToolTip->hideTextImmediately(); + } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbtooltiplabel_p.cpp --- a/src/hbcore/gui/hbtooltiplabel_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbtooltiplabel_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -57,7 +57,7 @@ void HbToolTipLabelPrivate::init() { Q_Q(HbToolTipLabel); - q->setBackgroundItem(HbStyle::P_ToolTip_background); + setBackgroundItem(HbStyle::P_ToolTip_background); q->setFocusPolicy(Qt::NoFocus); q->setTimeout(HbPopup::NoTimeout); @@ -78,7 +78,7 @@ #endif } -/* +/*! Checks if there is an item under scenePos that has tooltip. If it finds an item it sends an QGraphicsSceneHelpEvent event to it. If the event is not handled by the item it uses default implementation to display tooltip. @@ -198,7 +198,7 @@ q->show(); } -/* +/*! Returns true if item is a tooltip blocking item. For example HbPopup background item is tooltip blocking for modal popups. */ @@ -212,7 +212,7 @@ return false; } -/* +/*! \class HbToolTipLabel \brief HbToolTipLabel is a convenience widget that displays a small message box. Compared to traditional popup, a tooltip does not dim the background. @@ -230,11 +230,15 @@ { } -/* +/*! + \primitives + \primitive{background} HbFrameItem representing the tooltip background frame. + */ + +/*! This method can be used to eventHook tool tip triggering and dismissal logic to a scene event flow. */ - void HbToolTipLabel::eventHook(QEvent *event) { Q_D(HbToolTipLabel); @@ -268,12 +272,11 @@ } -/* +/*! Returns the text of the tooltip. \sa setText() */ - QString HbToolTipLabel::text() const { Q_D(const HbToolTipLabel); @@ -284,7 +287,7 @@ } } -/* +/*! Sets the text of the tooltip. \sa text() @@ -300,7 +303,7 @@ d->label->setText(newText); } -/* +/*! If you specify a non-empty rect the tip will be hidden as soon as you move your cursor out of this area. @@ -313,7 +316,7 @@ } -/* +/*! Displays tooltip using preferredAlignment regarding item. \sa hideText() @@ -330,8 +333,8 @@ d->mItem = item; } -/* - Hides tooltip +/*! + Hides tooltip. \sa hideText() */ @@ -352,8 +355,8 @@ close(); } -/* - Timer event to show tooltip or hide the tool tip immediately +/*! + Timer event to show tooltip or hide the tool tip immediately. */ void HbToolTipLabel::timerEvent(QTimerEvent *event) { @@ -366,10 +369,9 @@ } } -/* - reimp +/*! + \reimp */ -#include bool HbToolTipLabel::event(QEvent *event) { Q_D(HbToolTipLabel); @@ -386,8 +388,8 @@ return HbPopup::event(event); } -/* - reimp +/*! + \reimp */ void HbToolTipLabel::polish(HbStyleParameters ¶ms) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbview.cpp --- a/src/hbcore/gui/hbview.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -43,25 +43,25 @@ /*! @stable @hbcore - \class HbView - \brief The HbView class defines one screen of user interface content. - + \class HbView + \brief The HbView class defines one screen of user interface content. + The screen area of a mobile device is small, so an application's user interface is often composed of a set of separate screens of content or "views". Each view can contain a number of widgets. A view can also contain a title, an icon (not used at present), a menu and a toolbar. These additional components are called decorators and together they make up the "chrome" of the interface. - + An application will have a number of views to present different kinds of information to the user. You can add multiple views to the \link HbMainWindow main window \endlink of your application and then manage them through the main window object. When a view is activated, the main window handles the updating of the view contents, i.e. the title, icon, menu and toolbar. The view object itself handles the visibility of the toolbar, but the main window will repaint it whenever the view is activated. \image html hbview_wireframes.png "Wireframes of two different views in a messaging application" - + \section _usecases_hbview Using the HbView class In general, the actual widgets, menu and toolbar that make up the content of a view will be designed with a UI layout tool. This means you do not need to use code to place each widget into the layout but instead load the layout from a file with HbDocumentLoader. Once the view is populated with widgets, you can manipulate them and connect their signals to methods in your application. See the HbMainWindow class for information about switching between different views. - \subsection _uc_001_hbview Hiding and showing the chrome + \subsection _uc_001_hbview Hiding and showing the chrome The chrome, (i.e. title, menu and toolbar of the view) can be hidden to allow your application to fill the whole screen. Also, individual components of the chrome can be hidden if desired. - \code + \code // Hide all the chrome items myView.setContentFullScreen(true) @@ -118,12 +118,13 @@ Defines policy for showing the HbTitleBar in the current HbView. */ /*! - \var HbView::ViewFlagNone + \var HbView::ViewFlagNone Titlebar and statusbar is shown with the default attributes. */ /*! \var HbView::ViewTitleBarMinimizable - When this flag is set, there will be an indication in the titlebar showing the possibility to minimize the titlebar, e.g. swipe it off the screen. + When this flag is set, there will be an indication in the titlebar showing the possibility to + minimize the titlebar, e.g. swipe it off the screen. */ /*! \var HbView::ViewTitleBarMinimized @@ -131,33 +132,46 @@ */ /*! \var HbView::ViewTitleBarHidden - Do not show the title bar at all. The title bar handle is not shown and it is not possible to maximize the title bar. + Do not show the title bar at all. + The title bar handle is not shown and it is not possible to maximize the title bar. */ /*! \var HbView::ViewTitleBarTransparent - Show normal style title bar but make it transparent. This flag is normally used in combination with TitleBarFloating flag. + Show normal style title bar but make it transparent. + This flag is normally used in combination with TitleBarFloating flag. */ /*! \var HbView::ViewTitleBarFloating - Show the title bar floating on top of the underlying content. Setting this flag also make the application area start from the top of the screen. This flag is normally used in combination with TitleBarTransparent flag. + Show the title bar floating on top of the underlying content. + Setting this flag also make the application area start from the top of the screen. + This flag is normally used in combination with TitleBarTransparent flag. */ /*! \var HbView::ViewStatusBarHidden - Do not show the statusbar at all. This flag is normally used in combination with the ViewTitleBarHidden flag. + Do not show the statusbar at all. + This flag is normally used in combination with the ViewTitleBarHidden flag. */ /*! \var HbView::ViewStatusBarTransparent - Show the statusbar with normal content but transparent. This flag is normally used in combination with ViewStatusBarFloating flag. + Show the statusbar with normal content but transparent. + This flag is normally used in combination with ViewStatusBarFloating flag. */ /*! \var HbView::ViewStatusBarFloating - Show the statusbar on top of the underlying content. Setting this flag also changes the application area to start from the top of the screen. This flag is normally used in combination with the ViewStatusBarTransparent flag. + Show the statusbar on top of the underlying content. + Setting this flag also changes the application area to start from the top of the screen. + This flag is normally used in combination with the ViewStatusBarTransparent flag. +*/ +/*! + \var HbView::ViewDisableRelayout + This flag disables relayoting of the view when hiding the title and/or status bar. + This flag is normally used in combination with ViewTitleBarHidden and/or ViewStatusBarHiddenflag. */ /*! \enum HbView::ActionContainer Defines the default container when you add actions to a view. - + \sa navigationAction() */ /*! @@ -177,7 +191,7 @@ \fn void HbView::titleChanged(const QString &title) This signal is emitted when the title is replaced by a different title. - + \sa setTitle() */ @@ -185,7 +199,7 @@ \fn void HbView::iconChanged(const HbIcon &icon) This signal is emitted when the icon is replaced by a different icon. - + \sa setIcon() */ @@ -193,31 +207,31 @@ \fn void HbView::toolBarChanged() This signal is emitted when toolbar is replaced by a different toolbar. - + \sa setToolBar() */ /*! \fn void HbView::visibleItemsChanged() - + This signal is emitted when items in the chrome (e.g. toolbar, menu) are made visible or hidden. - + \sa visibleItems() */ /*! \fn void HbView::contentFullScreenChanged() - + This signal is emitted when the view is set to occupy the whole screen. - + \sa setContentFullScreen() */ /*! \fn void HbView::dockWidgetChanged() - + This signal is emitted when the dock widget is replaced by a different dock widget. - + \sa setDockWidget() */ @@ -229,9 +243,9 @@ \internal */ HbViewPrivate::HbViewPrivate() - : mLayout(0), - menu(0), - toolBar(0), + : mLayout(0), + menu(0), + toolBar(0), dockWidget(0), widget(0), mVisibleItems(Hb::AllItems), @@ -251,6 +265,9 @@ */ HbViewPrivate::~HbViewPrivate() { + delete menu; + delete toolBar; + delete dockWidget; } /*! @@ -266,11 +283,11 @@ /*! \internal */ -HbView::HbView( HbViewPrivate &dd, QGraphicsItem *parent ): +HbView::HbView(HbViewPrivate &dd, QGraphicsItem *parent): HbWidget(dd, parent) { Q_D(HbView); - d->q_ptr = this; + d->q_ptr = this; } /*! @@ -278,16 +295,6 @@ */ HbView::~HbView() { - Q_D(HbView); - if (d->menu) { - d->menu->deleteLater(); - } - if (d->toolBar) { - d->toolBar->deleteLater(); - } - if (d->dockWidget) { - d->dockWidget->deleteLater(); - } } /*! @@ -371,7 +378,7 @@ { Q_D(HbView); if (d->menu != menu) { - if(d->menu) { + if (d->menu) { d->menu->deleteLater(); } d->menu = menu; @@ -389,9 +396,9 @@ } /*! - Returns the toolbar for the view. If the view does not already have a toolbar, an - empty toolbar is created and returned to the caller but the toolBarChanged() - signal is not emitted. + Returns the toolbar for the view. If the view does not already have a toolbar, an + empty toolbar is created and returned to the caller but the toolBarChanged() + signal is not emitted. Ownership is not transferred. @@ -430,15 +437,15 @@ Removes the toolbar from the view and returns it to the caller. Ownership of the toolbar is transferred to the caller. -\note This function is particularly useful if you want to switch to a +\note This function is particularly useful if you want to switch to a different view and keep the same toolbar. \sa setToolBar() */ -HbToolBar* HbView::takeToolBar() +HbToolBar *HbView::takeToolBar() { Q_D(HbView); - HbToolBar* toolBar = d->toolBar; + HbToolBar *toolBar = d->toolBar; d->toolBar = 0; // Reset the ownership @@ -512,23 +519,23 @@ if (widget) { if (!d->mLayout) { d->mLayout = new HbStackedLayout; - d->mLayout->setContentsMargins( 0.0, 0.0, 0.0, 0.0 ); - d->mLayout->setMinimumSize( 0.0, 0.0 ); - setLayout( d->mLayout ); + d->mLayout->setContentsMargins(0.0, 0.0, 0.0, 0.0); + d->mLayout->setMinimumSize(0.0, 0.0); + setLayout(d->mLayout); } else { Q_ASSERT(d->mLayout->count() == 1); - d->mLayout->removeAt( 0 ); + d->mLayout->removeAt(0); } - d->mLayout->addItem( widget ); + d->mLayout->addItem(widget); } else { if (d->mLayout) { // "setLayout( 0 )" deletes the existing layout. - setLayout( 0 ); + setLayout(0); d->mLayout = 0; } } delete d->widget; - d->widget = widget; + d->widget = widget; } } @@ -536,19 +543,21 @@ Removes the widget that makes up the view and returns the widget to the caller. Ownership of the widget is transferred to the caller. -\note This function is particularly useful if you want to use +\note This function is particularly useful if you want to use different widgets in a view without deleting them. +\note The widget is not removed from the scene. + \sa widget() setWidget() */ QGraphicsWidget *HbView::takeWidget() { Q_D(HbView); QGraphicsWidget *widget = d->widget; - if ( d->mLayout ) { - d->mLayout->removeAt( 0 ); + if (d->mLayout) { + d->mLayout->removeAt(0); // "setLayout( 0 )" deletes the existing layout. - setLayout( 0 ); + setLayout(0); d->mLayout = 0; } d->widget = 0; @@ -563,9 +572,9 @@ Makes the given scene items visible in this view. Changes are visible instantly if the view is active, otherwise they will be shown the next time the view is activated. - + The flag values in \a items override the corresponding settings in HbMainWindow. - + \sa hideItems() setItemVisible() isItemVisible() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen() */ void HbView::showItems(Hb::SceneItems items) @@ -590,8 +599,8 @@ view is activated. The flag values in \a items override the corresponding settings in HbMainWindow. - - + + \sa showItems() setItemVisible() isItemVisible() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen() */ void HbView::hideItems(Hb::SceneItems items) @@ -614,7 +623,7 @@ Returns the scene items that are visible in this view. \sa isItemVisible() setItemVisible() hideItems() showItems() unsetVisibleItems() isContentFullScreen() setContentFullScreen() - + */ Hb::SceneItems HbView::visibleItems() const { @@ -630,7 +639,7 @@ Returns \c true if \a item is set to be visible, otherwise returns \c false. \sa setItemVisible() hideItems() showItems() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen() - + */ bool HbView::isItemVisible(Hb::SceneItem item) const { @@ -642,11 +651,11 @@ Shows or hides the given scene item for the view. If \a visible is \c true, then the given \a item is shown. If \a visible is \c false, then the given \a item is hidden. - Changes are visible instantly if the view is active, otherwise they will be shown the next time the - view is activated. + Changes are visible instantly if the view is active, otherwise they will be shown the next time the + view is activated. This overrides the corresponding scene item settings in HbMainWindow. - + \sa isItemVisible() hideItems() showItems() unsetVisibleItems() visibleItems() isContentFullScreen() setContentFullScreen() */ void HbView::setItemVisible(Hb::SceneItem item, bool visible) @@ -670,10 +679,10 @@ } /*! - Makes the view content fill the whole screen area. The decorators that make up the chrome (such as + Makes the view content fill the whole screen area. The decorators that make up the chrome (such as signal bar, title pane etc.) can still be shown on top of view content. - Changes are visible instantly if the view is active, otherwise they will - be shown the next time the view is activated. + Changes are visible instantly if the view is active, otherwise they will + be shown the next time the view is activated. \sa isContentFullScreen() setItemVisible() isItemVisible() hideItems() showItems() visibleItems() */ @@ -763,26 +772,27 @@ } // Statusbar-visibility - if ( statusBar->isVisible() ){ - d->mVisibleItems |= Hb::StatusBarItem; + if (d->mViewFlags & HbView::ViewStatusBarHidden) { + d->mVisibleItems &= ~Hb::StatusBarItem; d->mVisibleItemsSet = true; } else { - d->mVisibleItems &= ~Hb::StatusBarItem; + d->mVisibleItems |= Hb::StatusBarItem; d->mVisibleItemsSet = true; } // Titlebar-visibility - if (titleBar->isVisible()){ - d->mVisibleItems |= Hb::TitleBarItem; + if (d->mViewFlags & HbView::ViewTitleBarHidden) { + d->mVisibleItems &= ~Hb::TitleBarItem; d->mVisibleItemsSet = true; - }else{ - d->mVisibleItems &= ~Hb::TitleBarItem; + } else { + d->mVisibleItems |= Hb::TitleBarItem; d->mVisibleItemsSet = true; } // Repolish the screen if needed - int visibilityFlags = HbView::ViewTitleBarMinimized | HbView::ViewTitleBarFloating - | HbView::ViewTitleBarMinimizable | HbView::ViewStatusBarHidden | HbView::ViewStatusBarFloating; + int visibilityFlags = HbView::ViewTitleBarMinimized | HbView::ViewTitleBarFloating + | HbView::ViewTitleBarMinimizable | HbView::ViewStatusBarHidden | HbView::ViewStatusBarFloating + | HbView::ViewTitleBarHidden | HbView::ViewDisableRelayout; if ((d->mViewFlags & visibilityFlags) != (originalFlags & visibilityFlags)) { HbMainWindowPrivate::d_ptr(mainWindow())->mClippingItem->decoratorVisibilityChanged(); } @@ -804,7 +814,7 @@ setViewFlags(d->mViewFlags &~ HbView::ViewTitleBarHidden); } else { setViewFlags(d->mViewFlags | HbView::ViewTitleBarHidden); - } + } } /*! @@ -829,13 +839,13 @@ \overload - This adds the \a action to the list of actions in the view. You specify a preferred container - in the UI where you would like the action to be added, e.g. the options menu or the toolbar. - However, if you choose the toolbar as the preferred container but no more buttons can fit in the - the toolbar, then the action might be moved to the options menu or it might displace another item in the toolbar. - The result depends on the prioties of the actions already in the toolbar compared with the priority of + This adds the \a action to the list of actions in the view. You specify a preferred container + in the UI where you would like the action to be added, e.g. the options menu or the toolbar. + However, if you choose the toolbar as the preferred container but no more buttons can fit in the + the toolbar, then the action might be moved to the options menu or it might displace another item in the toolbar. + The result depends on the prioties of the actions already in the toolbar compared with the priority of the action you are adding. - + Ownership of the \a action is not transferred. */ void HbView::addAction(HbAction *action, ActionContainer preferredActionContainer) @@ -858,10 +868,9 @@ QActionEvent *actionEvent = static_cast(event); HbAction *hbAction = qobject_cast(actionEvent->action()); // Forward command to action manager - d->actionManager->removeAction(hbAction); + d->actionManager->removeAction(hbAction); return true; - } - else if (event->type() == QEvent::ActionAdded) { + } else if (event->type() == QEvent::ActionAdded) { // Create action manager if needed if (!d->actionManager) { d->actionManager = new HbViewActionManager(this); @@ -869,7 +878,7 @@ QActionEvent *actionEvent = static_cast(event); HbAction *hbAction = qobject_cast(actionEvent->action()); // Forward command to action manager - d->actionManager->addAction(hbAction, d->preferredActionContainer); + d->actionManager->addAction(hbAction, d->preferredActionContainer); // Clear the variable after used d->preferredActionContainer = HbView::NotSpecified; return true; @@ -878,6 +887,28 @@ } /*! + \reimp + */ +void HbView::changeEvent(QEvent *event) +{ + + // We're listening for layout direction changes, because the screen needs to be + // repolished, if the layout direction changes and the titlebar is minimizable. + // We have to listen to the event here(and not in the titlebar), cause the layout + // direction change event is delivered to the titlebar (cause it does not mirror) + if (event->type() == QEvent::LayoutDirectionChange + && isVisible() + && (viewFlags() & ViewTitleBarMinimizable)) { + HbMainWindow *mw = mainWindow(); + if (mw && mw->currentView() == this) { + HbMainWindowPrivate::d_ptr(mw)->mClippingItem->decoratorVisibilityChanged(); + } + } + + HbWidget::changeEvent(event); +} + +/*! Removes the menu from the view and returns it to the caller. Ownership of the menu is transferred to the caller. @@ -886,10 +917,10 @@ \sa setMenu() */ -HbMenu* HbView::takeMenu() +HbMenu *HbView::takeMenu() { Q_D(HbView); - HbMenu* menu = d->menu; + HbMenu *menu = d->menu; d->menu = 0; // Reset the ownership @@ -907,10 +938,10 @@ #ifdef HB_EFFECTS /* - Handles effect finished event for title bar animation + Handles effect finished event for title bar animation */ void HbView::titleBarEffectFinished(const HbEffect::EffectStatus &status) -{ +{ Q_D(HbView); HbMainWindow *mw = mainWindow(); @@ -928,6 +959,7 @@ if (titleBar) { if (status.effectEvent == "disappear") { titleBar->setVisible(false); + titleBar->resetTransform(); } else { titleBar->setVisible(true); } @@ -936,10 +968,10 @@ } /* - Handles the effect finished event for title bar animation + Handles the effect finished event for title bar animation */ void HbView::statusBarEffectFinished(const HbEffect::EffectStatus &status) -{ +{ HbMainWindow *mw = mainWindow(); HbStatusBar *statusBar = HbMainWindowPrivate::d_ptr(mw)->mStatusBar; @@ -950,9 +982,10 @@ statusBar->propertiesChanged(); HbMainWindowPrivate::d_ptr(mw)->mClippingItem->decoratorVisibilityChanged(); - if (mw) { + if (mw) { if (status.effectEvent == "disappear") { statusBar->setVisible(false); + statusBar->resetTransform(); } else { statusBar->setVisible(true); } @@ -966,7 +999,7 @@ If setNavigationAction() has not been called for this view, then the default action will be returned. - + \sa setNavigationAction() */ HbAction *HbView::navigationAction() const diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbview.h --- a/src/hbcore/gui/hbview.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbview.h Thu Jul 22 16:36:53 2010 +0100 @@ -47,20 +47,21 @@ Q_PROPERTY(QString title READ title WRITE setTitle) Q_PROPERTY(HbIcon icon READ icon WRITE setIcon) Q_PROPERTY(bool contentFullScreen READ isContentFullScreen WRITE setContentFullScreen) + Q_PROPERTY(HbViewFlags viewFlags READ viewFlags WRITE setViewFlags) public: - enum HbViewFlag - { + enum HbViewFlag { ViewFlagNone = 0, - ViewTitleBarMinimizable = 0x01, - ViewTitleBarMinimized = 0x02, - ViewTitleBarHidden = 0x04, + ViewTitleBarMinimizable = 0x01, + ViewTitleBarMinimized = 0x02, + ViewTitleBarHidden = 0x04, ViewTitleBarTransparent = 0x08, ViewTitleBarFloating = 0x10, ViewStatusBarHidden = 0x20, ViewStatusBarTransparent = 0x40, - ViewStatusBarFloating = 0x80 + ViewStatusBarFloating = 0x80, + ViewDisableRelayout = 0x100 }; Q_DECLARE_FLAGS(HbViewFlags, HbViewFlag) @@ -74,11 +75,11 @@ HbMenu *menu() const; void setMenu(HbMenu *menu); - HbMenu* takeMenu(); + HbMenu *takeMenu(); HbToolBar *toolBar() const; void setToolBar(HbToolBar *toolBar); - HbToolBar* takeToolBar(); + HbToolBar *takeToolBar(); HbDockWidget *dockWidget() const; void setDockWidget(HbDockWidget *dockWidget); @@ -99,9 +100,11 @@ void setStatusBarVisible(bool visible); enum { Type = Hb::ItemType_View }; - int type() const { return Type; } + int type() const { + return Type; + } - enum ActionContainer{ + enum ActionContainer { NotSpecified, OptionsMenu, ToolBar @@ -126,9 +129,10 @@ void dockWidgetChanged(); protected: - HbView( HbViewPrivate &dd, QGraphicsItem *parent ); + HbView(HbViewPrivate &dd, QGraphicsItem *parent); bool event(QEvent *event); + void changeEvent(QEvent *event); private slots: #ifdef HB_EFFECTS diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbviewactionmanager.cpp --- a/src/hbcore/gui/hbviewactionmanager.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbviewactionmanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,22 +36,22 @@ @hbcore \class HbViewActionManager \brief HbViewActionManager is the class that decides switch to container - the action is placed (options menu or toolbar). + the action is placed (options menu or toolbar). Decision is based the UI commands distribution guide that is read automatically. \internal */ -/*! +/*! Constructor. */ HbViewActionManager::HbViewActionManager(HbView *view) : - QObject(view), view(view), toolBarMaxCount(99), + QObject(view), view(view), toolBarMaxCount(99), defaultContainer(HbView::OptionsMenu), orientation(Qt::Vertical) { if (view) { - HbMainWindow* mainWin = view->mainWindow(); + HbMainWindow *mainWin = view->mainWindow(); if (mainWin) { connect(mainWin, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(orientationChanged(Qt::Orientation))); @@ -62,7 +62,7 @@ createTemplate(); } -/*! +/*! Destructor. */ HbViewActionManager::~HbViewActionManager() @@ -70,7 +70,7 @@ } -/*! +/*! The function adds \a action to either menu's or toolbar's list of actions. The ownership of \a action is not transferred. @@ -85,15 +85,14 @@ if (preferredContainer == HbView::NotSpecified) { container = actualContainer(action, preferredContainer); } - + // Add action to right container if (container == HbView::OptionsMenu) { - view->menu()->addAction(action); - } - else if (container == HbView::ToolBar) { + view->menu()->addAction(action); + } else if (container == HbView::ToolBar) { view->toolBar()->addAction(action); if (view->toolBar()->actions().count() > toolBarMaxCount) { - moveActionToMenu(); + moveActionToMenu(); } } @@ -104,7 +103,7 @@ /*! The function removes \a action either menu's or toolbar's list of actions. - + The ownership of \a action is not transferred. */ void HbViewActionManager::removeAction(QAction *action) @@ -113,14 +112,14 @@ } /*! - The function replaces an old \a action either menu's or + The function replaces an old \a action either menu's or toolbar's list of actions. - + The ownership of \a action is transferred to the caller. */ void HbViewActionManager::replaceAction(QAction *oldAction, QAction *newAction) { - QMap::const_iterator i = + QMap::const_iterator i = distributedActions.find(oldAction); if (i != distributedActions.end()) { HbViewActionManager::Placement placement = i.value(); @@ -130,8 +129,7 @@ if (placement.container == HbView::OptionsMenu) { view->menu()->insertAction(oldAction, newAction); view->menu()->removeAction(oldAction); - } - else if (placement.container == HbView::ToolBar) { + } else if (placement.container == HbView::ToolBar) { view->toolBar()->insertAction(oldAction, newAction); view->toolBar()->removeAction(oldAction); } @@ -171,13 +169,11 @@ { if (containerString == "ToolBar") { defaultContainer = HbView::ToolBar; - } - else if (containerString == "OptionsMenu") { + } else if (containerString == "OptionsMenu") { defaultContainer = HbView::OptionsMenu; + } else { + defaultContainer = HbView::NotSpecified; } - else { - defaultContainer = HbView::NotSpecified; - } } /*! @@ -187,7 +183,7 @@ */ void HbViewActionManager::addGuideItem(const GuideItem &guideItem) { - distributionGuide.append(guideItem); + distributionGuide.append(guideItem); } /*! @@ -204,7 +200,7 @@ createTemplate(); // Remove actions from containers - QMapIterator i(distributedActions); + QMapIterator i(distributedActions); while (i.hasNext()) { i.next(); removeAction(i.key(), false); @@ -223,31 +219,29 @@ QString path(":/actionmanager/"); if (orientation == Qt::Vertical) { file.setFileName(path + "distribution_guide_vertical.xml"); - } - else { + } else { file.setFileName(path + "distribution_guide_horizontal.xml"); } - + if (!file.open(QIODevice::ReadOnly)) { qWarning("HbViewActionManager::createTemplate: opening file failed"); - } - else { + } else { HbActionManagerXmlParser reader(this); if (!reader.read(&file)) { qWarning("HbViewActionManager::createTemplate: reading file failed"); - } + } } } HbView::ActionContainer HbViewActionManager::actualContainer(QAction *action, - HbView::ActionContainer preferredContainer) + HbView::ActionContainer preferredContainer) { HbView::ActionContainer container(preferredContainer); HbAction *hbAction = qobject_cast(action); // use the default container, if the downcast failed cause then // we are not able to obtain the commandRole from the action - if(!hbAction){ + if (!hbAction) { return defaultContainer; } @@ -281,7 +275,7 @@ // Add actions to menu if it does not exist already if (view->menu()->actions().indexOf(action) < 0) { - view->menu()->addAction(action); + view->menu()->addAction(action); // Update private structure Placement placement(HbView::OptionsMenu, HbView::ToolBar); distributedActions.insert(action, placement); @@ -290,18 +284,17 @@ void HbViewActionManager::removeAction(QAction *action, bool removeFromMap) { - QMap::const_iterator i = + QMap::const_iterator i = distributedActions.find(action); if (i != distributedActions.end()) { // Remove from the container HbViewActionManager::Placement placement = i.value(); if (placement.container == HbView::OptionsMenu) { - view->menu()->removeAction(action); - } - else if (placement.container == HbView::ToolBar) { + view->menu()->removeAction(action); + } else if (placement.container == HbView::ToolBar) { view->toolBar()->removeAction(action); } - + if (removeFromMap) { // Remove from private structure distributedActions.remove(action); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbviewactionmanager_p.h --- a/src/hbcore/gui/hbviewactionmanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbviewactionmanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,22 +36,19 @@ public: - class Placement + class Placement { public: - Placement(HbView::ActionContainer container, + Placement(HbView::ActionContainer container, HbView::ActionContainer preferredContainer) : - container(container), preferredContainer(preferredContainer) - { + container(container), preferredContainer(preferredContainer) { } Placement(const QString &containerString) : - container(HbView::NotSpecified), preferredContainer(HbView::NotSpecified) - { + container(HbView::NotSpecified), preferredContainer(HbView::NotSpecified) { if (containerString == "ToolBar") { container = HbView::ToolBar; preferredContainer = HbView::ToolBar; - } - else { + } else { container = HbView::OptionsMenu; preferredContainer = HbView::OptionsMenu; } @@ -60,25 +57,22 @@ HbView::ActionContainer preferredContainer; }; - class GuideItem + class GuideItem { public: - GuideItem() - { + GuideItem() { } GuideItem(HbActionManager::TemplateItem templateItem, Placement placement) : - templateItem(templateItem) - { + templateItem(templateItem) { placements.append(placement); } - bool operator==(const GuideItem &other) const - { return (templateItem == other.templateItem); } - void setTemplateItem(HbActionManager::TemplateItem item) - { + bool operator==(const GuideItem &other) const { + return (templateItem == other.templateItem); + } + void setTemplateItem(HbActionManager::TemplateItem item) { templateItem = item; } - void addPlacement(Placement placement) - { + void addPlacement(Placement placement) { placements.append(placement); } HbActionManager::TemplateItem templateItem; @@ -98,15 +92,15 @@ void addGuideItem(const GuideItem &guideItem); public slots: - void orientationChanged(Qt::Orientation orientation); + void orientationChanged(Qt::Orientation orientation); private: void createTemplate(); HbView::ActionContainer actualContainer(QAction *action, - HbView::ActionContainer preferredContainer); - void moveActionToMenu(); + HbView::ActionContainer preferredContainer); + void moveActionToMenu(); void removeAction(QAction *action, bool removeFromMap); - QList containerActions(HbView::ActionContainer container); + QList containerActions(HbView::ActionContainer container); Q_DISABLE_COPY(HbViewActionManager) @@ -116,7 +110,7 @@ HbView::ActionContainer defaultContainer; Qt::Orientation orientation; QList distributionGuide; - QMap distributedActions; + QMap distributedActions; }; #endif // HBVIEWACTIONMANAGER_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbwidget.cpp --- a/src/hbcore/gui/hbwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,8 @@ #include "hbgraphicsscene.h" #include "hbgraphicsscene_p.h" #include "hbdeviceprofile.h" -#include "hbspaceritem_p.h" +#include "hbtapgesture.h" +#include "hbnamespace_p.h" #include #include #include @@ -67,8 +68,8 @@ polishPending(false), themingPending(true), repolishOutstanding(false), + mHandlingRepolishSynchronously(false), notifyScene(false), - pluginBaseId(0), focusGroup(0), focusActiveType(HbStyle::P_None), focusResidualType(HbStyle::P_None), @@ -89,70 +90,30 @@ delete backgroundItem; backgroundItem = 0; } - - // need to delete the hash values - QList deletedSpacers = mSpacers.values(); - mSpacers.clear(); - qDeleteAll( deletedSpacers ); -} - -/*! - Creates a new spacer item with the given \a name. - - Returns a pointer to the newly created spacer item. Widget keeps the ownership. -*/ -QGraphicsLayoutItem *HbWidgetPrivate::createSpacerItem( const QString &name ) -{ -#ifndef Q_OS_SYMBIAN - Q_ASSERT( !name.isEmpty() ); - // check in desktop environments that the item does not exist already - Q_ASSERT( !mSpacers.contains( name ) ); -#endif - - HbSpacerItem *newSpacer = new HbSpacerItem(); - mSpacers.insert( name, newSpacer ); - return newSpacer; } -/* - - \deprecated HbWidget::setBackgroundItem(HbStyle::Primitive, int) - is deprecated. Use HbWidget::setBackgroundItem(QGraphicsItem *item, int zValue) instead. - - Creates background item to the widget from style primitive. - - Creates a new background item to the widget and the reparents it to - be child of the widget. Also Z-value of the background item will be - changed to zValue. By default the zValue is -1, which should be - behind other widget content. Background item will be always resized - to be same size as the widgets bounding rect. - - If type is HbStyle::P_None, the background item will be removed from - widget. - - Previously set background item will be deleted. - */ -void HbWidget::setBackgroundItem(HbStyle::Primitive type, int zValue) +void HbWidgetPrivate::setBackgroundItem(HbStyle::Primitive type, int zValue) { - Q_D(HbWidget); - if(type!=d->backgroundPrimitiveType || type == HbStyle::P_None) { - if (d->backgroundItem) { - delete d->backgroundItem; - d->backgroundItem = 0; + Q_Q(HbWidget); + if(type!=backgroundPrimitiveType || type == HbStyle::P_None) { + if (backgroundItem) { + delete backgroundItem; + backgroundItem = 0; } - d->backgroundPrimitiveType = type; - d->backgroundItem = style()->createPrimitive(d->backgroundPrimitiveType, const_cast(this)); - if(d->backgroundItem) { - d->backgroundItem->setParentItem(this); + backgroundPrimitiveType = type; + backgroundItem = q->style()->createPrimitive(backgroundPrimitiveType, const_cast(q)); + if(backgroundItem) { + backgroundItem->setParentItem(q); } - updatePrimitives(); + q->updatePrimitives(); +} + if(backgroundItem && zValue != backgroundItem->zValue()) { + backgroundItem->setZValue(zValue); } - if(d->backgroundItem && zValue != d->backgroundItem->zValue()) { - d->backgroundItem->setZValue(zValue); - } -} +} -/* + +/*! Sets background item to the widget. The item will be reparented to be child of the widget. Also Z-value @@ -182,9 +143,10 @@ d->backgroundItem->setZValue(zValue); d->updateBackgroundItemSize(); } + updatePrimitives(); } -/* +/*! Returns background item. 0 is returned if there isn't background item in the widget. */ @@ -194,7 +156,7 @@ return d->backgroundItem; } -/* +/*! Returns focusItem primitive items. Focus primitive is created if has not been created already. */ @@ -221,7 +183,7 @@ return 0; } -/* +/*! Hides or shows focus primitive depending on the focus state of the widget. */ void HbWidgetPrivate::focusChangeEvent(HbWidget::FocusHighlight focusHighlight) @@ -265,7 +227,7 @@ } -/* +/*! Find closest parent with focus group and update the focused child. */ void HbWidgetPrivate::updateCurrentFocusChild() @@ -279,7 +241,7 @@ } } -/* +/*! Find and return the closest parent with focus group if any. If propagate is true then the closest parent with focus group and children is accepted as valid focus group e.g. used for a widget which has the key for changing the @@ -316,7 +278,7 @@ return (group) ? group : 0; } -/* +/*! Set focus to child widget depending on the set focus delegation policy. */ @@ -343,30 +305,6 @@ } } -/* - Test if some item in our parent hierarchy has - the Hb::InputMethodNeutral flag set. -*/ -bool HbWidgetPrivate::isInputMethodNeutral() -{ - Q_Q(HbWidget); - - // Test the widget itself... - if(q->testAttribute(Hb::InputMethodNeutral)) { - return true; - } - - // and then all parents - QGraphicsWidget* i = q->parentWidget(); - while(i) { - HbWidget* w = qobject_cast(i); - if(w && w->testAttribute(Hb::InputMethodNeutral)) { - return true; - } - i = i->parentWidget(); - } - return false; -} /*! \class HbWidget @@ -464,6 +402,7 @@ { Q_D( HbWidget ); d->q_ptr = this; + setAttribute(Hb::Widget, true); #ifdef HB_TESTABILITY if(d->testabilitySignal) { @@ -482,6 +421,7 @@ { Q_D( HbWidget ); d->q_ptr = this; + setAttribute(Hb::Widget, true); #ifdef HB_TESTABILITY if (d->testabilitySignal) { @@ -523,21 +463,6 @@ QCoreApplication::sendEvent( parentWidget(), &event1 ); //End of snippet 1 } - -#if QT_VERSION >= 0x040600 - if(!d->isInputMethodNeutral() && !(flags() & QGraphicsItem::ItemAcceptsInputMethod)) { - // Make sure the input panel is closed if this widget is not input method neutral or - // it does not accept input method - // Send close input panel event. - QInputContext *ic = qApp->inputContext(); - if (ic) { - QEvent *closeEvent = new QEvent(QEvent::CloseSoftwareInputPanel); - ic->filterEvent(closeEvent); - delete closeEvent; - } - } -#endif - } /*! @@ -619,22 +544,21 @@ } /*! - This function returns the base id of the style plugin of the widget or - \c 0 if the widget is not plugin based. + \deprecated HbWidget::pluginBaseId() + is deprecated. Style plugins are deprecated. */ int HbWidget::pluginBaseId() const { - Q_D(const HbWidget); - return d->pluginBaseId; + return 0; // deprecated } /*! - Sets the base id of the style plugin of the widget. + \deprecated HbWidget::setPluginBaseId(int) + is deprecated. Style plugins are deprecated. */ void HbWidget::setPluginBaseId( int baseId ) { - Q_D(HbWidget); - d->pluginBaseId = baseId; + Q_UNUSED(baseId); // deprecated } /*! @@ -697,7 +621,6 @@ } d->updateBackgroundItemSize(); } - if (d->focusPrimitive(HbWidget::FocusHighlightResidual)) { style()->updatePrimitive(d->focusPrimitive(HbWidget::FocusHighlightResidual), d->focusResidualType, &option); @@ -860,6 +783,15 @@ d->polishPending = false; HbStyleParameters params; polish( params ); + if (scene()) { + // The widget is polished again or is beign polished now. As we set layout to widget in polishEvent, + // inform scene to polish any new child items and handle any resulting layoutrequest + // events before drawing. + HbGraphicsScene *hbscene = qobject_cast(scene()); + if (hbscene) { + HbGraphicsScenePrivate::d_ptr(hbscene)->mPolishWidgets = true; + } + } } } else if (change == QGraphicsItem::ItemChildAddedChange) { @@ -932,12 +864,9 @@ backend). When overriding, always call the base classes impelentation. - If you are implementing a custom widget that has a style plugin - you must make sure that pluginBaseId is set. - \param params, For querying (custom) style parameters from HbStyle. - \sa polish(), pluginBaseId() + \sa polish() */ void HbWidget::polish( HbStyleParameters& params ) { @@ -975,6 +904,17 @@ d->repolishOutstanding = true; QEvent* polishEvent = new QEvent( QEvent::Polish ); QCoreApplication::postEvent(this, polishEvent); + // If no one is handling repolish synchronously, lets make sure they are handled + // before painting. For example view items handle them synchronously. + if (scene() && !d->mHandlingRepolishSynchronously) { + // The widget needs to be polished again. As we set layout to widget in polishEvent, + // inform scene to handle polish and any resulting layoutrequest + // events before drawing. + HbGraphicsScene *hbscene = qobject_cast(scene()); + if (hbscene) { + HbGraphicsScenePrivate::d_ptr(hbscene)->mRepolishWidgets = true; + } + } } } @@ -1034,17 +974,15 @@ /*! Returns primitive which HbStyle::itemName equals to \a itemName. - If the \a itemName is empty, the layout is returned. + If the \a itemName is empty, the layout is returned, otherwise + returns the primitive that matches the \a itemName. - If the \a itemName does not match any primitive, \a itemName is mapped to owned spacers. - If the \a itemName cannot be mapped to any of the above, returns 0. \sa HbStyle::itemName() */ QGraphicsLayoutItem *HbWidget::layoutPrimitive(const QString &itemName) const { - Q_D(const HbWidget); if ( itemName == "" ) { return layout(); } else { @@ -1056,11 +994,6 @@ } } } - - if ( d->mSpacers.contains(itemName) ) { - return d->mSpacers.value(itemName); - } - return 0; } @@ -1367,3 +1300,18 @@ } return primitive; } + +bool HbWidget::sceneEventFilter (QGraphicsItem *watched, QEvent *event) +{ + if(event->type() == QEvent::Gesture && watched->type() == Hb::ItemType_TouchArea) { + QGestureEvent* ge = static_cast(event); + HbTapGesture* tap = qobject_cast(ge->gesture(Qt::TapGesture)); + + if (tap && tap->state() == Qt::GestureStarted) { + tap->setProperty(HbPrivate::ThresholdRect.latin1(), watched->mapRectToScene(watched->boundingRect()).toRect()); + } + sceneEvent(event); + return true; + } + return HbWidgetBase::sceneEventFilter(watched, event); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbwidget.h --- a/src/hbcore/gui/hbwidget.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbwidget.h Thu Jul 22 16:36:53 2010 +0100 @@ -116,7 +116,6 @@ void setFocusHighlight(HbStyle::Primitive type, HbWidget::FocusHighlight focusHighlight); HbStyle::Primitive focusHighlight(HbWidget::FocusHighlight focusHighlight); - void setBackgroundItem(HbStyle::Primitive type, int zValue = -1); void setBackgroundItem(QGraphicsItem *item, int zValue = -1); QGraphicsItem *backgroundItem() const; @@ -139,6 +138,8 @@ void setPluginBaseId(int baseId); + bool sceneEventFilter (QGraphicsItem *watched, QEvent *event); + protected: HbWidget(HbWidgetPrivate &dd, QGraphicsItem *parent, Qt::WindowFlags wFlags=0); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbwidget_p.h --- a/src/hbcore/gui/hbwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -75,10 +75,7 @@ void updateBackgroundItemSize(); - bool isInputMethodNeutral(); - - QGraphicsLayoutItem *createSpacerItem( const QString &name ); - + void setBackgroundItem(HbStyle::Primitive type, int zValue = -1); HbWidget *q_ptr; HbStyle *style; @@ -91,13 +88,13 @@ bool polishPending; bool themingPending; bool repolishOutstanding; + bool mHandlingRepolishSynchronously; bool notifyScene; int pluginBaseId; HbFocusGroup *focusGroup; HbStyle::Primitive focusActiveType; HbStyle::Primitive focusResidualType; bool highlightExpired; - QHash mSpacers; private: mutable QGraphicsItem *backgroundItem; mutable QGraphicsItem *focusActiveItem; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbwidgetbase.cpp --- a/src/hbcore/gui/hbwidgetbase.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbwidgetbase.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -45,6 +45,12 @@ \brief HbWidgetBase is a common base for all Hb widgets and primitives. It contains common functionality shared between these two types. + HbWidgetBase disables the ItemSendsGeometryChanges and ItemUsesExtendedStyleOption flags + by default for performance reasons. + Custom widget should enable ItemSendsGeometryChanges flag to receive notifications for position + and transform changes.You should enable ItemUsesExtendedStyleOption if widget uses QStyleOptionGraphicsItem + i.eduring painting. + Currently HbWidgetBase offers the following functionality: - Layout direction locking */ @@ -64,6 +70,12 @@ { Q_Q( HbWidgetBase ); QGraphicsItem *item = q->parentItem(); + QGraphicsItem::GraphicsItemFlags itemFlags = q->flags(); +#if QT_VERSION >= 0x040600 + itemFlags &= ~QGraphicsItem::ItemSendsGeometryChanges; +#endif + itemFlags &= ~QGraphicsItem::ItemUsesExtendedStyleOption; + q->setFlags(itemFlags); if ( item ) { handleInsidePopup(item); } @@ -192,7 +204,25 @@ { Q_D(HbWidgetBase); - if( change == QGraphicsItem::ItemParentChange) { + if( change == QGraphicsItem::ItemVisibleChange) { + if (value.toBool()) { + // Applies same initialisation for Hb widgets as QGraphicsWidget. + // For Hb primitives size is not set as they will be later layouted by Hb widgets. + // This is done to avoid flickering as primitives tend to paint themselves before layouting, + // if they are added to existing layout. + // If Hb primitives are used standalone, their size and position must be set explicitly. + + // Send Show event before the item has been shown. + QShowEvent event; + QApplication::sendEvent(this, &event); + bool resized = testAttribute(Qt::WA_Resized); + if (!resized && testAttribute(Hb::Widget)) { + adjustSize(); + setAttribute(Qt::WA_Resized, false); + } + return QGraphicsItem::itemChange(change, value); + } + } else if( change == QGraphicsItem::ItemParentChange) { d->handleInsidePopup(value.value()); } return QGraphicsWidget::itemChange(change, value); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbwidgetbase_p.h --- a/src/hbcore/gui/hbwidgetbase_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/gui/hbwidgetbase_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,6 @@ #include #include -#include #include // @@ -42,6 +41,7 @@ // We mean it. // +class HbCssInspectorWindow; class HB_CORE_PRIVATE_EXPORT HbWidgetBasePrivate { @@ -63,9 +63,10 @@ AC_TextAlign = 0x02, AC_IconBrush = 0x04, AC_IconAspectRatioMode = 0x08, - AC_TextWrapMode = 0x10, - AC_TextLinesMin = 0x20, - AC_TextLinesMax = 0x40 + AC_IconAlign = 0x10, + AC_TextWrapMode = 0x20, + AC_TextLinesMin = 0x40, + AC_TextLinesMax = 0x80 }; inline void setApiProtectionFlag(HbWidgetBasePrivate::ApiCssProtectionFlags att, bool value) @@ -89,13 +90,14 @@ case Hb::InteractionDisabled: bit = 1; break; case Hb::InsidePopup: bit = 2; break; case Hb::InputMethodNeutral: bit = 3; break; + case Hb::Widget: bit = 4; break; default: break; } return bit; } quint32 mApiProtectionFlags; - quint32 attributes : 4; + quint32 attributes : 5; HbFontSpec fontSpec; HbWidgetBase *q_ptr; @@ -108,6 +110,7 @@ friend class HbStylePrivate; friend class HbDocumentLoaderActions; friend class HbWidgetLoaderActions; + friend class HbInputCheckBoxList; // for accessing setBackgroundItem #ifdef HB_CSS_INSPECTOR friend class HbCssInspectorWindow; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbwindowobscured_p.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/gui/hbwindowobscured_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,120 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include + +#include "hbmainwindow.h" +#include "hbwindowobscured_p.h" +#include "hbinstance.h" +#include "hbevent.h" + +#if defined(Q_WS_X11) +#include +#include +#endif // defined(Q_WS_X11) + + +#if defined(Q_OS_SYMBIAN) +#include +#include +#endif + +bool HbWindowObscured::filterInstalled = false; +QCoreApplication::EventFilter HbWindowObscured::prevEventFilter = 0; + +void HbWindowObscured::installWindowEventFilter() +{ + //Install only one eventfilter, HbMainWindow can be created multiple times. + if (!filterInstalled) { + prevEventFilter = qApp->setEventFilter(eventFilter); + filterInstalled = true; + } +} + +#if defined(Q_WS_X11) //eventfilter implementation for xlib +bool HbWindowObscured::eventFilter(void *message, long *result) +{ + XEvent *xEvent = (XEvent *)message; + + if (xEvent->type == VisibilityNotify) { + XVisibilityEvent *event = (XVisibilityEvent *)xEvent; + QList mainWindows = hbInstance->allMainWindows(); + int mainWindowCount = mainWindows.size(); + for (int index = 0; index < mainWindowCount; ++index) { + HbMainWindow *window = mainWindows[index]; + if (window != 0 && window->effectiveWinId() == event->window) { + bool obscuredState = (event->state == VisibilityFullyObscured); + + HbWindowObscuredChangedEvent obscureChangedEvent(obscuredState); + QCoreApplication::sendEvent(window, &obscureChangedEvent); + break; + } + } + + } + //Call the previous event filter if there is one, else return false with no filtering. + return prevEventFilter ? prevEventFilter(message, result) : false; +} +#elif defined(Q_WS_S60) //eventfilter implementation for symbian. +bool HbWindowObscured::eventFilter(void *message, long *result) +{ + QSymbianEvent *symEvent = static_cast(message); + if (symEvent->type() == QSymbianEvent::WindowServerEvent) { + const TWsEvent *wsEvent = symEvent->windowServerEvent(); + switch (wsEvent->Type()) { + case EEventWindowVisibilityChanged: { + // we need to generate an HbWindowObscuredChanged event. + CCoeControl *control = reinterpret_cast(wsEvent->Handle()); + RDrawableWindow *rWindow = control->DrawableWindow(); + QList mainWindows = hbInstance->allMainWindows(); + int mainWindowCount = mainWindows.size(); + for (int index = 0; index < mainWindowCount; ++index) { + HbMainWindow *window = mainWindows[index]; + if (window != 0 + && window->effectiveWinId()->DrawableWindow() == rWindow) { + + const TWsVisibilityChangedEvent *visChangedEvent = wsEvent->VisibilityChanged(); + bool obscuredState = + (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) ? + true : false; + + HbWindowObscuredChangedEvent obscureChangedEvent(obscuredState); + QCoreApplication::sendEvent(window, &obscureChangedEvent); + break; + } + } + } + } + } + //Call the previous event filter if there is one, else return false with no filtering. + return prevEventFilter ? prevEventFilter(message, result) : false; +} +#else //defined(Q_WS_S60) +//Generic evenfilter for non-supported platform i.e windows. Do nothing. +bool HbWindowObscured::eventFilter(void *, long *) +{ + return false; +} +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/gui/hbwindowobscured_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/gui/hbwindowobscured_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBWINDOWOBSCURED_P_H +#define HBWINDOWOBSCURED_P_H + +#include +#include + +class HB_CORE_PRIVATE_EXPORT HbWindowObscured +{ +public: + HbWindowObscured() { }; + ~HbWindowObscured() { }; + +public: + static void installWindowEventFilter(); + +private: + static bool eventFilter(void *message, long *result); + +private: + static bool filterInstalled; + static QCoreApplication::EventFilter prevEventFilter; +}; + +#endif //HBWINDOWOBSCURED_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/hbcore.pro --- a/src/hbcore/hbcore.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/hbcore.pro Thu Jul 22 16:36:53 2010 +0100 @@ -73,7 +73,7 @@ CONVENIENCE_HEADERS += $${HB_BUILD_DIR}/include/hbcore/hbcore.h CONVENIENCE_HEADERS += $$files($${HB_BUILD_DIR}/include/hbcore/Hb*) -HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS +HEADERS += $$PUBLIC_HEADERS $$RESTRICTED_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS # installation !local { @@ -83,12 +83,13 @@ pubheaders.files = $$PUBLIC_HEADERS pubheaders.path = $${HB_INCLUDE_DIR}/hbcore - privheaders.files = $$PRIVATE_HEADERS - privheaders.path = $${HB_INCLUDE_DIR}/hbcore/private + restheaders.files = $$RESTRICTED_HEADERS + restheaders.path = $${HB_INCLUDE_DIR}/hbcore/restricted + convheaders.files = $$CONVENIENCE_HEADERS convheaders.path = $${HB_INCLUDE_DIR}/hbcore - INSTALLS += target pubheaders privheaders convheaders + INSTALLS += target pubheaders restheaders convheaders win32:INSTALLS += dlltarget } @@ -103,6 +104,9 @@ TRANSLATIONS += i18n/translations/directorylocalizer_en_GB.ts TRANSLATIONS += i18n/translations/directorylocalizer_de_DE.ts TRANSLATIONS += i18n/translations/languages.ts +TRANSLATIONS += i18n/translations/collations.ts +TRANSLATIONS += i18n/translations/regions.ts +TRANSLATIONS += i18n/translations/languages_OLD.ts symbian { defFilePath = defs @@ -159,11 +163,11 @@ } # i18n's other files export BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/i18n/translations/language_list.txt $${EPOCROOT}epoc32/winscw/c/resource/hbi18n/translations/language_list.txt" + BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/i18n/translations/locale_mappings.txt $${EPOCROOT}epoc32/winscw/c/resource/hbi18n/translations/locale_mappings.txt" LIBS += -lapparc LIBS += -lavkon LIBS += -lbafl - LIBS += -lalfdecoderserverclient LIBS += -lSensrvClient LIBS += -lsensrvutil LIBS += -lcentralrepository @@ -173,6 +177,7 @@ LIBS += -lws32 LIBS += -lapgrfx LIBS += -lcone + LIBS += -lsystemtoneservice # central repository BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/resources/centralrepository/2002C304.txt $${EPOCROOT}epoc32/data/z/private/10202BE9/2002C304.txt" diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbdirectorynamelocalizer.cpp --- a/src/hbcore/i18n/hbdirectorynamelocalizer.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbdirectorynamelocalizer.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -48,6 +48,11 @@ */ +/*! + Constructor of HbDirectoryNameLocalizer. + + \attention Cross-Platform API + */ HbDirectoryNameLocalizer::HbDirectoryNameLocalizer() { HbDNTXmlReader* dirDataReader = new HbDNTXmlReader(); @@ -70,13 +75,18 @@ Translates the given source path to a localized string if possible. If localized version is not found returns an empty string. Should be only used for localizing directory names. + + \attention Symbian specific API - @param sourceText The path that is to be translated. - @return The translated string. If translation is not found returns + \param sourceText The path that is to be translated. + + \return Symbian - The translated string. If translation is not found returns an empty string. + \return other platforms - empty QString */ QString HbDirectoryNameLocalizer::translate( QString& sourceText ) const { +#if defined(Q_OS_SYMBIAN) if ( sourceText.length() == 0 ) { return ""; } @@ -94,4 +104,8 @@ } return result; +#else + Q_UNUSED(sourceText); + return QString(); +#endif } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbdirectorynamelocalizer.h --- a/src/hbcore/i18n/hbdirectorynamelocalizer.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbdirectorynamelocalizer.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef DIRECTORYNAMELOCALIZER_H_ -#define DIRECTORYNAMELOCALIZER_H_ +#ifndef DIRECTORYNAMELOCALIZER_H +#define DIRECTORYNAMELOCALIZER_H #include #include @@ -44,4 +44,4 @@ HbDirectoryNameLocalizerPrivate* d; }; -#endif /* DIRECTORYNAMELOCALIZER_H_ */ +#endif /* DIRECTORYNAMELOCALIZER_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbdirectorynamelocalizer_p.h --- a/src/hbcore/i18n/hbdirectorynamelocalizer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbdirectorynamelocalizer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef DIRECTORYNAMELOCALIZER_P_H_ -#define DIRECTORYNAMELOCALIZER_P_H_ +#ifndef DIRECTORYNAMELOCALIZER_P_H +#define DIRECTORYNAMELOCALIZER_P_H #include @@ -34,4 +34,4 @@ QMap localizedNames; }; -#endif /* DIRECTORYNAMELOCALIZER_H_ */ +#endif /* DIRECTORYNAMELOCALIZER_P_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbdntxmlreader.cpp --- a/src/hbcore/i18n/hbdntxmlreader.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbdntxmlreader.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,6 +32,9 @@ #define DirectoryLocalizerFile ":/i18n/hbdirectorylocalizer.xml" #define DirectoryLocalizerTranslationsFile "/resource/hbi18n/translations/directorylocalizer_" +/*! + Constructor of class. +*/ HbDNTXmlReader::HbDNTXmlReader() { fullPaths = NULL; @@ -81,6 +84,9 @@ } +/*! + Destructor of class. +*/ HbDNTXmlReader::~HbDNTXmlReader() { delete fullPaths; @@ -89,59 +95,75 @@ delete trans; } +/*! + This function is needed by XML reader. + + \return true +*/ bool HbDNTXmlReader::startDocument() { return true; } +/*! + This function is needed by XML reader. + + \param qName element which will be readed + \return true +*/ bool HbDNTXmlReader::startElement( const QString & , const QString & , const QString & qName, const QXmlAttributes & ) { - if( qName == DirectoryLocalizerPathStringsStr ) { - parsePathStrings = true; // set to parse Path - parseDirectoryPaths = false; - elements.clear(); - elementNumber = 0; // Set current path element number as undefined - twoDone = false; - } else if( qName == DirectoryLocalizerFullDirectoryPathsStr ) { - parsePathStrings = false; - parseDirectoryPaths = true; // set to parse localized path - elements.clear(); - elementNumber = 0; // set current path element as undefined - twoDone = false; - } else if( qName == DirectoryLocalizerNameStr ) { - elementNumber = 1; // - validElement = true; - twoDone = false; - } else if( qName == DirectoryLocalizerPathStr ){ - elementNumber = 2; - validElement = true; - twoDone = false; - } else if( qName == DirectoryLocalizerTranslationStr){ - elementNumber = 3; - validElement = true; - } else if( qName == DirectoryLocalizerRootPathStr ){ - elementNumber = 1; - validElement = true; - twoDone = false; - } else if( qName == DirectoryLocalizerLocalizedPathStr ){ - elementNumber = 2; - validElement = true; - twoDone = false; - } else if( qName == DirectoryLocalizerLocalizedNameStr ){ - elementNumber = 3; - validElement = true; - twoDone = false; - } else - { + if( qName == DirectoryLocalizerPathStringsStr ) { + parsePathStrings = true; // set to parse Path + parseDirectoryPaths = false; + elements.clear(); + elementNumber = 0; // Set current path element number as undefined + twoDone = false; + } else if( qName == DirectoryLocalizerFullDirectoryPathsStr ) { + parsePathStrings = false; + parseDirectoryPaths = true; // set to parse localized path + elements.clear(); + elementNumber = 0; // set current path element as undefined + twoDone = false; + } else if( qName == DirectoryLocalizerNameStr ) { + elementNumber = 1; // + validElement = true; + twoDone = false; + } else if( qName == DirectoryLocalizerPathStr ){ + elementNumber = 2; + validElement = true; + twoDone = false; + } else if( qName == DirectoryLocalizerTranslationStr){ + elementNumber = 3; + validElement = true; + } else if( qName == DirectoryLocalizerRootPathStr ){ + elementNumber = 1; + validElement = true; + twoDone = false; + } else if( qName == DirectoryLocalizerLocalizedPathStr ){ + elementNumber = 2; + validElement = true; + twoDone = false; + } else if( qName == DirectoryLocalizerLocalizedNameStr ){ + elementNumber = 3; + validElement = true; + twoDone = false; + } else { elementNumber++; } return true; } +/*! + This function is needed by XML reader. + + \param text readed element + \return true +*/ bool HbDNTXmlReader::characters(const QString& text) { QString t = text; @@ -177,6 +199,7 @@ localizedStr = QCoreApplication::translate(0,charPtr); delete ba; + ba = 0; if( localizedStr == t ){ localizedStr = ""; @@ -213,9 +236,18 @@ validElement = false; } } + if (ba) { + delete ba; + } return true; } +/*! + This function is needed by XML reader. + + \param qName element which was readed + \return true +*/ bool HbDNTXmlReader::endElement( const QString &, const QString &, const QString & qName ) @@ -253,11 +285,19 @@ return true; } +/*! + This function is needed by XML reader. + + \return true +*/ bool HbDNTXmlReader::endDocument() { return true; } +/*! + \return pointer to list of full paths +*/ QMap HbDNTXmlReader::getFullPaths() { return *fullPaths; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbdntxmlreader_p.h --- a/src/hbcore/i18n/hbdntxmlreader_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbdntxmlreader_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBDNTXMLREADER_H -#define HBDNTXMLREADER_H +#ifndef HBDNTXMLREADER_P_H +#define HBDNTXMLREADER_P_H #include #include @@ -82,4 +82,4 @@ bool twoDone; }; -#endif // HBDNTXMLREADER_H +#endif // HBDNTXMLREADER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbextendedlocale.cpp --- a/src/hbcore/i18n/hbextendedlocale.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbextendedlocale.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -115,15 +115,18 @@ /*! Returns the date separator, which can occur in four different positions: - Beginning of the expression - Between the first and second part - Between the second and third part - At the end of the expression - Some of the positions may contain an empty string if a separator is not used in that position in the locale in question + Beginning of the expression; + Between the first and second part; + Between the second and third part; + At the end of the expression; + Some of the positions may contain an empty string if a separator is not used in that position in the locale in question. + + \attention Symbian specific API - \return one of the four characters used to separate the day, + \return Symbian - One of the four characters used to separate the day, month and year components of the date according to the - system locale. + system locale + \return other platforms - Empty QChar or '\' (depending on index) \param index Index of the separator (0-3) */ @@ -147,6 +150,8 @@ month and year components of the date according to the system locale. + \attention Symbian specific API + \param ch Character to set, \param index Index of the separator (0-3) @@ -171,11 +176,14 @@ } /*! - Retrieves the time separator (for example, colon or full stop) + Retrieves the time separator (for example, colon or full stop). - \return one of the four characters used to separate the hour, + \attention Symbian specific API + + \return Symbian - One of the four characters used to separate the hour, minute and second components of the date according to the - system locale. + system locale + \return other platforms - Empty QChar or ':' (depending on index) \param index Index of the separator (0-3) */ @@ -198,6 +206,8 @@ Sets one of the four characters used to separate the hour, minute and second components of the date. + \attention Symbian specific API + \param ch Character to set, \param index Index of the separator (0-3) @@ -229,15 +239,19 @@ or year-month-day (used, for example, in Japanese, Chinese and Swedish) This enum defines the order of date components. - \value American American order (mm/dd/yyyy) - \value European European order (dd/mm/yyyy) - \value Japanese Japanese order (yyyy/mm/dd) + \value American American order (mm/dd/yyyy) + \value European European order (dd/mm/yyyy) + \value Japanese Japanese order (yyyy/mm/dd) \sa dateStyle(), setDateStyle() */ /*! - \return date style from system locale. The date style is returned according to DateStyle. + Returns date style from system locale. The date style is returned according to DateStyle. + + \attention Symbian specific API + + \return date style for Symbian and HbExtendedLocale::American for other platforms */ HbExtendedLocale::DateStyle HbExtendedLocale::dateStyle() const { @@ -265,6 +279,8 @@ /*! Sets date style to system locale. The date style is chosen according to the \a style parameter. + + \attention Symbian specific API \return true for Symbian and false for other OS */ @@ -301,14 +317,18 @@ \enum HbExtendedLocale::TimeStyle Finds out if the 12-hour or the 24-hour clock is used - \value Time12 12 hour clock style - \value Time24 24 hour clock style + \value Time12 12 hour clock style + \value Time24 24 hour clock style \sa timeStyle(), setTimeStyle() */ /*! - \return time style from system locale. The time style is returned according to TimeStyle. + Returns time style from system locale. The time style is returned according to TimeStyle. + + \attention Symbian specific API + + \return time style for Symbian and HbExtendedLocale::Time12 for other platforms */ HbExtendedLocale::TimeStyle HbExtendedLocale::timeStyle() const { @@ -331,6 +351,8 @@ /*! Sets time style to system locale. The time style is chosen according to the \a style parameter. + + \attention Symbian specific API \return true for Symbian and false for other OS */ @@ -360,9 +382,12 @@ /*! - Finds out if the AM/PM symbol is separated by a space from the time expression + Finds out if the AM/PM symbol is separated by a space from the time expression. + + \attention Symbian specific API - \return true if space is inserted between the time and the preceding or trailing am/pm text; otherwise returns false. + \return Symbian - True if space is inserted between the time and the preceding or trailing am/pm text; otherwise returns false. + \return other platforms - true */ bool HbExtendedLocale::amPmSpace() const { @@ -376,6 +401,8 @@ /*! Sets whether a \a space is inserted between the time and the preceding or trailing am/pm text. + + \attention Symbian specific API \return true for Symbian and false for other OS */ @@ -396,7 +423,7 @@ \enum HbExtendedLocale::SymbolPos \value Before - \value After + \value After Retrieves the position of the AM/PM symbol (before or after the time expression) \sa amPmSymbolPosition(), setAmPmSymbolPosition() @@ -404,7 +431,11 @@ */ /*! - \return Before if am/pm text is positioned before time; otherwise returns After. + Returns HbExtendedLocale::Before if am/pm text is positioned before time; otherwise returns HbExtendedLocale::After. + + \attention Symbian specific API + + \return After/Before for Symbian and HbExtendedLocale::After for other platforms */ HbExtendedLocale::SymbolPos HbExtendedLocale::amPmSymbolPosition() const { @@ -413,18 +444,19 @@ TLocalePos position = _symbianLocale.GetLocale()->AmPmSymbolPosition(); if ( position == ELocaleBefore ) { return HbExtendedLocale::Before; - } else if ( position == ELocaleAfter ) { + } else { return HbExtendedLocale::After; } #else return HbExtendedLocale::After; #endif - return HbExtendedLocale::After; } /*! Sets the am/pm text position. The position is chosen according to the \a position parameter. + + \attention Symbian specific API \return true for Symbian if succesfull and false for other OS */ @@ -462,10 +494,13 @@ */ /*! - Retrives the measurement system (if metric or imperial units are in use) + Retrives the measurement system (if metric or imperial units are in use). + + \attention Symbian specific API - \return short unit distance format from system locale. Format is specified by UnitsFormat. - */ + \return Symbian - Short unit distance format from system locale. Format is specified by UnitsFormat. + \return other platforms - QLocale::MetricSystem +*/ QLocale::MeasurementSystem HbExtendedLocale::unitsDistanceShort() const { #if defined(Q_OS_SYMBIAN) @@ -486,6 +521,8 @@ /*! Sets short unit distance \a format to system locale. + \attention Symbian specific API + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setUnitsDistanceShort( const QLocale::MeasurementSystem format ) @@ -514,7 +551,11 @@ } /*! - \return long unit distance format from system locale. Format is specified by UnitsFormat. + Returns long unit distance format from system locale. Format is specified by UnitsFormat. + + \attention Symbian specific API + + \return long unit distance format for Symbian and QLocale::MetricSystem for other platforms */ QLocale::MeasurementSystem HbExtendedLocale::unitsDistanceLong() const { @@ -535,6 +576,8 @@ /*! Sets long unit distance \a format to system locale. + + \attention Symbian specific API \return true for Symbian and false for other OS */ @@ -564,8 +607,10 @@ /*! Sets general unit distance \a format to system locale. + + \attention Symbian specific API - \return true for Symbian and -1 for other OS + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setUnitsGeneral( const QLocale::MeasurementSystem format ) { @@ -607,8 +652,12 @@ */ /*! - \return the negative currency format from system locale. - */ + Returns the negative currency format from system locale. + + \attention Symbian specific API + + \return the negative currency format for Symbian and HbExtendedLocale::LeadingMinusSign for other platforms +*/ HbExtendedLocale::NegativeCurrencyFormat HbExtendedLocale::negativeCurrencyFormat() const { #if defined(Q_OS_SYMBIAN) @@ -632,6 +681,8 @@ /*! Sets negative currency \a format to system locale. + + \attention Symbian specific API \return true for Symbian and false for other OS */ @@ -666,7 +717,11 @@ /*! Finds out if the currency symbol is separated by a space from the amount. - \return true if negative currency values have a space between the currency symbol and the value; otherwise returns false. + + \attention Symbian specific API + + \return Symbian - True if negative currency values have a space between the currency symbol and the value; otherwise returns false. + \return other platforms - false */ bool HbExtendedLocale::negativeCurrencySpace() const { @@ -681,6 +736,8 @@ /*! Sets whether negative currency values have a space between the currency symbol and the value. + \attention Symbian specific API + \param space True to set a flag which indicates that negative currency values should have the space between the value and the symbol. False to unset it. @@ -703,9 +760,12 @@ Finds out if the currency symbol is placed on the opposite side with negative currencies compared to where it is placed with non-negative currencies. - \return true if in negative currency values, the position of the currency + \attention Symbian specific API + + \return Symbian - True if in negative currency values, the position of the currency symbol is set to be the opposite of the position used for non-negative values; otherwise returns false. + \return other platforms - false */ bool HbExtendedLocale::negativeCurrencySymbolOpposite() const { @@ -722,6 +782,8 @@ values should be the \a opposite of the position used for non-negative values. + \attention Symbian specific API + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setNegativeCurrencySymbolOpposite( const bool opposite ) @@ -741,8 +803,10 @@ Finds out if currency triads are used (the grouping of digits in large numbers, for example, 123 456 789). The Symbian OS only supports the grouping of currency amounts. - \return true if currency triads are allowed in currency values; otherwise returns false. - + \attention Symbian specific API + + \return Symbian - True if currency triads are allowed in currency values; otherwise returns false. + \return other platforms - false */ bool HbExtendedLocale::currencyTriadsAllowed() const { @@ -757,7 +821,9 @@ /*! Sets whether triads are \a allowed in currency values. - \return true for Symbian and false for other CS + \attention Symbian specific API + + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setCurrencyTriadsAllowed( const bool allowed ) { @@ -774,10 +840,15 @@ /*! - \return true if a space is inserted between the currency symbol and - a positive currency value; otherwise returns false. + Returns boolean which tells if currency format contains a space. + + \attention Symbian specific API - \note For negative currency values, the space can be inserted using + \return Symbian - True if a space is inserted between the currency symbol and + a positive currency value; otherwise returns false. + \return other platforms - false + + \note For negative currency values, the space can be inserted using setNegativeCurrencySpace(). */ bool HbExtendedLocale::currencySpace() const @@ -794,7 +865,9 @@ Sets whether a \a space is inserted between the currency symbol and the currency amount. - \return true for Symbian and false for other OS + \attention Symbian specific API + + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setCurrencySpace( const bool space ) { @@ -813,7 +886,10 @@ /*! The currency symbol may contain a different number of characters in different countries/regions. Example: œ, $, Ft, kn, Euro symbol - \return the currency symbol. + + \attention Symbian specific API + + \return the currency symbol for Symbian and empty QString for other platforms */ QString HbExtendedLocale::currencySymbol() const { @@ -829,6 +905,8 @@ /*! Sets the currency \a symbol. + \attention Symbian specific API + \return true for Symbian if succesfull and false for other OS */ bool HbExtendedLocale::setCurrencySymbol( const QString &symbol ) @@ -850,9 +928,13 @@ /*! Retrieves position of the currency symbol (before or after the amount). - \return the currency symbol position. + + \attention Symbian specific API + + \return Symbian - the currency symbol position + \return other platforms - HbExtendedLocale::Before - \note For negative currency values, this position may be reversed using + \note For negative currency values, this position may be reversed using SetNegativeCurrencySymbolOpposite(). */ HbExtendedLocale::SymbolPos HbExtendedLocale::currencySymbolPosition() const @@ -873,9 +955,11 @@ } /*! - Sets the currency symbol \a position. + Sets the currency symbol \a position. + + \attention Symbian specific API - \return true for Symbian and false for other OS + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setCurrencySymbolPosition( const SymbolPos position ) { @@ -901,7 +985,12 @@ } /*! - \return the number of decimal places to which currency values are set. + Returns the number of decimal places to which currency values are set. + + \attention Symbian specific API + + \return Symbian - the number of decimal place + \return other platforms - '0' */ int HbExtendedLocale::currencyDecimalPlaces() const { @@ -914,9 +1003,11 @@ } /*! - Sets the number of decimal \a places to which currency values should be set. + Sets the number of decimal \a places to which currency values should be set. + + \attention Symbian specific API - \return true for Symbian and false for other OS + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setCurrencyDecimalPlaces( const int places ) { @@ -955,6 +1046,9 @@ These settings include the currency symbol, the symbol's position and how negative values are formatted. + \attention Cross-Platform API + \attention Uses QString::number() function with other platforms than Symbian. + \sa setCurrencyDecimalPlaces(), setCurrencySpace(), setCurrencySymbol(), setCurrencySymbolPosition(), setNegativeCurrencySpace(), setNegativeCurrencyFormat(), setCurrencyTriadsAllowed(), setNegativeCurrencySymbolOpposite(), @@ -973,7 +1067,7 @@ HBufC *bufPtr = HBufC::New(bufferMinSize); - if ( bufPtr == NULL ) { + if ( !bufPtr ) { return QString(); } @@ -996,7 +1090,7 @@ HBufC *newBufPtr = bufPtr->ReAlloc(fSize); - if ( newBufPtr == NULL ) { + if ( !newBufPtr ) { delete bufPtr; return QString(); } @@ -1008,8 +1102,10 @@ _symbianLocale.LoadSystemSettings(); _symbianLocale.GetLocale()->FormatCurrency(modifiableBufPtr, overflow, TInt64(amount)); } - - return QString::fromUtf16(bufPtr->Ptr(), bufPtr->Length()); + QString value = QString::fromUtf16(bufPtr->Ptr(), bufPtr->Length()); + delete bufPtr; + bufPtr = 0; + return value; #else return QString::number(amount); @@ -1018,6 +1114,8 @@ /*! Sets decimal point character \a ch to system locale. + + \attention Symbian specific API \return true for Symbian and false for other OS */ @@ -1037,6 +1135,8 @@ /*! Sets group separator character \a ch to system locale. + + \attention Symbian specific API \return true for Symbian and false for other OS */ @@ -1057,6 +1157,8 @@ /*! Sets zero digit \a type to system locale. + \attention Symbian specific API + \return true for Symbian and false for other OS */ bool HbExtendedLocale::setZeroDigit( const DigitType type ) @@ -1095,89 +1197,194 @@ Mapping from Symbian to ISO locale */ struct symbianToISO { + // enumeration of symbian language int symbian_language; + // string of ISO value char iso_name[8]; }; #if defined(Q_OS_SYMBIAN) +/*! + Mapping from Symbian to ISO locale +*/ static const symbianToISO symbian_to_iso_list[] = { - { ELangEnglish, "en_GB" }, - { ELangFrench, "fr_FR" }, - { ELangGerman, "de_DE" }, - { ELangSpanish, "es_ES" }, - { ELangItalian, "it_IT" }, - { ELangSwedish, "sv_SE" }, - { ELangDanish, "da_DK" }, - { ELangNorwegian, "no_NO" }, - { ELangFinnish, "fi_FI" }, - { ELangAmerican, "en_US" }, - { ELangPortuguese, "pt_PT" }, - { ELangTurkish, "tr_TR" }, - { ELangIcelandic, "is_IS" }, - { ELangRussian, "ru_RU" }, - { ELangHungarian, "hu_HU" }, - { ELangDutch, "nl_NL" }, - { ELangCzech, "cs_CZ" }, - { ELangSlovak, "sk_SK" }, - { ELangPolish, "pl_PL" }, - { ELangSlovenian, "sl_SI" }, - { ELangTaiwanChinese, "zh_TW" }, - { ELangHongKongChinese, "zh_HK" }, - { ELangPrcChinese, "zh_CN" }, - { ELangJapanese, "ja_JP" }, - { ELangThai, "th_TH" }, - { ELangArabic, "ar_AE" }, - { ELangTagalog, "tl_PH" }, - { ELangBengali, "bn_IN" }, // Bangladesh/India - { ELangBulgarian, "bg_BG" }, - { ELangCatalan, "ca_ES" }, - { ELangCroatian, "hr_HR" }, - { ELangEstonian, "et_EE" }, - { ELangFarsi, "fa_IR" }, - { ELangCanadianFrench, "fr_CA" }, - { ELangGreek, "el_GR" }, - { ELangGujarati, "gu_IN" }, - { ELangHebrew, "he_IL" }, - { ELangHindi, "hi_IN" }, - { ELangIndonesian, "id_ID" }, - { ELangKannada, "kn_IN" }, - { ELangKorean, "ko_KR" }, - { ELangLatvian, "lv_LV" }, - { ELangLithuanian, "lt_LT" }, - { ELangMalay, "ms_MY" }, - { ELangMalayalam, "ml_IN" }, - { ELangMarathi, "mr_IN" }, - { ELangBrazilianPortuguese, "pt_BR" }, - { ELangRomanian, "ro_RO" }, - { ELangSerbian, "sr_YU" }, - { ELangLatinAmericanSpanish, "es_MX" }, - { ELangTamil, "ta_IN" }, - { ELangTelugu, "te_IN" }, - { ELangUkrainian, "uk_UA" }, - { ELangUrdu, "ur_PK" }, // India/Pakistan - { ELangVietnamese, "vi_VN" }, + { ELangEnglish, "en_GB" }, + { ELangFrench, "fr_FR" }, + { ELangGerman, "de_DE" }, + { ELangSpanish, "es_ES" }, + { ELangItalian, "it_IT" }, + { ELangSwedish, "sv_SE" }, + { ELangDanish, "da_DK" }, + { ELangNorwegian, "nb_NO" }, + { ELangFinnish, "fi_FI" }, + { ELangAmerican, "en_US" }, + { ELangSwissFrench, "fr_CH" }, + { ELangSwissGerman, "de_CH" }, + { ELangPortuguese, "pt_PT" }, + { ELangTurkish, "tr_TR" }, + { ELangIcelandic, "is_IS" }, + { ELangRussian, "ru_RU" }, + { ELangHungarian, "hu_HU" }, + { ELangDutch, "nl_NL" }, + { ELangBelgianFlemish, "nl_BE" }, + { ELangAustralian, "en_AU" }, + { ELangBelgianFrench, "fr_AU" }, + { ELangAustrian, "de_AT" }, + { ELangNewZealand, "en_NZ" }, + { ELangInternationalFrench, "fr_ZZ" }, + { ELangCzech, "cs_CZ" }, + { ELangSlovak, "sk_SK" }, + { ELangPolish, "pl_PL" }, + { ELangSlovenian, "sl_SI" }, + { ELangTaiwanChinese, "zh_TW" }, + { ELangHongKongChinese, "zh_HK" }, + { ELangPrcChinese, "zh_CN" }, + { ELangJapanese, "ja_JP" }, + { ELangThai, "th_TH" }, + { ELangAfrikaans, "af_ZA" }, + { ELangAlbanian, "sq_AL" }, + { ELangAmharic, "am_ET" }, + { ELangArabic, "ar_AE" }, + { ELangArmenian, "hy_AM" }, + { ELangTagalog, "tl_PH" }, + { ELangBelarussian, "be_BY" }, + { ELangBengali, "bn_IN" }, + { ELangBulgarian, "bg_BG" }, + { ELangBurmese, "my_MM" }, + { ELangCatalan, "ca_ES" }, + { ELangCroatian, "hr_HR" }, + { ELangCanadianEnglish, "en_CA" }, + { ELangInternationalEnglish,"en_ZZ" }, + { ELangSouthAfricanEnglish, "en_ZA" }, + { ELangEstonian, "et_EE" }, + { ELangFarsi, "fa_IR" }, + { ELangCanadianFrench, "fr_CA" }, + { ELangScotsGaelic, "gd_GB" }, + { ELangGeorgian, "ka_GE" }, + { ELangGreek, "el_GR" }, + { ELangCyprusGreek, "el_CY" }, + { ELangGujarati, "gu_IN" }, + { ELangHebrew, "he_IL" }, + { ELangHindi, "hi_IN" }, + { ELangIndonesian, "id_ID" }, + { ELangIrish, "ga_IE" }, + { ELangSwissItalian, "it_CH" }, + { ELangKannada, "kn_IN" }, + { ELangKazakh, "kk_KZ" }, + { ELangKhmer, "km_KH" }, + { ELangKorean, "ko_KR" }, + { ELangLao, "lo_LA" }, + { ELangLatvian, "lv_LV" }, + { ELangLithuanian, "lt_LT" }, + { ELangMacedonian, "mk_MK" }, + { ELangMalay, "ms_MY" }, + { ELangMalayalam, "ml_IN" }, + { ELangMarathi, "mr_IN" }, + { ELangMoldavian, "ro_MD" }, + { ELangMongolian, "mn_MN" }, + { ELangNorwegianNynorsk, "nn_NO" }, + { ELangBrazilianPortuguese, "pt_BR" }, + { ELangPunjabi, "pa_IN" }, + { ELangRomanian, "ro_RO" }, + { ELangSerbian, "sr_YU" }, + { ELangSinhalese, "si_LK" }, + { ELangSomali, "so_SO" }, + { ELangInternationalSpanish,"es_ZZ" }, + { ELangLatinAmericanSpanish,"es_419" }, + { ELangSwahili, "sw_KE" }, + { ELangFinlandSwedish, "sv_FI" }, + { ELangTamil, "ta_IN" }, + { ELangTelugu, "te_IN" }, + { ELangTibetan, "bo_CN" }, + { ELangTigrinya, "ti_ER" }, + { ELangCyprusTurkish, "tr_CY" }, + { ELangTurkmen, "tk_TM" }, + { ELangUkrainian, "uk_UA" }, + { ELangUrdu, "ur_PK" }, + { ELangVietnamese, "vi_VN" }, + { ELangWelsh, "cy_GB" }, + { ELangZulu, "zu_ZA" }, + { ELangManufacturerEnglish, "en_XZ" }, + { ELangSouthSotho, "st_LS" }, #ifdef __E32LANG_H__ // 5.0 - { ELangBasque, "eu_ES" }, - { ELangGalician, "gl_ES" }, + { ELangBasque, "eu_ES" }, + { ELangGalician, "gl_ES" }, #endif - { ELangEnglish_Apac, "en_APAC" }, - { ELangEnglish_Taiwan, "en_TW" }, - { ELangEnglish_HongKong, "en_HK" }, - { ELangEnglish_Prc, "en_CN" }, - { ELangEnglish_Japan, "en_JP"}, - { ELangEnglish_Thailand, "en_TH" }, - { ELangEnglish_India, "en_IN" }, - { ELangMalay_Apac, "ms_APAC" }, - { ELangIndonesian_Apac, "id_APAC" } + { ELangJavanese, "jv_ID" }, + { ELangMaithili, "bh_IN" }, + { ELangAzerbaijani_Latin, "az_AZ" }, + { ELangOriya, "or_IN" }, + { ELangBhojpuri, "bh_IN" }, + { ELangSundanese, "su_ID" }, + { ELangKurdish_Latin, "ku_TR" }, + { ELangKurdish_Arabic, "ku_IQ" }, + { ELangPashto, "ps_AF" }, + { ELangHausa, "ha_NG" }, + { ELangOromo, "om_ET" }, + { ELangUzbek_Latin, "uz_UZ" }, + { ELangSindhi_Arabic, "sd_PK" }, + { ELangSindhi_Devanagari, "sd_IN" }, + { ELangYoruba, "yo_NG" }, + { ELangIgbo, "ig_NG" }, + { ELangMalagasy, "mg_MG" }, + { ELangNepali, "ne_NP" }, + { ELangAssamese, "as_IN" }, + { ELangShona, "sn_ZW" }, + { ELangZhuang, "za_CN" }, + { ELangEnglish_Taiwan, "en_TW" }, + { ELangEnglish_HongKong, "en_HK" }, + { ELangEnglish_Prc, "en_CN" }, + { ELangEnglish_Japan, "en_JP" }, + { ELangEnglish_Thailand, "en_TH" }, + { ELangFulfulde, "ff_NE" }, + { ELangBolivianQuechua, "qu_BO" }, + { ELangPeruQuechua, "qu_PE" }, + { ELangEcuadorQuechua, "qu_EC" }, + { ELangTajik_Cyrillic, "tg_TJ" }, + { ELangNyanja, "ny_MW" }, + { ELangHaitianCreole, "ht_HT" }, + { ELangKoongo, "kg_CG" }, + { ELangAkan, "ak_GH" }, + { ELangYi, "ii_CN" }, + { ELangUyghur, "ug_CN" }, + { ELangRwanda, "rw_RW" }, + { ELangXhosa, "xh_ZA" }, + { ELangGikuyu, "ki_KE" }, + { ELangRundi, "rn_BI" }, + { ELangTswana, "tn_BW" }, + { ELangKanuri, "kr_NE" }, + { ELangKashmiri_Devanagari, "ks_ZZ" }, + { ELangKashmiri_PersoArabic,"ks_XZ" }, + { ELangWolof, "wo_SN" }, + { ELangTsonga, "ts_ZA" }, + { ELangYiddish, "yi_IL" }, + { ELangKirghiz, "ky_KG" }, + { ELangGanda, "lg_UG" }, + { ELangBambara, "bm_ML" }, + { ELangCentralAymara, "ay_BO" }, + { ELangLingala, "ln_CG" }, + { ELangBashkir, "ba_RU" }, + { ELangChuvash, "cv_RU" }, + { ELangSwati, "ss_SZ" }, + { ELangTatar, "tt_RU" }, + { ELangSouthernNdebele, "nr_ZA" }, + { ELangSardinian, "sc_IT" }, + { ELangWalloon, "wa_BE" }, + { ELangEnglish_India, "en_IN" } }; #endif /*! - \return ISO name corresponding to the Symbian language \a code. + Returns ISO name corresponding to the Symbian language \a code. If the code does not does not correspond to any Symbian language, returns a empty string. + \attention Symbian specific API + + \return Symbian - ISO style language code + \return other platforms - empty QString + \sa User::Language() */ QString HbExtendedLocale::symbianLangToISO( const int code ) @@ -1189,8 +1396,7 @@ int cmp = code - symbian_to_iso_list[0].symbian_language; if (cmp < 0) { return QString(); - } - else { + } else { if (cmp == 0) { return symbian_to_iso_list[0].iso_name; } @@ -1223,9 +1429,14 @@ } /*! - \return RFC3066 name corresponding to the Symbian language \a code. + Returns RFC3066 name corresponding to the Symbian language \a code. If the code does not does not correspond to any Symbian language, - returns a empty string. + returns a empty string. + + \attention Symbian specific API + + \return Symbian - RFC3066 style language code + \return other platforms - empty QString \sa User::Language() */ @@ -1237,9 +1448,11 @@ /*! Converts ISO tag to Symbian language code. + \attention Symbian specific API + \param langAndCountry ISO tag, example "fi_FI" - \return Symbian language code or -1 (failed case) + \return Symbian language code if successful. With other platforms or if case fails then '-1'. */ int HbExtendedLocale::ISOToSymbianLang( const QString &langAndCountry ) { @@ -1287,7 +1500,12 @@ /*! Returns a Qt version of the given \a sys_fmt Symbian datetime format string. Some convertable fields use data from current system locale, - unwanted locale may cause unexpected results. + unwanted locale may cause unexpected results. + + \attention Symbian specific API + + \return Symbian - datetime format string + \return other platforms - "not supported" */ QString HbExtendedLocale::symbianDateTimeToQt( const QString &sys_fmt ) { @@ -1507,6 +1725,9 @@ case 'A': { // quickie to get capitalization, can't use s60 string as is because Qt 'hh' format's am/pm logic TAmPmName ampm = TAmPmName(); + if ( ampm.Size() == 0 ) { + return QString(); + } TChar first(ampm[0]); QString qtampm = QString::fromLatin1(first.IsUpper() ? "AP" : "ap"); @@ -1599,7 +1820,12 @@ if ( n_mode ) { offset += 10; } - + + // 'offset + (c.digitValue()-1' cannot be bigger than us_locale_dep, eu_locale_dep or jp_locale_dep table + if ( (offset + (c.digitValue()-1)) > 19 ) { + return QString(); + } + result += QLatin1String(locale_dep[offset + (c.digitValue()-1)]); } break; @@ -1658,15 +1884,17 @@ \enum HbExtendedLocale::WeekDay This enum defines weekdays. - \sa startOfWeek() + \sa startOfWeek() */ /*! Gets first day of the week. It is usually Saturday, Sunday or Monday, but the Symbian OS allows setting any weekday as the first. - Returns enum WeekDay. + + \attention Symbian specific API - \return Monday for other OS + \return Symbian - enum of WeekDay + \return other platforms - HbExtendedLocale::Monday */ HbExtendedLocale::WeekDay HbExtendedLocale::startOfWeek() const { @@ -1697,8 +1925,13 @@ /*! Sets the day which is considered to be the first day of the week. - \param day The first day of the week. + + \attention Symbian specific API + + \param day The first day of the week. + \return true for Symbian and false for other OS + \sa startOfWeek() */ @@ -1744,13 +1977,15 @@ /*! - Gets days which are working days of week. - Returns QString which describes workdays as binary array. - 1 meaning workday and 0 as non working day. + Gets days which are working days of week. + 1 meaning workday and 0 as non working day. + + \attention Symbian specific API - \return 0011111 for other OS + \return Symbian - QString which describes workdays as binary array + \return other platforms - "0011111" - \sa setWorkDays() + \sa setWorkDays() */ QString HbExtendedLocale::workDays() const { @@ -1768,7 +2003,10 @@ } /*! - Sets working days of week. + Sets working days of week. + + \attention Symbian specific API + \param days which describes workdays as QString binary array. 1 meaning workday and 0 non workday. @@ -1798,8 +2036,12 @@ } /*! - Checks whether or not daylight saving is set for the home city - \return True if home daylight saving is set, false if home daylight saving is not set + Checks whether or not daylight saving is set for the home city. + + \attention Symbian specific API + + \return Symbian - True if home daylight saving is set. False if home daylight saving is not set. + \return other platforms - false */ bool HbExtendedLocale::homeHasDaylightSavingOn() const @@ -1813,14 +2055,26 @@ } /*! + \enum HbExtendedLocale::DaylightSavingZone + Enumeration for "daylight saving time" settings. + + \sa setHomeDaylightSavingZone(), homeHasDaylightSavingOn() + */ + +/*! Returns the daylight saving zone in which the home city is located. + \attention Symbian specific API + \value Home Home daylight saving zone \value European European daylight saving zone \value Northern Northern hemisphere (non-European) daylight saving zone \value Southern Southern hemisphere daylight saving zone \value None No daylight saving zone + \return Symbian - the daylight saving zone + \return other platforms - HbExtendedLocale::None + \sa setHomeDaylightSavingZone() */ HbExtendedLocale::DaylightSavingZone HbExtendedLocale::homeDaylightSavingZone() const @@ -1847,7 +2101,10 @@ } /*! - Gets the locale’s universal time offset + Gets the locale’s universal time offset. + + \attention Symbian specific API + \return Offset in seconds from universal time. For other platforms it returns 0. */ int HbExtendedLocale::universalTimeOffset() const @@ -1861,6 +2118,11 @@ #endif } +/*! + Constructor of HbExtendedLocale. + + \attention Cross-Platform API + */ HbExtendedLocale::HbExtendedLocale() { #if defined(Q_OS_SYMBIAN) @@ -1869,7 +2131,11 @@ #endif } -//! Returns new/dummy copy of HbExtendedLocale. +/*! + Returns new/dummy copy of HbExtendedLocale. + + \attention Cross-Platform API + */ HbExtendedLocale HbExtendedLocale::system() { // make sure QLocale's lp is updated if in future QApplication does not do it @@ -1883,10 +2149,12 @@ For example, what date components are included, and if leading zeroes are used. This is a function uses the date formats defined in the hbi18ndef.h header file. + \attention Cross-Platform API + \param date The date to be formatted. \param dateFormat The wanted format to be used. - \return The date as a string. + \return the date as a string */ QString HbExtendedLocale::format( const QDate &date, const QString &dateFormat ) { @@ -1940,7 +2208,7 @@ #else Q_UNUSED(dateFormat); - return toString(date, ShortFormat ); + return toString(date, ShortFormat ); #endif } @@ -1949,10 +2217,12 @@ For example, what components are included (hours/minutes/seconds), and if leading zeroes and AM/PM or am/pm symbols are used. This is a function uses the time formats defined in the hbi18ndef.h header file. - \param time The time to be formatted. - \param timeFormat The wanted format to be used. + \attention Cross-Platform API + + \param time The time to be formatted. + \param timeFormat The wanted format to be used. - \return The time as a string. + \return the time as a string */ QString HbExtendedLocale::format( const QTime &time, const QString &timeFormat ) { @@ -1997,6 +2267,6 @@ return TDesC2QString(s60TimeStr->Des()); #else Q_UNUSED(timeFormat); - return toString(time, ShortFormat); + return toString(time, ShortFormat); #endif } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbextendedlocale.h --- a/src/hbcore/i18n/hbextendedlocale.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbextendedlocale.h Thu Jul 22 16:36:53 2010 +0100 @@ -144,4 +144,4 @@ QString format( const QTime &time, const QString &timeFormat ); }; -#endif +#endif // HBEXTENDEDLOCALE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbfindfile.cpp --- a/src/hbcore/i18n/hbfindfile.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbfindfile.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,35 +31,85 @@ #include #include #include +#include +#include +#include -#include +#if defined(Q_OS_SYMBIAN) + #define PLATFORM_WITH_DRIVES +#elif defined(Q_OS_WIN32) + #define PLATFORM_WITH_DRIVES +#else + #undef PLATFORM_WITH_DRIVES +#endif + +#ifdef Q_OS_SYMBIAN +/*! + Convert path to Symbian version +*/ +static void toSymbianPath(QString &path) { + int len=path.length(); + for (int i=0; iFsSession(); + TFindFile ff(fs); + QString str2 = str; + toSymbianPath(str2); + TPtrC fName((ushort*)(str2.constData()),str2.length()); + QString dNameString; + + if (!defaultDrive.isNull()) { + dNameString.append(defaultDrive); + dNameString += QString(":"); + } + dNameString += QString("\\"); + TPtrC dName((ushort*)(dNameString.constData()),dNameString.length()); + TInt err=ff.FindByDir(fName, dName); + if (err==KErrNone) { + TParse p; + p.Set(ff.File(), 0,0); + TPtrC ptrC = p.Drive(); + QString str3 = QString::fromRawData((QChar*)(ushort*)ptrC.Ptr(),ptrC.Length()); + str.prepend(str3); + return true; + } + else { + return false; + } +#elif defined(Q_OS_WIN32) QString file = str; -#if defined(Q_OS_WIN32) - file = "C:" + str; -#endif -#if !defined(Q_OS_SYMBIAN) - QFileInfo info(file); - if (info.exists()) { - str = file; - return true; - } - return false; -#endif - if (!defaultDrive.isNull()) { file = defaultDrive + QString(":") + str; QFileInfo info(file); @@ -82,24 +132,96 @@ } } return false; +#else + Q_UNUSED(defaultDrive); + QFileInfo info(str); + return info.exists(); +#endif } +#ifdef PLATFORM_WITH_DRIVES /*! - Returns available drives in device (Symbian). Empty for other platforms. + Helper class +*/ +class AvailableDrives : public QString +{ +public: + AvailableDrives(); +}; + +/*! + Search available drives +*/ +AvailableDrives::AvailableDrives() { +#ifdef Q_OS_SYMBIAN + RFs& fs = CCoeEnv::Static()->FsSession(); + TDriveList driveList; + fs.DriveList(driveList); + if ( driveList.Size() == 0 ) { + return; + } + + TChar driveLetter; + + // add first C and then Y..A and then Z. + TInt driveNumber; + if (driveList[EDriveC]) { + driveNumber = EDriveC; + fs.DriveToChar(driveNumber, driveLetter); + QChar cC = static_cast(driveLetter); + this->append(cC); + } + for (driveNumber = EDriveY; driveNumber >= EDriveA; --driveNumber) { + if (driveNumber == EDriveC) { + continue; + } else { + if (driveList[driveNumber]) { + fs.DriveToChar(driveNumber, driveLetter); + QChar c = static_cast(driveLetter); + this->append(c); + } + } + } + if (driveList[EDriveZ]) { + driveNumber = EDriveZ; + fs.DriveToChar(driveNumber, driveLetter); + QChar cZ = static_cast(driveLetter); + this->append(cZ); + } +#else // Q_OS_SYMBIAN + QFileInfoList fil = QDir::drives(); + for (int j=0; j< fil.length(); j++) { + QString fp = fil.at(j).filePath(); + if ( fp.isEmpty() ) { + return; + } + + if ( (fp[0] != '/') && (fp[0] != '\\') ) { + this->append(fp[0]); + } + } +#endif // Q_OS_SYMBIAN +} + +Q_GLOBAL_STATIC(AvailableDrives, gs_AvailableDrives) +#endif // PLATFORM_WITH_DRIVES + +/*! + \attention Cross-Platform API + + \returns Available drive(s) if platform supports (Eg. Symbian, Windows...). + If platform doesn't support drive(s) (Eg. Linux) then empty QString is returned. */ QString HbFindFile::availableDrives() { - QString drives = ""; -#if defined(Q_OS_SYMBIAN) - RFs& fs = CCoeEnv::Static()->FsSession(); - TDriveList driveList; - fs.DriveList(driveList); - TChar driveLetter; - for (TInt driveNumber = EDriveA; driveNumber <= EDriveZ; driveNumber++) { - fs.DriveToChar(driveNumber, driveLetter); - QChar c = static_cast(driveLetter); - drives.append(c); - } -#endif - return drives; +#ifdef PLATFORM_WITH_DRIVES + QString *str = gs_AvailableDrives(); + if (str) { + return *str; + } else { + return QString(); + } +#else // PLATFORM_WITH_DRIVES + return QString(); +#endif // PLATFORM_WITH_DRIVES } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbi18ndef.h --- a/src/hbcore/i18n/hbi18ndef.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbi18ndef.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HB_I18N_DEF_H -#define HB_I18N_DEF_H +#ifndef HBI18NDEF_H +#define HBI18NDEF_H #include #include @@ -85,4 +85,4 @@ // 13:15, 03:05 (minutes with leading zero and seconds) // separators are locale dependent. #define r_qtn_time_durat_min_sec_with_zero "%:0%T%:2%S%:3" -#endif // HB_I18N_DEF_H +#endif // HBI18NDEF_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hblanguageutil.cpp --- a/src/hbcore/i18n/hblanguageutil.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hblanguageutil.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -43,12 +43,12 @@ #endif // Q_OS_SYMBIAN #include "hblanguageutil.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #if defined(Q_OS_SYMBIAN) #define LANGUAGE_LIST_FILE "/resource/hbi18n/translations/language_list.txt" #define LANGUAGE_ID_PREFIX "language_" -#define TRANSLATOR_PATH "/resource/hbi18n/translations/languages" +#define TRANSLATOR_PATH "/resource/hbi18n/translations/languages_OLD" #endif // Q_OS_SYMBIAN /*! @@ -56,6 +56,9 @@ @hbcore \class HbLanguageUtil \brief HbLanguageUtil provides functions for quering supported languages and switching the system language. + + \deprecated HbLanguageUtil class + is deprecated. Please use HbLocaleUtil class instead. */ #if defined(Q_OS_SYMBIAN) @@ -112,6 +115,7 @@ bool setLocale( int language ) { TExtendedLocale dummy; + dummy.LoadSystemSettings(); QString no; no = QString( "%1" ).arg( language, 2, 10, QLatin1Char( '0' ) ); QString name = QString( "elocl." ).append( no ); @@ -134,8 +138,14 @@ Language names are localized according the language's native presentation. Language ID's returned by this functions may be used as language parameter for changeLanguage(int language) function. Language IDs and names are OS specific and may vary across the platforms and releases. + + \attention Symbian specific API + + \deprecated HbLanguageUtil::supportedLanguages() + is deprecated. Please use HbLocaleUtil::supportedLanguages() instead. - \return localized names and integer identifiers of languages supported in a device + \return Symbian - localized names and integer identifiers of languages supported in a device + \return other platforms - empty QHash */ QHash HbLanguageUtil::supportedLanguages() { @@ -143,9 +153,16 @@ QHash languages; QTranslator translator; - if (!translator.load(TRANSLATOR_PATH)) { - return languages; + QString path = "c:"; + path += QString(TRANSLATOR_PATH); + if (!translator.load(path)) { + path = "z:"; + path += QString(TRANSLATOR_PATH); + if (!translator.load(path)) { + return languages; + } } + QCoreApplication::installTranslator(&translator); QHash hashLanguageNames = readLanguageList(); @@ -182,7 +199,13 @@ Language ID's returned by this functions may be used as language parameter for changeLanguage(int language) function. Language IDs and names are OS specific and may vary across the platforms and releases. - \return localized names and integer identifiers of known languages + \attention Symbian specific API + + \deprecated HbLanguageUtil::allLanguages() + is deprecated. + + \return Symbian - localized names and integer identifiers of known languages + \return other platforms - empty QHash */ QHash HbLanguageUtil::allLanguages() { @@ -190,9 +213,16 @@ QHash langs; QTranslator translator; - if (!translator.load(TRANSLATOR_PATH)) { - return langs; + QString path = "c:"; + path += QString(TRANSLATOR_PATH); + if (!translator.load(path)) { + path = "z:"; + path += QString(TRANSLATOR_PATH); + if (!translator.load(path)) { + return langs; + } } + QCoreApplication::installTranslator(&translator); QHash languageNameList = readLanguageList(); @@ -217,9 +247,14 @@ /*! \brief Changes the device system language. - - \param identifier of language to set active - \return true if language change was successful + + \attention Symbian specific API + + \deprecated HbLanguageUtil::changeLanguage( int language ) + is deprecated. Please use HbLocaleUtil::changeLanguage( const QString &language ) instead. + + \param language identifier of language to set active + \return true for Symbian if succesfull and false for other platforms */ bool HbLanguageUtil::changeLanguage( int language ) { @@ -262,7 +297,12 @@ /*! \brief Returns ID of current language. - \return identifier of current system language + \attention Symbian specific API + + \deprecated HbLanguageUtil::currentLanguage() + is deprecated. Please use HbLocaleUtil::currentLanguage() instead. + + \return identifier of current system language for Symbian and '0' for other platforms */ int HbLanguageUtil::currentLanguage() { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hblocaleutil.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/i18n/hblocaleutil.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,815 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(Q_OS_SYMBIAN) +#include +#include +#include +#include +#include +#include //Ui language +#endif // Q_OS_SYMBIAN + +#include +#include + +#if defined(Q_OS_SYMBIAN) +#define LANGUAGE_LIST_FILE "/resource/hbi18n/translations/language_list.txt" +#define LANGUAGE_MAPPINGS_FILE "/resource/hbi18n/translations/locale_mappings.txt" +#define LANGUAGE_ID_PREFIX "language" +#define LANGUAGE_TRANSLATOR_PATH "/resource/hbi18n/translations/languages" + +#define REGION_LIST_FILE "z:/resource/bootdata/regions.txt" +#define REGION_ID_PREFIX "region" +#define REGION_TRANSLATOR_PATH "/resource/hbi18n/translations/regions" +#define REGION_DLL_PREFIX "elocl_reg." + +#define COLLATION_LIST_FILE "z:/resource/bootdata/collations.txt" +#define COLLATION_ID_PREFIX "collation" +#define COLLATION_TRANSLATOR_PATH "/resource/hbi18n/translations/collations" +#define COLLATION_DLL_PREFIX "elocl_col." +#define COLLATION_DLL_PREFIX_POSITION 3 +#endif // Q_OS_SYMBIAN + +/*! + @beta + @hbcore + \class HbLocaleUtil + \brief HbLocaleUtil provides functions for quering supported languages, regions and collations and activing them. + + Language and collation identifiers typically corresponds with two-letter ISO 639 language code, but for certain languages and collations combination of ISO 639 language code and ISO 3166 country code id used. + Region identifiers always corresponds with two-letter ISO 3166 country code. + + HbLocaleUtil also provides functions for converting language, region and collation identifiers to their localised names. +*/ + +#if defined(Q_OS_SYMBIAN) + +struct HbLocaleMapping +{ + int symLangValue; + QString languageDllId; + QString collationDllId; + QString regionDllId; + QString langName; + QString regName; + QString collName; +}; + +QList mappingList; +QList regions; +QStringList availRegions; +QHash locRegionNames; +QList collations; +QStringList availCollations; +QHash locCollationNames; + +/*! + \brief Reads langauge, region and collation mappings. +*/ +void readMappings() +{ + QString path = "c:"; + path += QString(LANGUAGE_MAPPINGS_FILE); + QFile* file = new QFile(path); + if (!file->exists() ) { + path = "z:"; + path += QString(LANGUAGE_MAPPINGS_FILE); + delete file; + file = new QFile(path); + } + if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) { + delete file; + return; + } + QTextStream in(file); + while (!in.atEnd()) { + QString line = in.readLine(256); + if (!line.isEmpty()) { + QStringList list = line.split(',', QString::SkipEmptyParts); + if (list.count() < 7) { + continue; + } + QString strCode = list[0]; + QString strLang = list[1]; + QString strRegion = list[2]; + QString strCollation = list[3]; + QString lanName = list[4]; //en_GB + QString region = list[5]; //en_GB + QString collation = list[6]; //en_GB + + bool ok; + int code = strCode.toUInt(&ok); + if (!ok) { + continue; + } + + HbLocaleMapping map; + map.symLangValue = code; + map.languageDllId = strLang; + map.collationDllId = strCollation; + map.regionDllId = strRegion; + map.langName = lanName; + map.regName = region; + map.collName = collation; + mappingList.append(map); + } + } + delete file; + return; +} +#endif // Q_OS_SYMBIAN + +#if defined(Q_OS_SYMBIAN) + +/*! + \brief Changes the system UI language. + + \param dllExtension extension of the locale dll + \return true if operation was successful +*/ +bool setLocale( const QString &dllExtension ) +{ + TExtendedLocale dummy; + dummy.LoadSystemSettings(); + QString name = QString( "elocl_lan." ).append( dllExtension ); + TPtrC nameptr(name.utf16()); + + TInt err = dummy.LoadLocaleAspect( nameptr ); + if( err != KErrNone ) + return false; + dummy.SaveSystemSettings(); + // cause localeprivate update on next qlocale object( glp->m_language_id = 0 ) + QSystemLocale dummy2; + return true; +} +#endif //Q_OS_SYMBIAN + +/*! + \brief Return identifier of the current UI language. + + \attention Symbian specific API + + \return Identifier of the language code for Symbian and empty QString for other platforms. +*/ +QString HbLocaleUtil::currentLanguage() +{ +#if defined(Q_OS_SYMBIAN) + TLanguage l = User::Language(); + + if(mappingList.isEmpty()) { + readMappings(); + } + + for (int i = 0; i < mappingList.count(); ++i) { + HbLocaleMapping mapping = mappingList.at(i); + if (mapping.symLangValue == l) { + return mapping.langName; + } + } +#endif + return QString(); +} + +/*! + \brief Returns identifiers of languages supported in a device. + Language identifier may be two-letter ISO 639 language code or combination of ISO 639 language code and ISO 3166 country code + Ex: Great Britain english it returns "en". + Ex: For U.S. english it returns "en_US" + + \attention Symbian specific API + + \return identifiers of supported languages for Symbian and empty QStringList for other platforms +*/ +QStringList HbLocaleUtil::supportedLanguages() +{ +#if defined(Q_OS_SYMBIAN) + QStringList languages; + CArrayFixFlat* systemEpocLanguageCodes = 0; + TInt error = SysLangUtil::GetInstalledLanguages( systemEpocLanguageCodes ); + if ( error != KErrNone ) { + delete systemEpocLanguageCodes; + return languages; + } + + if(mappingList.isEmpty()) { + readMappings(); + } + + for (int i = 0; i < systemEpocLanguageCodes->Count(); ++i) { + int code = systemEpocLanguageCodes->At(i); + for (int j = 0; j < mappingList.count(); ++j) { + HbLocaleMapping map = mappingList.at(j); + if (map.symLangValue == code) { + languages.append(map.langName); + break; + } + } + } + + delete systemEpocLanguageCodes; + return languages; +#else + return QStringList(); +#endif +} + +/*! + \brief Converts two or five letter language identifier code to localised language name. + + \attention Symbian specific API + + \param language identifier + + \return Symbian - localised name of the language, an empty String if translation fails + \return other platforms - empty QString +*/ +QString HbLocaleUtil::localisedLanguageName( const QString &language ) +{ +#if defined(Q_OS_SYMBIAN) + QTranslator translator; + QString path = "c:"; + path += QString(LANGUAGE_TRANSLATOR_PATH); + if (!translator.load(path)) { + path = "z:"; + path += QString(LANGUAGE_TRANSLATOR_PATH); + if (!translator.load(path)) { + return QString(""); + } + } + + QCoreApplication::installTranslator(&translator); + QString languageName = QString(LANGUAGE_ID_PREFIX); + languageName += '_'; + languageName += language; + QString translated = hbTrId(languageName.toAscii().constData()); + if (translated == languageName) { + return QString(""); + } + return translated; +#else + Q_UNUSED(language); + return QString(); +#endif +} + +/*! + \brief Changes the system language. + The language parameter should correspond with one of the identifiers returned by supportedLanguages(). + + \attention Symbian specific API + + \param language identifier of language to set active + + \return true if language change was successful and false for other platforms +*/ +bool HbLocaleUtil::changeLanguage( const QString &language ) +{ +#if defined(Q_OS_SYMBIAN) + if(mappingList.isEmpty()) { + readMappings(); + } + + int lanCode = -1; + QString dllExt = ""; + for (int i = 0; i < mappingList.count(); ++i) { + HbLocaleMapping map = mappingList.at(i); + if (map.langName == language) { + lanCode = map.symLangValue; + dllExt = map.languageDllId; + break; + } + } + + if (lanCode == -1) { + return false; + } + + CRepository* commonEngineRepository = 0; + TRAPD( err1, commonEngineRepository = CRepository::NewL( KCRUidCommonEngineKeys ) ); + if ( err1 != KErrNone ) { + return false; + } + + if (!setLocale(dllExt)) { + delete commonEngineRepository; + return false; + } + + // Never set Language code 0 to HAL + if ( language !=0 ) { + if ( HAL::Set( HAL::ELanguageIndex, lanCode ) != KErrNone ) { + delete commonEngineRepository; + return false; + } + } + if ( commonEngineRepository->Set( KGSDisplayTxtLang, lanCode ) != KErrNone ) { + delete commonEngineRepository; + return false; + } + delete commonEngineRepository; + return true; + +#else + Q_UNUSED(language); + return false; +#endif +} + +#if defined(Q_OS_SYMBIAN) +/*! + \brief reads the regions.txt file and reads the list of symbian region codes +*/ +void readRegions() +{ + QFile* file = new QFile(REGION_LIST_FILE); + if (!file->exists() ) + { + delete file; + return; + } + if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) + { + delete file; + return; + } + QTextStream in(file); + while (!in.atEnd()) + { + QString line = in.readLine(256); + if (!line.isEmpty()) + { + int regCode = line.toUInt(); + regions.append(regCode); + } + } + return; +} +#endif + +/*! + \brief Returns names supported regions in a phone. + Region names are identified by 2 letter code(ISO 3166 standard). + Ex: For United Kingdom it returns GB + + \attention Symbian specific API + + \return list of supported regions in a device for Symbian and empty QStringList for other platforms +*/ +QStringList HbLocaleUtil::supportedRegions() +{ +#if defined(Q_OS_SYMBIAN) + if(!availRegions.isEmpty()) + { + return availRegions; + } + + if(regions.isEmpty()) + { + readRegions(); + } + + if(mappingList.isEmpty()) + { + readMappings(); + } + int regCount = regions.count(); + for(int i = 0; i < regCount; i++) + { + int region = regions.at(i); + int count = mappingList.count(); + for (int j = 0; j < count; j++) + { + HbLocaleMapping mapping = mappingList.at(j); + QString regCode = mapping.regionDllId; + if(region == regCode.toUInt()) + { + availRegions.append(mapping.regName); + break; + } + } + } + return availRegions; +#else + return QStringList(); +#endif +} + +/*! + \brief Converts two letter region identifier to localised region name. + + \attention Symbian specific API + + \param region region identifier + + \return Symbian - localised name of the region, an empty String if translation fails + \return other platforms - empty QString +*/ +QString HbLocaleUtil::localisedRegionName( const QString ®ion ) +{ +#if defined(Q_OS_SYMBIAN) + if(locRegionNames.isEmpty()) + { + QTranslator translator; + QString path = "c:"; + path += QString(REGION_TRANSLATOR_PATH); + if (!translator.load(path)) { + path = "z:"; + path += QString(REGION_TRANSLATOR_PATH); + if (!translator.load(path)) { + return QString(""); + } + } + + QCoreApplication::installTranslator(&translator); + + if(mappingList.isEmpty()) + { + readMappings(); + } + int cnt = mappingList.count(); + for(int i = 0 ; i < cnt; i++ ) + { + HbLocaleMapping map = mappingList.at(i); + QString regionName = QString(REGION_ID_PREFIX); + regionName += '_'; + regionName += map.regName; + QString locRegName = hbTrId(regionName.toAscii().constData()); + if(locRegName != regionName) + locRegionNames.insert(map.regName, locRegName); + } + } + + return locRegionNames.value(region); +#else + Q_UNUSED(region); + return QString(); +#endif +} + +/*! + \brief Changes the system region. + The region parameter should correspond with one of the identifiers returned by supportedRegions(). + + \attention Symbian specific API + + \param region identifier of region to set active + + \return true if region change was successful for Symbian and false for other platforms +*/ +bool HbLocaleUtil::changeRegion( const QString ®ion ) +{ +#if defined(Q_OS_SYMBIAN) + TExtendedLocale dummy; + QString regDllName = QString( "elocl_reg." ); + + if(mappingList.isEmpty()) + { + readMappings(); + } + int count = mappingList.count(); + for (int j = 0; j < count; j++) + { + HbLocaleMapping mapping = mappingList.at(j); + QString name = mapping.regName; + if(name == region) + { + dummy.LoadSystemSettings(); + regDllName += mapping.regionDllId; + TPtrC nameptr(regDllName.utf16()); + TInt err = dummy.LoadLocaleAspect( nameptr ); + if( err != KErrNone ) + return false; + dummy.SaveSystemSettings(); + // cause localeprivate update on next qlocale object + QSystemLocale dummy2; + return true; + } + } + return false; +#else + Q_UNUSED(region); + return false; +#endif +} + +/*! + \brief Return identifier of the current region. + + \attention Symbian specific API + + \return identifier of the region for Symbian and empty QString for other platforms +*/ +QString HbLocaleUtil::currentRegion() +{ +#if defined(Q_OS_SYMBIAN) + if(mappingList.isEmpty()) + { + readMappings(); + } + TRegionCode reg = User::RegionCode(); + int cnt = mappingList.count(); + for(int i = 0; i < cnt; i++) + { + HbLocaleMapping mapping = mappingList.at(i); + int dllid = mapping.regionDllId.toInt(); + if(dllid == reg) + { + return mapping.regName; + } + } +#endif + return QString(); +} + +#if defined(Q_OS_SYMBIAN) +/*! + \brief reads the collations.txt file and reads the list of symbian collation codes +*/ +void readCollations() +{ + QFile* file = new QFile(COLLATION_LIST_FILE); + if (!file->exists() ) + { + delete file; + return ; + } + if (!file->open(QIODevice::ReadOnly | QIODevice::Text)) + { + delete file; + return ; + } + QTextStream in(file); + while (!in.atEnd()) + { + QString line = in.readLine(256); + if (!line.isEmpty()) + { + int colCode = line.toUInt(); + collations.append(colCode); + } + } + return ; +} +#endif + +/*! + \brief Returns identifiers of collations supported in a device. + Collation identifier may be two-letter ISO 639 language code or combination of ISO 639 language code and ISO 3166 country code + Ex: Great Britain english it returns "en". + Ex: For U.S. english it returns "en_US" + + \attention Symbian specific API + + \return identifiers of supported collations for Symbian and empty QStringList for other platforms +*/ +QStringList HbLocaleUtil::supportedCollations() +{ +#if defined(Q_OS_SYMBIAN) + if(!availCollations.isEmpty()) + { + return availCollations; + } + + if(collations.isEmpty()) + { + readCollations(); + } + + if(mappingList.isEmpty()) + { + readMappings(); + } + int colCount = collations.count(); + for(int i = 0; i < colCount; i++) + { + int collation = collations.at(i); + int count = mappingList.count(); + for (int j = 0; j < count; j++) + { + HbLocaleMapping mapping = mappingList.at(j); + QString colCode = mapping.collationDllId; + if(collation == colCode.toUInt()) + { + availCollations.append(mapping.collName); + break; + } + } + } + return availCollations; +#else + return QStringList(); +#endif +} + +/*! + \brief Converts collation identifier to localised collation name. + + \attention Symbian specific API + + \param collation region collation identifier + + \return Symbian - localised name of the collation, an empty String if translation fails + \return other platforms - empty QString +*/ +QString HbLocaleUtil::localisedCollationName( const QString &collation ) +{ +#if defined(Q_OS_SYMBIAN) + if(locCollationNames.isEmpty()) + { + QTranslator translator; + QString path = "c:"; + path += QString(COLLATION_TRANSLATOR_PATH); + if (!translator.load(path)) { + path = "z:"; + path += QString(COLLATION_TRANSLATOR_PATH); + if (!translator.load(path)) { + return QString(""); + } + } + + QCoreApplication::installTranslator(&translator); + + if(mappingList.isEmpty()) + { + readMappings(); + } + int cnt = mappingList.count(); + for(int i = 0 ; i < cnt; i++ ) + { + HbLocaleMapping map = mappingList.at(i); + QString collationName = QString(COLLATION_ID_PREFIX); + collationName += '_'; + collationName += map.collName; + QString locColName = hbTrId(collationName.toAscii().constData()); + if(locColName != collationName) + locCollationNames.insert(map.collName, locColName); + } + } + + return locCollationNames.value(collation); +#else + Q_UNUSED(collation); + return QString(); +#endif +} + +/*! + \brief Changes the system collation. + The collation parameter should correspond with one of the identifiers returned by supportedCollations(). + + \attention Symbian specific API + + \param collation identifier of collation to set active + \return true if collation change was successful for Symbian and false for other platforms +*/ +bool HbLocaleUtil::changeCollation( const QString &collation ) +{ +#if defined(Q_OS_SYMBIAN) + TExtendedLocale dummy; + QString colDllName = QString( "elocl_col." ); + + if(mappingList.isEmpty()) + { + readMappings(); + } + int count = mappingList.count(); + for (int j = 0; j < count; j++) + { + HbLocaleMapping mapping = mappingList.at(j); + QString name = mapping.collName; + if(name == collation) + { + dummy.LoadSystemSettings(); + colDllName += mapping.collationDllId; + TPtrC nameptr(colDllName.utf16()); + TInt err = dummy.LoadLocaleAspect( nameptr ); + if( err != KErrNone ) + return false; + dummy.SaveSystemSettings(); + // cause localeprivate update on next qlocale object + QSystemLocale dummy2; + return true; + } + } + return false; +#else + Q_UNUSED(collation); + return false; +#endif +} + +/*! + \brief Return identifier of the current collation. + + \attention Symbian specific API + + \return identifier of the collation for Symbian and empty QString for other platforms +*/ +QString HbLocaleUtil::currentCollation() +{ +#if defined(Q_OS_SYMBIAN) + if(mappingList.isEmpty()) + { + readMappings(); + } + TExtendedLocale dummy; + dummy.LoadSystemSettings(); + TBuf<256> name; + dummy.GetLocaleDllName(ELocaleCollateSetting,name); + + QString dllname; +#ifdef QT_NO_UNICODE + dllname = QString::fromLocal8Bit(name.Ptr(), name.Length()); +#else + dllname = QString::fromUtf16(name.Ptr(), name.Length()); +#endif + + dllname = dllname.right(COLLATION_DLL_PREFIX_POSITION); + int cnt = mappingList.count(); + for(int i = 0; i < cnt; i++) + { + HbLocaleMapping mapping = mappingList.at(i); + QString dllid = mapping.collationDllId; + if(dllid == dllname) + { + return mapping.collName; + } + } +#endif + return QString(); +} + +/*! + \brief Changes the system language, region and collation. + The language parameter should correspond with one of the identifiers returned by supportedLanguages(). + Proper region and collation is selected automatically according the language. + + \attention Symbian specific API + + \param language identifier of language which language, region and collation settings should set active + + \return Symbian - true if language, region and collation change was successful + \return other platforms - false +*/ +bool HbLocaleUtil::changeLocale( const QString &language ) +{ +#if defined(Q_OS_SYMBIAN) + if(mappingList.isEmpty()) { + readMappings(); + } + + for (int i = 0; i < mappingList.count(); ++i) { + HbLocaleMapping map = mappingList.at(i); + if (map.langName == language) { + if (!changeLanguage(map.langName)) { + return false; + } + if (!changeRegion(map.regName)) { + return false; + } + if (!changeCollation(map.collName)) { + return false; + } + return true; + } + } +#else + Q_UNUSED(language); +#endif // Q_OS_SYMBIAN + return false; +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hblocaleutil.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/i18n/hblocaleutil.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,53 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBLOCALEUTIL_H +#define HBLOCALEUTIL_H + +#include +#include + +class HB_CORE_EXPORT HbLocaleUtil +{ +public: + static QString currentLanguage(); + static QStringList supportedLanguages(); + static QString localisedLanguageName( const QString &language ); + static bool changeLanguage( const QString &language ); + + static QString currentRegion(); + static QStringList supportedRegions(); + static QString localisedRegionName( const QString ®ion ); + static bool changeRegion( const QString ®ion ); + + static QString currentCollation(); + static QStringList supportedCollations(); + static QString localisedCollationName( const QString &collation ); + static bool changeCollation( const QString &collation ); + + static bool changeLocale( const QString &language ); +}; + +#endif /* HBLOCALEUTIL_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbngnormalnumber.cpp --- a/src/hbcore/i18n/hbngnormalnumber.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbngnormalnumber.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,6 +30,13 @@ QHash countryList; } +/*! + Function for general grouping. + + \param number QString which contains numbers + \param country locale for grouping + \return grouped numbers +*/ QString HbNgNormalNumber::normalNumberGrouping( const QString &number, const QLocale::Country &country ) { @@ -58,6 +65,16 @@ return HbNgNormalNumber::formatingGroup(number, firstNumber, lastNumber, dot, sign, decimal, group, patternBlockSizes); } +/*! + Verifies that number string is valid. + + \param number QString which contains numbers + \param firstNumber index of first number + \param lastNumber index of last number + \param dot index of dot + \param sign boolean which tells is there sign used + \return true if valid +*/ bool HbNgNormalNumber::checkingNumber( const QString &number, int &firstNumber, int &lastNumber, @@ -153,6 +170,15 @@ return true; } +/*! + Reads locale data from XML if needed. + + \param country locale for grouping + \param decimal character(s) for decimal + \param group character(s) for group separator + \param patternBlockSizes list of blocks + \return true if successful +*/ bool HbNgNormalNumber::checkingXML( const QLocale::Country &country, QString &decimal, QString &group, @@ -171,7 +197,7 @@ decimal = numberGrpReader.getDecimal(); group = numberGrpReader.getGroup(); - if ( (pattern == "") || (decimal == "") ) { + if ( (pattern.isEmpty()) || (decimal.isEmpty()) ) { // XML doesn't contain all needed information or reading has failed return false; } @@ -192,7 +218,7 @@ NgNormalNumber::countryList.insert(country, tempCountryData); } else { // Data found - HbNgNormalNumber::CountryData tempCountryData2 = iter.value(); + HbNgNormalNumber::CountryData tempCountryData2 = iter.value(); pattern = tempCountryData2.pattern; decimal = tempCountryData2.decimal; group = tempCountryData2.group; @@ -202,6 +228,12 @@ return true; } +/*! + Verifies that pattern for gouping is valid. + + \param pattern rules for grouping + \return size of (number) block +*/ QList HbNgNormalNumber::checkingPattern( const QString &pattern ) { int index = 0; @@ -242,6 +274,19 @@ return blockSizes; } +/*! + Grouping numbers + + \param number QString which contains numbers + \param firstNumber index of first number + \param lastNumber index of last number + \param dot index of dot + \param sign boolean which tells is there sign used + \param decimal character(s) for decimal + \param group character(s) for group separator + \param patternBlockSizes list of blocks + \return grouped numbers +*/ QString HbNgNormalNumber::formatingGroup( const QString &number, const int &firstNumber, const int &lastNumber, @@ -278,7 +323,7 @@ numberOfBlocks = patternBlockSizes.length(); patternBlockSize = patternBlockSizes.last(); - for ( index = tempDot-1; index > firstNumber-1; index-- ) { + for ( index = tempDot-1; index > firstNumber-1; --index ) { if ( blockCounter < patternBlockSize ) { // Inserting number... formated.insert(0, number.at(index)); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbngnormalnumber_p.h --- a/src/hbcore/i18n/hbngnormalnumber_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbngnormalnumber_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBNGNORMALNUMBER_H -#define HBNGNORMALNUMBER_H +#ifndef HBNGNORMALNUMBER_P_H +#define HBNGNORMALNUMBER_P_H #include #include @@ -63,4 +63,4 @@ const QList &patternBlockSizes ); }; -#endif +#endif // HBNGNORMALNUMBER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbnumbergrouping.cpp --- a/src/hbcore/i18n/hbnumbergrouping.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbnumbergrouping.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -38,7 +38,7 @@ - Also '+' and '-' characters are supported. - Decimal separator needs to be a dot '.' always. - Any other characters than above descripted are not allowed. - - If grouping fails for some reason then return value is empty QString (NULL). + - If grouping fails for some reason then return value is empty QString. - At the moment currency mark is not added to return value (formatCurrency). - Grouping for phone numbers is not activated yet. @@ -50,11 +50,14 @@ /*! Static function for creating a (generic) number group. + + \attention Cross-Platform API \param number Source number for grouping. \param country Format for number converting. If the country is not given (country = QLocale::AnyCountry) then it will be requested from QLocale::country. - \return Modified string. + + \return modified string. */ QString HbNumberGrouping::formatGeneric( const QString &number, QLocale::Country country ) @@ -73,11 +76,14 @@ /*! Static function for creating a currency group. + + \attention Cross-Platform API \param number Source number for grouping. \param country Format for number converting. If the country is not given (country = QLocale::AnyCountry) then it will be requested from QLocale::country. - \return Modified string. + + \return modified string. */ QString HbNumberGrouping::formatCurrency( const QString &number, QLocale::Country country ) @@ -97,10 +103,13 @@ /*! Static function for creating a phone number group. + \attention Cross-Platform API + \param number Source number for grouping. \param country Format for number converting. If the country is not given (country = QLocale::AnyCountry) then it will be requested from QLocale::country. - \return Modified string. + + \return modified string. */ QString HbNumberGrouping::formatPhoneNumber( const QString &number, QLocale::Country country ) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbnumbergrouping.h --- a/src/hbcore/i18n/hbnumbergrouping.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbnumbergrouping.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,4 +40,4 @@ QLocale::Country country = QLocale::AnyCountry ); }; -#endif +#endif // HBNUMBERGROUPING_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbnumbergrpxmlreader.cpp --- a/src/hbcore/i18n/hbnumbergrpxmlreader.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbnumbergrpxmlreader.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,6 +29,11 @@ using namespace HbNumberGrpXmlReaderHelp; +/*! + Constructor of class + + \param localeId identifier for locale +*/ HbNumberGrpXmlReader::HbNumberGrpXmlReader( int localeId ) { locale.setNum(localeId); @@ -50,35 +55,54 @@ } } +/*! + \return pattern for grouping +*/ QString HbNumberGrpXmlReader::getPattern() { return pattern; } +/*! + \return character(s) for group +*/ QString HbNumberGrpXmlReader::getGroup() { return group; } +/*! + \return character(s) for decimal +*/ QString HbNumberGrpXmlReader::getDecimal() { return decimal; } -HbNumberGrpXmlReader::HbNumberGrpXmlReader() -{ -} - +/*! + Destructor of class. +*/ HbNumberGrpXmlReader::~HbNumberGrpXmlReader() { } +/*! + This function is needed by XML reader. + + \return true +*/ bool HbNumberGrpXmlReader::startDocument() { return true; } +/*! + This function is needed by XML reader. + + \param qName element which will be readed + \return true +*/ bool HbNumberGrpXmlReader::startElement( const QString &, const QString &, const QString &qName, @@ -102,6 +126,12 @@ return true; } +/*! + This function is needed by XML reader. + + \param text readed element + \return true +*/ bool HbNumberGrpXmlReader::characters( const QString &text ) { if ( done ) { @@ -113,7 +143,7 @@ // This little trick is needed because of limitation in XML reader // XML reader doesn't read space character corretly if ( text.at(0).toAscii() == 32 ) { // " " - tmpText = " "; + tmpText = ' '; } else { tmpText = text; } @@ -132,6 +162,12 @@ return true; } +/*! + This function is needed by XML reader. + + \param qName element which was readed + \return true +*/ bool HbNumberGrpXmlReader::endElement( const QString &, const QString &, const QString &qName ) @@ -143,6 +179,11 @@ return true; } +/*! + This function is needed by XML reader. + + \return true +*/ bool HbNumberGrpXmlReader::endDocument() { return true; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbnumbergrpxmlreader_p.h --- a/src/hbcore/i18n/hbnumbergrpxmlreader_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbnumbergrpxmlreader_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef NUMBERGRPXMLREADER_H_ -#define NUMBERGRPXMLREADER_H_ +#ifndef NUMBERGRPXMLREADER_P_H +#define NUMBERGRPXMLREADER_P_H #include #include @@ -57,8 +57,6 @@ QString getPattern(); QString getGroup(); QString getDecimal(); -private: - HbNumberGrpXmlReader(); private: QString locale; @@ -71,4 +69,4 @@ }; -#endif // NUMBERGRPXMLREADER_H_ +#endif // NUMBERGRPXMLREADER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbparameterlengthlimiter.cpp --- a/src/hbcore/i18n/hbparameterlengthlimiter.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbparameterlengthlimiter.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include "hbparameterlengthlimiter_p.h" /*! - @alpha + @stable @hbcore \class HbParameterLengthLimiter \brief HbParameterLengthLimiter is a class that offers support to insert different types of arguments into a QString. @@ -44,14 +44,17 @@ limited argument is the second argument to be inserted. - %Lx for inserting numbers, x is used to indicate argument inserting order. - Example of how to use HbParameterLengthLimiter + Example of how to use HbParameterLengthLimiter: \snippet{unittest_HbParameterLengthLimiter/unittest_HbParameterLengthLimiter.cpp,1} */ /*! Constructs a HbParameterLengthLimiter with \a HbParameterLengthLimiter. - \a HbLengthLimter& - HbParameterLengthLimiter that will have arguments inserted + + \attention Cross-Platform API + + \param a HbParameterLengthLimiter that will have arguments inserted */ HbParameterLengthLimiter::HbParameterLengthLimiter( const HbParameterLengthLimiter& a ) { @@ -59,10 +62,12 @@ p->str = a.p->str; } - /*! Constructs a HbParameterLengthLimiter with \a QString. - \a QString - QString that will have arguments inserted + + \attention Cross-Platform API + + \param a QString that will have arguments inserted */ HbParameterLengthLimiter::HbParameterLengthLimiter( QString a ) { @@ -72,7 +77,10 @@ /*! Constructs a HbParameterLengthLimiter with \a char*. - \a const char* - char string that will have arguments inserted + + \attention Cross-Platform API + + \param a char string that will have arguments inserted */ HbParameterLengthLimiter::HbParameterLengthLimiter( const char* a ) { @@ -81,9 +89,12 @@ } /*! - Constructs a HbParameterLengthLimiter with \a char*. - \a const char* - char string that will have arguments inserted - \n int - used to identify which plural form to use + Constructs a HbParameterLengthLimiter with \a char* and \a int. + + \attention Cross-Platform API + + \param a char string that will have arguments inserted + \param n used to identify which plural form to use */ HbParameterLengthLimiter::HbParameterLengthLimiter( const char* a, int n ) { @@ -93,6 +104,8 @@ /*! Conp->structs a HbParameterLengthLimiter without a predefined QString. + + \attention Cross-Platform API */ HbParameterLengthLimiter::HbParameterLengthLimiter() { @@ -110,10 +123,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a qlonglong - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldwidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg(qlonglong a, int fieldwidth, @@ -127,10 +143,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a qulonglong - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldwidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( qulonglong a, int fieldwidth, @@ -145,10 +164,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a long - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldwidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( long a, int fieldwidth, @@ -163,10 +185,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a ulong - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldwidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( ulong a, int fieldwidth, @@ -180,10 +205,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a int - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( int a, int fieldWidth, @@ -198,10 +226,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a uint - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( uint a, int fieldWidth, @@ -215,10 +246,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a short - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( short a, int fieldWidth, @@ -232,10 +266,13 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a ushort - number that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \base int - defines the number base - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a number that will be inserted to the QString + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param base defines the number base + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( ushort a, int fieldWidth, @@ -249,11 +286,14 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a double - Argument a is formatted according to the specified format and precision. - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \fmt char - defines the format to be used - \prec int - defines the precision to be used - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a argument a is formatted according to the specified format and precision + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param fmt defines the format to be used + \param prec defines the precision to be used + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( double a, int fieldWidth, @@ -268,9 +308,12 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a char - character that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a character that will be inserted to the QString + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( char a, int fieldWidth, @@ -283,9 +326,12 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a QChar - character that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a character that will be inserted to the QString + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( QChar a, int fieldWidth, @@ -298,9 +344,12 @@ /*! Inserts an \a argument to a HbParameterLengthLimiter QString. - \a QString - QString that will be inserted to the QString - \fieldwidth int - specifies the minimum amount of space that a is padded to and filled with the character fillChar - \fillChar QChar - defines the fill character + + \attention Cross-Platform API + + \param a string that will be inserted to the QString + \param fieldWidth specifies the minimum amount of space that a is padded to and filled with the character fillChar + \param fillChar defines the fill character */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a, int fieldWidth, @@ -337,6 +386,9 @@ while( p->str.at(i) != ']' ) { i++; + if( i >= p->str.length() ) { + break; + } } i++; @@ -431,9 +483,12 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString + Inserts an arguments a1 and a2 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2 ) @@ -443,10 +498,13 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString - \a3 QString - QString that will be inserted to the QString + Inserts an arguments a1, a2 and a3 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString + \param a3 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2, @@ -457,11 +515,14 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString - \a3 QString - QString that will be inserted to the QString - \a4 QString - QString that will be inserted to the QString + Inserts an arguments a1, a2, a3 and a4 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString + \param a3 string that will be inserted to the QString + \param a4 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2, @@ -473,12 +534,15 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString - \a3 QString - QString that will be inserted to the QString - \a4 QString - QString that will be inserted to the QString - \a5 QString - QString that will be inserted to the QString + Inserts an arguments a1, a2, a3, a4 and a5 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString + \param a3 string that will be inserted to the QString + \param a4 string that will be inserted to the QString + \param a5 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2, @@ -491,13 +555,16 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString - \a3 QString - QString that will be inserted to the QString - \a4 QString - QString that will be inserted to the QString - \a5 QString - QString that will be inserted to the QString - \a6 QString - QString that will be inserted to the QString + Inserts an arguments a1, a2, a3, a4, a5 and a6 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString + \param a3 string that will be inserted to the QString + \param a4 string that will be inserted to the QString + \param a5 string that will be inserted to the QString + \param a6 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2, @@ -511,14 +578,17 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString - \a3 QString - QString that will be inserted to the QString - \a4 QString - QString that will be inserted to the QString - \a5 QString - QString that will be inserted to the QString - \a6 QString - QString that will be inserted to the QString - \a7 QString - QString that will be inserted to the QString + Inserts an arguments a1, a2, a3, a4, a5, a6 and a7 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString + \param a3 string that will be inserted to the QString + \param a4 string that will be inserted to the QString + \param a5 string that will be inserted to the QString + \param a6 string that will be inserted to the QString + \param a7 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2, @@ -533,15 +603,18 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString - \a3 QString - QString that will be inserted to the QString - \a4 QString - QString that will be inserted to the QString - \a5 QString - QString that will be inserted to the QString - \a6 QString - QString that will be inserted to the QString - \a7 QString - QString that will be inserted to the QString - \a8 QString - QString that will be inserted to the QString + Inserts an arguments a1, a2, a3, a4, a5, a6, a7 and a8 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString + \param a3 string that will be inserted to the QString + \param a4 string that will be inserted to the QString + \param a5 string that will be inserted to the QString + \param a6 string that will be inserted to the QString + \param a7 string that will be inserted to the QString + \param a8 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2, @@ -557,16 +630,19 @@ } /*! - Inserts an arguments \a1 and \a2 to a HbParameterLengthLimiter QString. - \a1 QString - QString that will be inserted to the QString - \a2 QString - QString that will be inserted to the QString - \a3 QString - QString that will be inserted to the QString - \a4 QString - QString that will be inserted to the QString - \a5 QString - QString that will be inserted to the QString - \a6 QString - QString that will be inserted to the QString - \a7 QString - QString that will be inserted to the QString - \a8 QString - QString that will be inserted to the QString - \a9 QString - QString that will be inserted to the QString + Inserts an arguments a1, a2, a3, a4, a5, a6, a7, a8 and a9 to a HbParameterLengthLimiter QString. + + \attention Cross-Platform API + + \param a1 string that will be inserted to the QString + \param a2 string that will be inserted to the QString + \param a3 string that will be inserted to the QString + \param a4 string that will be inserted to the QString + \param a5 string that will be inserted to the QString + \param a6 string that will be inserted to the QString + \param a7 string that will be inserted to the QString + \param a8 string that will be inserted to the QString + \param a9 string that will be inserted to the QString */ HbParameterLengthLimiter& HbParameterLengthLimiter::arg( const QString &a1, const QString &a2, @@ -583,8 +659,11 @@ } /*! - Changes the QString that is to be used for inserting arguments to \a. - \a QString - QString that will be used for inserting arguments + Changes the QString that is to be used for inserting arguments to QString. + + \attention Cross-Platform API + + \param a QString that will be used for inserting arguments */ HbParameterLengthLimiter& HbParameterLengthLimiter::operator=( const QString &a ) { @@ -593,8 +672,11 @@ } /*! - Changes the QString that is to be used for inserting arguments to \a. - \a HbParameterLengthLimiter - HbParameterLengthLimiter holding the QString that will be used for inserting arguments + Changes the QString that is to be used for inserting arguments to HbParameterLengthLimiter. + + \attention Cross-Platform API + + \param a HbParameterLengthLimiter holding the QString that will be used for inserting arguments */ HbParameterLengthLimiter& HbParameterLengthLimiter::operator=( const HbParameterLengthLimiter &a ) { @@ -603,7 +685,9 @@ } /*! - returns the current QString. + Returns the current QString. + + \attention Cross-Platform API */ HbParameterLengthLimiter::operator QString() const { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbparameterlengthlimiter.h --- a/src/hbcore/i18n/hbparameterlengthlimiter.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbparameterlengthlimiter.h Thu Jul 22 16:36:53 2010 +0100 @@ -92,4 +92,4 @@ HbParameterLengthLimiterPrivate* p; }; -#endif // HbParameterLengthLimiter_H +#endif // HBPARAMETERLENGTHLIMITER_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbparameterlengthlimiter_p.h --- a/src/hbcore/i18n/hbparameterlengthlimiter_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbparameterlengthlimiter_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #ifndef HBPARAMETERLENGTHLIMITER_P_H -#define HbPARAMETERLENGTHLIMITER_P_H +#define HBPARAMETERLENGTHLIMITER_P_H #include @@ -41,4 +41,4 @@ QString str; }; -#endif // HbParameterLengthLimiter_H +#endif // HBPARAMETERLENGTHLIMITER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbstringutil.cpp --- a/src/hbcore/i18n/hbstringutil.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbstringutil.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -42,17 +42,12 @@ #endif /*! - @beta + @stable @hbcore \class HbStringUtil \brief The HbStringUtil class can be used to execute operations on strings, such as comparisons and finding data sequences. - \ingroup i18n - - \warning This class is only useful in Symbian platforms since it uses Symbian - methods in order to implement different functionalities. - \sa HbStringUtil */ @@ -85,6 +80,8 @@ /*! Searches source string's collated data for a match with collated data supplied in pattern string + + \attention Cross-Platform API \param strFrom Source string. \param strToMatch Pattern string. @@ -97,10 +94,11 @@ \param wildChar Wild card character. \param wildSequenceChar Wild card sequence character. \param escapeChar The escape character, for example, '?', '*'. + \return If a match is found the offset within source string's data where the match first occurs. -1 if match is not found. - Example + Example: \snippet{unittest_hbstringutil/unittest_hbstringutil.cpp,3} */ int HbStringUtil::matchC( const QString &strFrom, const QString &strToMatch, @@ -144,6 +142,8 @@ Compares source string's data with the other string's data using the specified collation method. + \attention Cross-Platform API + \param string1 Source string. \param string2 String whose data is to be compared with the source string. \param maxLevel Maximum level to use for comparing. @@ -152,10 +152,11 @@ Level 2 - Character identity, accents and case; Level 3 - Character identity, accents, case and Unicode value; \param flags The flags that will be used. Default value is Default. + \return Positive if source string is greater, negative if it is less and zero if the content of both strings match. - Example + Example: \snippet{unittest_hbstringutil/unittest_hbstringutil.cpp,1} */ int HbStringUtil::compareC( const QString &string1, const QString &string2, @@ -184,10 +185,12 @@ } /*! - Searches for the first occurence of the specified collated + Searches for the first occurrence of the specified collated data sequence in the aStrFrom to the specified maximum collation level. + \attention Cross-Platform API + \param strFrom Source string. \param strToFind String whose data is to be compared with the source string. \param maxLevel The maximum collation level. @@ -195,10 +198,11 @@ Level 1 - Character identity and accents; Level 2 - Character identity, accents and case; Level 3 - Character identity, accents, case and Unicode value; + \return Offset of the data sequence from the beginning of the aStrFrom. -1 if the data sequence cannot be found. - Example + Example: \snippet{unittest_hbstringutil/unittest_hbstringutil.cpp,5} */ int HbStringUtil::findC( const QString &strFrom, @@ -225,12 +229,15 @@ Searches source string's folded data for a match with folded data supplied in pattern string + \attention Cross-Platform API + \param strFrom Source string. \param strToMatch Pattern string. + \return If a match is found the offset within source string's data where the match first occurs. -1 if match is not found. - Example + Example: \snippet{unittest_hbstringutil/unittest_hbstringutil.cpp,4} */ int HbStringUtil::matchF( const QString &strFrom, @@ -254,16 +261,19 @@ } /*! - Searches for the first occurence of the specified folded + Searches for the first occurrence of the specified folded data sequence in the strFrom. + \attention Cross-Platform API + \param strFrom Source string. \param strToFind String whose data is to be compared with the source string. + \return Offset of the data sequence from the beginning of the strFrom. -1 if the data sequence cannot be found. Zero, if the length of search data sequence is zero. - Example + Example: \snippet{unittest_hbstringutil/unittest_hbstringutil.cpp,6} */ int HbStringUtil::findF( const QString &strFrom, @@ -283,12 +293,15 @@ Compares source string's folded data with the other string's folded data. + \attention Cross-Platform API + \param string1 Source string. \param string2 String whose data is to be compared with the source string. + \return Positive if source string is greater, negative if it is less and zero if the content of both strings match. - Example + Example: \snippet{unittest_hbstringutil/unittest_hbstringutil.cpp,2} */ int HbStringUtil::compareF( const QString &string1, @@ -311,7 +324,7 @@ */ static QChar nativeDigitBase(QChar ch) { - DigitType d[] = { WesternDigit, ArabicIndicDigit, EasternArabicIndicDigit, DevanagariDigit, ThaiDigit }; + DigitType d[] = { WesternDigit, ArabicIndicDigit, EasternArabicIndicDigit, DevanagariDigit, ThaiDigit }; int i = 0; int num = sizeof(d)/sizeof(d[0]); while(i #include +#if defined(Q_OS_SYMBIAN) + #define PLATFORM_WITH_DRIVES +#elif defined(Q_OS_WIN32) + #define PLATFORM_WITH_DRIVES +#else + #undef PLATFORM_WITH_DRIVES +#endif -const QString defaultpath = "/resource/qt/translations/"; +#ifdef Q_OS_SYMBIAN +const char* defaultPath = "/resource/qt/translations/"; +const char* defaultDrive = "Z:"; +const char* defaultCommon = "common_"; +#else +const char* defaultPath = ""; +const char* defaultDrive = ""; +const char* defaultCommon = "common_"; + +#endif + +#ifdef Q_OS_SYMBIAN +#include +#include +#endif + +#ifdef Q_OS_SYMBIAN +/*! + Convert path to Symbian version +*/ +static void toSymbianPath(QString &path) { + int len=path.length(); + for (int i=0; iFsSession(); + QString qmFile2; + QString delims="_."; + TInt err; + for (;;) { + qmFile2=qmFile; + qmFile2 += QString(".qm"); + + TPtrC ptrFName(reinterpret_cast(qmFile2.constData())); + err= fl.Open(fs, ptrFName, EFileShareReadersOrWriters | EFileRead | EFileStream ); + if (err == KErrNotFound) { + if (!doFallback) { // no fallback, then return + return false; + } + // else continue + } else { + if (err != KErrNone ) { // if some other error return error, don't look anymore + return false; + } else { + break; // file was found + } + } + // do fallback + qmFile2 = qmFile; + ptrFName.Set((ushort*)(qmFile2.constData()), qmFile2.length()); + err= fl.Open(fs, ptrFName, EFileShareReadersOrWriters | EFileRead | EFileStream ); + if (err == KErrNone) { + break; + } else { + if (err != KErrNotFound) { + return false; + } + } + // check fallback names + int rightmost = 0; + for (int i=0; i<(int)delims.length(); i++) { + int k=qmFile.lastIndexOf(delims[i]); + if (k>rightmost) { + rightmost=k; + } + } + + if (rightmost==0) { + return false; + } + qmFile.truncate(rightmost); + } + + TInt sz; + err = fl.Size(sz); + if (err != KErrNone) { + fl.Close(); + return false; + } + uchar *buf = new uchar[sz]; + TPtr8 bufPtr(buf,0,sz); + err = fl.Read(bufPtr, sz); + if (err != KErrNone) { + fl.Close(); + return false; + } + fl.Close(); + if (!translator.load(bufPtr.Ptr(),sz)) { + delete buf; + return false; + } + buffer = buf; + return true; + +#endif +} + +/*! + @stable @hbcore \class HbTranslator \brief HbTranslator installs QTranslator(s) automatically needed in localisation and loads translation files into QTranslator. + + Note: file name should be given without language and .qm postfix. + Eg. if English qm file name is testapp_en.qm + \code + HbTranslator trans("testapp"); + \endcode + which loads correct testapp_xx.qm file from default location, where xx is postfix for current system locale, eg "en". + + \sa hbTrId */ /*! - Default case: searches translation file from default location (/resource/qt/translations/) with default name, which is .qm + Default case: searches translation file from default location (/resource/qt/translations/) with default name, which is EXECUTABLENAME_xx.qm + + \attention Cross-Platform API */ HbTranslator::HbTranslator(): d(new HbTranslatorPrivate()) { QFileInfo info(qApp->applicationFilePath()); - QString defaultname = info.baseName(); // defaultname = - d->installTranslator(defaultpath, defaultname); + QString defaultName = info.baseName(); // defaultname = + d->translatorPath=defaultPath; + d->translatorFile=defaultName; + d->installTranslator(defaultPath, defaultName); } /*! Searches translation file \a file from default location. + + \attention Cross-Platform API */ - HbTranslator::HbTranslator(const QString &file): d(new HbTranslatorPrivate()) { - d->installTranslator(defaultpath, file); + d->translatorPath=defaultPath; + d->translatorFile=file; + d->installTranslator(defaultPath, file); } /*! Searches translation file \a file from path \a path. + + \attention Cross-Platform API + \code - HbTranslator trans = new HbTranslator("/resource/qt/custom/", "customfile"); + HbTranslator trans("/resource/qt/custom/", "customfile"); \endcode */ HbTranslator::HbTranslator(const QString &path, const QString &file): d(new HbTranslatorPrivate()) { + d->translatorPath=defaultPath; + d->translatorFile=file; d->installTranslator(path, file); } +/*! + Destructor +*/ HbTranslator::~HbTranslator() { delete d; } +static bool commonTr = false; +#include +#include +Q_GLOBAL_STATIC_WITH_ARGS(QMutex, gs_CommonTrMutex, (QMutex::Recursive) ) + /*! Loads common.ts translations from default location. + + \attention Cross-Platform API */ void HbTranslator::loadCommon() -{ - QString lang = QLocale::system().name(); - QString commonts = QString("Z:") + defaultpath + QString("common_") + lang; - d->common.load(commonts); - qApp->installTranslator(&d->common); +{ + QMutexLocker ml(gs_CommonTrMutex()); + if (!commonTr) { + QString lang = QLocale::system().name(); + d->languageDowngrade(lang); + QString commonts; + commonts += QString(defaultDrive); + commonts += QString(defaultPath); + commonts += QString(defaultCommon); + commonts += lang; +#ifdef Q_OS_SYMBIAN + toSymbianPath(commonts); +#endif + bool loaded; + uchar *commonData=0; + loaded = loadTranslatorData(d->common, commonts, d->commonData); + if (loaded) { + d->commonData = commonData; + d->commonTr=true; + qApp->installTranslator(&d->common); + commonTr=true; + } + } } -// internal function for common operations of HbTranslator -void HbTranslatorPrivate::installTranslator(const QString &path, const QString &name) +/*! + Destructor +*/ +HbTranslatorPrivate::~HbTranslatorPrivate() { - QString filepath = qApp->applicationFilePath(); - QChar drive = filepath.at(0); + qApp->removeTranslator(&translator); + if (translatorData) { + delete [] translatorData; + } + qApp->removeTranslator(&common); + if (commonData) { + delete [] commonData; + } + if (commonTr) { + ::commonTr=false; + } +} + +/*! + Internal function for common operations of HbTranslator. + + \param pth path for translation file + \param name translation file +*/ +void HbTranslatorPrivate::installTranslator(const QString &pth, const QString &name) +{ QString lang = QLocale::system().name(); QString lang2 = lang; languageDowngrade(lang); - QString tsfile = path + name + QString("_") + lang + QString(".qm"); - if (!HbFindFile::hbFindFile(tsfile, drive)) { - tsfile = path + name + QString("_") + lang2 + QString(".qm"); - HbFindFile::hbFindFile(tsfile); + QString path(pth); + if (path.isNull() || path.isEmpty()) { + return; + } + if (path.at(0) == ':') { + QString tsfile = path + name + QString("_") + lang; + if ( translator.load(tsfile) ) { + qApp->installTranslator(&translator); + } + return; + } + +#ifdef PLATFORM_WITH_DRIVES +#ifdef Q_OS_SYMBIAN + toSymbianPath(path); +#endif + QString filepath = qApp->applicationFilePath(); + QChar drive; + if (filepath.length()>=2 && filepath.at(1) == ':') { + drive = filepath.at(0); + } + + QString tsfile = path + name + QString("_") + lang; + QString tsfileQM = tsfile + QString(".qm"); + + bool loaded = false; + if (HbFindFile::hbFindFile(tsfileQM, drive)) { + tsfileQM.chop(3); + loaded = loadTranslatorData(translator,tsfileQM,translatorData); } - translator.load(tsfile); - qApp->installTranslator(&translator); + else { + tsfile = path + name + QString("_") + lang2; + tsfileQM = tsfile + QString(".qm"); + if (HbFindFile::hbFindFile(tsfileQM, drive)) { + tsfileQM.chop(3); + loaded = loadTranslatorData(translator,tsfileQM,translatorData); + } + else { + QList fallBack; + fallBack.append("en"); + fallBack.append("en_US"); + int len = fallBack.length(); + for (int i=0; iinstallTranslator(&translator); + } +#else + QString tsfile2 = path + name + QString("_") + lang; + if ( translator.load(tsfile2) ) { + qApp->installTranslator(&translator); + } +#endif } -// internal function for solving conflict between QLocale::system().name() and actual ts file naming convention. +/*! + Internal helper class. +*/ +class LanguageHash : public QHash +{ +public: + LanguageHash(); +}; + +/*! + Table for downgrade. +*/ +LanguageHash::LanguageHash(){ + (*this)["en_GB"] = "en"; + (*this)["fr_FR"] = "fr"; + (*this)["de_DE"] = "de"; + (*this)["es_ES"] = "es"; + (*this)["it_IT"] = "it"; + (*this)["sv_SE"] = "sv"; + (*this)["da_DK"] = "da"; + (*this)["no_NO"] = "no"; + (*this)["fi_FI"] = "fi"; + (*this)["en_US"] = "en_US"; + (*this)["pt_PT"] = "pt"; + (*this)["tr_TR"] = "tr"; + (*this)["is_IS"] = "is"; + (*this)["ru_RU"] = "ru"; + (*this)["hu_HU"] = "hu"; + (*this)["nl_NL"] = "nl"; + (*this)["cs_CZ"] = "cs"; + (*this)["sk_SK"] = "sk"; + (*this)["pl_PL"] = "pl"; + (*this)["sl_SI"] = "sl"; + (*this)["zh_TW"] = "zh_TW"; + (*this)["zh_HK"] = "zh_HK"; + (*this)["zh_CN"] = "zh_CN"; + (*this)["ja_JP"] = "ja"; + (*this)["th_TH"] = "th"; + (*this)["ar_AE"] = "ar"; + (*this)["tl_PH"] = "tl"; + (*this)["bg_BG"] = "bg"; + (*this)["ca_ES"] = "ca"; + (*this)["hr_HR"] = "hr"; + (*this)["et_EE"] = "et"; + (*this)["fa_IR"] = "fa"; + (*this)["fr_CA"] = "fr_CA"; + (*this)["el_GR"] = "el"; + (*this)["he_IL"] = "he"; + (*this)["hi_IN"] = "hi"; + (*this)["id_ID"] = "id"; + (*this)["ko_KR"] = "ko"; + (*this)["lv_LV"] = "lv"; + (*this)["lt_LT"] = "lt"; + (*this)["ms_MY"] = "ms"; + (*this)["pt_BR"] = "pt_BR"; + (*this)["ro_RO"] = "ro"; + (*this)["sr_YU"] = "sr"; + (*this)["es_MX"] = "es_MX"; + (*this)["uk_UA"] = "uk"; + (*this)["ur_PK"] = "ur"; + (*this)["vi_VN"] = "vi"; + (*this)["eu_ES"] = "eu"; + (*this)["gl_ES"] = "gl"; + +} + +Q_GLOBAL_STATIC(LanguageHash, gs_LanguageHash) + +/*! + Internal function for solving conflict between QLocale::system().name() and actual ts file naming convention. + + \param lang language for downgrading + \return true if successful +*/ bool HbTranslatorPrivate::languageDowngrade(QString &lang) { - static QHash languages; - languages["en_GB"] = "en"; - languages["fr_FR"] = "fr"; - languages["de_DE"] = "de"; - languages["es_ES"] = "es"; - languages["it_IT"] = "it"; - languages["sv_SE"] = "sv"; - languages["da_DK"] = "da"; - languages["no_NO"] = "no"; - languages["fi_FI"] = "fi"; - languages["en_US"] = "en_US"; - languages["pt_PT"] = "pt"; - languages["tr_TR"] = "tr"; - languages["is_IS"] = "is"; - languages["ru_RU"] = "ru"; - languages["hu_HU"] = "hu"; - languages["nl_NL"] = "nl"; - languages["cs_CZ"] = "cs"; - languages["sk_SK"] = "sk"; - languages["pl_PL"] = "pl"; - languages["sl_SI"] = "sl"; - languages["zh_TW"] = "zh_TW"; - languages["zh_HK"] = "zh_HK"; - languages["zh_CN"] = "zh_CN"; - languages["ja_JP"] = "ja"; - languages["th_TH"] = "th"; - languages["ar_AE"] = "ar"; - languages["tl_PH"] = "tl"; - languages["bg_BG"] = "bg"; - languages["ca_ES"] = "ca"; - languages["hr_HR"] = "hr"; - languages["et_EE"] = "et"; - languages["fa_IR"] = "fa"; - languages["fr_CA"] = "fr_CA"; - languages["el_GR"] = "el"; - languages["he_IL"] = "he"; - languages["hi_IN"] = "hi"; - languages["id_ID"] = "id"; - languages["ko_KR"] = "ko"; - languages["lv_LV"] = "lv"; - languages["lt_LT"] = "lt"; - languages["ms_MY"] = "ms"; - languages["pt_BR"] = "pt_BR"; - languages["ro_RO"] = "ro"; - languages["sr_YU"] = "sr"; - languages["es_MX"] = "es_MX"; //!! - languages["uk_UA"] = "uk"; - languages["ur_PK"] = "ur"; - languages["vi_VN"] = "vi"; - languages["eu_ES"] = "eu"; - languages["gl_ES"] = "gl"; - - if (languages.contains(lang)) { - lang = languages.value(lang); - return true; + QHash *languageHash = gs_LanguageHash(); + if (languageHash) { + if (languageHash->contains(lang)) { + lang = languageHash->value(lang); + return true; + } } return false; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/hbtranslator_p.h --- a/src/hbcore/i18n/hbtranslator_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/hbtranslator_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,19 +23,26 @@ ** ****************************************************************************/ -#ifndef HBTRANSLATORPRIVATE_H -#define HBTRANSLATORPRIVATE_H +#ifndef HBTRANSLATOR_P_H +#define HBTRANSLATOR_P_H class QTranslator; class HB_CORE_PRIVATE_EXPORT HbTranslatorPrivate { public: - void installTranslator(const QString &name, const QString &path); - bool languageDowngrade(QString &lang); - QTranslator translator; - QTranslator common; + void installTranslator(const QString &name, const QString &path); + bool languageDowngrade(QString &lang); + HbTranslatorPrivate(): translatorData(0), commonData(0), commonTr(false){} + ~HbTranslatorPrivate(); + QTranslator translator; + QTranslator common; + uchar *translatorData; + uchar *commonData; + bool commonTr; + QString translatorPath; + QString translatorFile; }; -#endif +#endif // HBTRANSLATOR_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/i18n.pri --- a/src/hbcore/i18n/i18n.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/i18n.pri Thu Jul 22 16:36:53 2010 +0100 @@ -1,4 +1,3 @@ -# ############################################################################# ## ## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). @@ -23,7 +22,6 @@ ## Nokia at developer.feedback@nokia.com. ## ############################################################################# -# INCLUDEPATH += $$PWD DEPENDPATH += $$PWD @@ -37,6 +35,7 @@ PUBLIC_HEADERS += $$PWD/hbfindfile.h PUBLIC_HEADERS += $$PWD/hbtranslator.h PUBLIC_HEADERS += $$PWD/hblanguageutil.h +PUBLIC_HEADERS += $$PWD/hblocaleutil.h PRIVATE_HEADERS += $$PWD/hbdntxmlreader_p.h PRIVATE_HEADERS += $$PWD/hbngnormalnumber_p.h @@ -54,9 +53,10 @@ SOURCES += $$PWD/hbngnormalnumber.cpp SOURCES += $$PWD/hbnumbergrpxmlreader.cpp SOURCES += $$PWD/hbparameterlengthlimiter.cpp +SOURCES += $$PWD/hbtranslator.cpp SOURCES += $$PWD/hbfindfile.cpp -SOURCES += $$PWD/hbtranslator.cpp SOURCES += $$PWD/hblanguageutil.cpp +SOURCES += $$PWD/hblocaleutil.cpp symbian:LIBS += -leuser -lhal -lcentralrepository -lptiengine -lSysLangUtil symbian:TARGET.CAPABILITY += WriteDeviceData diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/collations.qm Binary file src/hbcore/i18n/translations/collations.qm has changed diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/collations.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/i18n/translations/collations.ts Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,211 @@ + + + + + hblanguageswitch + + English + English + + + French + Français + + + German + Deutsch + + + Spanish + Español + + + Italian + Italiano + + + Swedish + Svenska + + + Danish + Dansk + + + Norwegian + Norsk + + + Finnish + Suomi + + + English (American) + English + + + Portuguese + Português + + + Turkish + Türkçe + + + Icelandic + Ãslenska + + + Russian + РуÑÑкий + + + Hungarian + Magyar + + + Dutch + Nederlands + + + Czech + ÄŒeÅ¡tina + + + Slovak + SlovenÄina + + + Polish + Polski + + + Slovenian + SlovenÅ¡Äina + + + Chinese TW + ç¹é«”中文(å°ç£) + + + Chinese HK + ç¹é«”中文(香港) + + + Chinese PRC + 简体中文 + + + Japanese + 日本語 + + + Thai + ภาษาไทย + + + Arabic + العربية + + + Pilipino + Pilipino + + + Burgarian + БългарÑки + + + Catalan + Català + + + Croatian + Hrvatski + + + Estonian + Eesti + + + Farsi + Ùارسى + + + French (Canadian) + Français + + + Greek + Ελληνικά + + + Hebrew + עברית + + + Hindi + हिनà¥à¤¦à¥€ + + + Indonesian + Indonesia + + + Korean + 한국어 + + + Latvian + LatvieÅ¡u + + + Lithuanian + Lietuvių + + + Malay + Melayu + + + Marathi + मराठी + + + Portuguese (Brazil) + Português + + + Romanian + Română + + + Serbian + Srpski + + + Spanish (American) + Español + + + Ukrainian + УкраїнÑька + + + Urdu + اردو + + + Vietnamese + TiêÌng Việt + + + Basque + Euskara + + + Galician + Galego + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/languages.qm Binary file src/hbcore/i18n/translations/languages.qm has changed diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/languages.ts --- a/src/hbcore/i18n/translations/languages.ts Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/i18n/translations/languages.ts Thu Jul 22 16:36:53 2010 +0100 @@ -3,207 +3,207 @@ hblanguageswitch - + English English - + French Français - + German Deutsch - + Spanish Español - + Italian Italiano - + Swedish Svenska - + Danish Dansk - + Norwegian Norsk - + Finnish Suomi - + English (American) English - + Portuguese Português - + Turkish Türkçe - + Icelandic Ãslenska - + Russian РуÑÑкий - + Hungarian Magyar - + Dutch Nederlands - + Czech ÄŒeÅ¡tina - + Slovak SlovenÄina - + Polish Polski - + Slovenian SlovenÅ¡Äina - + Chinese TW ç¹é«”中文(å°ç£) - + Chinese HK ç¹é«”中文(香港) - + Chinese PRC 简体中文 - + Japanese 日本語 - + Thai ภาษาไทย - + Arabic العربية - + Pilipino Pilipino - + Burgarian БългарÑки - + Catalan Català - + Croatian Hrvatski - + Estonian Eesti - + Farsi Ùارسى - + French (Canadian) Français - + Greek Ελληνικά - + Hebrew עברית - + Hindi हिनà¥à¤¦à¥€ - + Indonesian Indonesia - + Korean 한국어 - + Latvian LatvieÅ¡u - + Lithuanian Lietuvių - + Malay Melayu - + Marathi मराठी - + Portuguese (Brazil) Português - + Romanian Română - + Serbian Srpski - + Spanish (American) Español - + Ukrainian УкраїнÑька - + Urdu اردو - + Vietnamese TiêÌng Việt - + Basque Euskara - + Galician Galego diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/languages_OLD.qm Binary file src/hbcore/i18n/translations/languages_OLD.qm has changed diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/languages_OLD.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/i18n/translations/languages_OLD.ts Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,211 @@ + + + + + hblanguageswitch + + English + English + + + French + Français + + + German + Deutsch + + + Spanish + Español + + + Italian + Italiano + + + Swedish + Svenska + + + Danish + Dansk + + + Norwegian + Norsk + + + Finnish + Suomi + + + English (American) + English + + + Portuguese + Português + + + Turkish + Türkçe + + + Icelandic + Ãslenska + + + Russian + РуÑÑкий + + + Hungarian + Magyar + + + Dutch + Nederlands + + + Czech + ÄŒeÅ¡tina + + + Slovak + SlovenÄina + + + Polish + Polski + + + Slovenian + SlovenÅ¡Äina + + + Chinese TW + ç¹é«”中文(å°ç£) + + + Chinese HK + ç¹é«”中文(香港) + + + Chinese PRC + 简体中文 + + + Japanese + 日本語 + + + Thai + ภาษาไทย + + + Arabic + العربية + + + Pilipino + Pilipino + + + Burgarian + БългарÑки + + + Catalan + Català + + + Croatian + Hrvatski + + + Estonian + Eesti + + + Farsi + Ùارسى + + + French (Canadian) + Français + + + Greek + Ελληνικά + + + Hebrew + עברית + + + Hindi + हिनà¥à¤¦à¥€ + + + Indonesian + Indonesia + + + Korean + 한국어 + + + Latvian + LatvieÅ¡u + + + Lithuanian + Lietuvių + + + Malay + Melayu + + + Marathi + मराठी + + + Portuguese (Brazil) + Português + + + Romanian + Română + + + Serbian + Srpski + + + Spanish (American) + Español + + + Ukrainian + УкраїнÑька + + + Urdu + اردو + + + Vietnamese + TiêÌng Việt + + + Basque + Euskara + + + Galician + Galego + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/locale_mappings.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/i18n/translations/locale_mappings.txt Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,50 @@ +1,001,826,001,en,GB,en +2,002,250,002,fr,FR,fr +3,003,276,003,de,DE,de +4,004,724,004,es,ES,es +5,005,380,005,it,IT,it +6,006,752,006,sv,SE,sv +7,007,208,007,da,DK,da +8,008,578,008,no,NO,no +9,009,246,009,fi,FI,fi +10,010,840,010,en_US,US,en_US +13,013,620,013,pt,PT,pt +14,014,792,014,tr,TR,tr +15,015,352,015,is,IS,is +16,016,643,016,ru,RU,ru +17,017,348,017,hu,HU,hu +18,018,528,018,nl,NL,nl +25,025,203,025,cs,CZ,cs +26,026,703,026,sk,SK,sk +27,027,616,027,pl,PL,pl +28,028,705,028,sl,SI,sl +29,029,158,029,zh_TW,TW,zh_TW +30,030,344,030,zh_HK,HK,zh_HK +31,031,156,031,zh,CN,zh +32,032,392,032,ja,JP,ja +33,033,764,033,th,TH,th +37,037,682,037,ar,SA,ar +39,039,608,039,tl,PH,tl +42,042,100,042,bg,BG,bg +44,044, ,044,ca, ,ca +45,045,191,045,hr,HR,hr +49,049,233,049,et,EE,et +50,050,364,050,fa,IR,fa +51,051,124,051,fr_CA,CA,fr_CA +54,054,196,054,el,GR,el +57,057,376,057,he,IL,he +58,058,356,058,hi,IN,hi +59,059,360,059,id,ID,id +65,065,410,065,ko,KR,ko +67,067,428,067,lv,LV,lv +68,068,440,068,lt,LT,lt +70,070,458,070,ms,MY,ms +76,076,076,076,pt_BR,BR,pt_BR +78,078,642,078,ro,RO,ro +79,079,891,079,sr,RS,sr +83,083, ,083,es_419, ,es_419 +93,093,804,093,uk,UA,uk +94,094,586,094,ur,PK,ur +96,096,704,096,vi,VN,vi +102,102, ,102,eu, ,eu +103,103, ,103,gl, ,gl \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/regions.qm Binary file src/hbcore/i18n/translations/regions.qm has changed diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/i18n/translations/regions.ts --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/i18n/translations/regions.ts Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,191 @@ + + + + + hblanguageswitch + + English + United Kingdom + + + France + France + + + Germany + Deutschland + + + Spain + España + + + Italy + Italia + + + Sweden + Sverige + + + Denmark + Danmark + + + Norway + Norge + + + Finland + Suomi + + + United States + United States + + + Portugal + Portugal + + + Turkey + Türkiye + + + Iceland + Ãsland + + + Russia + РоÑÑÐ¸Ñ + + + Hungary + Magyarország + + + Netherlands + Nederland + + + Czech + ÄŒeský + + + Slovakia + Slovensko + + + Poland + Polska + + + Slovenia + Slovenija + + + Taiwan + å°ç£ + + + Hong Kong + 香港 + + + China + 中国 + + + Japan + 日本 + + + Thailand + ประเทศไทย + + + Saudi Arabia + العربية السعودية + + + Philippines + Pilipinas + + + Bulgaria + Ð‘ÑŠÐ»Ð³Ð°Ñ€Ð¸Ñ + + + Croatian + Hrvatska + + + Estonia + Eesti + + + Iran + ایران + + + Canada + Canada + + + Greece + Ελλάδα + + + Israel + ישר×ל + + + India + भारत + + + Indonesia + Indonesia + + + Korea + 한국 + + + Latvia + Latvija + + + Lithuania + Lietuva + + + Malaysia + Malaysia + + + Brazil + Brasil + + + Romania + România + + + Serbia + Србија + + + Ukraine + Україна + + + Pakistan + Pakistan + + + Vietnam + Việt Nam + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbbadgeicon.cpp --- a/src/hbcore/image/hbbadgeicon.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbbadgeicon.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,9 +23,9 @@ ** ****************************************************************************/ +#include "hbbadgeicon_p.h" #include "hbicon.h" #include "hbbadgeiconinfo_p.h" -#include "hbbadgeicon_p.h" #include /*! @@ -73,18 +73,19 @@ */ void HbBadgeIcon::addBadge(Qt::Alignment alignment, const HbIcon &icon, - int zValue) + int zValue, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio) { - HbBadgeIconInfo info(icon, alignment, zValue); - int size = mBadgeIcons.size(); - if (size == 0) { + HbBadgeIconInfo info(icon, alignment, zValue, sizeFactor, aspectRatio); + int badgeCount = mBadgeIcons.count(); + if (badgeCount == 0) { mBadgeIcons.append(info); - } - else { + } else { bool added = false; //Find a spot to insert the badgeinfo in the list. - for (int i = size - 1; i >= 0; i--){ - if (mBadgeIcons[i].zValue() > zValue){ + for (int i = badgeCount - 1; i >= 0; i--) { + if (mBadgeIcons[i].zValue() > zValue) { mBadgeIcons.insert(i + 1, info); added = true; break; @@ -147,7 +148,7 @@ Paint all badges in z-order. */ void HbBadgeIcon::paint(QPainter *painter, - const QRectF& rect, + const QRectF &rect, QIcon::Mode mode, QIcon::State state, bool mirror) @@ -155,12 +156,12 @@ int count = mBadgeIcons.count(); for (int i = count - 1; i >= 0; i--) { - HbBadgeIconInfo aIcon = mBadgeIcons[i]; - Qt::Alignment align = aIcon.alignment(); + HbBadgeIconInfo badge = mBadgeIcons.at(i); + // Fix the alignment. + Qt::Alignment align = badge.alignment(); Qt::Alignment absAlign = align; if (mirror) { absAlign = align & ~(Qt::AlignRight | Qt::AlignLeft); - if (align & Qt::AlignLeft) { absAlign |= Qt::AlignRight; } @@ -168,30 +169,44 @@ absAlign |= Qt::AlignLeft; } } - // ... and then draw at the specified location. - aIcon.icon().paint(painter, - rect, - Qt::KeepAspectRatio, - absAlign, - mode, - state); + // Update the size. + QSizeF sizeFactor = badge.sizeFactor(); + if (!sizeFactor.isNull()) { + QSizeF targetSizeF(sizeFactor.width() * rect.width(), sizeFactor.height() * rect.height()); + QSize targetSize = targetSizeF.toSize(); + HbIcon icon = badge.icon(); + if (targetSize != icon.size().toSize()) { + icon.setSize(targetSize); + badge.setIcon(icon); + mBadgeIcons[i] = badge; + } + } + // And finally draw the badge. + badge.icon().paint(painter, + rect, + badge.aspectRatio(), + absAlign, + mode, + state); } } /*! \internal */ -void HbBadgeIcon::externalize(QDataStream& stream) +void HbBadgeIcon::externalize(QDataStream &stream) { - int size = mBadgeIcons.size(); + int count = mBadgeIcons.count(); // Write out how many badges we'll save first - stream << size; + stream << count; // And write each item - for (int i = 0; i < size; i++) { - HbBadgeIconInfo aIcon = mBadgeIcons[i]; - stream << aIcon.icon(); - stream << (qint32)(aIcon.alignment()); - stream << aIcon.zValue(); + for (int i = 0; i < count; i++) { + const HbBadgeIconInfo &badge(mBadgeIcons.at(i)); + stream << badge.icon(); + stream << (qint32) badge.alignment(); + stream << badge.zValue(); + stream << badge.sizeFactor(); + stream << (qint32) badge.aspectRatio(); } } @@ -199,19 +214,24 @@ /*! \Internal */ -void HbBadgeIcon::internalize(QDataStream& stream) +void HbBadgeIcon::internalize(QDataStream &stream) { int howManyBadges; stream >> howManyBadges; - for (int i = 0; i> icon; stream >> align; stream >> zValue; + stream >> sizeFactor; + stream >> aspectRatio; - HbBadgeIconInfo info(icon, (Qt::Alignment)align, zValue); + HbBadgeIconInfo info(icon, (Qt::Alignment) align, zValue, + sizeFactor, (Qt::AspectRatioMode) aspectRatio); mBadgeIcons.append(info); - }; + } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbbadgeicon_p.h --- a/src/hbcore/image/hbbadgeicon_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbbadgeicon_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,10 +26,11 @@ #ifndef HBBADGEICON_P_H #define HBBADGEICON_P_H +#include "hbbadgeiconinfo_p.h" +#include "hbicon.h" #include #include - -#include "hbbadgeiconinfo_p.h" +#include class HbBadgeIcon { @@ -39,29 +40,27 @@ public: void addBadge(Qt::Alignment alignment, - const HbIcon& badge, - int zValue=0); - bool removeBadge(const HbIcon& badge); + const HbIcon &badge, + int zValue, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio); + bool removeBadge(const HbIcon &badge); void removeAllBadges(); bool isBadged() const; const QList badges() const; - void paint( QPainter *painter, - const QRectF& rect, - QIcon::Mode mode, - QIcon::State state, - bool mirror); - void externalize(QDataStream& stream); - void internalize(QDataStream& stream); + void paint(QPainter *painter, + const QRectF &rect, + QIcon::Mode mode, + QIcon::State state, + bool mirror); + void externalize(QDataStream &stream); + void internalize(QDataStream &stream); private: - QRectF badgeLocation(const HbBadgeIconInfo& iconInfo, - const QRectF& parentRect, - bool mirror); QList mBadgeIcons; }; #endif /* HBBADGEICON_P_H */ - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbbadgeiconinfo.cpp --- a/src/hbcore/image/hbbadgeiconinfo.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbbadgeiconinfo.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,74 +23,61 @@ ** ****************************************************************************/ +#include "hbbadgeiconinfo_p.h" #include "hbicon.h" -#include "hbbadgeiconinfo_p.h" #include "hbbadgeicon_p.h" #include - #include - +#include -HbBadgeIconInfo::HbBadgeIconInfo(const HbIcon& badge, +HbBadgeIconInfo::HbBadgeIconInfo(const HbIcon &badge, Qt::Alignment alignment, - int zValue): mIcon(badge),mAlignment(alignment),mZValue(zValue) + int zValue, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio) + : mIcon(badge), mAlignment(alignment), mZValue(zValue), + mSizeFactor(sizeFactor), mAspectRatio(aspectRatio) { } -HbBadgeIconInfo::HbBadgeIconInfo(const HbBadgeIconInfo& other) -{ - *this = other; -} - -HbBadgeIconInfo::~HbBadgeIconInfo() -{ -} - -bool HbBadgeIconInfo::operator==(const HbBadgeIconInfo &other) +bool HbBadgeIconInfo::operator==(const HbBadgeIconInfo &other) const { return !(*this != other); } -bool HbBadgeIconInfo::operator!=(const HbBadgeIconInfo &other) +bool HbBadgeIconInfo::operator!=(const HbBadgeIconInfo &other) const { if ((icon() != other.icon()) || - (zValue() != other.zValue()) || - (alignment() != other.alignment()) - ) - { + (zValue() != other.zValue()) || + (alignment() != other.alignment()) + ) { return true; } return false; } -HbIcon HbBadgeIconInfo::icon() const -{ - return mIcon; -} - -void HbBadgeIconInfo::setIcon(const HbIcon& icon) +void HbBadgeIconInfo::setIcon(const HbIcon &icon) { mIcon = icon; } -int HbBadgeIconInfo::zValue() const -{ - return mZValue; -} - void HbBadgeIconInfo::setZValue(int zValue) { mZValue = zValue; } -Qt::Alignment HbBadgeIconInfo::alignment() const -{ - return mAlignment; -} - void HbBadgeIconInfo::setAlignment(Qt::Alignment align) { mAlignment = align; } +void HbBadgeIconInfo::setSizeFactor(const QSizeF &sizeFactor) +{ + mSizeFactor = sizeFactor; +} + +void HbBadgeIconInfo::setAspectRatio(Qt::AspectRatioMode aspectRatio) +{ + mAspectRatio = aspectRatio; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbbadgeiconinfo_p.h --- a/src/hbcore/image/hbbadgeiconinfo_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbbadgeiconinfo_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,34 +26,47 @@ #ifndef HBBADGEICONINFO_P_H #define HBBADGEICONINFO_P_H +#include #include - +#include +#include class HbBadgeIconInfoPrivate; -class HbIcon; -class HbBadgeIconInfo { +class HbBadgeIconInfo +{ public: - HbBadgeIconInfo( const HbIcon& badge, - Qt::Alignment alignment = Qt::AlignCenter, - int zValue=0); - HbBadgeIconInfo(const HbBadgeIconInfo& other); - ~HbBadgeIconInfo(); + HbBadgeIconInfo(const HbIcon &badge, + Qt::Alignment alignment, + int zValue, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio); + + bool operator==(const HbBadgeIconInfo &other) const; + bool operator!=(const HbBadgeIconInfo &other) const; - bool operator==(const HbBadgeIconInfo &other); - bool operator!=(const HbBadgeIconInfo &other); + HbIcon icon() const { return mIcon; } + void setIcon(const HbIcon &icon); + + int zValue() const { return mZValue; } + void setZValue(int z); - HbIcon icon() const; - void setIcon(const HbIcon&); - int zValue() const; - void setZValue(int); - Qt::Alignment alignment() const; + Qt::Alignment alignment() const { return mAlignment; } void setAlignment(Qt::Alignment align); + QSizeF sizeFactor() const { return mSizeFactor; } + void setSizeFactor(const QSizeF &sizeFactor); + + Qt::AspectRatioMode aspectRatio() const { return mAspectRatio; } + void setAspectRatio(Qt::AspectRatioMode aspectRatio); + private: HbIcon mIcon; + HbIcon mSizedIcon; Qt::Alignment mAlignment; int mZValue; + QSizeF mSizeFactor; + Qt::AspectRatioMode mAspectRatio; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbeglstate_p.h --- a/src/hbcore/image/hbeglstate_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbeglstate_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,8 +34,6 @@ #include "hbnvgiconimpl_p.h" #include "hbnvgenginepool_p.h" -class HbNvgIconImpl; - class HbEglStates: public QObject { Q_OBJECT @@ -74,15 +72,15 @@ return init; } - void deref(HbEglStates *& instance) + void deref(HbEglStates *&instance) { if (instance && --(instance->refCount) == 0) { } } - void removeVGImage(VGImage * image); + void removeVGImage(VGImage *image); - void addVGImage(VGImage * image) + void addVGImage(VGImage *image) { if (image) { imageList.insert(image); @@ -108,16 +106,16 @@ EGLContext c = 0, EGLConfig cfg = 0 ); - int refCount; - int init; - typedef QSet ImageList; + int refCount; + int init; + typedef QSet ImageList; typedef ImageList::iterator ImageListIter; - ImageList imageList; - QMutex mutex; + ImageList imageList; + QMutex mutex; }; -/* HbEglStateRestorer +/*! HbEglStateRestorer * * Saves the EGL state passed in the constructor. * This class will help in saving the state even in the case of exception. @@ -132,9 +130,10 @@ : display(d), currentReadSurface(rs), currentWriteSurface(ds), - eglContext(c) + eglContext(c), + restored(0) { - restored = 0; + } void restore(); @@ -153,5 +152,4 @@ int restored; }; -#endif - +#endif /* HBEGLSTATE_P_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbframebackground.cpp --- a/src/hbcore/image/hbframebackground.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbframebackground.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,16 +28,16 @@ #include /*! - @stable + @stable @hbcore \class HbFrameBackground \brief HbFrameBackground stores the frame data. - This class is a data container for frame related data. It stores data that defines the + This class is a data container for frame related data. It stores data that defines the frame background into single object that can be stored into QVariant. */ -// Must be initialized dynamically because QIcon cannot be constructed +// Must be initialized dynamically because QIcon cannot be constructed // when static variables are constructed. static HbFrameBackgroundPrivate *shared_null = 0; @@ -62,7 +62,7 @@ HbFrameBackground::HbFrameBackground() { // Construct shared_null if not done yet. - if ( !shared_null ) { + if (!shared_null) { shared_null = new HbFrameBackgroundPrivate; } d = shared_null; @@ -78,7 +78,7 @@ /*! * Copy constructs a new frame background using the \a other frame background. */ -HbFrameBackground::HbFrameBackground( const HbFrameBackground &other ) : +HbFrameBackground::HbFrameBackground(const HbFrameBackground &other) : d(other.d) { } @@ -92,9 +92,9 @@ /*! * Assigns the \a other frame background to this frame background and returns a reference to -* this frame background. Copy-on-write semantics is used, so this only does a shallow copy. +* this frame background. Copy-on-write semantics is used, so this only does a shallow copy. */ -HbFrameBackground &HbFrameBackground::operator=( const HbFrameBackground &other ) +HbFrameBackground &HbFrameBackground::operator=(const HbFrameBackground &other) { if (&other != this) { d = other.d; @@ -103,20 +103,20 @@ } /*! -* Equality operator. +* Equality operator. */ -bool HbFrameBackground::operator==( const HbFrameBackground &other ) const +bool HbFrameBackground::operator==(const HbFrameBackground &other) const { - return !( *this != other ); + return !(*this != other); } /*! -* Inequality operator. +* Inequality operator. */ -bool HbFrameBackground::operator!=( const HbFrameBackground &other ) const +bool HbFrameBackground::operator!=(const HbFrameBackground &other) const { if (d->frameGraphicsName != other.d->frameGraphicsName - || d->frameGraphicsName.isNull() != other.d->frameGraphicsName.isNull()) { + || d->frameGraphicsName.isNull() != other.d->frameGraphicsName.isNull()) { return true; } @@ -154,12 +154,12 @@ // Remove possible file extension QString nameWithoutExt = frameGraphicsName; int index = nameWithoutExt.lastIndexOf(QChar('.')); - if (index>0) { + if (index > 0) { nameWithoutExt.resize(index); } if (d->frameGraphicsName != nameWithoutExt - || d->frameGraphicsName.isNull() != nameWithoutExt.isNull()) { + || d->frameGraphicsName.isNull() != nameWithoutExt.isNull()) { d.detach(); d->frameGraphicsName = nameWithoutExt; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbframebackground.h --- a/src/hbcore/image/hbframebackground.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbframebackground.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,11 +44,11 @@ HbFrameBackground(const QString &frameGraphicsName, HbFrameDrawer::FrameType type); ~HbFrameBackground(); - HbFrameBackground( const HbFrameBackground &other ); - HbFrameBackground &operator=( const HbFrameBackground &other ); + HbFrameBackground(const HbFrameBackground &other); + HbFrameBackground &operator=(const HbFrameBackground &other); - bool operator==( const HbFrameBackground &other ) const; - bool operator!=( const HbFrameBackground &other ) const; + bool operator==(const HbFrameBackground &other) const; + bool operator!=(const HbFrameBackground &other) const; bool isNull() const; @@ -65,6 +65,6 @@ QExplicitlySharedDataPointer d; }; -Q_DECLARE_METATYPE( HbFrameBackground ) +Q_DECLARE_METATYPE(HbFrameBackground) #endif // HBFRAMEBACKGROUND_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbframedrawer.cpp --- a/src/hbcore/image/hbframedrawer.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbframedrawer.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,11 +25,12 @@ #include "hbframedrawer.h" #include "hbframedrawer_p.h" #include "hbimagetraces_p.h" +#include "hbmaskableiconimpl_p.h" #include #include #include -#include "hbmaskableiconimpl_p.h" +#include #include #include @@ -38,7 +39,7 @@ #include /*! - @stable + @stable @hbcore \class HbFrameDrawer \brief HbFrameDrawer draws frames graphics. @@ -47,11 +48,11 @@ Frame graphics mean graphics that consist of either 3 or 9 parts that are positioned and scaled followingly. - + A 9-piece frame consists of a 3x3 grid, where the corner parts have a fixed size and the other parts are scaled. - - A 3-piece frame consists of 3 parts tiled either horizontally of vertically. The side + + A 3-piece frame consists of 3 parts tiled either horizontally or vertically. The side parts preserve their aspect ratio and the center part is scaled to fill the remaining space. For convenience, frame drawer can also draw the frame with a single graphic. @@ -60,7 +61,7 @@ takes care that there are no visible gaps between the frame parts when the whole frame is painted to the display even if the frame bounding rectangle uses floating point accuracy. - Filenames for 9-piece frame graphics are defined according to the following. + Filenames for 9-piece frame graphics are defined according to the following convention. - top left _tl. - top _t. @@ -72,13 +73,13 @@ - bottom _b. - bottom right _br. - Filenames for 3-piece horizontal frame graphics are defined according to the following. + Filenames for 3-piece horizontal frame graphics are defined according to the following convention. - left _l. - center _c. - right _r. - Filenames for 3-piece vertical frame graphics are defined according to the following. + Filenames for 3-piece vertical frame graphics are defined according to the following convention. - top _t. - center _c. @@ -93,7 +94,7 @@ See class HbIcon for information of supported icon formats and file locations. - The frame drawer stores the whole generated frame graphics in a pixmap for + The frame drawer stores the entire generated frame graphics in a pixmap for improving the speed of the paint operations. Therefore, the frame drawer instance should not be re-created each time the frame needs to be rendered. @@ -114,7 +115,7 @@ \b OnePiece The frame consist of a single graphic piece, which is scaled to the frame's bounding rectangle. \b ThreePiecesHorizontal The frame consists of three graphic pieces that are tiled horizontally. - As default, the side parts preserve their aspect ratio and the center part is scaled to fill the remaining space. + By default, the side parts preserve their aspect ratio and the center part is scaled to fill the remaining space. Filenames for 3-piece horizontal frame graphics are defined according to the following. - left _l. @@ -122,14 +123,14 @@ - right _r. \b ThreePiecesVertical The frame consists of three graphic pieces that are tiled vertically. - As default, the side parts preserve their aspect ratio and the center part is scaled to fill the remaining space. + By default, the side parts preserve their aspect ratio and the center part is scaled to fill the remaining space. Filenames for 3-piece vertical frame graphics are defined according to the following. - top _t. - center _c. - bottom _b. - \b NinePieces The frame consists of a 3x3 grid of graphic pieces, where as default the corner + \b NinePieces The frame consists of a 3x3 grid of graphic pieces, where by default the corner parts have a fixed size and the other parts are scaled. Filenames for 9-piece frame graphics are defined according to the following. @@ -168,10 +169,10 @@ maskChanged(false), clipPath(QPainterPath()) { - borderWidths[0]=0.0; - borderWidths[1]=0.0; - borderWidths[2]=0.0; - borderWidths[3]=0.0; + borderWidths[0] = 0.0; + borderWidths[1] = 0.0; + borderWidths[2] = 0.0; + borderWidths[3] = 0.0; //Register the HbFrameDrawerPrivate Instance to HbIconLoader HbIconLoader::global()->storeFrameDrawerInfo(this); } @@ -187,7 +188,7 @@ frameParts(0), mirroring(HbIcon::Default), defaultMirroring(Unknown), - flags( 0 ), + flags(0), layoutDirection(Qt::LeftToRight), graphicsItem(0), color(), @@ -195,16 +196,19 @@ maskChanged(false), clipPath(QPainterPath()) { - borderWidths[0]=0.0; - borderWidths[1]=0.0; - borderWidths[2]=0.0; - borderWidths[3]=0.0; + borderWidths[0] = 0.0; + borderWidths[1] = 0.0; + borderWidths[2] = 0.0; + borderWidths[3] = 0.0; - // Remove possible file extension - int index = this->frameGraphicsName.lastIndexOf(QChar('.')); - if (index>0) { - this->frameGraphicsName.resize(index); + if (HbThemeUtils::isLogicalName(frameGraphicsName)) { + // Remove possible file extension + int index = this->frameGraphicsName.lastIndexOf(QChar('.')); + if (index>0) { + this->frameGraphicsName.resize(index); + } } + //Register the HbFrameDrawerPrivate Instance to HbIconLoader HbIconLoader::global()->storeFrameDrawerInfo(this); } @@ -221,18 +225,18 @@ frameParts(other.frameParts), mirroring(other.mirroring), defaultMirroring(other.defaultMirroring), - flags( other.flags ), - layoutDirection( other.layoutDirection ), - graphicsItem( other.graphicsItem ), + flags(other.flags), + layoutDirection(other.layoutDirection), + graphicsItem(other.graphicsItem), color(other.color), icon(0), maskChanged(false), clipPath(QPainterPath()) { - borderWidths[0]=other.borderWidths[0]; - borderWidths[1]=other.borderWidths[1]; - borderWidths[2]=other.borderWidths[2]; - borderWidths[3]=other.borderWidths[3]; + borderWidths[0] = other.borderWidths[0]; + borderWidths[1] = other.borderWidths[1]; + borderWidths[2] = other.borderWidths[2]; + borderWidths[3] = other.borderWidths[3]; //Register the HbFrameDrawerPrivate Instance to HbIconLoader HbIconLoader::global()->storeFrameDrawerInfo(this); } @@ -255,7 +259,7 @@ if (!frameParts) { checkFrameParts(); } - if ((!icon ) && (!fallbackMaskableIconList.count()) ) { + if ((!icon) && (!fallbackMaskableIconList.count())) { createFrameIcon(); } } @@ -267,7 +271,7 @@ */ bool HbFrameDrawerPrivate::testBorderApiProtectionFlag() const { - return flags & HbFrameDrawerPrivate::BorderWidthSetByApi; + return flags & HbFrameDrawerPrivate::BorderWidthSetByApi; } /*! @@ -278,11 +282,11 @@ */ void HbFrameDrawerPrivate::setBorderApiProtectionFlag(bool on) { - if(on){ - flags |= HbFrameDrawerPrivate::BorderWidthSetByApi; - }else{ - flags &= ~HbFrameDrawerPrivate::BorderWidthSetByApi; - } + if (on) { + flags |= HbFrameDrawerPrivate::BorderWidthSetByApi; + } else { + flags &= ~HbFrameDrawerPrivate::BorderWidthSetByApi; + } } /*! @@ -314,46 +318,46 @@ // If the suffix list has been set explicitly, return that if it contains enough suffixes. if (!suffixList.isEmpty()) { switch (type) { - case HbFrameDrawer::ThreePiecesHorizontal: // fall through - case HbFrameDrawer::ThreePiecesVertical: - if (suffixList.count() >= 3) { - return suffixList; - } - break; + case HbFrameDrawer::ThreePiecesHorizontal: // fall through + case HbFrameDrawer::ThreePiecesVertical: + if (suffixList.count() >= 3) { + return suffixList; + } + break; - case HbFrameDrawer::NinePieces: - if (suffixList.count() >= 9) { - return suffixList; - } - break; - - default: + case HbFrameDrawer::NinePieces: + if (suffixList.count() >= 9) { return suffixList; + } + break; + + default: + return suffixList; } - } + } // Otherwise, return default suffix list. QStringList list; switch (type) { - case HbFrameDrawer::ThreePiecesHorizontal: - list << "_l" << "_c" << "_r"; - break; - case HbFrameDrawer::ThreePiecesVertical: - list << "_t" << "_c" << "_b"; - break; - case HbFrameDrawer::NinePieces: - list << "_tl" << "_t" << "_tr" << "_l" << "_c" << "_r" << "_bl" << "_b" << "_br"; - break; - default: - break; + case HbFrameDrawer::ThreePiecesHorizontal: + list << "_l" << "_c" << "_r"; + break; + case HbFrameDrawer::ThreePiecesVertical: + list << "_t" << "_c" << "_b"; + break; + case HbFrameDrawer::NinePieces: + list << "_tl" << "_t" << "_tr" << "_l" << "_c" << "_r" << "_bl" << "_b" << "_br"; + break; + default: + break; } return list; } /*! -* Creates a consolidated HbIconImpl (Icon) with the available piece information +* Creates a consolidated HbIconImpl (Icon) with the available piece information * If failed to create the same, then creates HbIconImpls for the pieces. * \internal */ @@ -367,39 +371,37 @@ // Create the frame icon and add it in the icon cache HbIconLoader *loader = HbIconLoader::global(); - + //If it's one-piece frame-item, it's loaded using HbIconLoader::loadIcon() if (frameParts == 1) { - HbIconImpl * iconImpl = loader->loadIcon(frameGraphicsName, HbIconLoader::AnyType, - HbIconLoader::AnyPurpose, - frameIconSize, - Qt::IgnoreAspectRatio, - QIcon::Normal, - iconLoaderOptions()); + HbIconImpl *iconImpl = loader->loadIcon(frameGraphicsName, HbIconLoader::AnyType, + HbIconLoader::AnyPurpose, + frameIconSize, + Qt::IgnoreAspectRatio, + QIcon::Normal, + iconLoaderOptions()); if (iconImpl) { icon = new HbMaskableIconImpl(iconImpl); } } else { - QStringList multiPieceFileNames; - QStringList list = fileNameSuffixList(); - int nameListCount = list.count(); - for (int i = 0; i < nameListCount; i++) { - multiPieceFileNames.append(frameGraphicsName + list[i]); + QStringList multiPieceFileNames = resolveMultiPieceFileNames(); + + for (int i = 0; i < frameParts; i++) { if (data.pixmapSizes[i].isEmpty()) { - data.pixmapSizes[i] = QSize(0,0); + data.pixmapSizes[i] = QSize(0, 0); } } QVector listOfIcons; - + //For multi-piece frame-items, HbIocnLoader::loadMultipieceIcon is used //This function returns the consolidate (stitched) icon created on the themeserver. //If the consolidated icon-creation on themeserver fails, then server returns a list //of individual frame-items. - HbIconImpl * iconImpl = loader->loadMultiPieceIcon(multiPieceFileNames, data, frameIconSize, - Qt::IgnoreAspectRatio, QIcon::Normal, iconLoaderOptions(), - listOfIcons, color); + HbIconImpl *iconImpl = loader->loadMultiPieceIcon(multiPieceFileNames, data, frameIconSize, + Qt::IgnoreAspectRatio, QIcon::Normal, iconLoaderOptions(), + listOfIcons, color); if (iconImpl) { icon = new HbMaskableIconImpl(iconImpl); @@ -409,10 +411,36 @@ fallbackMaskableIconList.append(new HbMaskableIconImpl(listOfIcons[i])); } } - + } } +QStringList HbFrameDrawerPrivate::resolveMultiPieceFileNames() +{ + QStringList multiPieceFileNames; + + bool logicalName = HbThemeUtils::isLogicalName(frameGraphicsName); + + int suffixIndex = frameGraphicsName.length(); + if (!logicalName) { + // If it is an absolute icon path, the suffix is inserted before the file extension + int index = frameGraphicsName.lastIndexOf(QChar('.')); + if (index > 0) { + suffixIndex = index; + } + } + + QStringList list = fileNameSuffixList(); + int count = list.count(); + for (int i = 0; i < count; i++) { + QString nameWithSuffix = frameGraphicsName; + nameWithSuffix.insert(suffixIndex, list.at(i)); + multiPieceFileNames.append(nameWithSuffix); + } + + return multiPieceFileNames; +} + /*! \internal */ @@ -436,18 +464,18 @@ if (!mask.isNull() && maskChanged) { icon->setMask(mask); - } + } //paint the stitched icon icon->paint(painter, centeredRect, Qt::AlignHCenter, clipPath); - if ( icon->isCreatedOnServer() ) { + if (icon->isCreatedOnServer()) { iconType = icon->iconImpl()->iconData().type; } - #ifdef HB_FRAME_DRAWER_TRACES +#ifdef HB_FRAME_DRAWER_TRACES qDebug() << "FRAMENAME: " << frameGraphicsName << "Drawn at: " - << centeredRect.topLeft().x() << "," << centeredRect.topLeft().y() << " | " - << centeredRect.bottomRight().x() << "," << centeredRect.bottomRight().y(); - #endif + << centeredRect.topLeft().x() << "," << centeredRect.topLeft().y() << " | " + << centeredRect.bottomRight().x() << "," << centeredRect.bottomRight().y(); +#endif } else { for (int i = 0; i < fileNameSuffixList().count(); i++) { if (i < fallbackMaskableIconList.count() && fallbackMaskableIconList[i]) { @@ -469,12 +497,12 @@ } if (!multiPartSizeData.targets[i].isEmpty()) { fallbackMaskableIconList[i]->paint(painter, - QRect(position, multiPartSizeData.pixmapSizes[i]), - Qt::AlignHCenter, clipPath); + QRect(position, multiPartSizeData.pixmapSizes[i]), + Qt::AlignHCenter, clipPath); } } } - if ( fallbackMaskableIconList[0]->iconImpl() + if ( fallbackMaskableIconList.count() && fallbackMaskableIconList[0]->iconImpl() && fallbackMaskableIconList[0]->iconImpl()->isCreatedOnServer() ) { if ( fallbackMaskableIconList[0]->iconImpl()->iconData().type != INVALID_FORMAT ) { // store the icon type @@ -488,7 +516,7 @@ /*! \internal */ -bool HbFrameDrawerPrivate::fillWholeRect() const +bool HbFrameDrawerPrivate::fillWholeRect() const { return flags & HbFrameDrawerPrivate::FillWholeRect; } @@ -498,7 +526,7 @@ * - frame bounding rectangle * - frame inner rectangle (optional) * - default sizes of the frame corner (9-piece) or side (3-piece) graphics. -* +* * Note! Integer pixel sizes are used in this function to avoid one pixel gaps between the frame parts. * \internal */ @@ -537,7 +565,7 @@ if (borderWidths[0] == 0 && borderWidths[2] == 0) { QSizeF leftSize = defaultSize(suffixList.at(0)); // index 0 is leftmost frame part QSizeF rightSize = defaultSize(suffixList.at(2)); // index 2 is rightmost frame part - + if (fillWholeRect()) { leftSize.scale(rect.size(), Qt::KeepAspectRatio); rightSize.scale(rect.size(), Qt::KeepAspectRatio); @@ -573,15 +601,15 @@ if (fullWidth >= leftWidth + rightWidth) { data.targets[0] = QRect(0, 0, leftWidth, fullHeight); data.targets[1] = QRect(leftWidth, 0, centerWidth, fullHeight); - data.targets[2] = QRect(fullWidth-rightWidth, 0, rightWidth, fullHeight); + data.targets[2] = QRect(fullWidth - rightWidth, 0, rightWidth, fullHeight); data.pixmapSizes[0] = QSize(leftWidth, fullHeight); data.pixmapSizes[1] = QSize(centerWidth, fullHeight); data.pixmapSizes[2] = QSize(rightWidth, fullHeight); - data.sources[0] = QRect(QPoint(0,0), data.pixmapSizes[0]); - data.sources[1] = QRect(QPoint(0,0), data.pixmapSizes[1]); - data.sources[2] = QRect(QPoint(0,0), data.pixmapSizes[2]); + data.sources[0] = QRect(QPoint(0, 0), data.pixmapSizes[0]); + data.sources[1] = QRect(QPoint(0, 0), data.pixmapSizes[1]); + data.sources[2] = QRect(QPoint(0, 0), data.pixmapSizes[2]); } else { // Only sides fit int totalSideWidth = leftWidth + rightWidth; @@ -606,7 +634,7 @@ if (borderWidths[1] == 0 && borderWidths[3] == 0) { QSizeF topSize = defaultSize(suffixList.at(0)); // index 0 is top frame part QSizeF bottomSize = defaultSize(suffixList.at(2)); // index 2 is bottom frame part - + if (fillWholeRect()) { topSize.scale(rect.size(), Qt::KeepAspectRatio); bottomSize.scale(rect.size(), Qt::KeepAspectRatio); @@ -647,9 +675,9 @@ data.pixmapSizes[1] = QSize(fullWidth, centerHeight); data.pixmapSizes[2] = QSize(fullWidth, bottomHeight); - data.sources[0] = QRect(QPoint(0,0), data.pixmapSizes[0]); - data.sources[1] = QRect(QPoint(0,0), data.pixmapSizes[1]); - data.sources[2] = QRect(QPoint(0,0), data.pixmapSizes[2]); + data.sources[0] = QRect(QPoint(0, 0), data.pixmapSizes[0]); + data.sources[1] = QRect(QPoint(0, 0), data.pixmapSizes[1]); + data.sources[2] = QRect(QPoint(0, 0), data.pixmapSizes[2]); } else { // Only sides fit int totalSideHeight = topHeight + bottomHeight; @@ -657,9 +685,9 @@ data.targets[1] = QRect(); data.targets[2] = QRect(0, data.targets[0].height(), fullWidth, fullHeight - data.targets[0].height()); - data.pixmapSizes[0] = QSize(fullWidth,data.targets[0].height()); + data.pixmapSizes[0] = QSize(fullWidth, data.targets[0].height()); data.pixmapSizes[1] = QSize(); - data.pixmapSizes[2] = QSize(fullWidth,data.targets[2].height()); + data.pixmapSizes[2] = QSize(fullWidth, data.targets[2].height()); data.sources[0] = data.targets[0]; data.sources[1] = QRect(); @@ -681,7 +709,7 @@ // Do all 9 pieces fit? if (fullWidth >= tlSize.width() + brSize.width() && - fullHeight >= tlSize.height() + brSize.height()) { + fullHeight >= tlSize.height() + brSize.height()) { int centerWidth = fullWidth - tlSize.width() - brSize.width(); int centerHeight = fullHeight - tlSize.height() - brSize.height(); @@ -706,15 +734,15 @@ data.pixmapSizes[7] = data.targets[7].size(); data.pixmapSizes[8] = data.targets[8].size(); - data.sources[0] = QRect(QPoint(0,0), data.pixmapSizes[0]); - data.sources[1] = QRect(QPoint(0,0), data.pixmapSizes[1]); - data.sources[2] = QRect(QPoint(0,0), data.pixmapSizes[2]); - data.sources[3] = QRect(QPoint(0,0), data.pixmapSizes[3]); - data.sources[4] = QRect(QPoint(0,0), data.pixmapSizes[4]); - data.sources[5] = QRect(QPoint(0,0), data.pixmapSizes[5]); - data.sources[6] = QRect(QPoint(0,0), data.pixmapSizes[6]); - data.sources[7] = QRect(QPoint(0,0), data.pixmapSizes[7]); - data.sources[8] = QRect(QPoint(0,0), data.pixmapSizes[8]); + data.sources[0] = QRect(QPoint(0, 0), data.pixmapSizes[0]); + data.sources[1] = QRect(QPoint(0, 0), data.pixmapSizes[1]); + data.sources[2] = QRect(QPoint(0, 0), data.pixmapSizes[2]); + data.sources[3] = QRect(QPoint(0, 0), data.pixmapSizes[3]); + data.sources[4] = QRect(QPoint(0, 0), data.pixmapSizes[4]); + data.sources[5] = QRect(QPoint(0, 0), data.pixmapSizes[5]); + data.sources[6] = QRect(QPoint(0, 0), data.pixmapSizes[6]); + data.sources[7] = QRect(QPoint(0, 0), data.pixmapSizes[7]); + data.sources[8] = QRect(QPoint(0, 0), data.pixmapSizes[8]); } else { // All 9 pieces do not fit. @@ -735,8 +763,8 @@ } calculateShrinkedNinePieceCorners( - data, tlSize, brSize, - QSize(fullWidth, fullHeight), QPoint(splitPointX, splitPointY)); + data, tlSize, brSize, + QSize(fullWidth, fullHeight), QPoint(splitPointX, splitPointY)); // Left and right get drawn if corners height does not cover the total height if (!splitPointY) { @@ -770,16 +798,16 @@ data.pixmapSizes[8] = data.targets[8].size(); data.sources[0] = data.targets[0]; - data.sources[1] = QRect(QPoint(0,0), data.pixmapSizes[1]); - data.sources[2] = QRect(QPoint(0,0), data.pixmapSizes[2]); + data.sources[1] = QRect(QPoint(0, 0), data.pixmapSizes[1]); + data.sources[2] = QRect(QPoint(0, 0), data.pixmapSizes[2]); data.sources[2].setBottomLeft(QPoint(data.pixmapSizes[2].width() - data.targets[2].width(), data.targets[2].height() - 1)); - data.sources[3] = QRect(QPoint(0,0), data.pixmapSizes[3]); + data.sources[3] = QRect(QPoint(0, 0), data.pixmapSizes[3]); data.sources[4] = QRect(); // center is always empty - data.sources[5] = QRect(QPoint(0,0), data.pixmapSizes[5]); - data.sources[6] = QRect(QPoint(0,0), data.pixmapSizes[6]); + data.sources[5] = QRect(QPoint(0, 0), data.pixmapSizes[5]); + data.sources[6] = QRect(QPoint(0, 0), data.pixmapSizes[6]); data.sources[6].setTopRight(QPoint(data.targets[6].width() - 1, data.pixmapSizes[6].height() - data.targets[6].height())); - data.sources[7] = QRect(QPoint(0,0), data.pixmapSizes[7]); - data.sources[8] = QRect(QPoint(0,0), data.pixmapSizes[8]); + data.sources[7] = QRect(QPoint(0, 0), data.pixmapSizes[7]); + data.sources[8] = QRect(QPoint(0, 0), data.pixmapSizes[8]); data.sources[8].setTopLeft(QPoint(data.pixmapSizes[8].width() - data.targets[8].width(), data.pixmapSizes[8].height() - data.targets[8].height())); } } @@ -796,9 +824,9 @@ \internal */ void HbFrameDrawerPrivate::calculateShrinkedNinePieceCorners( - HbMultiPartSizeData &data, - const QSize& tlSize, const QSize& brSize, - const QSize& fullSize, const QPoint& splitPoint) + HbMultiPartSizeData &data, + const QSize &tlSize, const QSize &brSize, + const QSize &fullSize, const QPoint &splitPoint) { // Make sure that corner sizes don't exceed frames full size @@ -806,10 +834,10 @@ int topLeftWidth = splitPoint.x() ? splitPoint.x() : tlSize.width(); int topLeftHeight = splitPoint.y() ? splitPoint.y() : tlSize.height(); data.targets[0] = QRect( - 0, - 0, - topLeftWidth < fullSize.width() ? topLeftWidth : fullSize.width(), - topLeftHeight < fullSize.height() ? topLeftHeight : fullSize.height()); + 0, + 0, + topLeftWidth < fullSize.width() ? topLeftWidth : fullSize.width(), + topLeftHeight < fullSize.height() ? topLeftHeight : fullSize.height()); // Top-right corner int topRightX = splitPoint.x() ? splitPoint.x() : fullSize.width() - brSize.width(); @@ -850,7 +878,7 @@ bottomRightHeight = fullSize.height(); bottomRightY = 0; } - data.targets[8] = QRect( bottomRightX, bottomRightY, bottomRightWidth, bottomRightHeight); + data.targets[8] = QRect(bottomRightX, bottomRightY, bottomRightWidth, bottomRightHeight); } /*! @@ -859,7 +887,20 @@ QSizeF HbFrameDrawerPrivate::defaultSize(const QString &framePartSuffix) { HbIconLoader *loader = HbIconLoader::global(); - return loader->defaultSize(frameGraphicsName + framePartSuffix).toSize(); + + QString nameWithSuffix = frameGraphicsName; + if (HbThemeUtils::isLogicalName(frameGraphicsName)) { + // Logical icon name, append suffix in the end + nameWithSuffix.append(framePartSuffix); + } else { + // Absolute icon path, insert suffix before file extension + int index = this->frameGraphicsName.lastIndexOf(QChar('.')); + if (index > 0) { + nameWithSuffix.insert(index, framePartSuffix); + } + } + + return loader->defaultSize(nameWithSuffix).toSize(); } bool HbFrameDrawerPrivate::isMirrored() @@ -880,23 +921,23 @@ } else if (defaultMirroring == Disabled) { return false; } - // Forced + // Forced } else if (mirroring == HbIcon::Forced) { return true; - // Prevented + // Prevented } else if (mirroring == HbIcon::Prevented) { return false; - // LayoutDirection + // LayoutDirection } else if (mirroring == HbIcon::LayoutDirection) { basedOnLayoutDir = true; } if (basedOnLayoutDir) { Qt::LayoutDirection usedDirection = Qt::LeftToRight; // default; - if ( flags&HbFrameDrawerPrivate::LayoutDirectionSet ) { + if (flags & HbFrameDrawerPrivate::LayoutDirectionSet) { usedDirection = layoutDirection; } else { - usedDirection = QApplication::layoutDirection(); + usedDirection = QApplication::layoutDirection(); } return usedDirection == Qt::LeftToRight ? false : true; @@ -914,9 +955,9 @@ bool HbFrameDrawerPrivate::hasBorderWidths() const { return borderWidths[1] > 0 - || borderWidths[2] > 0 - || borderWidths[2] > 0 - || borderWidths[3] > 0; + || borderWidths[2] > 0 + || borderWidths[2] > 0 + || borderWidths[3] > 0; } /*! @@ -925,40 +966,40 @@ void HbFrameDrawerPrivate::reset(bool resetFrameCount, bool unloadedByServer) { unLoadIcon(unloadedByServer); - if ( resetFrameCount ) { + if (resetFrameCount) { frameParts = 0; } } /*! -* Resets the MaskableIcon +* Resets the MaskableIcon */ void HbFrameDrawerPrivate::resetMaskableIcon() { -#if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) +#if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) HbIconLoader *loader = HbIconLoader::global(); - if ( icon ) { - //consolidated icon case - icon->decrementRefCount(); - if ( icon->refCount() == 0 && icon->isCreatedOnServer() ) { - // remove the item from cache and delete the icon - loader->removeItemInCache( icon->iconImpl() ); - icon->dispose(); - } - icon = 0; - } else { + if (icon) { + //consolidated icon case + icon->decrementRefCount(); + if (icon->refCount() == 0 && icon->isCreatedOnServer()) { + // remove the item from cache and delete the icon + loader->removeItemInCache(icon->iconImpl()); + icon->dispose(); + } + icon = 0; + } else { int count = fallbackMaskableIconList.count(); - if ( count ) { + if (count) { // for each item in fallbackMaskableIconList - decrement the reference count and // remove the item in cache, dispose if needed. - foreach ( HbMaskableIconImpl* impl, fallbackMaskableIconList ) { - impl->decrementRefCount(); - if ( impl->refCount() == 0 && impl->isCreatedOnServer() ) { - loader->removeItemInCache( impl->iconImpl() ); - impl->dispose(); - } - } - fallbackMaskableIconList.clear(); + foreach(HbMaskableIconImpl * impl, fallbackMaskableIconList) { + impl->decrementRefCount(); + if (impl->refCount() == 0 && impl->isCreatedOnServer()) { + loader->removeItemInCache(impl->iconImpl()); + impl->dispose(); + } + } + fallbackMaskableIconList.clear(); } } frameParts = 0; @@ -1006,7 +1047,7 @@ id.append("_0"); } - for (int i = 0;i < 4; i++) { + for (int i = 0; i < 4; i++) { QString boundary; id.append("_"); id.append(boundary.setNum(borderWidths[i])); @@ -1014,7 +1055,7 @@ } for (int i = 0; i < suffixList.count(); i++) { - id.append( suffixList[i] ); + id.append(suffixList[i]); } return id; @@ -1026,7 +1067,7 @@ if (icon) { //If a consolidated (stitched) icon was created on the themeserver, then //HbIconLoader::unloadIcon() is used to unload it. - loader->unLoadIcon(icon->iconImpl(),unloadedByServer); + loader->unLoadIcon(icon->iconImpl(), unloadedByServer); icon->dispose(); icon = 0; } @@ -1035,7 +1076,7 @@ QVector fallbackIconList; int count = fallbackMaskableIconList.count(); for (int i = 0; i < count ; i++) { - if ( fallbackMaskableIconList.at(i) ) { + if (fallbackMaskableIconList.at(i)) { fallbackIconList.append(fallbackMaskableIconList.at(i)->iconImpl()); } } @@ -1044,24 +1085,24 @@ //If a consolidated (stitched) icon-creation on themeserver fails, unload-request for all individual //frame-items are batched together in a single IPC, which is initiated in HbIconLoader::unLoadMultiIcon(). loader->unLoadMultiIcon(fallbackIconList); - for (int i=0; i < count ; i++) { - if ( fallbackMaskableIconList.at(i) ) { + for (int i = 0; i < count ; i++) { + if (fallbackMaskableIconList.at(i)) { fallbackMaskableIconList.at(i)->dispose(); } } - } + } fallbackIconList.clear(); // vector of HbIconImpl* fallbackMaskableIconList.clear(); // vector of HbMaskableIconImpl* } -void HbFrameDrawerPrivate::themeChange( const QStringList &updatedFiles) +void HbFrameDrawerPrivate::themeChange(const QStringList &updatedFiles) { bool unloadIcons = false; if (updatedFiles.count() == 0 || (icon && updatedFiles.contains(icon->iconFileName()))) { unloadIcons = true; } else { HbMaskableIconImpl *fallbackIcon; - foreach (fallbackIcon, fallbackMaskableIconList) { + foreach(fallbackIcon, fallbackMaskableIconList) { if (fallbackIcon && updatedFiles.contains(fallbackIcon->iconFileName())) { unloadIcons = true; break; @@ -1079,8 +1120,8 @@ HbFrameDrawer::HbFrameDrawer(bool cacheFlag) { d = new HbFrameDrawerPrivate(); - if ( !cacheFlag ) { - d->flags &= HbFrameDrawerPrivate::DoNotCache; + if (!cacheFlag) { + d->flags &= HbFrameDrawerPrivate::DoNotCache; } } @@ -1089,15 +1130,15 @@ HbFrameDrawer::HbFrameDrawer(const QString &frameGraphicsName, FrameType type, bool cacheFlag) { d = new HbFrameDrawerPrivate(frameGraphicsName, type); - if ( !cacheFlag ) { + if (!cacheFlag) { d->flags &= HbFrameDrawerPrivate::DoNotCache; - } + } } /*! * Copy constructs a new frame drawer using the \a other frame drawer. * This is very fast. -* Copy-on-write semantics is used, so this only does a shallow copy. +* Copy-on-write semantics is used, so this only does a shallow copy. */ HbFrameDrawer::HbFrameDrawer(const HbFrameDrawer &other) : d(other.d) @@ -1106,7 +1147,7 @@ /*! * Assigns the \a other frame drawer to this frame drawer and returns a reference to -* this frame drawer. Copy-on-write semantics is used, so this only does a shallow copy. +* this frame drawer. Copy-on-write semantics is used, so this only does a shallow copy. */ HbFrameDrawer &HbFrameDrawer::operator=(const HbFrameDrawer &other) { @@ -1146,14 +1187,19 @@ /*! * Sets the frame graphics name. See the class description for the file name convention for different frame parts. * \sa HbFrameDrawer::frameGraphicsName() +* \note Logical frame names that define a themable frame should not include filename extension, whereas absolute filenames +* must include full path and filename extension. */ void HbFrameDrawer::setFrameGraphicsName(const QString &frameGraphicsName) { - // Remove possible file extension QString nameWithoutExt = frameGraphicsName; - int index = nameWithoutExt.lastIndexOf(QChar('.')); - if (index>0) { - nameWithoutExt.resize(index); + + if (HbThemeUtils::isLogicalName(frameGraphicsName)) { + // Remove possible file extension + int index = nameWithoutExt.lastIndexOf(QChar('.')); + if (index>0) { + nameWithoutExt.resize(index); + } } if (d->frameGraphicsName != nameWithoutExt) { @@ -1164,7 +1210,7 @@ d->defaultMirroring = HbFrameDrawerPrivate::Unknown; // if graphicsItem is set, request redraw - if ( d->graphicsItem ) { + if (d->graphicsItem) { d->graphicsItem->update(); } } @@ -1216,7 +1262,7 @@ * - Left part width = (default size of the left part graphics scaled to the bounding rectangle).width * - Right part width = (default size of the right part graphics scaled to the bounding rectangle).width * - Center part width = remaining width -* +* * Frame type \b ThreePiecesVertical: * * - Top part height = (default size of the top part graphics scaled to the bounding rectangle).height @@ -1232,16 +1278,16 @@ */ void HbFrameDrawer::setBorderWidths(const qreal left, const qreal top, const qreal right, const qreal bottom) { - d->setBorderApiProtectionFlag(true); - if ( left != d->borderWidths[0] || top != d->borderWidths[1] || - right != d->borderWidths[2] || bottom != d->borderWidths[3] ) { + d->setBorderApiProtectionFlag(true); + if (left != d->borderWidths[0] || top != d->borderWidths[1] || + right != d->borderWidths[2] || bottom != d->borderWidths[3]) { // Negative values are converted to zero. d->borderWidths[0] = qMax((qreal)0.0, left); d->borderWidths[1] = qMax((qreal)0.0, top); d->borderWidths[2] = qMax((qreal)0.0, right); d->borderWidths[3] = qMax((qreal)0.0, bottom); // borderWidths changed, clear frame icon - d->reset( false ); + d->reset(false); } } @@ -1254,7 +1300,7 @@ */ void HbFrameDrawer::setBorderWidths(const qreal horizontal, const qreal vertical) { - setBorderWidths( horizontal, vertical, horizontal, vertical ); + setBorderWidths(horizontal, vertical, horizontal, vertical); } /*! @@ -1266,7 +1312,7 @@ */ void HbFrameDrawer::setBorderWidth(const qreal width) { - setBorderWidths( width, width, width, width ); + setBorderWidths(width, width, width, width); } @@ -1288,7 +1334,7 @@ if (rect != d->rect) { d->rect = rect; // Rect changed, clear frame icon - d->reset( false ); + d->reset(false); } } @@ -1297,7 +1343,7 @@ */ void HbFrameDrawer::paint(QPainter *painter, const QRectF &rect) const { - const_cast(this)->setRect( rect ); + const_cast(this)->setRect(rect); if (d->frameGraphicsName.isEmpty() || d->type == HbFrameDrawer::Undefined || d->rect.isEmpty()) { return; @@ -1306,11 +1352,14 @@ // Lazy graphics rasterizing is used. // Rasterize the frame parts now if that has not been done yet. if (d->icon && (rect.toRect().size() != d->prevRect.size())) { - d->reset(); - } - + d->reset(); + } + // update the rendering mode - HbIconLoader::global()->updateRenderingMode(painter->paintEngine()->type()); + QPaintEngine *paintEngine = painter->paintEngine(); + if (paintEngine) { + HbIconLoader::global()->updateRenderingMode(paintEngine->type()); + } d->prepareFrameIcon(); d->prevRect = rect.toRect(); // Paint the frame @@ -1346,15 +1395,15 @@ */ void HbFrameDrawer::setFillWholeRect(bool fill) { - if ( (fill && !d->fillWholeRect()) || (!fill && d->fillWholeRect()) ) { - if ( fill ) { + if ((fill && !d->fillWholeRect()) || (!fill && d->fillWholeRect())) { + if (fill) { d->flags |= HbFrameDrawerPrivate::FillWholeRect; } else { d->flags &= ~HbFrameDrawerPrivate::FillWholeRect; } // Fill mode changed, clear frame Icon - d->reset( false ); + d->reset(false); } } @@ -1374,7 +1423,7 @@ if (mode != d->mirroring) { d->mirroring = mode; // Mirroring changed, clear frame Icon - d->reset( false ); + d->reset(false); } } @@ -1444,13 +1493,13 @@ } } -/*! -* Sets the mask to be applied with the the entire frame icon. +/*! +* Sets the mask to be applied with the entire frame icon. * If the mask is also a frame item, use another frame drawer to draw it. * Mask should be of the same size as returned by frameSize(). * To unset the mask, set it to a null pixmap. -* -* \warning Currently this method makes use of pixmap() routine in case of NVG icons. +* +* \warning Currently this method makes use of pixmap() routine in case of NVG icons. * pixmap() slows down the hardware accelerated rendering. * \sa frameSize(), mask() */ @@ -1460,9 +1509,9 @@ d->maskChanged = true; } -/*! +/*! * Sets the \a clipPath to be applied with the entire frame icon. -* +* */ void HbFrameDrawer::setClipPath(const QPainterPath &clipPath) { @@ -1471,7 +1520,7 @@ /*! * Returns the clippath set on the frame drawer. -* As default, returns a empty QPainterPath. +* By default, returns a empty QPainterPath. * \sa setClipPath() */ @@ -1480,13 +1529,13 @@ return d->clipPath; } -/*! -* Sets the mask to be applied with the the entire frame icon. +/*! +* Sets the mask to be applied with the entire frame icon. * If the mask is also a frame item, use another frame drawer to draw it. * Mask should be of the same size as returned by frameSize(). * To unset the mask, set it to a null bitmap. * - \warning Currently this method makes use of pixmap() routine in case of NVG icons. + \warning Currently this method makes use of pixmap() routine in case of NVG icons. * pixmap() slows down the hardware accelerated rendering. * *\sa frameSize(), mask() @@ -1499,7 +1548,7 @@ /*! * Returns the mask set on the frame drawer. -* As default, returns a null pixmap. +* By default, returns a null pixmap. * \sa setMask() */ @@ -1511,7 +1560,7 @@ /*! * Returns the mask set on the frame drawer. -* As default, returns a null bitmap. +* By default, returns a null bitmap. * \sa setMask() */ QBitmap HbFrameDrawer::maskBitmap() const @@ -1519,7 +1568,7 @@ return d->mask; } /*! - * Returns the size of the entire frame icon. + * Returns the size of the entire frame icon. * Use this method to retrieve the correct size for a mask pixmap that can be set with method setMask(). * If the frame graphics name, bounding rectangle or frame type have not been set, this method returns * an empty size. @@ -1564,27 +1613,27 @@ * * Valid only when the mirroring mode is HbIcon::LayoutDirection. */ -void HbFrameDrawer::setLayoutDirection( Qt::LayoutDirection direction ) +void HbFrameDrawer::setLayoutDirection(Qt::LayoutDirection direction) { d->flags |= HbFrameDrawerPrivate::LayoutDirectionSet; - if ( d->layoutDirection != direction ) { + if (d->layoutDirection != direction) { d->layoutDirection = direction; - - if ( ( d->mirroring == HbIcon::Default - && d->defaultMirroring == HbFrameDrawerPrivate::Enabled ) || - d->mirroring == HbIcon::LayoutDirection) { - d->reset( false ); + if ((d->mirroring == HbIcon::Default + && d->defaultMirroring == HbFrameDrawerPrivate::Enabled) || + d->mirroring == HbIcon::LayoutDirection) { + + d->reset(false); } } } /*! * Sets the \a item which is needs to be redrawn when the frame drawer -* needs re-paint. +* needs re-paint. */ -void HbFrameDrawer::setGraphicsItem( QGraphicsItem *item ) +void HbFrameDrawer::setGraphicsItem(QGraphicsItem *item) { d->graphicsItem = item; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbframedrawer.h --- a/src/hbcore/image/hbframedrawer.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbframedrawer.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,8 +43,7 @@ { public: - enum FrameType - { + enum FrameType { Undefined = 0, OnePiece, ThreePiecesHorizontal, @@ -79,10 +78,10 @@ QStringList fileNameSuffixList() const; void setFileNameSuffixList(const QStringList &list); - void setMask(const QPixmap &mask); + void setMask(const QPixmap &mask); void setMask(const QBitmap &mask); - QPixmap mask() const; - QBitmap maskBitmap() const; + QPixmap mask() const; + QBitmap maskBitmap() const; void setClipPath(const QPainterPath &clipPath); QPainterPath clipPath() const; @@ -92,10 +91,10 @@ void themeChanged(); void setLayoutDirection(Qt::LayoutDirection direction); - void setGraphicsItem( QGraphicsItem *item ); - + void setGraphicsItem(QGraphicsItem *item); + void paint(QPainter *painter, const QRectF &rect) const; - + protected: QRectF rect() const; void setRect(const QRectF &rect); @@ -105,7 +104,7 @@ HbFrameDrawerPrivate *d; friend class HbStylePrivate; + friend class HbFrameDrawerPrivate; }; #endif // HBFRAMEDRAWER_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbframedrawer_p.h --- a/src/hbcore/image/hbframedrawer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbframedrawer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -58,7 +58,7 @@ void paint(QPainter *painter); void reset(bool resetFrameCount = true, bool unloadedByServer = false); - void resetMaskableIcon(); + void resetMaskableIcon(); bool fillWholeRect() const; QString multiPartIconId() const; HbIconLoader::IconLoaderOptions iconLoaderOptions(); @@ -66,17 +66,23 @@ void themeChange(const QStringList &updatedFiles); + static HbFrameDrawerPrivate *d_ptr(HbFrameDrawer *frameDrawer) { + return frameDrawer->d; + } + private: void calculateShrinkedNinePieceCorners( - HbMultiPartSizeData &data, - const QSize& tlSize, const QSize& brSize, - const QSize& fullSize, const QPoint& splitPoint); + HbMultiPartSizeData &data, + const QSize &tlSize, const QSize &brSize, + const QSize &fullSize, const QPoint &splitPoint); QSizeF defaultSize(const QString &framePartSuffix); bool isMirrored(); bool hasBorderWidths() const; + QStringList resolveMultiPieceFileNames(); // disabled - HbFrameDrawerPrivate& operator=(const HbFrameDrawerPrivate &other); - HbIconFormatType iconType; + HbFrameDrawerPrivate &operator=(const HbFrameDrawerPrivate &other); + HbIconFormatType iconType; + public: QString frameGraphicsName; HbFrameDrawer::FrameType type; @@ -88,28 +94,26 @@ // - 0 if frame part files not checked // - 1 if not all frame parts exist and fall back to 1 piece frame // - frame part count otherwise - int frameParts; + int frameParts; HbIcon::MirroringMode mirroring; - enum DefaultMirroring - { + enum DefaultMirroring { Unknown = 0, Enabled = 1, Disabled = 2 }; DefaultMirroring defaultMirroring; - enum internalFlags - { + enum internalFlags { LayoutDirectionSet = 0x01, FillWholeRect = 0x02, - BorderWidthSetByApi = 0x04, - DoNotCache = 0x08, + BorderWidthSetByApi = 0x04, + DoNotCache = 0x08, ResolutionCorrected = 0x10, NoAutoStartAnimation = 0x20 }; - int flags; + int flags; Qt::LayoutDirection layoutDirection; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbframedrawerpool.cpp --- a/src/hbcore/image/hbframedrawerpool.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbframedrawerpool.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -44,8 +44,7 @@ \internal */ -struct HbFrameDrawerPoolKey -{ +struct HbFrameDrawerPoolKey { public: HbFrameDrawerPoolKey(const QString &name, HbFrameDrawer::FrameType type, @@ -56,8 +55,8 @@ QSizeF frameSize; bool operator==(const HbFrameDrawerPoolKey &other) const { return other.frameGraphicsName == frameGraphicsName - && other.frameGraphicsType == frameGraphicsType - && other.frameSize == frameSize; + && other.frameGraphicsType == frameGraphicsType + && other.frameSize == frameSize; } }; @@ -66,8 +65,7 @@ \internal */ -struct HbFrameDrawerPoolValue -{ +struct HbFrameDrawerPoolValue { HbFrameDrawerPoolValue() : frameDrawer(0), refCount(0) { } HbFrameDrawerPoolValue(HbFrameDrawer *drawer) @@ -85,7 +83,7 @@ Q_GLOBAL_STATIC(HbFrameDrawerPoolData, poolData) /*! Returns a new or an existing HbFrameDrawer instance. Ownership of the - pointer is NOT transfered to the caller. The returned pointer must never be + pointer is NOT transferred to the caller. The returned pointer must never be destroyed with delete, use release() instead. \a frameSize is optional, if the default constructed QSizeF is @@ -127,7 +125,8 @@ { bool inPool = false; HbFrameDrawerPoolData *pool = poolData(); - foreach (const HbFrameDrawerPoolKey &key, pool->keys()) { + QList keys = pool->keys(); + foreach(const HbFrameDrawerPoolKey & key, keys) { HbFrameDrawerPoolValue value = pool->value(key); if (value.frameDrawer == frameDrawer) { if (!--value.refCount) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbicon.cpp --- a/src/hbcore/image/hbicon.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbicon.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -61,21 +61,21 @@ E.g. logical name of the icon is "frame". Assuming the icon file is in SVG-T format, the filename should be "frame.svg". - If the given icon name is a logical icon name and not an absolute filename, - it is searched in the icon locations of the theming framework. + The icon name can be either a logical icon name that is fetched from the theme + or an absolute filename. Logical icon names should not include a filename extension. - An absolute icon filename can point e.g. in application's resource file. + An absolute icon filename must include full path and filename extension. The icon can be resized with method HbIcon::setSize. When resizing, by default the aspect ratio of the icon is preserved. - To change this, define the aspect ratio mode parameter in the method HbIcon::paint(). + To change this, define the aspect ratio mode parameter in the method HbIcon::paint(). An icon itself can be a combination of existing icons; in this case the main icon is "badged" with smaller icons to form a distinct icon. You can badge icons in this way with the HbIcon::addBadge method, specifying the location where the badge should be drawn - and a second HbIcon to draw at the indicated location. To prevent possible recursion , + and a second HbIcon to draw at the indicated location. To prevent possible recursion , you can't badge an icon with a badge icon that is itself badged, however. - + Scaled instances of the icons are shared by the framework to decrease memory consumption. @@ -101,7 +101,7 @@ This can be disabled with flag HbIcon::NoAutoStartAnimation. An example of how to define a frame-by-frame animation and construct an icon using it. - + \dontinclude ultimatecodesnippet/ultimatecodesnippet.cpp \skip frame-by-frame \until } @@ -115,14 +115,14 @@ not need to be cached for being able to load it faster next time. \b ResolutionCorrected \b (0x02) This flag is useful for making icon sizes automatically - adapt to different screen resolutions (DPI values) and zoom factors used in the user + adapt to different screen resolutions (DPI values) and zoom factors used in the user interface. The current display resolution (DPI value) and zoom factor are taken in consideration when defining the default size of the icon. This affects on what default size is reported for the icon and also in which size the icon is rendered if its size is not set explicitly. The default DPI value is 144 and the default zoom factor 1.0. When this flag is set, the corrected default size of icon is defined as: - Corrected default size = original default size * current DPI value / default DPI + Corrected default size = original default size * current DPI value / default DPI value * current zoom factor \note Currently this flag has an effect on vector icons only. @@ -170,7 +170,7 @@ in a right-to-left layout. */ -// Must be initialized dynamically because QIcon cannot be constructed +// Must be initialized dynamically because QIcon cannot be constructed // when static variables are constructed. static HbIconPrivate *shared_null = 0; @@ -181,7 +181,7 @@ \internal */ HbIconPrivate::HbIconPrivate() : - engine( new HbIconEngine(QString()) ), + engine(new HbIconEngine(QString())), qicon(engine), badgeInfo(0) { @@ -191,7 +191,7 @@ /*! \internal */ -HbIconPrivate::HbIconPrivate( const QIcon &qicon ) : +HbIconPrivate::HbIconPrivate(const QIcon &qicon) : engine(0), qicon(qicon), badgeInfo(0) @@ -201,8 +201,8 @@ /*! \internal */ -HbIconPrivate::HbIconPrivate( const QString &iconName ) : - engine( new HbIconEngine(iconName) ), +HbIconPrivate::HbIconPrivate(const QString &iconName) : + engine(new HbIconEngine(iconName)), qicon(engine), badgeInfo(0) { @@ -211,25 +211,25 @@ /*! \internal */ -HbIconPrivate::HbIconPrivate( const HbIconPrivate &other ) : - QSharedData( other ), - size( other.size ), +HbIconPrivate::HbIconPrivate(const HbIconPrivate &other) : + QSharedData(other), + size(other.size), engine(0), qicon(), badgeInfo(0) { - if ( other.engine ) { - engine = new HbIconEngine( *other.engine ); - // Have to instantiate a temporary QIcon because + if (other.engine) { + engine = new HbIconEngine(*other.engine); + // Have to instantiate a temporary QIcon because // QIcon's copy constructor shares the engine. QIcon temp(engine); qicon = temp; } else { // Copy constructed from qicon - so just copy the qicon. qicon = other.qicon; - if ( other.badgeInfo ) { + if (other.badgeInfo) { badgeInfo = new HbBadgeIcon(*other.badgeInfo); - } + } } } @@ -267,9 +267,9 @@ */ void HbIconPrivate::removeAllBadges() { - if ( engine ) { + if (engine) { engine->removeAllBadges(); - } else if ( badgeInfo ) { + } else if (badgeInfo) { badgeInfo->removeAllBadges(); } } @@ -279,17 +279,35 @@ */ bool HbIconPrivate::isBadged() const { - if ( engine ) { + if (engine) { return engine->isBadged(); - } else if ( badgeInfo ) { + } else if (badgeInfo) { return badgeInfo->isBadged(); - } + } return false; } /*! \internal */ +void HbIconPrivate::setThemedColor(const QColor &color) +{ + if (engine && color != engine->themedColor()) { + engine->setThemedColor(color); + } +} + +/*! +\internal +*/ +QColor HbIconPrivate::themedColor() const +{ + return engine ? engine->themedColor() : QColor(); +} + +/*! +\internal +*/ QDataStream &operator>>(QDataStream &stream, HbIconPrivate &icon) { stream >> icon.size; @@ -326,18 +344,20 @@ \internal */ bool HbIconPrivate::addBadge(Qt::Alignment align, - const HbIcon& icon, - int z) + const HbIcon &icon, + int z, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio) { - if ( icon.isBadged() ) { + if (icon.isBadged()) { return false; - } else if ( engine ) { - engine->addBadge(align, icon, z); + } else if (engine) { + engine->addBadge(align, icon, z, sizeFactor, aspectRatio); } else { - if ( !badgeInfo ) { + if (!badgeInfo) { badgeInfo = new HbBadgeIcon(); } - badgeInfo->addBadge(align, icon, z); + badgeInfo->addBadge(align, icon, z, sizeFactor, aspectRatio); } return true; } @@ -345,13 +365,13 @@ /*! \internal */ -bool HbIconPrivate::removeBadge(const HbIcon& badge) +bool HbIconPrivate::removeBadge(const HbIcon &badge) { bool result = false; - if ( engine ) { + if (engine) { result = engine->removeBadge(badge); - } else if ( badgeInfo ) { + } else if (badgeInfo) { result = badgeInfo->removeBadge(badge); } @@ -364,7 +384,7 @@ HbIcon::HbIcon() { // Construct shared_null if not done yet. - if ( !shared_null ) { + if (!shared_null) { shared_null = new HbIconPrivate; } d = shared_null; @@ -372,7 +392,7 @@ /*! Constructs a new icon with the icon name \a iconName. */ -HbIcon::HbIcon( const QString &iconName ) +HbIcon::HbIcon(const QString &iconName) { d = new HbIconPrivate(iconName); } @@ -382,14 +402,15 @@ * compatibility reasons if a QIcon instance needs to be passed as a parameter * to a method taking a HbIcon parameter. * \note If this constructor is used, there are the following limitations in the HbIcon methods. -* - HbIcon::defaultSize() always returns QSizeF(). +* - HbIcon::defaultSize() may return QSizeF(). * - HbIcon::paint() ignores the parameter aspectRatioMode and converts the given QRectF to QRect. * - HbIcon::iconName() returns empty string by default. * - HbIcon::pixmap() returns null pixmap. * - Colorization and mirroring support are not available. -* This method should only be used if absolute necessary, as this is not ideal for hardware accelerated environment. +* This method should only be used if absolute necessary, as this is not ideal for hardware accelerated environment +* and there may be huge differences in painting performance when compared to a native HbIcon. */ -HbIcon::HbIcon( const QIcon &icon ) +HbIcon::HbIcon(const QIcon &icon) { d = new HbIconPrivate(icon); } @@ -398,8 +419,8 @@ * Copy constructs a new icon using the \a other icon. * Copy-on-write semantics is used, so this only does a shallow copy. */ -HbIcon::HbIcon( const HbIcon &other ) : - d( other.d ) +HbIcon::HbIcon(const HbIcon &other) : + d(other.d) { } @@ -407,9 +428,9 @@ * Assigns the \a other icon to this icon and returns a reference to * this icon. Copy-on-write semantics is used, so this only does a shallow copy. */ -HbIcon &HbIcon::operator=( const HbIcon &other ) +HbIcon &HbIcon::operator=(const HbIcon &other) { - if ( &other != this ) { + if (&other != this) { d = other.d; } return *this; @@ -445,7 +466,7 @@ void HbIcon::clear() { // A NULL icon is always cleared - save some time not detaching from it - if ( d.constData() != shared_null ) { + if (d.constData() != shared_null) { d.detach(); d->clear(); } @@ -471,7 +492,7 @@ QPixmap HbIcon::pixmap() { if (d->engine) { - return d->engine->pixmap( d->size.toSize(), QIcon::Normal, QIcon::Off ); + return d->engine->pixmap(d->size.toSize(), QIcon::Normal, QIcon::Off); } return QPixmap(); @@ -486,17 +507,20 @@ * is not set. This does not apply to theme elements, for them the color is * always taken into account when the logical graphics name indicates that it is * a mono icon. -* -* Note that if a widget css defines a color for an icon primitive then the style will take -* care of calling setColor() with the correct color from the theme whenever the theme -* changes. Typical examples of such widgets are the itemviews (e.g. list, grid). Therefore -* mono icons shown in such widgets will automatically be colorized with a theme-specific -* color if the icon is either a mono icon coming from the theme or the icon has the +* +* Note that if a widget defines a color for its icon primitive (as most standard +* widgets do) then the style will take care of colorizing with the correct color +* from the theme whenever the theme changes. Therefore mono icons shown in such +* widgets will automatically be colorized with a theme-specific color if the +* icon is either a mono icon coming from the theme or the icon has the * HbIcon::Colorized flag set. * -* \warning Currently this method makes use of pixmap() routine in case of NVG icons. -* pixmap() slows down the hardware accelerated rendering. -* +* However it is possible to override this theme-specific color with a custom one +* by calling this function. +* +* \warning Currently this method makes use of pixmap() routine in case of NVG icons. +* pixmap() slows down the hardware accelerated rendering. +* * \sa HbIcon::color(), HbIcon::Colorized */ void HbIcon::setColor(const QColor &color) @@ -537,11 +561,12 @@ } /*! -* Sets the name of the icon. +* Sets the name of the icon. It can be either a logical icon name that is fetched from the theme +* or an absolute filename. Logical icon names should not include a filename extension. * This icon name is used if there is no name set separately for the specified icon mode and state. * \sa HbIcon::iconName() */ -void HbIcon::setIconName( const QString &iconName ) +void HbIcon::setIconName(const QString &iconName) { if (d->engine && d->engine->iconName() != iconName) { d.detach(); @@ -552,7 +577,7 @@ d.detach(); d->engine = new HbIconEngine(iconName); d->engine->setSize(d->size); - // Have to instantiate a temporary QIcon because + // Have to instantiate a temporary QIcon because // QIcon's assignment operator shares the engine. QIcon temp(d->engine); d->qicon = temp; @@ -565,13 +590,13 @@ * the icon name set without these parameters is returned. * \sa HbIcon::setIconName() */ -QString HbIcon::iconName( QIcon::Mode mode, QIcon::State state ) const +QString HbIcon::iconName(QIcon::Mode mode, QIcon::State state) const { QString ret; if (d->engine) { - ret = d->engine->iconName( mode, state ); - if ( ret.isEmpty() ) { + ret = d->engine->iconName(mode, state); + if (ret.isEmpty()) { ret = d->engine->iconName(); } } @@ -585,9 +610,9 @@ * the given mode and state. * \sa HbIcon::iconName() */ -void HbIcon::setIconName( const QString &iconName, QIcon::Mode mode, QIcon::State state ) +void HbIcon::setIconName(const QString &iconName, QIcon::Mode mode, QIcon::State state) { - if ( d->engine && d->engine->iconName(mode, state) != iconName) { + if (d->engine && d->engine->iconName(mode, state) != iconName) { d.detach(); d->engine->setIconName(iconName, mode, state); } @@ -596,50 +621,58 @@ /*! Paints the icon in the given \a painter with the specified drawing parameters. * \note If the constructor HbIcon::HbIcon(const QIcon &icon) is used, the parameter * \a aspectRatioMode is ignored and Qt::KeepAspectRatio is used. Also in that case the icon -* is not scaled exactly to the given size but the best size match returned by the QIcon +* is not scaled exactly to the given size but the best size match returned by the QIcon * instance is used. */ -void HbIcon::paint( QPainter *painter, - const QRectF &rect, - Qt::AspectRatioMode aspectRatioMode, - Qt::Alignment alignment, - QIcon::Mode mode, - QIcon::State state) const +void HbIcon::paint(QPainter *painter, + const QRectF &rect, + Qt::AspectRatioMode aspectRatioMode, + Qt::Alignment alignment, + QIcon::Mode mode, + QIcon::State state) const { - if ( !rect.isEmpty() && d.constData() != shared_null ) { - if ( d->engine ) { - d->engine->paint( painter, rect, aspectRatioMode, alignment, mode, state ); + if (!rect.isEmpty() && d.constData() != shared_null) { + if (d->engine) { + d->engine->paint(painter, rect, aspectRatioMode, alignment, mode, state); } else { - // This HbIcon was copy constructed from QIcon and + // This HbIcon was copy constructed from QIcon and // we cannot use HbIconEngine for painting. QSizeF size = this->size(); - if ( !size.isValid() ) { + if (!size.isValid()) { // If size is not set, have to use rect size because QIcon // does not provide defaultSize information. size = rect.size(); } - - QPixmap pixmap = d->qicon.pixmap( size.toSize(), mode, state ); + + QPixmap pixmap = d->qicon.pixmap(size.toSize(), mode, state); QSizeF pixmapSize = pixmap.size(); - // Adjust the alignment - QPointF topLeft = rect.topLeft(); - if ( alignment & Qt::AlignRight ) { - topLeft.setX( rect.right() - pixmapSize.width() ); - } else if ( alignment & Qt::AlignHCenter ) { - topLeft.setX( topLeft.x() + (rect.width() - pixmapSize.width()) / 2 ); + // QIcon::pixmap() will not do upscaling. + if (pixmapSize.width() < size.width() || pixmapSize.height() < size.height()) { + // Native HbIcons are scaled using SmoothTransformation so use the same. + pixmap = pixmap.scaled(size.toSize(), aspectRatioMode, Qt::SmoothTransformation); + pixmapSize = pixmap.size(); } - if ( alignment & Qt::AlignBottom ) { - topLeft.setY( rect.bottom() - pixmapSize.height() ); - } else if ( alignment & Qt::AlignVCenter ) { - topLeft.setY( topLeft.y() + (rect.height() - pixmapSize.height()) / 2 ); + // Adjust the alignment + QPointF topLeft = rect.topLeft(); + + if (alignment & Qt::AlignRight) { + topLeft.setX(rect.right() - pixmapSize.width()); + } else if (alignment & Qt::AlignHCenter) { + topLeft.setX(topLeft.x() + (rect.width() - pixmapSize.width()) / 2); } - painter->drawPixmap( topLeft, pixmap, pixmap.rect() ); + if (alignment & Qt::AlignBottom) { + topLeft.setY(rect.bottom() - pixmapSize.height()); + } else if (alignment & Qt::AlignVCenter) { + topLeft.setY(topLeft.y() + (rect.height() - pixmapSize.height()) / 2); + } + + painter->drawPixmap(topLeft, pixmap, pixmap.rect()); // Draw the badges on this icon - if ( d->badgeInfo ) { + if (d->badgeInfo) { d->badgeInfo->paint(painter, rect, mode, state, false); } } @@ -652,25 +685,27 @@ QSizeF HbIcon::size() const { if ((static_cast(flags()) & HbIcon::ResolutionCorrected)) { + if (d->engine) { + d->size = d->engine->size(); + } if (d->size.isValid()) { return d->size; - } else { + } else { QSizeF defSize(defaultSize()); - HbIconLoader::global()->applyResolutionCorrection(defSize); return defSize; } } else if (d->size.isValid()) { return d->size; } return defaultSize(); -} +} /*! Returns the default size of the icon. */ QSizeF HbIcon::defaultSize() const { // Default constructed icon? - if ( d.constData() == shared_null ) { + if (d.constData() == shared_null) { return QSizeF(); } @@ -692,29 +727,29 @@ /*! Sets the \a height of the icon. Its width is computed using the aspect ratio of the icon. */ -void HbIcon::setHeight( qreal height ) +void HbIcon::setHeight(qreal height) { QSizeF size = defaultSize(); - if ( size.height() > 0 ) { + if (size.height() > 0) { qreal ar = size.width() / size.height(); - setSize( QSizeF( ar * height , height) ); + setSize(QSizeF(ar * height , height)); } } /*! Sets the \a width of the icon. Its height is computed using the aspect ratio of the icon. */ -void HbIcon::setWidth( qreal width ) +void HbIcon::setWidth(qreal width) { QSizeF size = defaultSize(); - if ( size.width() > 0 ) { + if (size.width() > 0) { qreal ar = size.height() / size.width(); - setSize( QSizeF( width, ar * width ) ); + setSize(QSizeF(width, ar * width)); } } /*! Returns the width of the icon. */ -qreal HbIcon::width() const +qreal HbIcon::width() const { return size().width(); } @@ -741,10 +776,10 @@ /*! Sets the mirroring \a mode for the icon. * \sa HbIcon::mirroringMode() */ -void HbIcon::setMirroringMode( HbIcon::MirroringMode mode ) +void HbIcon::setMirroringMode(HbIcon::MirroringMode mode) { if (d->engine) { - if ( mode != d->engine->mirroringMode() ) { + if (mode != d->engine->mirroringMode()) { d.detach(); d->engine->setMirroringMode(mode); } @@ -759,7 +794,7 @@ if (d->engine) { return d->engine->flags(); } else { - return ( HbIcon::Flags )0; + return (HbIcon::Flags)0; } } @@ -778,9 +813,9 @@ /*! Sets the size for the icon. Without calling this method, the icon uses its default size. * \sa HbIcon::size(), HbIcon::defaultSize() */ -void HbIcon::setSize( const QSizeF &size ) +void HbIcon::setSize(const QSizeF &size) { - if ( size != d->size ) { + if (size != d->size) { d.detach(); d->size = size; @@ -802,71 +837,71 @@ * Returns a reference to a QIcon instance representing this icon. * \note The returned reference is valid only for the life time of this HbIcon instance. */ -QIcon & HbIcon::qicon() const +QIcon &HbIcon::qicon() const { return d->qicon; } /*! * Equality operator. It compares the icon names for all the state and mode combinations. -* It also compares the badges, the color and the mirroring mode of the icon. The sizes +* It also compares the badges, the color and the mirroring mode of the icon. The sizes * set for the icons are not used for the comparison. */ -bool HbIcon::operator==( const HbIcon &other ) const +bool HbIcon::operator==(const HbIcon &other) const { - return !( *this != other ); + return !(*this != other); } /*! * Inequality operator. It compares the icon names for all the state and mode combinations. -* It also compares the badges, the color and the mirroring mode of the icon. The sizes +* It also compares the badges, the color and the mirroring mode of the icon. The sizes * set for the icons are not used for the comparison. */ -bool HbIcon::operator!=( const HbIcon &other ) const +bool HbIcon::operator!=(const HbIcon &other) const { // NULL icons are equal - if ( isNull() && other.isNull() ) { - if ( d->badgeInfo && other.d->badgeInfo ) { - if ( d->badgeInfo->badges() != other.d->badgeInfo->badges() ) { + if (isNull() && other.isNull()) { + if (d->badgeInfo && other.d->badgeInfo) { + if (d->badgeInfo->badges() != other.d->badgeInfo->badges()) { return true; } } return false; } - + const HbIconEngine *engine1 = d->engine; const HbIconEngine *engine2 = other.d->engine; // If both icons do not have engines, they are unequal. // An icon does not have an engine if it is constructed with a QIcon. - if ( !engine1 || !engine2 ) { - return true; + if (!engine1 || !engine2) { + return true; } - if ( engine1->iconName() != engine2->iconName() || - engine1->iconName( QIcon::Normal, QIcon::Off ) != engine2->iconName( QIcon::Normal, QIcon::Off ) || - engine1->iconName( QIcon::Normal, QIcon::On ) != engine2->iconName( QIcon::Normal, QIcon::On ) || - engine1->iconName( QIcon::Disabled, QIcon::Off ) != engine2->iconName( QIcon::Disabled, QIcon::Off ) || - engine1->iconName( QIcon::Disabled, QIcon::On ) != engine2->iconName( QIcon::Disabled, QIcon::On ) || - engine1->iconName( QIcon::Active, QIcon::Off ) != engine2->iconName( QIcon::Active, QIcon::Off ) || - engine1->iconName( QIcon::Active, QIcon::On ) != engine2->iconName( QIcon::Active, QIcon::On ) || - engine1->iconName( QIcon::Selected, QIcon::Off ) != engine2->iconName( QIcon::Selected, QIcon::Off ) || - engine1->iconName( QIcon::Selected, QIcon::On ) != engine2->iconName( QIcon::Selected, QIcon::On ) ) { + if (engine1->iconName() != engine2->iconName() || + engine1->iconName(QIcon::Normal, QIcon::Off) != engine2->iconName(QIcon::Normal, QIcon::Off) || + engine1->iconName(QIcon::Normal, QIcon::On) != engine2->iconName(QIcon::Normal, QIcon::On) || + engine1->iconName(QIcon::Disabled, QIcon::Off) != engine2->iconName(QIcon::Disabled, QIcon::Off) || + engine1->iconName(QIcon::Disabled, QIcon::On) != engine2->iconName(QIcon::Disabled, QIcon::On) || + engine1->iconName(QIcon::Active, QIcon::Off) != engine2->iconName(QIcon::Active, QIcon::Off) || + engine1->iconName(QIcon::Active, QIcon::On) != engine2->iconName(QIcon::Active, QIcon::On) || + engine1->iconName(QIcon::Selected, QIcon::Off) != engine2->iconName(QIcon::Selected, QIcon::Off) || + engine1->iconName(QIcon::Selected, QIcon::On) != engine2->iconName(QIcon::Selected, QIcon::On)) { return true; } // If they have different badges, they are unequal - if ( engine1->badges() != engine2->badges() ) { + if (engine1->badges() != engine2->badges()) { return true; } - if ( engine1->color() != engine2->color() ){ + if (engine1->color() != engine2->color()) { return true; } // two icons are considered different if their mirroring modes are different - if ( engine1->mirroringMode() != engine2->mirroringMode() ){ + if (engine1->mirroringMode() != engine2->mirroringMode()) { return true; } @@ -877,22 +912,62 @@ * Adds a badge icon to the existing icon. The badge icons * are drawn relative to the alignment you specify with the * z-order you provide. + * + * By default the badge icon will use its default size. If this is + * not suitable (which is typical in case of vector graphics) then + * call setSize() explicitly on \a badge before passing it to this + * function. + * + * The aspect ratio for the badge is kept by default, but this can be + * changed in the \a aspectRatio argument. + * + * \sa addProportionalBadge() */ -bool HbIcon::addBadge( Qt::Alignment alignment, - const HbIcon& badge, - int z ) +bool HbIcon::addBadge(Qt::Alignment alignment, + const HbIcon &badge, + int z, + Qt::AspectRatioMode aspectRatio) { d.detach(); - return d->addBadge(alignment, badge, z); + return d->addBadge(alignment, badge, z, QSizeF(), aspectRatio); +} + +/*! + * Adds a badge icon to the existing icon. The badge icons + * are drawn relative to the alignment you specify with the + * z-order you provide. + * + * With this function the size of the badge icon will be proportional + * to the size of the badged icon. If the size needs to be explicitly + * specified then use addBadge() instead. + * + * \a sizeFactor's x and y values must be between 0 and 1. They + * specify how much space the badge takes. For example (0.25, 0.25) + * causes both the width and height to be 1/4 of the full icon width + * and height. + * + * The aspect ratio for the badge is kept by default, but this can be + * changed in the \a aspectRatio argument. + * + * \sa addBadge() + */ +bool HbIcon::addProportionalBadge(Qt::Alignment alignment, + const HbIcon &badge, + const QSizeF &sizeFactor, + int z, + Qt::AspectRatioMode aspectRatio) +{ + d.detach(); + return d->addBadge(alignment, badge, z, sizeFactor, aspectRatio); } /*! * Removes badge icon(s) from the icon. */ -bool HbIcon::removeBadge( const HbIcon& badge ) +bool HbIcon::removeBadge(const HbIcon &badge) { d.detach(); - return d->removeBadge( badge ); + return d->removeBadge(badge); } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbicon.h --- a/src/hbcore/image/hbicon.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbicon.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,6 +31,7 @@ #include //krazy:exclude=qclasses #include #include +#include #include class HbIconPrivate; @@ -100,20 +101,26 @@ void setFlags(Flags flags); void paint(QPainter *painter, - const QRectF &rect, - Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio, - Qt::Alignment alignment = Qt::AlignCenter, - QIcon::Mode mode = QIcon::Normal, - QIcon::State state = QIcon::Off) const; + const QRectF &rect, + Qt::AspectRatioMode aspectRatioMode = Qt::KeepAspectRatio, + Qt::Alignment alignment = Qt::AlignCenter, + QIcon::Mode mode = QIcon::Normal, + QIcon::State state = QIcon::Off) const; operator QVariant() const; QIcon &qicon() const; bool addBadge(Qt::Alignment alignment, - const HbIcon& badge, - int z=0); - bool removeBadge(const HbIcon& badge); + const HbIcon &badge, + int z = 0, + Qt::AspectRatioMode aspectRatio = Qt::KeepAspectRatio); + bool addProportionalBadge(Qt::Alignment alignment, + const HbIcon &badge, + const QSizeF &sizeFactor = QSizeF(0.25, 0.25), + int z = 0, + Qt::AspectRatioMode aspectRatio = Qt::KeepAspectRatio); + bool removeBadge(const HbIcon &badge); void removeAllBadges(); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbicon_p.h --- a/src/hbcore/image/hbicon_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbicon_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,36 +31,47 @@ class HbIconAnimator; class HbBadgeIcon; + class HbIconPrivate : public QSharedData { public: HbIconPrivate(); - HbIconPrivate( const QIcon &qicon ); - HbIconPrivate( const QString &iconName ); - HbIconPrivate( const HbIconPrivate &other ); + HbIconPrivate(const QIcon &qicon); + HbIconPrivate(const QString &iconName); + HbIconPrivate(const HbIconPrivate &other); ~HbIconPrivate(); void clear(); void clearStoredIconContent(); bool addBadge(Qt::Alignment alignment, - const HbIcon& badge, - int z=0); - bool removeBadge(const HbIcon& badge); + const HbIcon &badge, + int z, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio); + bool removeBadge(const HbIcon &badge); void removeAllBadges(); bool isBadged() const; + void setThemedColor(const QColor &color); + QColor themedColor() const; private: // disabled - HbIconPrivate & operator=( const HbIconPrivate &other ); + HbIconPrivate &operator=(const HbIconPrivate &other); public: - static HbIconPrivate *d_ptr(HbIcon *icon) { return icon->d.data(); } - + static HbIconPrivate *d_ptr(HbIcon *icon) { + return icon->d.data(); + } + static HbIconPrivate *d_ptr_detached(HbIcon *icon) { + icon->d.detach(); + return icon->d.data(); + } + QSizeF size; HbIconEngine *engine; // this is 0 if HbIcon was copy constructed from QIcon. QIcon qicon; - HbBadgeIcon* badgeInfo; + HbBadgeIcon *badgeInfo; }; QDataStream &operator<<(QDataStream &stream, const HbIconPrivate &icon); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimation.cpp --- a/src/hbcore/image/hbiconanimation.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimation.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -56,7 +56,7 @@ mView(0), mPaused(false), mPausedDueToBackground(false) - { +{ Q_ASSERT(!(animator->d->animation)); // Set the animation in the animator, it takes ownership of this object. animator->d->animation = this; @@ -64,7 +64,7 @@ #ifdef HB_ICON_TRACES qDebug() << "HbIconAnimation created: " << mIconName; #endif - } +} HbIconAnimation::~HbIconAnimation() { @@ -98,7 +98,7 @@ { return mColor; } - + void HbIconAnimation::setColor(const QColor &color) { mColor = color; @@ -278,7 +278,7 @@ // Apply mirroring if required if (mMirrored) { QTransform t; - t.scale(-1,1); + t.scale(-1, 1); canvasPixmap = canvasPixmap.transformed(t); } @@ -381,7 +381,7 @@ delete mImageRenderer; mImageRenderer = 0; mImageRenderer = new QImageReader(mIconFileName, mType == MNG ? "MNG" : "GIF"); - + // New image reader starts from the first frame. Handle animation update. notifyAnimationStarted(); handleAnimationUpdated(); @@ -417,7 +417,7 @@ // Inform client to update display emit animationUpdated(); - + notifyAnimationStopped(); } @@ -448,7 +448,7 @@ // Apply mirroring if required if (mMirrored) { QTransform t; - t.scale(-1,1); + t.scale(-1, 1); canvasPixmap = canvasPixmap.transformed(t); } @@ -507,11 +507,11 @@ } HbIconAnimationFrameSet::HbIconAnimationFrameSet( - HbIconAnimator *animator, const QString &iconName,const QList &frames) : - HbIconAnimation(animator, iconName), - mFrames(frames), - mCurrentFrameIndex(0), - mTimerEntry(0) + HbIconAnimator *animator, const QString &iconName, const QList &frames) : + HbIconAnimation(animator, iconName), + mFrames(frames), + mCurrentFrameIndex(0), + mTimerEntry(0) { // Do not start the timer or initiate any signal emission here. // Do it in start() instead, since mFresh is true by default. @@ -623,7 +623,7 @@ if (jumpData.execCount < jumpData.repeatCount) { ++jumpData.execCount; // Before returning, the exec counts of all previous jumps in - // this frame must be resetted, because they were caused by + // this frame must be reset, because they were caused by // elements that were embedded into the that // generated this jump. for (int j = 0; j < i; ++j) { @@ -631,7 +631,7 @@ } // And similarly, all jumps in frames that fall between the // target (incl.) and the current frame (excl.) must be - // resetted. Note that jumping forward is not supported and such + // reset. Note that jumping forward is not supported and such // jumps are never generated by the animation xml parser. for (int j = jumpData.targetFrameIndex; j < mCurrentFrameIndex; ++j) { resetJumpCount(mFrames[j]); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimation_p.h --- a/src/hbcore/image/hbiconanimation_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimation_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -88,7 +88,7 @@ void setMirrored(bool mirrored); QColor color() const; - void setColor(const QColor &color); + void setColor(const QColor &color); bool resolutionCorrected() const; void setResolutionCorrected(bool corrected); @@ -96,33 +96,27 @@ HbIconAnimationDefinition::PlayMode playMode() const; void setPlayMode(HbIconAnimationDefinition::PlayMode playMode); - inline HbView *view() const - { + inline HbView *view() const { return mView; } - inline void setView(HbView *view) - { + inline void setView(HbView *view) { mView = view; } - inline HbIconAnimator *animator() const - { + inline HbIconAnimator *animator() const { return mAnimator; } - inline bool paused() const - { + inline bool paused() const { return mPaused; } - inline bool pausedDueToBackground() const - { + inline bool pausedDueToBackground() const { return mPausedDueToBackground; } - inline void setPausedDueToBackground(bool status) - { + inline void setPausedDueToBackground(bool status) { mPausedDueToBackground = status; } @@ -161,7 +155,7 @@ // dptr to the global animation manager instance HbIconAnimationManagerPrivate *mAnimMgrD; - QColor mColor; + QColor mColor; HbIconAnimator *mAnimator; HbView *mView; @@ -239,17 +233,16 @@ QPixmap pixmap; int duration; // in milliseconds QList jumps; - void assignJumps(const QList &jlist) - { - jumps.clear(); - for (int i = 0, ie = jlist.count(); i != ie; ++i) { - JumpData jd; - jd.targetFrameIndex = jlist.at(i).targetFrameIndex; - jd.repeatCount = jlist.at(i).repeatCount; - jd.execCount = 0; - jumps.append(jd); - } + void assignJumps(const QList &jlist) { + jumps.clear(); + for (int i = 0, ie = jlist.count(); i != ie; ++i) { + JumpData jd; + jd.targetFrameIndex = jlist.at(i).targetFrameIndex; + jd.repeatCount = jlist.at(i).repeatCount; + jd.execCount = 0; + jumps.append(jd); } + } }; HbIconAnimationFrameSet(HbIconAnimator *animator, const QString &iconName, const QList &frames); @@ -277,7 +270,7 @@ int mCurrentFrameIndex; bool mMirrored; - + HbTimerSignalEntry *mTimerEntry; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimationmanager.cpp --- a/src/hbcore/image/hbiconanimationmanager.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimationmanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,6 @@ #include "hbiconanimator.h" #include "hbiconanimator_p.h" #include "hbtheme.h" -#include "hbimagetraces_p.h" #include "hbiconanimation_p.h" #include "hbimagetraces_p.h" @@ -65,14 +64,20 @@ bool HbIconAnimationManagerPrivate::addDefinitionFile(const QString &definitionFileName) { // Stop right away if the file has already been added. - foreach (const QString &iconName, animations.keys()) { + QList keys = animations.keys(); + foreach(const QString & iconName, keys) { if (animations.operator[](iconName).definitionFileName == definitionFileName) { return true; } } // Check if there is a file with the given name in the current theme. - QString pathInTheme = HbIconLoader::global()->findSharedResource(definitionFileName, Hb::AnimationResource); + // Attach the .axml suffix if needed, just for the theme lookup. + QString fileNameWithSuffix = definitionFileName; + if (!fileNameWithSuffix.contains('.')) { + fileNameWithSuffix.append(QLatin1String(".axml")); + } + QString pathInTheme = HbIconLoader::global()->findSharedResource(fileNameWithSuffix, Hb::AnimationResource); #ifdef HB_ICON_TRACES qDebug() << definitionFileName << " => " << pathInTheme; #endif @@ -83,7 +88,7 @@ // Parse the filename and add entries in the hash table, first try the themeserver. bool ret = parser.parseDefinitionFileShared(definitionFileName, - animations, *realFileName); + animations, *realFileName); if (!ret) { // If themeserver did not return anything then try the file locally. ret = parser.parseDefinitionFile(definitionFileName, @@ -153,12 +158,12 @@ void HbIconAnimationManagerPrivate::handleAnimationResume() { // resume all paused animations - foreach (HbIconAnimation *anim, playingAnims) { + foreach(HbIconAnimation * anim, playingAnims) { if (anim->pausedDueToBackground()) { - #ifdef HB_ICON_TRACES +#ifdef HB_ICON_TRACES qDebug() << "Foreground gained - resuming animation:" << anim->iconName(); - #endif +#endif anim->resume(); } @@ -171,13 +176,13 @@ void HbIconAnimationManagerPrivate::handleAnimationPause() { // pause all playing animations - foreach (HbIconAnimation *anim, playingAnims) { + foreach(HbIconAnimation * anim, playingAnims) { if (!anim->paused()) { - - #ifdef HB_ICON_TRACES + +#ifdef HB_ICON_TRACES qDebug() << "Foreground lost - pausing animation:" << anim->iconName(); - #endif - +#endif + anim->pause(); anim->setPausedDueToBackground(true); } @@ -190,7 +195,7 @@ void HbIconAnimationManagerPrivate::handleThemeChanged() { // The theme is being changed, stop all on-going animations. - foreach (HbIconAnimation *anim, playingAnims) { + foreach(HbIconAnimation * anim, playingAnims) { anim->stop(); } } @@ -204,7 +209,8 @@ // animation definitions (or at least try to reload; some defs may now be // missing if they were present in the previous theme but not in the new // one). - foreach (const QString &iconName, animations.keys()) { + QList keys = animations.keys(); + foreach(const QString & iconName, keys) { // Do not remove animations that were not created from files. if (!animations.operator[](iconName).definitionFileName.isEmpty()) { animations.remove(iconName); @@ -220,7 +226,7 @@ // // 3. Theme changes to another theme that _does_ contain somethingFromTheme. // - foreach (const QString &name, allDefNames) { + foreach(const QString & name, allDefNames) { addDefinitionFile(name); } } @@ -228,18 +234,18 @@ void HbIconAnimationManagerPrivate::handleViewChanged(HbView *view) { // Pause all playing animations which do not belong to the new view, resume the ones belonging to it - foreach (HbIconAnimation *anim, playingAnims) { + foreach(HbIconAnimation * anim, playingAnims) { // If the view of the animation is not resolved, do nothing if (anim->view()) { if (anim->view() == view) { - #ifdef HB_ICON_TRACES +#ifdef HB_ICON_TRACES qDebug() << "View activated - resuming animation:" << anim->iconName(); - #endif +#endif anim->resume(); } else { - #ifdef HB_ICON_TRACES +#ifdef HB_ICON_TRACES qDebug() << "View deactivated - pausing animation:" << anim->iconName(); - #endif +#endif anim->pause(); } } @@ -261,8 +267,8 @@ // Connect to view change signals if not done yet if (!viewChangeConnected) { QList windowList = hbInstance->allMainWindows(); - Q_FOREACH(const HbMainWindow *window, windowList) { - connect(window, SIGNAL(currentViewChanged(HbView*)), SLOT(handleViewChanged(HbView*))); + Q_FOREACH(const HbMainWindow * window, windowList) { + connect(window, SIGNAL(currentViewChanged(HbView *)), SLOT(handleViewChanged(HbView *))); } viewChangeConnected = true; } @@ -282,7 +288,7 @@ if (scene) { // Resolve the main window having the same scene that the item belongs to QList windowList = hbInstance->allMainWindows(); - Q_FOREACH(const HbMainWindow *window, windowList) { + Q_FOREACH(const HbMainWindow * window, windowList) { if (window->scene() == scene) { anim->setView(window->currentView()); break; @@ -390,7 +396,7 @@ * * * \endcode -* +* * The frame names e.g. "anim1_frame1" in the example above correspond to the icon name * parameters passed in HbIcon constructor when the animation frame icons are loaded. * diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimationmanager.h --- a/src/hbcore/image/hbiconanimationmanager.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimationmanager.h Thu Jul 22 16:36:53 2010 +0100 @@ -42,7 +42,7 @@ static HbIconAnimationManager *global(); bool addDefinitionFile(const QString &definitionFileName); - + void addDefinition( const QString &iconName, const HbIconAnimationDefinition &definition); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimationmanager_p.h --- a/src/hbcore/image/hbiconanimationmanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimationmanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,7 @@ ~HbIconAnimationManagerPrivate(); bool addDefinitionFile(const QString &definitionFileName); - + void addDefinition( const QString &iconName, const HbIconAnimationDefinition &definition); @@ -58,8 +58,7 @@ void animPlaying(HbIconAnimation *anim); void animNotPlaying(HbIconAnimation *anim); - static HbIconAnimationManagerPrivate *d_ptr(HbIconAnimationManager *mgr) - { + static HbIconAnimationManagerPrivate *d_ptr(HbIconAnimationManager *mgr) { return mgr->d; } @@ -68,7 +67,7 @@ void handleAnimationPause(); void handleThemeChanged(); void handleThemeChangeFinished(); - void handleViewChanged(HbView*); + void handleViewChanged(HbView *); private: Q_DISABLE_COPY(HbIconAnimationManagerPrivate) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimationparser.cpp --- a/src/hbcore/image/hbiconanimationparser.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimationparser.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -87,7 +87,7 @@ #endif return false; } - + setDevice(&file); bool ret = doParseFile(fileName, animations); file.close(); @@ -107,7 +107,7 @@ if (name() == "animations") { ret = readAnimations(fileName, animations); } - } + } } #ifdef HB_ICON_TRACES @@ -165,7 +165,7 @@ QString HbIconAnimationParser::readIconData(HbIconAnimationData &data) { Q_ASSERT(isStartElement() && name() == "icon"); - + QString iconName; int defaultDuration = 0; QStack< QPair > repStk; @@ -176,7 +176,7 @@ QList frames = data.def.frameList(); // Read icon attributes - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { // "name" = ... if (attr.name().toString() == "name") { iconName = attr.value().toString(); @@ -226,7 +226,7 @@ QXmlStreamAttributes attrs = attributes(); // Read attributes - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { // duration attribute if (attr.name().toString() == "duration") { frame.duration = attr.value().toString().toInt(); @@ -246,7 +246,7 @@ // int repeatCount = 0; QXmlStreamAttributes attrs = attributes(); - foreach (const QXmlStreamAttribute &attr, attrs) { + foreach(const QXmlStreamAttribute & attr, attrs) { if (attr.name().toString() == "count") { repeatCount = attr.value().toString().toInt(); } @@ -255,7 +255,7 @@ if (repeatCount > 0) { // Target frame index for this loop's last frame will be the index of // the frame that comes next. - repStk.push(QPair(frames.count(), repeatCount)); + repStk.push(QPair(frames.count(), repeatCount)); } } else { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimationparser_p.h --- a/src/hbcore/image/hbiconanimationparser_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimationparser_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,7 +43,7 @@ bool parseDefinitionFile(const QString &fileName, AnimHash &animations, const QString &realFileName); private: - bool doParseFile(const QString &fileName, AnimHash &animations); + bool doParseFile(const QString &fileName, AnimHash &animations); bool readAnimations(const QString &fileName, AnimHash &animations); QString readIconData(HbIconAnimationData &data); void readUnknownElement(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconanimator.cpp --- a/src/hbcore/image/hbiconanimator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconanimator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -44,9 +44,9 @@ \brief HbIconAnimator is the animation interface for animated icons. Class HbIconItem uses it for built-in animation support. For more specific use cases, clients can also create their own HbIconAnimator instance and use it for driving an icon animation. - + If the icon is not animated, the animator does not do anything. - + The animator provides signals for observing the start, stop and finish of the animation and the animation progress. */ @@ -70,23 +70,23 @@ /*! \fn void HbIconAnimator::animationStopped() - + This signal is emitted whenever the icon animation is stopped (by calling stopAnimation()) before the animation has finished. - + \sa stopAnimation() */ /*! \fn void HbIconAnimator::animationProgressed() - + This signal is emitted whenever the icon animation has progressed and the icon should be repainted to the screen. */ /*! \fn void HbIconAnimator::animationFinished() - + This signal is emitted whenever the icon animation is finished (and there was no stopAnimation() call). This can be used e.g. to synchronize subsequent icon animations. If looping is enabled then this signal is never emitted. @@ -162,10 +162,9 @@ // Update current mirroring in the animation d->animation->setMirrored(icon.d->engine->isMirrored()); } - } - else if ((static_cast(icon.flags()) & HbIcon::ResolutionCorrected) != - (static_cast(d->icon.flags()) & HbIcon::ResolutionCorrected) || - icon.isNull()) { + } else if ((static_cast(icon.flags()) & HbIcon::ResolutionCorrected) != + (static_cast(d->icon.flags()) & HbIcon::ResolutionCorrected) || + icon.isNull()) { needToRecreateAnimation = true; } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconengine.cpp --- a/src/hbcore/image/hbiconengine.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconengine.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -34,10 +34,12 @@ #include "hbimagetraces_p.h" #include "hbiconimpl_p.h" #include "hbpixmapiconimpl_p.h" +#include "hbbadgeicon_p.h" + #include #include #include -#include "hbbadgeicon_p.h" + #include #include @@ -67,18 +69,21 @@ void unLoadIcon(bool unloadedByServer = false); void addBadge(Qt::Alignment alignment, - const HbIcon& badge, - int z=0); - bool removeBadge(const HbIcon& badge); + const HbIcon &badge, + int z, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio); + bool removeBadge(const HbIcon &badge); void removeAllBadges(); const QList badges() const; bool isBadged() const; + QColor colorToUse(const QString &iconName) const; + public: QSizeF size; - struct IconName - { + struct IconName { QIcon::Mode mode; QIcon::State state; QString name; @@ -105,8 +110,7 @@ HbIcon::Flags flags; HbIcon::MirroringMode mirroringMode; - enum DefaultMirroring - { + enum DefaultMirroring { Unknown = 0, Enabled = 1, Disabled = 2 @@ -119,7 +123,9 @@ // Variables introduced for handling colorizable icons QColor color; - + // The color coming from the color group associated with a widget in its css. + QColor themedColor; + //Icon Implementation interface which provides abstraction for the type of icon ( Pixmap, NVG, SgImage etc). // Each class derived from HbIconImpl will have to implement the paint(), pixmap() and defaultSize() API HbIconImpl *icon; @@ -135,20 +141,15 @@ // Class HbIconEnginePrivate HbIconEnginePrivate::HbIconEnginePrivate(const QString &iconName) : - size(), - iconNames(), - pixmap(), aspectRatioMode(Qt::KeepAspectRatio), mode(QIcon::Normal), state(QIcon::Off), - defaultSize(), defaultSizeFailed(false), loadFailed(0), flags(0), mirroringMode(HbIcon::Default), defaultMirroring(Unknown), animator(0), - color(QColor()), icon(0), badgeInfo(0), signalConnectionsSet(false), @@ -163,8 +164,7 @@ HbIconEnginePrivate::HbIconEnginePrivate(const HbIconEnginePrivate &other) : size(other.size), iconNames(other.iconNames), - // Pixmap is cleared if other object uses animation - pixmap(other.animator ? QPixmap() : other.pixmap), + pixmap(other.animator ? QPixmap() : other.pixmap), // Pixmap is cleared if other object uses animation. aspectRatioMode(other.aspectRatioMode), mode(other.mode), state(other.state), @@ -174,11 +174,9 @@ flags(other.flags), mirroringMode(other.mirroringMode), defaultMirroring(other.defaultMirroring), - // Animator is instance specific and not copied - animator(0), - color(other.color), - // HbIconImpl is instance specific, it is recreated when icon is painted - icon(0), + animator(0), // Animator is instance specific and not copied. + color(other.color), // No copy for themedColor, that one is an internal, instance-specific setting. + icon(0), // HbIconImpl is instance specific, it is recreated when icon is painted. badgeInfo(0), signalConnectionsSet(false), iconType(INVALID_FORMAT) @@ -190,20 +188,15 @@ } HbIconEnginePrivate::HbIconEnginePrivate(QDataStream &stream) : - size(), - iconNames(), - pixmap(), aspectRatioMode(Qt::KeepAspectRatio), mode(QIcon::Normal), state(QIcon::Off), - defaultSize(), defaultSizeFailed(false), loadFailed(0), flags(0), mirroringMode(HbIcon::Default), defaultMirroring(Unknown), animator(0), - color(QColor()), icon(0), badgeInfo(new HbBadgeIcon), signalConnectionsSet(false), @@ -233,6 +226,7 @@ stream >> temp; defaultMirroring = (HbIconEnginePrivate::DefaultMirroring)temp; stream >> color; + // Do not store themedColor, see the copy ctor. badgeInfo->internalize(stream); } @@ -242,7 +236,7 @@ // Externalize parameters that are needed to reconstruct the icon stream << size; stream << iconNames.count(); - Q_FOREACH(const IconName &name, iconNames) { + Q_FOREACH(const IconName & name, iconNames) { stream << (qint32)(name.mode); stream << (qint32)(name.state); stream << name.name; @@ -283,9 +277,9 @@ /*! \internal - Initiates an IPC call to the ThemeServer to unload ( decrement ref count ) + Initiates an IPC call to the ThemeServer to unload ( decrement ref count ) the icon if created on server side. - + */ void HbIconEnginePrivate::unLoadIcon(bool unloadedByServer) { @@ -313,6 +307,7 @@ defaultMirroring = Unknown; animator = 0; color = QColor(); + themedColor = QColor(); unLoadIcon(); if (badgeInfo) { badgeInfo->removeAllBadges(); @@ -325,7 +320,7 @@ if (mirroringMode == HbIcon::Default && defaultMirroring == Unknown) { HbIconLoader *loader = HbIconLoader::global(); defaultMirroring = loader->isAutomaticallyMirrored( - iconName(QIcon::Normal, QIcon::Off)) ? Enabled : Disabled; + iconName(QIcon::Normal, QIcon::Off)) ? Enabled : Disabled; } bool basedOnLayoutDir = false; @@ -338,13 +333,13 @@ } else if (defaultMirroring == Disabled) { return false; } - // Forced + // Forced } else if (mirroringMode == HbIcon::Forced) { return true; - // Prevented + // Prevented } else if (mirroringMode == HbIcon::Prevented) { return false; - // LayoutDirection + // LayoutDirection } else if (mirroringMode == HbIcon::LayoutDirection) { basedOnLayoutDir = true; } @@ -352,11 +347,11 @@ if (basedOnLayoutDir) { // e.g. some unit tests do not have primary window at this point so need to do NULL checks here. if (hbInstance) { - QList allWindows = hbInstance->allMainWindows(); - - if ( !allWindows.isEmpty() && - allWindows.value(0) && - allWindows.value(0)->layoutDirection() == Qt::RightToLeft) { + QList allWindows = hbInstance->allMainWindows(); + + if (!allWindows.isEmpty() && + allWindows.value(0) && + allWindows.value(0)->layoutDirection() == Qt::RightToLeft) { return true; } return false; @@ -393,7 +388,7 @@ { QString ret; - Q_FOREACH(const HbIconEnginePrivate::IconName &name, iconNames) { + Q_FOREACH(const HbIconEnginePrivate::IconName & name, iconNames) { if (name.mode == mode && name.state == state) { ret = name.name; break; @@ -432,20 +427,31 @@ // Even when the Colorized flag is not set certain icons from the theme must be // colorized. These mono icons are recognized from their name. The check should not be // done for normal files, only for logical theme graphics names. - return name.startsWith("qtg_mono_") && !name.contains('.'); + return name.startsWith(QLatin1String("qtg_mono_")) && !name.contains('.'); +} + +QColor HbIconEnginePrivate::colorToUse(const QString &iconName) const +{ + if (flags.testFlag(HbIcon::Colorized) || isMonoIcon(iconName)) { + return color.isValid() ? color : themedColor; + } else { + return QColor(); + } } void HbIconEnginePrivate::addBadge(Qt::Alignment align, - const HbIcon& icon, - int z) + const HbIcon &icon, + int z, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio) { if (!badgeInfo) { badgeInfo = new HbBadgeIcon(); } - badgeInfo->addBadge(align, icon, z); + badgeInfo->addBadge(align, icon, z, sizeFactor, aspectRatio); } -bool HbIconEnginePrivate::removeBadge(const HbIcon& badge) +bool HbIconEnginePrivate::removeBadge(const HbIcon &badge) { return badgeInfo ? badgeInfo->removeBadge(badge) : false; } @@ -477,7 +483,7 @@ { // Register the HbIconEngine Instance to HbIconLoader HbIconLoader *loader = HbIconLoader::global(); - loader->storeIconEngineInfo(this); + loader->storeIconEngineInfo(this); } HbIconEngine::HbIconEngine(const QString &iconName) : @@ -486,7 +492,7 @@ d(new HbIconEnginePrivate(iconName)) { // Register the HbIconEngine Instance to HbIconLoader - HbIconLoader *loader = HbIconLoader::global(); + HbIconLoader *loader = HbIconLoader::global(); loader->storeIconEngineInfo(this); } @@ -622,7 +628,7 @@ // Mirroring changed, clear stored icon content clearStoredIconContent(); } - + d->mirroringMode = mode; } @@ -655,7 +661,7 @@ // If size has not been defined, use icon's default size. if (!s.isValid()) { // With size (0,0), loader uses the icon's default size. - s = QSize(0,0); + s = QSize(0, 0); } QIcon::Mode modeForLoader = mode; @@ -674,21 +680,21 @@ // If requested size is not the same as set in the engine, get a new pixmap from loader if (pixelSize != size().toSize()) { - // Clear the old icon first + // Clear the old icon first d->unLoadIcon(); - + d->icon = loader->loadIcon( - name, - HbIconLoader::AnyType, - HbIconLoader::AnyPurpose, - s, - Qt::KeepAspectRatio, - modeForLoader, - d->iconLoaderOptions(), - 0, - (d->flags.testFlag(HbIcon::Colorized) || isMonoIcon(name)) ? d->color : QColor()); - - if (d->icon){ + name, + HbIconLoader::AnyType, + HbIconLoader::AnyPurpose, + s, + Qt::KeepAspectRatio, + modeForLoader, + d->iconLoaderOptions(), + 0, + d->colorToUse(name)); + + if (d->icon) { // Draw badges on this pixmap QPainter painter(&d->pixmap); if (d->badgeInfo) { @@ -697,7 +703,7 @@ d->pixmap = d->icon->pixmap(); return d->pixmap; } - + } // Requested size was same as set in engine, use the pixmap stored in engine else { @@ -708,26 +714,26 @@ // Clear the old icon first d->unLoadIcon(); d->icon = loader->loadIcon( - name, - HbIconLoader::AnyType, - HbIconLoader::AnyPurpose, - s, - Qt::KeepAspectRatio, - modeForLoader, - d->iconLoaderOptions(), - 0, - (d->flags.testFlag(HbIcon::Colorized) || isMonoIcon(name)) ? d->color : QColor()); + name, + HbIconLoader::AnyType, + HbIconLoader::AnyPurpose, + s, + Qt::KeepAspectRatio, + modeForLoader, + d->iconLoaderOptions(), + 0, + d->colorToUse(name)); // If loading failed, store information so it is not retried. if (!d->icon) { - d->appendLoadFail(mode, state); + d->appendLoadFail(mode, state); } } if (d->icon) { d->pixmap = d->icon->pixmap(); // Draw badges on this pixmap QPainter painter(&d->pixmap); - if (d->badgeInfo){ + if (d->badgeInfo) { d->badgeInfo->paint(&painter, QRectF(QPointF(0, 0), pixelSize), mode, state, d->isMirrored()); } return d->pixmap; @@ -754,15 +760,31 @@ return d->color; } +void HbIconEngine::setThemedColor(const QColor &color) +{ + if (d->themedColor != color) { + clearStoredIconContent(); + d->themedColor = color; + } +} + +QColor HbIconEngine::themedColor() const +{ + return d->themedColor; +} + QSizeF HbIconEngine::defaultSize() const { QString name = iconName(); if (!d->defaultSizeFailed && !d->defaultSize.isValid() && !name.isEmpty()) { - if (d->icon){ + if (d->icon) { d->defaultSize = d->icon->defaultSize(); } else { HbIconLoader *loader = HbIconLoader::global(); d->defaultSize = loader->defaultSize(name, QString(), d->iconLoaderOptions()); + if (d->flags & HbIcon::ResolutionCorrected) { + HbIconLoader::global()->applyResolutionCorrection(d->defaultSize); + } } // If default size could not get retrieved, // store information about that so it does not need to be checked again. @@ -782,41 +804,49 @@ { if (size != d->size) { d->size = size; + // Update default size if size is set before painting + // to obtain the actual default size of the image + if (!d->icon && !d->defaultSize.isValid()) { + defaultSize(); + } // Size changed, invalidate pixmap stored in this object. - clearStoredIconContent(); + clearStoredIconContent(KeepDefaultSize); } } -void HbIconEngine::paint( QPainter *painter, - const QRect &rect, - QIcon::Mode mode, - QIcon::State state ) +void HbIconEngine::paint(QPainter *painter, + const QRect &rect, + QIcon::Mode mode, + QIcon::State state) { // This method is called by QIcon and it should paint the icon with the size defined by 'rect'. - HbIconImpl* icon = NULL; - + HbIconImpl *icon = 0; + // update the rendering mode - HbIconLoader::global()->updateRenderingMode(painter->paintEngine()->type()); - + QPaintEngine *paintEngine = painter->paintEngine(); + if (paintEngine) { + HbIconLoader::global()->updateRenderingMode(paintEngine->type()); + } + icon = paintHelper(rect.size(), Qt::KeepAspectRatio, mode, state); - if (icon){ + if (icon) { icon->paint(painter, rect, Qt::AlignCenter); HbIconLoader::global()->unLoadIcon(icon); icon->dispose(); - } - // Now paint any necessary badges. - if (d->badgeInfo) { - d->badgeInfo->paint(painter, rect, mode, state, icon->isMirrored()); + // Now paint any necessary badges. + if (d->badgeInfo) { + d->badgeInfo->paint(painter, rect, mode, state, icon->isMirrored()); + } } } -void HbIconEngine::paint( QPainter *painter, - const QRectF &rect, - Qt::AspectRatioMode aspectRatioMode, - Qt::Alignment alignment, - QIcon::Mode mode, - QIcon::State state) +void HbIconEngine::paint(QPainter *painter, + const QRectF &rect, + Qt::AspectRatioMode aspectRatioMode, + Qt::Alignment alignment, + QIcon::Mode mode, + QIcon::State state) { // If loading the pixmap has failed, do not retry forever if (loadFailed(mode, state)) { @@ -833,9 +863,9 @@ // FrameSet animations need to be reloaded if size related parameters have changed, // so delete the current animation in that case. HbIconAnimation *anim = animation(); - if (anim && anim->type() == HbIconAnimation::FrameSet) { - if ( ( (!s.isEmpty() || !anim->size().isEmpty()) && s != anim->size() ) || - aspectRatioMode != anim->aspectRatioMode()) { + if (anim && anim->type() == HbIconAnimation::FrameSet) { + if (((!s.isEmpty() || !anim->size().isEmpty()) && s != anim->size()) || + aspectRatioMode != anim->aspectRatioMode()) { #ifdef HB_ICON_TRACES qDebug("HbIconEngine: deleting anim"); #endif @@ -847,7 +877,7 @@ // If size has not been defined, use icon's default size. if (!s.isValid()) { // With size (0,0), loader uses the icon's default size. - s = QSizeF(0,0); + s = QSizeF(0, 0); } // If pixmap has not been loaded yet or parameters affecting to pixmap have changed, @@ -859,9 +889,12 @@ // If icon parameters changed unload the icon first, and get the new icon d->unLoadIcon(); // Update the rendering mode - HbIconLoader::global()->updateRenderingMode(painter->paintEngine()->type()); + QPaintEngine *paintEngine = painter->paintEngine(); + if (paintEngine) { + HbIconLoader::global()->updateRenderingMode(paintEngine->type()); + } d->icon = paintHelper(s, aspectRatioMode, mode, state); - if ( d->icon && d->icon->isCreatedOnServer() ) { + if (d->icon && d->icon->isCreatedOnServer()) { d->iconType = d->icon->iconData().type; } } @@ -885,7 +918,7 @@ void HbIconEngine::setAnimator(HbIconAnimator *animator) { d->animator = animator; - // Reconnect animation signals + // Reconnect animation signals HbIconAnimation *anim = animation(); if (anim) { @@ -897,7 +930,7 @@ } } -HbIconImpl* HbIconEngine::paintHelper( +HbIconImpl *HbIconEngine::paintHelper( const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -910,7 +943,7 @@ QString name = iconName(mode, state); QIcon::Mode modeForLoader = mode; - HbIconImpl *icon = NULL; + HbIconImpl *icon = 0; if (name.isEmpty()) { // Icon name not defined for this mode and state, use default icon name name = iconName(QIcon::Normal, QIcon::Off); @@ -940,15 +973,15 @@ HbIconLoader *loader = HbIconLoader::global(); icon = loader->loadIcon( - name, - HbIconLoader::AnyType, - HbIconLoader::AnyPurpose, - size, - aspectRatioMode, - modeForLoader, - d->iconLoaderOptions(), - d->animator, - (d->flags.testFlag(HbIcon::Colorized) || isMonoIcon(name)) ? d->color : QColor()); + name, + HbIconLoader::AnyType, + HbIconLoader::AnyPurpose, + size, + aspectRatioMode, + modeForLoader, + d->iconLoaderOptions(), + d->animator, + d->colorToUse(name)); // If loading failed, store information so it is not retried in every repaint. if (!icon) { @@ -981,22 +1014,24 @@ This function is called when some parameters change so that the content has to be reloaded, and in low-graphics-memory situations to get rid of all cached image data for the icon. - + The goal in the OOGM case is to destroy all unnecessary QPixmaps which will in turn lead to freeing graphics memory (in case we are running on the OpenVG paint engine). The data will be reloaded (well, at least tried to be reloaded) when the icon is painted the next time. */ -void HbIconEngine::clearStoredIconContent(bool resetIconSize, bool unloadedByServer) +void HbIconEngine::clearStoredIconContent(ClearingFlags flags) { #ifdef HB_ICON_TRACES qDebug("HbIconEngine %x: clearStoredIconContent", (int) this); #endif d->pixmap = QPixmap(); - d->unLoadIcon(unloadedByServer); - d->defaultSize = QSizeF(); - if (resetIconSize) { + d->unLoadIcon(flags.testFlag(UnloadedByServer)); + if (!(flags.testFlag(KeepDefaultSize))) { + d->defaultSize = QSizeF(); + } + if (flags.testFlag(ResetIconSize)) { d->size = QSizeF(); } d->defaultSizeFailed = false; @@ -1041,15 +1076,15 @@ { // Theme has changed, clear stored icon content // Server side icon cache is already cleared when theme is changed - if (updatedFiles.count() == 0 || (d->icon && updatedFiles.contains(d->icon->iconFileName())) ) { - clearStoredIconContent(false, true); + if (updatedFiles.count() == 0 || (d->icon && updatedFiles.contains(d->icon->iconFileName()))) { + clearStoredIconContent(UnloadedByServer); } } void HbIconEngine::handleLayoutDirectionChanged() { if ((d->mirroringMode == HbIcon::Default && d->defaultMirroring == HbIconEnginePrivate::Enabled) || - d->mirroringMode == HbIcon::LayoutDirection) { + d->mirroringMode == HbIcon::LayoutDirection) { // This icon is automatically mirrored based on layout direction. // Clear the stored icon content and its default size because the layout direction just changed. @@ -1062,7 +1097,7 @@ { if (d->flags.testFlag(HbIcon::ResolutionCorrected)) { // Icon content not valid any more - clear it. - clearStoredIconContent(true); + clearStoredIconContent(ResetIconSize); } } @@ -1117,7 +1152,7 @@ anim->setSize(size()); anim->setAspectRatioMode(d->aspectRatioMode); anim->setMode(d->mode); - // Get the current frame as pixmap from the animation + // Get the current frame as pixmap from the animation return anim->currentFrame(); } else { return QPixmap(); @@ -1126,15 +1161,15 @@ /*! * Removes the item in the cache if the ref. count is 0 and does delete on - * HbIconImpl and Resets the IconImpl. + * HbIconImpl and Resets the IconImpl. */ void HbIconEngine::resetIconImpl() const - { +{ #if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) - if ( (d->iconType == SGIMAGE) || (d->iconType == NVG) ) { - if ( d->icon ) { + if ((d->iconType == SGIMAGE) || (d->iconType == NVG)) { + if (d->icon) { d->icon->decrementRefCount(); - if ( d->icon->refCount() == 0 && d->icon->isCreatedOnServer() ) { + if (d->icon->refCount() == 0 && d->icon->isCreatedOnServer()) { HbIconLoader *loader = HbIconLoader::global(); loader->removeItemInCache(d->icon); d->icon->dispose(); @@ -1143,16 +1178,18 @@ } } #endif - } +} void HbIconEngine::addBadge(Qt::Alignment align, - const HbIcon& icon, - int z) + const HbIcon &icon, + int z, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio) { - d->addBadge(align, icon, z); + d->addBadge(align, icon, z, sizeFactor, aspectRatio); } -bool HbIconEngine::removeBadge(const HbIcon& badge) +bool HbIconEngine::removeBadge(const HbIcon &badge) { return d->removeBadge(badge); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconengine_p.h --- a/src/hbcore/image/hbiconengine_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconengine_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -78,6 +78,9 @@ void setColor(const QColor &color); QColor color() const; + void setThemedColor(const QColor &color); + QColor themedColor() const; + void paint(QPainter *painter, const QRect &rect, QIcon::Mode mode, @@ -95,17 +98,20 @@ void setAnimator(HbIconAnimator *animator); bool isMirrored() const; void addBadge(Qt::Alignment alignment, - const HbIcon& badge, - int z=0); - bool removeBadge(const HbIcon& badge); + const HbIcon &badge, + int z, + const QSizeF &sizeFactor, + Qt::AspectRatioMode aspectRatio); + bool removeBadge(const HbIcon &badge); void removeAllBadges(); const QList badges() const; - HbIconFormatType iconFormatType() const; + HbIconFormatType iconFormatType() const; + private: void ensureSignalConnections(); QPixmap getPixmapFromAnimation() const; - - HbIconImpl* paintHelper(const QSizeF &size, + + HbIconImpl *paintHelper(const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode, QIcon::State); @@ -114,8 +120,16 @@ HbIconAnimation *animation() const; +public: + enum ClearingFlag { + ResetIconSize = 0x01, + KeepDefaultSize = 0x02, + UnloadedByServer = 0x04 + }; + Q_DECLARE_FLAGS(ClearingFlags, ClearingFlag) + public slots: - void clearStoredIconContent(bool resetIconSize = false, bool unloadedByServer = false); + void clearStoredIconContent(ClearingFlags flags = 0); void clearStoredNonAnimIconContent(); private slots: @@ -131,4 +145,6 @@ HbIconEnginePrivate *d; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(HbIconEngine::ClearingFlags) + #endif // HBICONENGINE_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconimpl_p.h --- a/src/hbcore/image/hbiconimpl_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconimpl_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,132 +40,115 @@ public: HbIconImpl() - : iconRefCount(1) + : createdOnServer(false), + iconRefCount(1) { - createdOnServer = false; + } - HbIconImpl(const HbSharedIconInfo& iconData, - const QString& name, - const QSizeF& keySize, + HbIconImpl(const HbSharedIconInfo &iconData, + const QString &name, + const QSizeF &keySize, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, HbRenderingMode renderMode): - sharedIconData(iconData), - fileName(name), - cacheKeySize(keySize), - aspectRatioMode(aspectRatioMode), - mode(mode), - mirrored(mirrored), - defaultIconSize(QSize(0,0)), - createdOnServer(true), - iconRefCount(1), - multiPieceIcon(false), - renderMode(renderMode) - + sharedIconData(iconData), + fileName(name), + cacheKeySize(keySize), + aspectRatioMode(aspectRatioMode), + mode(mode), + mirrored(mirrored), + defaultIconSize(QSize(0, 0)), + createdOnServer(true), + iconRefCount(1), + multiPieceIcon(false), + renderMode(renderMode) + { } virtual QPixmap pixmap() = 0; - virtual void paint(QPainter* painter, - const QRectF &childRect, - Qt::Alignment alignment, - const QPainterPath &clipPath = QPainterPath(), - HbMaskableIconImpl * maskIconData = 0) = 0; + virtual void paint(QPainter *painter, + const QRectF &childRect, + Qt::Alignment alignment, + const QPainterPath &clipPath = QPainterPath(), + HbMaskableIconImpl *maskIconData = 0) = 0; virtual QSize defaultSize() const = 0; virtual QSize size() = 0; - void setColor(const QColor &color) - { - this->iconColor = color; + void setColor(const QColor &color) { + this->iconColor = color; } - QColor color() - { + QColor color() { return iconColor; } - void setMultiPieceIcon(bool value = true) - { + void setMultiPieceIcon(bool value = true) { multiPieceIcon = value; } - bool isMultiPieceIcon() - { + bool isMultiPieceIcon() { return multiPieceIcon; } - HbSharedIconInfo iconData() const - { + HbSharedIconInfo iconData() const { return sharedIconData; } - QString iconFileName() const - { + QString iconFileName() const { return fileName; } - QSizeF keySize() const - { + QSizeF keySize() const { return cacheKeySize; } - Qt::AspectRatioMode iconAspectRatioMode() const - { + Qt::AspectRatioMode iconAspectRatioMode() const { return aspectRatioMode; } - QIcon::Mode iconMode() const - { + QIcon::Mode iconMode() const { return mode; } - bool isMirrored() const - { + bool isMirrored() const { return mirrored; } - bool isCreatedOnServer() const - { + bool isCreatedOnServer() const { return createdOnServer; } - void incrementRefCount() - { + void incrementRefCount() { this->iconRefCount++; } - uint refCount() - { + uint refCount() { return this->iconRefCount; } - void decrementRefCount() - { + void decrementRefCount() { this->iconRefCount--; } - void dispose() - { + void dispose() { if (iconRefCount == 0) { delete this; } } - virtual void destroyMaskedData(HbIconMaskedData *data) - { + virtual void destroyMaskedData(HbIconMaskedData *data) { Q_UNUSED(data); } - - HbRenderingMode iconRenderingMode() const - { + + HbRenderingMode iconRenderingMode() const { return renderMode; } protected: - virtual ~HbIconImpl() - { + virtual ~HbIconImpl() { } HbSharedIconInfo sharedIconData; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconimplcreator_p.cpp --- a/src/hbcore/image/hbiconimplcreator_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconimplcreator_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -40,14 +40,25 @@ \internal */ -HbIconImpl *HbIconImplCreator::createIconImpl(HbSharedIconInfo& iconImplInfo, - HbIconLoadingParams ¶ms ) +HbIconImpl *HbIconImplCreator::createIconImpl(HbSharedIconInfo &iconImplInfo, + HbIconLoadingParams ¶ms) { - HbIconImpl* iconImpl = 0; - switch(iconImplInfo.type){ - case NVG: + HbIconImpl *iconImpl = 0; + switch (iconImplInfo.type) { + case NVG: #ifdef HB_NVG_CS_ICON - iconImpl = new HbNvgIconImpl(iconImplInfo, + iconImpl = new HbNvgIconImpl(iconImplInfo, + params.iconFileName, + params.size, + params.aspectRatioMode, + params.mode, + (params.mirrored && !params.mirroredIconFound), + params.renderMode); +#endif + break; + case SGIMAGE: +#ifdef HB_SGIMAGE_ICON + iconImpl = new HbSgimageIconImpl(iconImplInfo, params.iconFileName, params.size, params.aspectRatioMode, @@ -55,34 +66,23 @@ (params.mirrored && !params.mirroredIconFound), params.renderMode); #endif - break; - case SGIMAGE: -#ifdef HB_SGIMAGE_ICON - iconImpl = new HbSgimageIconImpl(iconImplInfo, - params.iconFileName, - params.size, - params.aspectRatioMode, - params.mode, - (params.mirrored && !params.mirroredIconFound), - params.renderMode); -#endif - break; - case OTHER_SUPPORTED_FORMATS: - iconImpl = new HbPixmapIconImpl(iconImplInfo, - params.iconFileName, - params.size, - params.aspectRatioMode, - params.mode, - (params.mirrored && !params.mirroredIconFound), - params.renderMode); - break; - default: - break; + break; + case OTHER_SUPPORTED_FORMATS: + iconImpl = new HbPixmapIconImpl(iconImplInfo, + params.iconFileName, + params.size, + params.aspectRatioMode, + params.mode, + (params.mirrored && !params.mirroredIconFound), + params.renderMode); + break; + default: + break; } - - if (iconImpl && params.color.isValid()){ - iconImpl->setColor(params.color); - } + + if (iconImpl && params.color.isValid()) { + iconImpl->setColor(params.color); + } return iconImpl; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconloader.cpp --- a/src/hbcore/image/hbiconloader.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconloader.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,25 +23,9 @@ ** ****************************************************************************/ -#include -#include "hbthemecommon_p.h" - -#include -#include -#include -#include -#include -#include -#include //krazy:exclude=qclasses -#include -#include -#include -#include -#include - +#include "hbiconloader_p.h" #include "hbframedrawer_p.h" #include "hbicontheme_p.h" -#include "hbstandarddirs_p.h" #include "hblayoutdirectionnotifier_p.h" #include "hbinstance.h" #include "hbiconanimation_p.h" @@ -60,6 +44,18 @@ #include "hbthemeindex_p.h" #include "hbthemecommon_p.h" #include "hbiconimplcreator_p.h" +#include +#include +#include +#include +#include +#include +#include //krazy:exclude=qclasses +#include +#include +#include +#include +#include #ifdef HB_NVG_CS_ICON #include "hbeglstate_p.h" @@ -83,7 +79,7 @@ #undef HB_SVG_ANIMATION static const char *s_unknown = "unknown"; - // Icon name without extension +// Icon name without extension /*! \class HbIconLoader @@ -98,7 +94,7 @@ static HbIconLoader *theLoader = 0; #ifdef HB_ICONIMPL_CACHE -static QHash iconImplCache; +static QHash iconImplCache; #endif class HbIconLoaderPrivate @@ -111,13 +107,13 @@ static QString removeIconNameSuffix(const QString &iconName); - /* This method is supposed to work the same way + /* This method is supposed to work the same way as the FindIconHelper in the Icon Theme Spec: */ static QString findSharedResourceHelper(const QString &resourceName, - bool mirrored, - bool& mirroredIconFound, - Hb::ResourceType itemType = Hb::IconResource, - bool useThemeIndex = true); + bool mirrored, + bool &mirroredIconFound, + Hb::ResourceType itemType = Hb::IconResource, + bool useThemeIndex = true); static QString findEffectHelper(const QString &effectName); @@ -127,16 +123,16 @@ void setLayoutMirrored(bool mirrored); #ifdef HB_ICONIMPL_CACHE - QByteArray createCacheKeyFrom( const QString &iconName, - const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - const QColor &color, - HbRenderingMode renderMode); + QByteArray createCacheKeyFrom(const QString &iconName, + const QSizeF &size, + Qt::AspectRatioMode aspectRatioMode, + QIcon::Mode mode, + bool mirrored, + const QColor &color, + HbRenderingMode renderMode); #endif -public: // data +public: QString storedTheme; int sourceResolution; @@ -151,7 +147,7 @@ HbIconSource *lastIconSource; -private: // data +private: enum { Unknown = 0, NotMirrored = 1, @@ -165,14 +161,14 @@ }; HbIconLoaderPrivate::HbIconLoaderPrivate() : - storedTheme(HbTheme::instance()->name()), - sourceResolution(144), // This is about the resolution of a Nokia N95 8GB - resolution(144), - zoom(1.0), - animationManager(HbIconAnimationManager::global()), - animationLoading(false), - lastIconSource(0), - layoutMirrored(Unknown) + storedTheme(HbTheme::instance()->name()), + sourceResolution(144), // This is about the resolution of a Nokia N95 8GB + resolution(144), + zoom(1.0), + animationManager(HbIconAnimationManager::global()), + animationLoading(false), + lastIconSource(0), + layoutMirrored(Unknown) { } @@ -190,18 +186,18 @@ QString HbIconLoaderPrivate::removeIconNameSuffix(const QString &iconName) { QString loweredIconName = iconName.toLower(); - if (loweredIconName.endsWith(".svg") - || loweredIconName.endsWith(".png") - || loweredIconName.endsWith(".mng") - || loweredIconName.endsWith(".gif") - || loweredIconName.endsWith(".xpm") - || loweredIconName.endsWith(".jpg") - || loweredIconName.endsWith(".nvg")) { + if (loweredIconName.endsWith(QLatin1String(".svg")) + || loweredIconName.endsWith(QLatin1String(".png")) + || loweredIconName.endsWith(QLatin1String(".mng")) + || loweredIconName.endsWith(QLatin1String(".gif")) + || loweredIconName.endsWith(QLatin1String(".xpm")) + || loweredIconName.endsWith(QLatin1String(".jpg")) + || loweredIconName.endsWith(QLatin1String(".nvg"))) { return iconName.left(iconName.length() - 4); } - if (loweredIconName.endsWith(".svgz") - || loweredIconName.endsWith(".qpic")) { + if (loweredIconName.endsWith(QLatin1String(".svgz")) + || loweredIconName.endsWith(QLatin1String(".qpic"))) { return iconName.left(iconName.length() - 5); } @@ -225,7 +221,7 @@ return suffix; } -QString HbIconLoaderPrivate::findSharedResourceHelper(const QString &resourceName, bool mirrored, bool& mirroredIconFound, Hb::ResourceType itemType, bool useThemeIndex) +QString HbIconLoaderPrivate::findSharedResourceHelper(const QString &resourceName, bool mirrored, bool &mirroredIconFound, Hb::ResourceType itemType, bool useThemeIndex) { Q_UNUSED(useThemeIndex) Q_UNUSED(itemType) @@ -233,9 +229,7 @@ mirroredIconFound = false; QString iconPath; - if (QDir::isRelativePath(resourceName)) { - -#ifdef Q_OS_SYMBIAN + if (HbThemeUtils::isLogicalName(resourceName)) { // Try to get themed icon information from theme index HbThemeIndexResource resource(resourceName); if (resource.isValid()) { @@ -244,30 +238,12 @@ } else { return resource.fullFileName(); } - } -#endif // Q_OS_SYMBIAN - - // If there was no theme index, search the icon in theme icon dirs (slow) - foreach (const QString &dir, HbThemePrivate::instance()->iconDirectories()) { - if (mirrored) { - // If icon is mirrored, try to find the icon in a separate "mirrored" folder used for mirrored icons - iconPath = HbStandardDirs::findResource( dir + "mirrored" + '/' + resourceName, Hb::IconResource ); - if( !iconPath.isEmpty() ) { - mirroredIconFound = true; - break; - } - } - - iconPath = HbStandardDirs::findResource( dir + resourceName, Hb::IconResource ); - - // If the file was found in this dir, return the filename. - if ( !iconPath.isEmpty() ) { - break; - } + } else { + // Logical name not found in theme index - return empty string + return QString(); } } else { - // Absolute path. Do not scan through different theme directories. - QString iconNameCopy(resourceName); + // Not a logical name. Check from file system. if (mirrored) { // If icon is mirrored, try to find the icon in a separate "mirrored" folder used for mirrored icons @@ -280,20 +256,26 @@ QString iconNameCopy(resourceName); if (index > 0) { - iconNameCopy.insert(index+1, QString("mirrored/")); + iconNameCopy.insert(index + 1, QString("mirrored/")); } - iconPath = HbStandardDirs::findResource(iconNameCopy, Hb::IconResource); + if (QFile::exists(iconNameCopy)) { + iconPath = iconNameCopy; + } - if( !iconPath.isEmpty() ) { + if (!iconPath.isEmpty()) { mirroredIconFound = true; return iconPath; } } - iconPath = HbStandardDirs::findResource(resourceName, Hb::IconResource); + if (QFile::exists(resourceName)) { + iconPath = resourceName; + } } return iconPath; +} + /* From Freedesktop.org: @@ -322,7 +304,7 @@ } return none } - + With the following helper functions: @@ -427,19 +409,15 @@ } */ -} bool HbIconLoaderPrivate::isAutomaticallyMirrored(const QString &iconName) { - Q_UNUSED(iconName); // only place to get mirroring information is from themeindex -#ifdef Q_OS_SYMBIAN - // Try to get themed icon information from theme index - HbThemeIndexResource resource(iconName); - if (resource.isValid()) { - return resource.isAutomaticallyMirrored(); - } -#endif + // Try to get themed icon information from theme index + HbThemeIndexResource resource(iconName); + if (resource.isValid()) { + return resource.isAutomaticallyMirrored(); + } return false; } @@ -448,8 +426,8 @@ { if (layoutMirrored == Unknown) { // The layout directionality is defined by asking it from the main window. - QList allWindows = hbInstance->allMainWindows(); - HbMainWindow* primaryWindow = allWindows.value(0); + QList allWindows = hbInstance->allMainWindows(); + HbMainWindow *primaryWindow = allWindows.value(0); if (primaryWindow) { layoutMirrored = primaryWindow->layoutDirection() == Qt::LeftToRight ? NotMirrored : Mirrored; } else { @@ -466,9 +444,13 @@ } #ifdef HB_ICONIMPL_CACHE -QByteArray HbIconLoaderPrivate::createCacheKeyFrom(const QString &iconName, const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, const QColor &color, - HbRenderingMode renderMode) +QByteArray HbIconLoaderPrivate::createCacheKeyFrom(const QString &iconName, + const QSizeF &size, + Qt::AspectRatioMode aspectRatioMode, + QIcon::Mode mode, + bool mirrored, + const QColor &color, + HbRenderingMode renderMode) { static const int paramArraySize = 8; @@ -498,10 +480,10 @@ // Append render mode when creating cache key temp[7] = renderMode; - cacheKey.append((char*)&(temp[0]), sizeof(int)*paramArraySize); + cacheKey.append((char *)&(temp[0]), sizeof(int)*paramArraySize); const QChar *iconNamePtr = iconName.constData(); - cacheKey.append((char*)iconNamePtr, nameSize * sizeof(QChar)); + cacheKey.append((char *)iconNamePtr, nameSize * sizeof(QChar)); if (mirrored) { cacheKey.append('M'); @@ -512,19 +494,19 @@ #endif HbIconLoader::HbIconLoader(const QString &appName, QObject *parent) - : QObject( parent ) + : QObject(parent) { - setObjectName( appName ); + setObjectName(appName); d = new HbIconLoaderPrivate(); - // Set default rendering mode to EHWRendering + // Set default rendering mode to EHWRendering renderMode = EHWRendering; // Delete the icon loader when the application is destroyed. connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(destroy())); connect(HbLayoutDirectionNotifier::instance(), SIGNAL(layoutDirectionChangeStarted()), - this, SLOT(updateLayoutDirection())); + this, SLOT(updateLayoutDirection())); #ifdef HB_TOOL_INTERFACE // This enables partial theme updates. @@ -576,11 +558,10 @@ } } - // Step 2: There was no animation definition, try to get default size from theme index if it is a themed icon - - // TODO: change this to simpler function call in Symbian OS env - if (QDir::isRelativePath(iconName)) { -#ifdef Q_OS_SYMBIAN + // Step 2: There was no animation definition, + // try to get default size from theme index if it is a themed icon (logical name). + + if (HbThemeUtils::isLogicalName(iconName)) { // Try to get themed icon information from theme index HbThemeIndexResource resource(iconName); if (resource.isValid()) { @@ -590,15 +571,9 @@ } else { size = resource.defaultItemSize(); } - // Returns invalid size if there is a valid theme index, but the item was not found there. - return size; - } else { - // Step 3: Theme index was not used, try to get icon's default size from theme server's default size cache. - params.iconFileName = resolveIconFileName(params); } -#else - params.iconFileName = resolveIconFileName(params); -#endif + // Returns invalid size if the index did not provide the size + return size; } else { // Absolute path, use it directly without resolving anything. params.iconFileName = iconName; } @@ -610,27 +585,7 @@ QString format = formatFromPath(params.iconFileName); -// Theme server on desktop was found very slow (probably due to IPC with QLocalServer/QLocalSocket). -// disabling icon sharing via theme server until theme server performance on desktop is improved -#ifdef Q_OS_SYMBIAN - GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory) - // Try to take data from server if parameters don't prevent it - if (manager && format != "MNG" && format != "GIF" && - !iconName.startsWith(':')) { // not using server for app's own resources (iconName is a logical name for theme elements) -#ifdef HB_ICON_TRACES - qDebug() << "HbIconLoader::DefaultSize req to server " << params.iconFileName; -#endif - QSizeF sizeFromServer = HbThemeClient::global()->getSharedIconDefaultSize(params.iconFileName); -#ifdef HB_ICON_TRACES - qDebug() << "HbIconLoader::DefaultSize result from server" << sizeFromServer; -#endif - if (sizeFromServer.isValid()) { - return sizeFromServer; - } - } -#endif // Q_OS_SYMBIAN - - // Step 4: Get the default size from the icon file in the client side + // Step 3: Get the default size from the icon file in the client side HbIconSource *source = getIconSource(params.iconFileName, format); size = source->defaultSize(); @@ -657,13 +612,25 @@ bool HbIconLoader::iconsExist(const QString &iconName, const QStringList &suffixList) { - QString name = HbIconLoaderPrivate::removeIconNameSuffix(iconName); bool found = true; + bool logicalName = HbThemeUtils::isLogicalName(iconName); + + int suffixIndex = iconName.length(); + if (!logicalName) { + // If it is an absolute icon path, the suffix is inserted before the file extension + int index = iconName.lastIndexOf(QChar('.')); + if (index > 0) { + suffixIndex = index; + } + } foreach (const QString &suffix, suffixList) { bool dummy = false; - QString path = HbIconLoaderPrivate::findSharedResourceHelper(name + suffix, false, dummy); + QString nameWithSuffix = iconName; + nameWithSuffix.insert(suffixIndex, suffix); + + QString path = HbIconLoaderPrivate::findSharedResourceHelper(nameWithSuffix, false, dummy); if (path.isEmpty()) { found = false; break; @@ -706,12 +673,12 @@ void HbIconLoader::applyResolutionCorrection(QSizeF &size) { - size = size * (qreal)(d->resolution) / (qreal)(d->sourceResolution) * d->zoom; + size = size * (qreal)(d->resolution) / (qreal)(d->sourceResolution) * d->zoom; } void HbIconLoader::themeChange(const QStringList &updatedFiles) { - foreach (HbFrameDrawerPrivate *frameDrawer, this->frameDrawerInstanceList) frameDrawer->themeChange(updatedFiles); + foreach(HbFrameDrawerPrivate * frameDrawer, this->frameDrawerInstanceList) frameDrawer->themeChange(updatedFiles); } void HbIconLoader::destroy() @@ -730,8 +697,8 @@ // classes use that signal to update their pixmaps, so the new layout // directionality must be updated in the icon loader before that. // Thus, there are these separate signals. - QList allWindows = hbInstance->allMainWindows(); - HbMainWindow* primaryWindow = allWindows.value(0); + QList allWindows = hbInstance->allMainWindows(); + HbMainWindow *primaryWindow = allWindows.value(0); d->setLayoutMirrored(primaryWindow->layoutDirection() == Qt::RightToLeft); } @@ -739,7 +706,7 @@ void HbIconLoader::handleForegroundLost() { #if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) - // Remove SGImage /NVG type of icons + // Remove SGImage /NVG type of icons freeGpuIconData(); // delete the VGImage HbEglStates *eglStateInstance = HbEglStates::global(); @@ -754,8 +721,8 @@ */ void HbIconLoader::removeItemInCache(HbIconImpl *iconImpl) { -#ifdef HB_ICONIMPL_CACHE - if ( iconImpl ) { +#ifdef HB_ICONIMPL_CACHE + if (iconImpl) { iconImplCache.remove(iconImplCache.key(iconImpl)); } #else @@ -770,23 +737,23 @@ void HbIconLoader::freeGpuIconData() { #if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) - for( int i = 0; i < iconEngineList.count(); i++ ) { + for (int i = 0; i < iconEngineList.count(); i++) { HbIconEngine *engine = iconEngineList.at(i); - engine->resetIconImpl(); - } - for(int i = 0; i< frameDrawerInstanceList.count(); i++) { - HbFrameDrawerPrivate * fd = frameDrawerInstanceList.at(i); - if ( (fd->iconFormatType() == SGIMAGE) || (fd->iconFormatType() == NVG) ) { - fd->resetMaskableIcon(); - } - } + engine->resetIconImpl(); + } + for (int i = 0; i < frameDrawerInstanceList.count(); i++) { + HbFrameDrawerPrivate *fd = frameDrawerInstanceList.at(i); + if ((fd->iconFormatType() == SGIMAGE) || (fd->iconFormatType() == NVG)) { + fd->resetMaskableIcon(); + } + } #endif } /*! \internal - This is a wrapper for findSharedResourceHelper(). It is used for getting + This is a wrapper for findSharedResourceHelper(). It is used for getting resources from the themeserver. The return value is either same as \a name, when the file is not found in the @@ -804,8 +771,8 @@ This function is used to register the IconEngine instance to IconLoader */ void HbIconLoader::storeIconEngineInfo(HbIconEngine *iconEngine) -{ - iconEngineList.append( iconEngine ); +{ + iconEngineList.append(iconEngine); } /*! @@ -813,13 +780,13 @@ */ void HbIconLoader::removeIconEngineInfo(HbIconEngine *iconEngine) { - iconEngineList.removeOne(iconEngine); + iconEngineList.removeOne(iconEngine); } /*! This function is used to register the FrameDrawerPrivate instance to IconLoader */ -void HbIconLoader::storeFrameDrawerInfo( HbFrameDrawerPrivate *frameDrawer ) +void HbIconLoader::storeFrameDrawerInfo(HbFrameDrawerPrivate *frameDrawer) { frameDrawerInstanceList.append(frameDrawer); } @@ -827,9 +794,9 @@ /*! This function is used to unregister the FrameDrawerPrivate instance from IconLoader */ -void HbIconLoader::removeFrameDrawerInfo( HbFrameDrawerPrivate *frameDrawer ) +void HbIconLoader::removeFrameDrawerInfo(HbFrameDrawerPrivate *frameDrawer) { - frameDrawerInstanceList.removeOne(frameDrawer); + frameDrawerInstanceList.removeOne(frameDrawer); } void HbIconLoader::resolveCleanIconName(HbIconLoadingParams ¶ms) const @@ -838,7 +805,7 @@ if (params.iconName.isEmpty() && params.options.testFlag(ReturnUnknownIcon)) { params.cleanIconName = QString(s_unknown); } else { - params.cleanIconName = params.iconName; + params.cleanIconName = params.iconName; } } @@ -848,23 +815,7 @@ QList frameList; // Get the default size from the first animation frame - params.cleanIconName = frameDefs.at(0).iconName; - params.iconFileName = resolveIconFileName(params); - QString format = formatFromPath(params.iconFileName); - - // Try to get the default size from server if the icon is not such that is loaded in client side. - if (format != "MNG" - && format != "GIF" - && !params.iconFileName.startsWith(':')) - { - QSizeF defSize = HbThemeClient::global()->getSharedIconDefaultSize(params.iconFileName); - if (defSize.isValid()) { - return defSize; - } - } - - // Otherwise get if by calling HbIconLoader::defaultSize for the first animation frame - return HbIconLoader::defaultSize(params.iconFileName, QString(), params.options); + return HbIconLoader::defaultSize(frameDefs.at(0).iconName, QString(), params.options); } void HbIconLoader::loadAnimation(HbIconAnimationDefinition &def, HbIconLoadingParams ¶ms) @@ -873,7 +824,7 @@ QList frameDefs = def.frameList(); QList frameList; - + #ifdef HB_ICON_TRACES if (!params.animator) { qDebug() << "HbIconLoader: no animator ptr provided, loading only frame 1 out of" << frameDefs.count(); @@ -908,15 +859,15 @@ // Frame-by-frame animations are always loaded in normal mode. // The mode is applied when the icon is painted. newFrame.pixmap = HbIconLoader::loadIcon( - frame.iconName, - params.purpose, - params.size, - params.aspectRatioMode, - QIcon::Normal, - params.options, - 0, - params.color); - + frame.iconName, + params.purpose, + params.size, + params.aspectRatioMode, + QIcon::Normal, + params.options, + 0, + params.color); + newFrame.duration = frame.duration; newFrame.assignJumps(frame.jumps); } @@ -946,7 +897,7 @@ // Take default size from the first frame QSizeF renderSize = QSizeF(params.canvasPixmap.size()); - if(!params.isDefaultSize) { + if (!params.isDefaultSize) { renderSize.scale(params.size, params.aspectRatioMode); } else if (params.options.testFlag(ResolutionCorrected)) { applyResolutionCorrection(renderSize); @@ -973,13 +924,6 @@ #ifdef HB_ICON_TRACES qDebug() << params.cleanIconName << " => " << iconPath; #endif - // If not found then it can still be a normal file specified with a relative path. - if (!iconFound) { - iconFound = QFile(params.iconName).exists(); - if (iconFound) { - iconPath = params.iconName; - } - } // Use the 'unknown' icon, if needed, when the queried icon was not found. if (!iconFound) { if (params.options.testFlag(ReturnUnknownIcon)) { @@ -992,13 +936,12 @@ /*! * \fn HbIconImpl *HbIconLoader::getIconFromServer() - * + * * Initiate an IPC to themeserver to get the icon-data from the server. - * + * */ HbIconImpl *HbIconLoader::getIconFromServer(HbIconLoadingParams ¶ms) { - HbIconImpl *icon = 0; #ifdef HB_ICON_TRACES @@ -1019,7 +962,7 @@ //Creates HbIconImpl instance based on the type of data returned by themeserver. //HbIconImpl thus created could be any one of the following impl-types: - //1. HbSgImageIconImpl + //1. HbSgImageIconImpl //2. HbNvgIconImpl //3. HbPixmapIconImpl icon = HbIconImplCreator::createIconImpl(iconInfo, params); @@ -1043,7 +986,7 @@ if (svgRenderer && svgRenderer->isValid()) { renderSize = QSizeF(svgRenderer->defaultSize()); - if(!params.isDefaultSize) { + if (!params.isDefaultSize) { renderSize.scale(params.size, params.aspectRatioMode); } else if (params.options.testFlag(ResolutionCorrected)) { applyResolutionCorrection(renderSize); @@ -1094,7 +1037,7 @@ svgRenderer->render(&painter, QRectF(QPointF(), renderSize.toSize())); painter.end(); } - + source->releaseSvgRenderer(); } @@ -1111,7 +1054,7 @@ qreal sy = 1.0; bool scale = false; - if(!params.isDefaultSize) { + if (!params.isDefaultSize) { scale = true; renderSize.scale(params.size, params.aspectRatioMode); } else if (params.options.testFlag(ResolutionCorrected)) { @@ -1123,7 +1066,7 @@ } if (scale) { - // Determine scale factor as QPicture doesn't allow for scaling + // Determine scale factor as QPicture doesn't allow for scaling sx = renderSize.width() / picSize.width(); sy = renderSize.height() / picSize.height(); } @@ -1153,7 +1096,7 @@ if (imgRenderer && imgRenderer->canRead()) { renderSize = QSizeF(imgRenderer->size()); - if(!params.isDefaultSize) { + if (!params.isDefaultSize) { renderSize.scale(params.size, params.aspectRatioMode); } else if (params.options.testFlag(ResolutionCorrected)) { applyResolutionCorrection(renderSize); @@ -1210,7 +1153,7 @@ QImage img = imgRenderer->read(); params.canvasPixmap = QPixmap::fromImage(img); } - + source->releaseImageReader(); } @@ -1229,20 +1172,20 @@ // Smooth scaling is very expensive (size^2). Therefore we reduce the size // to 1.5 of the destination size and using fast transformation. // Therefore we speed up but don't loose quality.. - if ( pm.size().width() > ( 4 * params.size.toSize().width() ) ) { + if (pm.size().width() > (4 * params.size.toSize().width())) { // Improve scaling speed by add an intermediate fast transformation.. - QSize intermediate_size = QSize( params.size.toSize().width() * 2, params.size.toSize().height() * 2 ); + QSize intermediate_size = QSize(params.size.toSize().width() * 2, params.size.toSize().height() * 2); pm = pm.scaled( - intermediate_size, - params.aspectRatioMode, - Qt::FastTransformation ); // Cheap operation! + intermediate_size, + params.aspectRatioMode, + Qt::FastTransformation); // Cheap operation! } #endif // ENABLE_EXPERIMENTAL_RESIZE_BOOST__ pm = pm.scaled( - params.size.toSize(), - params.aspectRatioMode, - Qt::SmoothTransformation); // Expensive operation! + params.size.toSize(), + params.aspectRatioMode, + Qt::SmoothTransformation); // Expensive operation! #ifdef ENABLE_EXPERIMENTAL_RESIZE_BOOST__ } @@ -1255,14 +1198,14 @@ /*! * \fn void HbIconLoader::switchRenderingMode() - * + * * This function gets notified when the rendering mode of the application changes e.g - * ( Hardware - Software rendering or vice versa ). If the mode is changed from + * ( Hardware - Software rendering or vice versa ). If the mode is changed from * Hardware to Software, all Hardware rendered icons will release the GPU resources. - * This function also initiates an IPC call to ThemeServer, so that the server - * can do its part of cleanup. - * \a newRenderMode new rendering mode of application - */ + * This function also initiates an IPC call to ThemeServer, so that the server + * can do its part of cleanup. + * \a newRenderMode new rendering mode of application + */ void HbIconLoader::switchRenderingMode(HbRenderingMode newRenderMode) { @@ -1271,12 +1214,12 @@ #endif #if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) - if (newRenderMode != renderMode) { + if (newRenderMode != renderMode) { if (newRenderMode == ESWRendering) { - // switching from HW to SW mode - freeGpuIconData(); - } - if (HbThemeClient::global()->switchRenderingMode(newRenderMode)) { + // switching from HW to SW mode + freeGpuIconData(); + } + if (HbThemeClient::global()->switchRenderingMode(newRenderMode)) { renderMode = newRenderMode; } } @@ -1294,23 +1237,23 @@ /*! * \fn HbIconImpl* HbIconLoader::loadIcon() - * + * * This function is responsible for loading a single-piece icon . * First it checks whether the icon is present on the application (client)cache, * if found it increments the ref-count of the HbIconImpl and returns. If the icon * is not found in the client's impl-cache, it initiates an IPC to themeserver * to load the icon. It receives HbSharedIconInfo from themeserver, creates a HbIconImpl * from this data, inserts this into client's icon-impl-cache and returns. - * - */ + * + */ HbIconImpl *HbIconLoader::loadIcon( const QString &iconName, - IconDataType type, - HbIconLoader::Purpose purpose, - const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - IconLoaderOptions options, + IconDataType type, + HbIconLoader::Purpose purpose, + const QSizeF &size, + Qt::AspectRatioMode aspectRatioMode, + QIcon::Mode mode, + IconLoaderOptions options, HbIconAnimator *animator, const QColor &color) { @@ -1327,9 +1270,9 @@ } qDebug() << debugString; #endif - Q_UNUSED( type ) + Q_UNUSED(type) - HbIconImpl* icon = 0; + HbIconImpl *icon = 0; if (!size.isValid()) { return 0; @@ -1345,7 +1288,7 @@ params.options = options; params.animator = animator; params.color = color; - params.isDefaultSize = ( purpose == AnyPurpose ) && size.isNull(); + params.isDefaultSize = (purpose == AnyPurpose) && size.isNull(); params.mirrored = options.testFlag(HorizontallyMirrored); params.mirroredIconFound = false; params.canCache = true; @@ -1381,26 +1324,33 @@ // Step 2: There was no animation definition, try get icon from server if (!params.animationCreated) { - + #ifdef HB_ICONIMPL_CACHE - QByteArray cacheKey = d->createCacheKeyFrom( params.iconName, params.size, params.aspectRatioMode, - params.mode, params.mirrored, params.color, params.renderMode ); - //look up in the local iconImplCache. + QByteArray cacheKey = d->createCacheKeyFrom(params.iconName, + params.size, + params.aspectRatioMode, + params.mode, + params.mirrored, + params.color, + params.renderMode); + //look up in the local iconImplCache. //If found return the ptr directly if (iconImplCache.contains(cacheKey)) { - HbIconImpl * ptr = iconImplCache.value(cacheKey); + HbIconImpl *ptr = iconImplCache.value(cacheKey); ptr->incrementRefCount(); #ifdef HB_ICON_CACHE_DEBUG - qDebug() << "HbIconLoader::loadIcon(): " << "Cache hit in iconImplCache for" << params.iconName<getMultiPartIconInfo(iconPathList, - multiPartIconData, size, aspectRatioMode, mode, - (mirrored && !mirroredIconFound), options, color, renderMode); + multiPartIconData, size, aspectRatioMode, mode, + (mirrored && !mirroredIconFound), options, color, renderMode); #ifdef HB_ICON_TRACES qDebug() << "HbIconLoader::getMultiPartIconInfo, offset from server: " << iconInfo.pixmapData.offset << iconPathList; @@ -1611,14 +1572,14 @@ getMultiIconImplFromServer(iconPathList, sizeList, aspectRatioMode, mode, - mirrored, + mirrored, mirroredIconFound, options, color, HbIconLoader::AnyType, HbIconLoader::AnyPurpose, multiPieceImpls, - renderMode); + renderMode); #else //For OS other than Symbian, call HbIconLoader::loadIcon to individually load icons for (int i = 0; i < count; i++) { @@ -1641,7 +1602,7 @@ } // Initiates an IPC call to the ThemeServer to unload ( decrement ref count ) the icon -void HbIconLoader::unLoadIcon(HbIconImpl * icon, bool unloadedByServer) +void HbIconLoader::unLoadIcon(HbIconImpl *icon, bool unloadedByServer) { if (!icon) { return; @@ -1651,13 +1612,13 @@ if (icon->refCount() == 0 && icon->isCreatedOnServer()) { if (!unloadedByServer) { - HbThemeClient::global()->unloadIcon(icon->iconFileName(), - icon->keySize(), - icon->iconAspectRatioMode(), - icon->iconMode(), - icon->isMirrored(), - icon->color(), - icon->iconRenderingMode() + HbThemeClient::global()->unloadIcon(icon->iconFileName(), + icon->keySize(), + icon->iconAspectRatioMode(), + icon->iconMode(), + icon->isMirrored(), + icon->color(), + icon->iconRenderingMode() ); } #ifdef HB_ICONIMPL_CACHE @@ -1692,40 +1653,45 @@ /*! * \fn void HbIconLoader::getMultiIconImplFromServer() - * + * * This function is responsible for loading individual pieces of a multi-piece icon. * This gets called if the consolidated icon-creation process on themeserver has failed. * This function initiates a single IPC to themeserver in which it sends out icon-parameters - * for each of the frame-items and gets back a list of HbSharedIconInfo corresponding to + * for each of the frame-items and gets back a list of HbSharedIconInfo corresponding to * individual pieces. - * + * */ -void HbIconLoader::getMultiIconImplFromServer(QStringList &multiPartIconList, - QVector &sizeList, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - bool mirroredIconFound, - HbIconLoader::IconLoaderOptions options, - const QColor &color, - HbIconLoader::IconDataType type, - HbIconLoader::Purpose, - QVector & iconImplList, - HbRenderingMode currRenderMode) +void HbIconLoader::getMultiIconImplFromServer(QStringList &multiPartIconList, + QVector &sizeList, + Qt::AspectRatioMode aspectRatioMode, + QIcon::Mode mode, + bool mirrored, + bool mirroredIconFound, + HbIconLoader::IconLoaderOptions options, + const QColor &color, + HbIconLoader::IconDataType type, + HbIconLoader::Purpose, + QVector & iconImplList, + HbRenderingMode currRenderMode) { Q_UNUSED(type); QVector posList; #ifdef HB_ICONIMPL_CACHE // search the client cache first before asking the server - for(int i = 0; i < multiPartIconList.count(); i++) { - QByteArray cacheKey = d->createCacheKeyFrom( multiPartIconList[i], sizeList[i], aspectRatioMode, - mode, mirrored, color, currRenderMode ); - //look up in the local iconImplCache. + for (int i = 0; i < multiPartIconList.count(); i++) { + QByteArray cacheKey = d->createCacheKeyFrom(multiPartIconList[i], + sizeList[i], + aspectRatioMode, + mode, + mirrored, + color, + currRenderMode); + //look up in the local iconImplCache. //If found return the ptr directly - HbIconImpl * ptr = 0; + HbIconImpl *ptr = 0; if (iconImplCache.contains(cacheKey)) { ptr = iconImplCache.value(cacheKey); - // if a specific frame-item is found in local impl-cache, + // if a specific frame-item is found in local impl-cache, // increment the ref count and remove the entry from the list that needs to be sent to server. ptr->incrementRefCount(); #ifdef HB_ICON_CACHE_DEBUG @@ -1753,7 +1719,7 @@ HbSharedIconInfoList iconInfoList = HbThemeClient::global()->getMultiIconInfo(multiPartIconList, sizeList, aspectRatioMode, mode, mirrored, options, color, currRenderMode); - HbIconImpl* impl = 0; + HbIconImpl *impl = 0; HbIconLoadingParams params; @@ -1771,8 +1737,13 @@ impl = HbIconImplCreator::createIconImpl(iconInfoList.icon[i], params); #ifdef HB_ICONIMPL_CACHE - QByteArray cacheKey = d->createCacheKeyFrom(multiPartIconList[i], sizeList.at(i) , aspectRatioMode, - mode, mirrored, color, currRenderMode); + QByteArray cacheKey = d->createCacheKeyFrom(multiPartIconList[i], + sizeList.at(i) , + aspectRatioMode, + mode, + mirrored, + color, + currRenderMode); iconImplCache.insert(cacheKey, impl); #ifdef HB_ICON_CACHE_DEBUG qDebug() << "HbIconLoader::getMultiIconImplFromServer(): " << params.iconName << " inserted into impl-cache, ref-count now = " << impl->refCount(); @@ -1814,36 +1785,54 @@ { QStringList iconNameList; QVector sizeList; - - // Decrement the ref count. If its zero, remove it from the client cache (if defined) and + + // Decrement the ref count. If its zero, remove it from the client cache (if defined) and // then send to server for unload. - foreach(HbIconImpl* impl, multiPieceImpls) { + foreach(HbIconImpl * impl, multiPieceImpls) { impl->decrementRefCount(); - if (impl->refCount() == 0 && impl->isCreatedOnServer()) { -#ifdef HB_ICONIMPL_CACHE + if (impl->refCount() == 0 && impl->isCreatedOnServer()) { +#ifdef HB_ICONIMPL_CACHE int rem = iconImplCache.remove(iconImplCache.key(impl)); if (rem > 0) { #ifdef HB_ICON_TRACES - qDebug()<<"HbIconLoader::unLoadMultiIcon :Removed from HbIconImpl Cache "<iconFileName()<< impl->keySize().height()<<"X"<keySize().width() ; -#endif + qDebug() << "HbIconLoader::unLoadMultiIcon :Removed from HbIconImpl Cache " << rem << impl->iconFileName() << impl->keySize().height() << "X" << impl->keySize().width() ; +#endif } -#endif +#endif // List of icons to be unloaded. - iconNameList<iconFileName(); - sizeList<keySize(); + iconNameList << impl->iconFileName(); + sizeList << impl->keySize(); } } - - if(iconNameList.count() > 0) { - HbThemeClient::global()->unLoadMultiIcon(iconNameList, - sizeList, - multiPieceImpls[0]->iconAspectRatioMode(), - multiPieceImpls[0]->iconMode(), - multiPieceImpls[0]->isMirrored(), - multiPieceImpls[0]->color(), - multiPieceImpls[0]->iconRenderingMode() - ); + + if (iconNameList.count() > 0) { + HbThemeClient::global()->unLoadMultiIcon(iconNameList, + sizeList, + multiPieceImpls[0]->iconAspectRatioMode(), + multiPieceImpls[0]->iconMode(), + multiPieceImpls[0]->isMirrored(), + multiPieceImpls[0]->color(), + multiPieceImpls[0]->iconRenderingMode() + ); } } +bool HbIconLoader::isInPrivateDirectory(const QString &filename) +{ + Q_UNUSED(filename); + bool isPrivate = false; + +#ifdef Q_OS_SYMBIAN + if (filename.length() > 11) { + // Private dir starts with e.g. "z:/private/" + if (filename[1] == ':' && (filename[2] == '/' || filename[2] == '\\') && + (filename[10] == '/' || filename[10] == '\\') && filename.mid(3, 7).compare("private"), Qt::CaseInsensitive) { + isPrivate = true; + } + } +#endif + + return isPrivate; +} + // End of File diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconloader_p.h --- a/src/hbcore/image/hbiconloader_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconloader_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,7 @@ class HB_CORE_PRIVATE_EXPORT HbIconLoader : public QObject { - Q_OBJECT + Q_OBJECT public: enum Purpose { @@ -74,9 +74,9 @@ NoAutoStartAnimation = 0x40 }; - Q_DECLARE_FLAGS (IconLoaderOptions, + Q_DECLARE_FLAGS(IconLoaderOptions, IconLoaderOption) - + explicit HbIconLoader(const QString &appName = QString(), QObject *parent = 0); ~HbIconLoader(); @@ -94,7 +94,7 @@ HbIconAnimator *animator = 0, const QColor &color = QColor()); - HbIconImpl* loadIcon( + HbIconImpl *loadIcon( const QString &iconName, HbIconLoader::IconDataType type, HbIconLoader::Purpose = AnyPurpose, @@ -105,22 +105,22 @@ HbIconAnimator *animator = 0, const QColor &color = QColor()); - void unLoadIcon(HbIconImpl * icon, bool unloadedByServer = false); + void unLoadIcon(HbIconImpl *icon, bool unloadedByServer = false); void unLoadMultiIcon(QVector &multiPieceImpls); - - HbIconImpl* loadMultiPieceIcon(const QStringList &listOfIcons, - HbMultiPartSizeData &multiPartIconData, - const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - IconLoaderOptions options, - QVector &multiPieceImpls, - const QColor &color); + + HbIconImpl *loadMultiPieceIcon(const QStringList &listOfIcons, + HbMultiPartSizeData &multiPartIconData, + const QSizeF &size, + Qt::AspectRatioMode aspectRatioMode, + QIcon::Mode mode, + IconLoaderOptions options, + QVector &multiPieceImpls, + const QColor &color); QSizeF defaultSize( const QString &iconName, const QString &appName = QString(), - IconLoaderOptions options = IconLoaderOptions(ReturnUnknownIcon | BitmapIcons | VectorIcons )); + IconLoaderOptions options = IconLoaderOptions(ReturnUnknownIcon | BitmapIcons | VectorIcons)); QSizeF size(HbIconLoader::Purpose) const; @@ -128,10 +128,10 @@ HbIconSource *getIconSource(const QString &filename, const QString &format); bool isAutomaticallyMirrored(const QString &iconName); - void setSourceResolution( int resolution ); + void setSourceResolution(int resolution); int sourceResolution() const; - void setResolution( int resolution ); + void setResolution(int resolution); int resolution() const; void applyResolutionCorrection(QSizeF &size); @@ -140,22 +140,24 @@ Hb::ResourceType resType = Hb::IconResource); void switchRenderingMode(HbRenderingMode newRenderMode); void updateRenderingMode(QPaintEngine::Type type); - void storeIconEngineInfo( HbIconEngine *iconEngine ); - void removeIconEngineInfo( HbIconEngine *iconEngine ); - - void storeFrameDrawerInfo( HbFrameDrawerPrivate *frameDrawer ); - void removeFrameDrawerInfo( HbFrameDrawerPrivate *frameDrawer ); + void storeIconEngineInfo(HbIconEngine *iconEngine); + void removeIconEngineInfo(HbIconEngine *iconEngine); + + void storeFrameDrawerInfo(HbFrameDrawerPrivate *frameDrawer); + void removeFrameDrawerInfo(HbFrameDrawerPrivate *frameDrawer); void freeGpuIconData(); - void removeItemInCache( HbIconImpl *iconImpl ); + void removeItemInCache(HbIconImpl *iconImpl); void handleForegroundLost(); + static bool isInPrivateDirectory(const QString &filename); + signals: void defaultSizeAdjustmentChanged(); private slots: - void themeChange( const QStringList &updatedFiles ); + void themeChange(const QStringList &updatedFiles); void destroy(); void updateLayoutDirection(); @@ -165,7 +167,7 @@ void loadAnimation(HbIconAnimationDefinition &def, HbIconLoadingParams ¶ms); QString resolveIconFileName(HbIconLoadingParams ¶ms); HbIconImpl *getIconFromServer(HbIconLoadingParams ¶ms); - void getMultiIconImplFromServer(QStringList &multiPartIconList, + void getMultiIconImplFromServer(QStringList &multiPartIconList, QVector &sizeList, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -177,19 +179,19 @@ HbIconLoader::Purpose, QVector & iconImplList, HbRenderingMode renderMode); - + void loadSvgIcon(HbIconLoadingParams ¶ms); void loadPictureIcon(HbIconLoadingParams ¶ms); void loadAnimatedIcon(HbIconLoadingParams ¶ms, const QString &format); void loadPixmapIcon(HbIconLoadingParams ¶ms, const QString &format); - QList< HbFrameDrawerPrivate *> frameDrawerInstanceList; + QList< HbFrameDrawerPrivate *> frameDrawerInstanceList; QList< HbIconEngine *> iconEngineList; friend class HbApplication; friend class HbIconLoaderPrivate; private: - Q_DISABLE_COPY (HbIconLoader) + Q_DISABLE_COPY(HbIconLoader) HbIconLoaderPrivate *d; HbRenderingMode renderMode; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconsource.cpp --- a/src/hbcore/image/hbiconsource.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconsource.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -52,27 +52,26 @@ { QString loweredIconPath = iconPath.toLower(); - if (loweredIconPath.endsWith(".svgz") ) { - return "SVG"; + if (loweredIconPath.endsWith(QLatin1String(".svgz"))) { + return QLatin1String("SVG"); } - if (loweredIconPath.endsWith(".qpic") ) { - return "PIC"; + if (loweredIconPath.endsWith(QLatin1String(".qpic"))) { + return QLatin1String("PIC"); } - if (loweredIconPath.endsWith(".svg") - || loweredIconPath.endsWith(".png") - || loweredIconPath.endsWith(".mng") - || loweredIconPath.endsWith(".gif") - || loweredIconPath.endsWith(".xpm") - || loweredIconPath.endsWith(".jpg") - || loweredIconPath.endsWith(".nvg")) { + if (loweredIconPath.endsWith(QLatin1String(".svg")) + || loweredIconPath.endsWith(QLatin1String(".png")) + || loweredIconPath.endsWith(QLatin1String(".mng")) + || loweredIconPath.endsWith(QLatin1String(".gif")) + || loweredIconPath.endsWith(QLatin1String(".xpm")) + || loweredIconPath.endsWith(QLatin1String(".jpg")) + || loweredIconPath.endsWith(QLatin1String(".nvg"))) { return iconPath.right(3).toUpper(); } - if (loweredIconPath.endsWith(".xml") - || loweredIconPath.endsWith(".axml") - || loweredIconPath.endsWith(".fxml")) - { + if (loweredIconPath.endsWith(QLatin1String(".xml")) + || loweredIconPath.endsWith(QLatin1String(".axml")) + || loweredIconPath.endsWith(QLatin1String(".fxml"))) { return "BLOB"; } @@ -86,21 +85,22 @@ // to avoid NVG dependency in ThemeIndexer QSize nvgContentDimensions(const QByteArray &buffer) { - QSize ret(0,0); - if (buffer.length() < static_cast(NVG_VIEWBOX_HEIGHT_OFS + sizeof (float))){ + QSize ret(0, 0); + if (buffer.length() < static_cast(NVG_VIEWBOX_HEIGHT_OFS + sizeof(float))) { ret = QSize(0, 0); - } - - const quint8* lBuf = (quint8*) buffer.data(); - if((buffer.length() > NVG_VIEWBOX_WIDTH_OFS) && (buffer.length() > NVG_VIEWBOX_HEIGHT_OFS)) { - float lViewboxWidth = * (float*)(lBuf + NVG_VIEWBOX_WIDTH_OFS); - float lViewboxHeight = * (float*)(lBuf + NVG_VIEWBOX_HEIGHT_OFS); + } - if (lViewboxWidth > 0 && lViewboxHeight > 0) { - ret = QSize((int)lViewboxWidth, (int)lViewboxHeight); - } else { - ret = QSize(0, 0); - } + const quint8 *lBuf = (quint8 *) buffer.data(); + if ((buffer.length() > NVG_VIEWBOX_WIDTH_OFS) && (buffer.length() > NVG_VIEWBOX_HEIGHT_OFS)) { + // Do not change to qreal, no matter what krazy says. + float lViewboxWidth = * (float *)(lBuf + NVG_VIEWBOX_WIDTH_OFS); + float lViewboxHeight = * (float *)(lBuf + NVG_VIEWBOX_HEIGHT_OFS); + + if (lViewboxWidth > 0 && lViewboxHeight > 0) { + ret = QSize((int)lViewboxWidth, (int)lViewboxHeight); + } else { + ret = QSize(0, 0); + } } return ret; } @@ -110,7 +110,7 @@ /*! \class HbIconSource - + \brief Encapsulates access (size and pixel data reading) to image files. \internal @@ -173,37 +173,35 @@ if (mType == "NVG") { #ifndef HB_BOOTSTRAPPED #ifdef HB_NVG_CS_ICON - if(!mByteArray){ - QFile file(mFilename); - if (!file.open(QIODevice::NotOpen | QIODevice::ReadOnly)) { - return QSizeF(); - } - mByteArray = new QByteArray(file.readAll()); - } - HbNvgEngine nvgEngine; - mDefaultSize = nvgEngine.contentDimensions(*mByteArray); + if (!mByteArray) { + QFile file(mFilename); + if (!file.open(QIODevice::NotOpen | QIODevice::ReadOnly)) { + return QSizeF(); + } + mByteArray = new QByteArray(file.readAll()); + } + HbNvgEngine nvgEngine; + mDefaultSize = nvgEngine.contentDimensions(*mByteArray); #endif // HB_NVG_CS_ICON #else // HB_BOOTSTRAPPED - if(!mByteArray){ - QFile file(mFilename); - if (!file.open(QIODevice::NotOpen | QIODevice::ReadOnly)) { - return QSizeF(); - } - mByteArray = new QByteArray (file.readAll()); - } + if (!mByteArray) { + QFile file(mFilename); + if (!file.open(QIODevice::NotOpen | QIODevice::ReadOnly)) { + return QSizeF(); + } + mByteArray = new QByteArray(file.readAll()); + } - mDefaultSize = nvgContentDimensions(*mByteArray); + mDefaultSize = nvgContentDimensions(*mByteArray); #endif - } - else if (mType == "SVG") { + } else if (mType == "SVG") { QSvgRenderer *renderer = svgRenderer(); if (renderer) { // isValid() is already checked in svgRenderer() mDefaultSize = renderer->defaultSize(); } releaseSvgRenderer(); - } - else if (mType == "PIC") { + } else if (mType == "PIC") { if (!mPicture) { mPicture = new QPicture; mPicture->load(mFilename); @@ -229,8 +227,7 @@ } } releaseImageReader(); - } - else if (mType != "BLOB") { + } else if (mType != "BLOB") { if (!mPixmap) { mPixmap = new QPixmap(mFilename); } @@ -270,20 +267,20 @@ { mSvgRenderer = 0; } - -QByteArray* HbIconSource::byteArray() + +QByteArray *HbIconSource::byteArray() { if (!mByteArray) { - #ifdef HB_NVG_CS_ICON +#ifdef HB_NVG_CS_ICON QFile file(mFilename); if (!file.open(QIODevice::NotOpen | QIODevice::ReadOnly)) { return 0; } - mByteArray = new QByteArray (file.readAll()); - #endif//nvg + mByteArray = new QByteArray(file.readAll()); +#endif } - - if (!mByteArray->isEmpty()) { + + if (mByteArray && !mByteArray->isEmpty()) { return mByteArray; } else { return 0; @@ -306,6 +303,7 @@ QImageReader *HbIconSource::imageReader() { if (!mImageReader) { + type(); // make sure type is initialized mImageReader = new QImageReader(mFilename, mType.toLatin1()); } return mImageReader && mImageReader->canRead() ? mImageReader : 0; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbiconsource_p.h --- a/src/hbcore/image/hbiconsource_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbiconsource_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -67,25 +67,25 @@ void releaseImageReader(); void takeImageReader(); QPixmap *pixmap(); - QByteArray* byteArray(); + QByteArray *byteArray(); void deletePixmapIfLargerThan(int limitInBytes); private: bool canKeepOpen() const; - + QString mFilename; QString mFullFilename; QString mType; // These are used to generate the raster pixmap of the icon and for fetching icon's default size - QPicture *mPicture; - QPixmap *mPixmap; - QByteArray* mByteArray; + QPicture *mPicture; + QPixmap *mPixmap; + QByteArray *mByteArray; // Stored default size QSize mDefaultSize; - + QSvgRenderer *mSvgRenderer; QImageReader *mImageReader; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbicontheme.cpp --- a/src/hbcore/image/hbicontheme.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbicontheme.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,6 @@ #include #include -#include #include #define THEME_INDEX_FILE "index.theme" @@ -41,35 +40,14 @@ HbIconThemePrivate(); ~HbIconThemePrivate(); - QString m_theme; - QStringList m_dirList; - QString m_description; - bool loaded; - void loadThemeDescriptionFile(const QString &themePath, int priority); - void loadThemeDescriptionFiles(const QString &theme); - bool addBaseThemePath(); -}; + void loadThemeDescriptionFile(); -void HbIconThemePrivate::loadThemeDescriptionFiles(const QString &theme) -{ - const QString indextheme(THEME_INDEX_FILE); - QString pathToTheme; - QMap maplist = HbThemeUtils::constructHierarchyListWithPathInfo( - QString(), theme, Hb::IconResource); - QMapIterator i(maplist); - i.toBack(); - while (i.hasPrevious()) { - i.previous(); - pathToTheme = HbStandardDirs::findResource(i.value() + indextheme, Hb::IconResource); - if (!pathToTheme.isEmpty()) { - loadThemeDescriptionFile(pathToTheme, i.key()); - } - } - if (!addBaseThemePath()) { - qDebug() << "Can't find base theme"; - } - loaded = true; -} +public: + QString m_theme; + QString m_description; + QString m_name; + bool loaded; +}; HbIconThemePrivate::HbIconThemePrivate() : loaded(false) { @@ -79,68 +57,38 @@ { } -void HbIconThemePrivate::loadThemeDescriptionFile(const QString &themePath, int priority) +void HbIconThemePrivate::loadThemeDescriptionFile() { + // TODO: index file is accessed in several places, create utility + HbThemeIndexInfo info = HbThemeUtils::getThemeIndexInfo(ActiveTheme); + + QString indexFileName; + + indexFileName.append(info.path); + indexFileName.append("/icons/"); + indexFileName.append(info.name); + indexFileName.append("/" THEME_INDEX_FILE); + HbIniParser iniParser; - QFile themeFile(themePath); + QFile themeFile(indexFileName); if (!themeFile.open(QIODevice::ReadOnly) || !iniParser.read(&themeFile)) { - qDebug() << "Can't access file : " << themePath; +#ifdef HB_THEME_SERVER_TRACES + qDebug() << "HbIconTheme: Can't access file: " << indexFileName; +#endif return; } - if (priority == HbLayeredStyleLoader::Priority_Theme) { - m_description = iniParser.value("Icon Theme", "Comment"); + m_description = iniParser.value("Icon Theme", "Comment"); + m_name = iniParser.value("Icon Theme", "Name"); #ifdef Q_OS_SYMBIAN - m_description = m_description.left(m_description.indexOf("\n", 0)); + m_description = m_description.left(m_description.indexOf("\n", 0)); + m_name = m_name.left(m_name.indexOf("\n", 0)); #endif - } - - QString directories = iniParser.value("Icon Theme", "Directories"); - QStringList dirList = directories.split( ',', QString::SkipEmptyParts ); - QString indexThemeDir(themePath); - indexThemeDir.chop(sizeof(THEME_INDEX_FILE) - 1); - - foreach (const QString &str, dirList) { - m_dirList.append(QString(indexThemeDir + str + '/')); - } } -bool HbIconThemePrivate::addBaseThemePath() -{ - HbIniParser iniParser; - const HbThemeInfo &baseThemeInfo = HbThemeUtils::baseTheme(); - QString baseThemePath = baseThemeInfo.rootDir + "/themes/icons/" + baseThemeInfo.name + "/"THEME_INDEX_FILE; - - // Parse it - QFile baseThemeFile(baseThemePath); - if (!baseThemeFile.open(QIODevice::ReadOnly) || !iniParser.read(&baseThemeFile)) { - qDebug() << "Can't access file"; - return false; - } - - if (m_theme == baseThemeInfo.name) { - m_description = iniParser.value("Icon Theme", "Comment"); -#ifdef Q_OS_SYMBIAN - m_description = m_description.left(m_description.indexOf("\n", 0)); -#endif - } - - //Read parameters - QString directories = iniParser.value("Icon Theme", "Directories"); - QStringList dirList = directories.split(',', QString::SkipEmptyParts); - baseThemePath.chop(sizeof(THEME_INDEX_FILE) - 1); - // Save paths - foreach (const QString &str, dirList) { - m_dirList.append(QString(baseThemePath + str + '/')); - } - - return true; -} - - /*! \class HbIconTheme - \brief HbIconTheme gives access to icon themes and stores icon theme properties + \brief HbIconTheme gives access to icon themes and stores icon theme properties according to the Freedesktop Icon Theme Specification */ HbIconTheme::HbIconTheme() @@ -155,9 +103,8 @@ void HbIconTheme::setCurrentTheme(const QString &theme) { - if (d->m_theme != theme) { + if (!theme.isEmpty()) { d->m_theme = theme; - d->m_dirList.clear(); d->loaded = false; } } @@ -170,29 +117,20 @@ return d->m_theme; } -/** - * List of valid subdirectories of a theme - */ -QStringList HbIconTheme::dirList() const -{ - if (!d->loaded) { - d->loadThemeDescriptionFiles(d->m_theme); - } - return d->m_dirList; -} - QString HbIconTheme::description() const { if (!d->loaded) { - d->loadThemeDescriptionFiles(d->m_theme); + d->loadThemeDescriptionFile(); } return d->m_description; } -void HbIconTheme::clearDirList() +QString HbIconTheme::name() const { - d->m_dirList.clear(); - d->loaded = false; + if (!d->loaded) { + d->loadThemeDescriptionFile(); + } + return d->m_name; } void HbIconTheme::emitUpdateIcons(const QStringList &fileNames) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbicontheme_p.h --- a/src/hbcore/image/hbicontheme_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbicontheme_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,16 +34,15 @@ class HB_AUTOTEST_EXPORT HbIconTheme : public QObject { -Q_OBJECT + Q_OBJECT public: explicit HbIconTheme(); ~HbIconTheme(); void setCurrentTheme(const QString &theme); QString currentTheme() const; - QStringList dirList() const; QString description() const; - void clearDirList(); + QString name() const; void emitUpdateIcons(const QStringList &fileNames = QStringList()); // For future addition: // QSizeF actualSize(HbIconLoader::Purpose purpose) const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbmaskableiconimpl_p.h --- a/src/hbcore/image/hbmaskableiconimpl_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbmaskableiconimpl_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -35,144 +35,118 @@ class HB_AUTOTEST_EXPORT HbMaskableIconImpl { public: - HbMaskableIconImpl(HbIconImpl * icon) - { - this->icon = icon; - data = 0; - maskApplied = false; + HbMaskableIconImpl(HbIconImpl *icon) { + this->icon = icon; + data = 0; + maskApplied = false; } - - QPixmap pixmap() - { + + QPixmap pixmap() { return icon->pixmap(); } - - void paint(QPainter* painter, const QRectF &childRect, - Qt::Alignment alignment, - const QPainterPath &clipPath = QPainterPath()) - { + + void paint(QPainter *painter, const QRectF &childRect, + Qt::Alignment alignment, + const QPainterPath &clipPath = QPainterPath()) { icon->paint(painter, childRect, alignment, clipPath, this); maskApplied = false; } - - HbIconImpl * iconImpl() - { + + HbIconImpl *iconImpl() { return icon; } - - bool maskChanged() - { + + bool maskChanged() { return maskApplied; } - - void setPixmap(QPixmap pixmap) - { - maskBitmap = pixmap; + + void setPixmap(QPixmap pixmap) { + maskBitmap = pixmap; } - - QSize defaultSize() const - { + + QSize defaultSize() const { return icon->defaultSize(); } - - void setMask(const QBitmap& mask) - { - if(!mask.isNull()) { + + void setMask(const QBitmap &mask) { + if (!mask.isNull()) { maskBitmap = mask; maskApplied = true; - } + } } - - QBitmap mask() - { + + QBitmap mask() { return maskBitmap; } - - QSize size() - { + + QSize size() { return icon->size(); } - - void setColor(const QColor &color) - { - icon->setColor(color); + + void setColor(const QColor &color) { + icon->setColor(color); } - - QColor color() - { + + QColor color() { return icon->color(); } - - HbSharedIconInfo iconData() const - { + + HbSharedIconInfo iconData() const { return icon->iconData(); } - - QString iconFileName() const - { + + QString iconFileName() const { return icon->iconFileName(); } - - QSizeF keySize() const - { + + QSizeF keySize() const { return icon->keySize(); } - - Qt::AspectRatioMode iconAspectRatioMode() const - { + + Qt::AspectRatioMode iconAspectRatioMode() const { return icon->iconAspectRatioMode(); } - - QIcon::Mode iconMode() const - { + + QIcon::Mode iconMode() const { return icon->iconMode(); } - - bool isMirrored() const - { + + bool isMirrored() const { return icon->isMirrored(); } - - bool isCreatedOnServer() const - { + + bool isCreatedOnServer() const { return icon->isCreatedOnServer(); } - - void incrementRefCount() - { + + void incrementRefCount() { icon->incrementRefCount(); } - - uint refCount() - { + + uint refCount() { return icon->refCount(); } - - void decrementRefCount() - { + + void decrementRefCount() { icon->decrementRefCount(); } - - void dispose() - { + + void dispose() { icon->destroyMaskedData(data); icon->dispose(); delete this; } - - void setImplData(HbIconMaskedData *data) - { + + void setImplData(HbIconMaskedData *data) { this->data = data; } - - HbIconMaskedData * implData() const - { + + HbIconMaskedData *implData() const { return data; } - + private: - ~HbMaskableIconImpl() - { + ~HbMaskableIconImpl() { } HbIconImpl *icon; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbnvgiconimpl_p.cpp --- a/src/hbcore/image/hbnvgiconimpl_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbnvgiconimpl_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -47,30 +47,30 @@ #define EGL_DESTROY_CONTEXT(display, context) \ if (context != EGL_NO_CONTEXT) { eglDestroyContext(display, context); } - + // Constants static const int HB_BITS_PER_COLOR = 8; HbNvgIconImpl::HbNvgIconImpl(const HbSharedIconInfo &iconData, - const QString& name, - const QSizeF& keySize, + const QString &name, + const QSizeF &keySize, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, HbRenderingMode renderMode): - HbIconImpl(iconData, - name, - keySize, - aspectRatioMode, - mode, - mirrored, - renderMode), - readyToRender(false), - specialCaseApplied(false), - nvgEngine(NULL), - eglStates(HbEglStates::global()), - vgImageRenderer(0), - pixmapIconRenderer(0) + HbIconImpl(iconData, + name, + keySize, + aspectRatioMode, + mode, + mirrored, + renderMode), + readyToRender(false), + specialCaseApplied(false), + nvgEngine(0), + eglStates(HbEglStates::global()), + vgImageRenderer(0), + pixmapIconRenderer(0) { eglStates->ref(); retrieveNvgData(); @@ -97,7 +97,7 @@ int width, int height, bool useGivenContext, - HbNvgEngine * nvgEngine) + HbNvgEngine *nvgEngine) { EGLConfig config; @@ -259,7 +259,7 @@ } if (currentReadSurface == EGL_NO_SURFACE) { - //pixmap is called without EGL being initialized + //pixmap is called without EGL being initialized const EGLint attribList2[] = { EGL_WIDTH, width, @@ -280,20 +280,20 @@ EGLContext newContext = EGL_NO_CONTEXT; if (eglContext == EGL_NO_CONTEXT) { newContext = eglCreateContext(display, config, EGL_NO_CONTEXT, 0); - if (newContext == EGL_NO_CONTEXT) { + if (newContext == EGL_NO_CONTEXT) { EGL_DESTROY_SURFACE(display, dummySurface); return currentPixmap; } } - + if (dummySurface) { if (eglMakeCurrent(display, dummySurface, dummySurface, newContext) == EGL_FALSE) { - EGL_DESTROY_SURFACE(display, dummySurface); + EGL_DESTROY_SURFACE(display, dummySurface); EGL_DESTROY_CONTEXT(display, newContext); return currentPixmap; } - + surfaceImage = createVGImageFromNVG(display, dummySurface, dummySurface, @@ -314,7 +314,7 @@ } if (surfaceImage == VG_INVALID_HANDLE) { - EGL_DESTROY_SURFACE(display, dummySurface); + EGL_DESTROY_SURFACE(display, dummySurface); EGL_DESTROY_CONTEXT(display, newContext); return currentPixmap; } @@ -326,23 +326,37 @@ VG_sARGB_8888_PRE, 0, 0, width, height); eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); } else { - eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - prevEGLState.restore(); + eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + prevEGLState.restore(); image = QImage(width, height, QImage::Format_ARGB32_Premultiplied); vgGetImageSubData(surfaceImage, image.bits(), image.bytesPerLine(), VG_sARGB_8888_PRE, 0, 0, width, height); - } - + } + vgDestroyImage(surfaceImage); EGL_DESTROY_SURFACE(display, dummySurface); EGL_DESTROY_CONTEXT(display, newContext); currentPixmap = QPixmap::fromImage(image); + + // Apply mode + if (this->mode != QIcon::Normal) { + QStyleOption opt(0); + opt.palette = QApplication::palette(); + currentPixmap = QApplication::style()->generatedIconPixmap(this->mode, currentPixmap, &opt); + } + + // Apply color + if (this->color().isValid() && (this->mode != QIcon::Disabled)) { + QPixmap mask = currentPixmap.alphaChannel(); + currentPixmap.fill(this->color()); + currentPixmap.setAlphaChannel(mask); + } return currentPixmap; } -HbNvgEngine::HbNvgErrorType HbNvgIconImpl::drawNVGIcon(const QSize & size, HbNvgEngine & nvgEngine) +HbNvgEngine::HbNvgErrorType HbNvgIconImpl::drawNVGIcon(const QSize &size, HbNvgEngine &nvgEngine) { VGint mMatrixMode; @@ -422,7 +436,7 @@ void HbNvgIconImpl::retrieveNvgData() { GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - nvgData = QByteArray::fromRawData((char*)manager->base() + sharedIconData.nvgData.offset, + nvgData = QByteArray::fromRawData((char *)manager->base() + sharedIconData.nvgData.offset, sharedIconData.nvgData.dataSize); defaultIconSize = QSize(sharedIconData.nvgData.defaultWidth, sharedIconData.nvgData.defaultHeight); @@ -430,9 +444,9 @@ } -VGImage HbNvgIconImpl::getVgImage(HbIconImpl * impl, QPainter * painter) +VGImage HbNvgIconImpl::getVgImage(HbIconImpl *impl, QPainter *painter) { - HbNvgIconImpl * nvgImpl = (HbNvgIconImpl*)impl; + HbNvgIconImpl *nvgImpl = (HbNvgIconImpl *)impl; painter->beginNativePainting(); @@ -449,14 +463,14 @@ return vgimage; } -void HbNvgIconImpl::paint(QPainter* painter, - const QRectF& rect, +void HbNvgIconImpl::paint(QPainter *painter, + const QRectF &rect, Qt::Alignment alignment, const QPainterPath &clipPath, - HbMaskableIconImpl * maskIconData) + HbMaskableIconImpl *maskIconData) { #ifdef HB_ICON_CACHE_DEBUG - qDebug() << "HbNvgIconImpl::paint()-->"<fileName; + qDebug() << "HbNvgIconImpl::paint()-->" << this->fileName; #endif QSizeF renderSize = contentSize; @@ -472,7 +486,8 @@ maskApplied = true; } - if ((painter->paintEngine()->type() != QPaintEngine::OpenVG) || maskApplied) { + QPaintEngine *paintEngine = painter->paintEngine(); + if (!paintEngine || paintEngine->type() != QPaintEngine::OpenVG || maskApplied) { painter->beginNativePainting(); pixmap(); @@ -494,18 +509,18 @@ return; } } - + vgSeti(VG_RENDERING_QUALITY, VG_RENDERING_QUALITY_FASTER); drawNVGIcon(painter, topLeft, renderSize, settings); } -void HbNvgIconImpl::drawNVGIcon(QPainter * painter, - const QPointF & topLeft, - const QSizeF & renderSize, +void HbNvgIconImpl::drawNVGIcon(QPainter *painter, + const QPointF &topLeft, + const QSizeF &renderSize, NvgAspectRatioSettings settings) { nvgEngine->engine()->setPreserveAspectRatio(settings.nvgAlignStatusAndAspectRatio, - settings.type); + settings.type); nvgEngine->engine()->enableMirroring(mirrored); painter->beginNativePainting(); @@ -581,9 +596,9 @@ painter->endNativePainting(); } -bool HbNvgIconImpl::drawRasterizedIcon(QPainter * painter, - const QPointF & topLeft, - const QSizeF & renderSize, +bool HbNvgIconImpl::drawRasterizedIcon(QPainter *painter, + const QPointF &topLeft, + const QSizeF &renderSize, const QPainterPath &clipPath) { bool ret = false; @@ -622,8 +637,8 @@ return ret; } -QPointF HbNvgIconImpl::setAlignment(const QRectF& rect, - QSizeF& renderSize, +QPointF HbNvgIconImpl::setAlignment(const QRectF &rect, + QSizeF &renderSize, Qt::Alignment alignment) { QPointF topLeft = rect.topLeft(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbnvgiconimpl_p.h --- a/src/hbcore/image/hbnvgiconimpl_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbnvgiconimpl_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -35,8 +35,7 @@ class HbVgImageIconRenderer; class HbPixmapIconRenderer; -struct NvgAspectRatioSettings -{ +struct NvgAspectRatioSettings { HbNvgEngine::HbNvgAlignType nvgAlignStatusAndAspectRatio; HbNvgEngine::HbNvgMeetType type; }; @@ -45,8 +44,8 @@ { public : HbNvgIconImpl(const HbSharedIconInfo &iconData, - const QString& name, - const QSizeF& keySize, + const QString &name, + const QSizeF &keySize, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, @@ -54,11 +53,11 @@ ~HbNvgIconImpl(); QPixmap pixmap(); - void paint(QPainter* painter, + void paint(QPainter *painter, const QRectF &rect, Qt::Alignment alignment, const QPainterPath &clipPath = QPainterPath(), - HbMaskableIconImpl * maskIconData = 0); + HbMaskableIconImpl *maskIconData = 0); QSize defaultSize() const; @@ -68,18 +67,18 @@ private : void retrieveNvgData(); - QPointF setAlignment(const QRectF& rect, - QSizeF& renderSize, + QPointF setAlignment(const QRectF &rect, + QSizeF &renderSize, Qt::Alignment alignment); NvgAspectRatioSettings mapKeyAspectRatioToNvgAspectRatio(Qt::AspectRatioMode aspectRatio); - HbNvgEngine::HbNvgErrorType drawNVGIcon(const QSize & size, HbNvgEngine &engine); + HbNvgEngine::HbNvgErrorType drawNVGIcon(const QSize &size, HbNvgEngine &engine); int createContextAndSurface(EGLDisplay display, int width, int height, - EGLContext & newContext, - EGLSurface & newSurface, - EGLConfig & config); + EGLContext &newContext, + EGLSurface &newSurface, + EGLConfig &config); VGImage createVGImageFromNVG(EGLDisplay display, EGLSurface currentReadSurface, @@ -88,19 +87,19 @@ int width, int height, bool useGivenContext = true, - HbNvgEngine * nvgEngine = 0); + HbNvgEngine *nvgEngine = 0); - bool drawRasterizedIcon(QPainter * painter, - const QPointF & topLeft, - const QSizeF & renderSize, + bool drawRasterizedIcon(QPainter *painter, + const QPointF &topLeft, + const QSizeF &renderSize, const QPainterPath &clipPath); - void drawNVGIcon(QPainter * painter, - const QPointF & topLeft, - const QSizeF & renderSize, + void drawNVGIcon(QPainter *painter, + const QPointF &topLeft, + const QSizeF &renderSize, NvgAspectRatioSettings settings); - static VGImage getVgImage(HbIconImpl * impl, QPainter * painter); + static VGImage getVgImage(HbIconImpl *impl, QPainter *painter); private: QByteArray nvgData; @@ -111,7 +110,7 @@ HbPooledNVGEngine *nvgEngine; HbEglStates *eglStates; HbVgImageIconRenderer *vgImageRenderer; - HbPixmapIconRenderer * pixmapIconRenderer; + HbPixmapIconRenderer *pixmapIconRenderer; }; #endif // end of HBNVGICONIMPL_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbpixmapiconimpl_p.cpp --- a/src/hbcore/image/hbpixmapiconimpl_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbpixmapiconimpl_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,33 +35,32 @@ #include "hbmaskableiconimpl_p.h" #include "hbpixmapiconrenderer_p.h" -struct HbPixmapMaskedIcon -{ +struct HbPixmapMaskedIcon { QPixmap currentPixmap; }; -HbPixmapIconImpl::HbPixmapIconImpl(HbSharedIconInfo iconData, QString& name, - const QSizeF& keySize, +HbPixmapIconImpl::HbPixmapIconImpl(HbSharedIconInfo iconData, QString &name, + const QSizeF &keySize, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, HbRenderingMode renderMode): - HbIconImpl(iconData, - name, - keySize, - aspectRatioMode, - mode, - mirrored, - renderMode), - pixmapIconRenderer(0) + HbIconImpl(iconData, + name, + keySize, + aspectRatioMode, + mode, + mirrored, + renderMode), + pixmapIconRenderer(0) { retrievePixmapData(); pixmapIconRenderer = new HbPixmapIconRenderer(pixmapData, this); } -HbPixmapIconImpl::HbPixmapIconImpl(const QPixmap& pixmap, const QString& name): - pixmapData(pixmap), - pixmapIconRenderer(0) +HbPixmapIconImpl::HbPixmapIconImpl(const QPixmap &pixmap, const QString &name): + pixmapData(pixmap), + pixmapIconRenderer(0) { pixmapIconRenderer = new HbPixmapIconRenderer(pixmapData, this); aspectRatioMode = Qt::KeepAspectRatio; @@ -95,7 +94,7 @@ void HbPixmapIconImpl::retrievePixmapData() { GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - QImage image((const uchar*) + QImage image((const uchar *) ((char *)manager->base() + sharedIconData.pixmapData.offset), sharedIconData.pixmapData.width, sharedIconData.pixmapData.height, sharedIconData.pixmapData.format); @@ -106,14 +105,14 @@ } -void HbPixmapIconImpl::paint(QPainter* painter, +void HbPixmapIconImpl::paint(QPainter *painter, const QRectF &rect, Qt::Alignment alignment, const QPainterPath &clipPath, - HbMaskableIconImpl * maskIconData) + HbMaskableIconImpl *maskIconData) { #ifdef HB_ICON_CACHE_DEBUG - qDebug() << "HbPixmapIconImpl::paint()-->"<fileName; + qDebug() << "HbPixmapIconImpl::paint()-->" << this->fileName; #endif QPointF topLeft = rect.topLeft(); QSizeF pixmapSize = pixmapData.size(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbpixmapiconimpl_p.h --- a/src/hbcore/image/hbpixmapiconimpl_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbpixmapiconimpl_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,21 +34,21 @@ class HB_AUTOTEST_EXPORT HbPixmapIconImpl : public HbIconImpl { public : - HbPixmapIconImpl(HbSharedIconInfo iconData, QString& name, - const QSizeF& keySize, + HbPixmapIconImpl(HbSharedIconInfo iconData, QString &name, + const QSizeF &keySize, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, HbRenderingMode renderMode); - HbPixmapIconImpl(const QPixmap& pixmap, const QString& name = QString()); + explicit HbPixmapIconImpl(const QPixmap &pixmap, const QString &name = QString()); ~HbPixmapIconImpl(); QPixmap pixmap(); - void paint(QPainter* painter, + void paint(QPainter *painter, const QRectF &rect, Qt::Alignment alignment, const QPainterPath &clipPath = QPainterPath(), - HbMaskableIconImpl * maskIconData = 0); + HbMaskableIconImpl *maskIconData = 0); QSize defaultSize() const; QSize size(); void destroyMaskedData(HbIconMaskedData *data); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbpixmapiconrenderer.cpp --- a/src/hbcore/image/hbpixmapiconrenderer.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbpixmapiconrenderer.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,16 +29,15 @@ #include #include -struct HbPixmapIconMaskedData -{ +struct HbPixmapIconMaskedData { QPixmap currentPixmap; }; HbPixmapIconRenderer::HbPixmapIconRenderer(const QPixmap &pixmap, HbIconImpl *impl) - : iconMode(QIcon::Normal), - iconPropertiesApplied(false), - pixmapData(pixmap), - iconImpl(impl) + : iconMode(QIcon::Normal), + iconPropertiesApplied(false), + pixmapData(pixmap), + iconImpl(impl) { } @@ -46,10 +45,10 @@ { } -void HbPixmapIconRenderer::draw(QPainter* painter, +void HbPixmapIconRenderer::draw(QPainter *painter, const QPointF &topLeft, const QPainterPath &clipPath, - HbMaskableIconImpl * maskIconData) + HbMaskableIconImpl *maskIconData) { if (!iconPropertiesApplied) { applyIconProperties(); @@ -67,37 +66,33 @@ doDraw(painter, topLeft, pixmapToDraw, clipPath); } -void HbPixmapIconRenderer::doDraw(QPainter * painter, - const QPointF & topLeft, - const QPixmap & finalPixmap, - const QPainterPath & clipPath) +void HbPixmapIconRenderer::doDraw(QPainter *painter, + const QPointF &topLeft, + const QPixmap &finalPixmap, + const QPainterPath &clipPath) { if (!clipPath.isEmpty()) { QPainterPath oldPath; - bool clipped = painter->hasClipping(); - - if (!clipped) { + bool wasClipped = painter->hasClipping(); + + if (!wasClipped) { painter->setClipping(true); } - + QRectF cliprect = clipPath.boundingRect(); QPainterPath intersect(clipPath); - if (clipped) { - oldPath = painter->clipPath(); + oldPath = painter->clipPath(); + if (wasClipped) { QRectF oldrect = oldPath.boundingRect(); intersect = oldPath.intersected(clipPath); QRectF interrect = intersect.boundingRect(); } - - painter->setClipPath(intersect, Qt::ReplaceClip); + + painter->setClipPath(intersect, Qt::ReplaceClip); painter->drawPixmap(topLeft, finalPixmap); - - if (!clipped) { - painter->setClipPath(oldPath, Qt::NoClip); - } else { - painter->setClipPath(oldPath); - } - painter->setClipping(clipped); + + painter->setClipPath(oldPath); + painter->setClipping(wasClipped); } else { painter->drawPixmap(topLeft, finalPixmap); } @@ -122,11 +117,11 @@ iconPropertiesApplied = true; } -QPixmap HbPixmapIconRenderer::getMaskedPixmap(HbMaskableIconImpl * maskIconData) +QPixmap HbPixmapIconRenderer::getMaskedPixmap(HbMaskableIconImpl *maskIconData) { QPixmap maskedPixmap; - HbPixmapIconMaskedData * mi = (HbPixmapIconMaskedData *)maskIconData->implData(); + HbPixmapIconMaskedData *mi = (HbPixmapIconMaskedData *)maskIconData->implData(); if (maskIconData->maskChanged()) { if (!mi) { mi = new HbPixmapIconMaskedData(); @@ -146,6 +141,6 @@ void HbPixmapIconRenderer::destroyMaskedData(HbIconMaskedData *data) { - delete((HbPixmapIconMaskedData*)data); + delete((HbPixmapIconMaskedData *)data); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbpixmapiconrenderer_p.h --- a/src/hbcore/image/hbpixmapiconrenderer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbpixmapiconrenderer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBPIXMAPICONRENDERER_P_H_ -#define HBPIXMAPICONRENDERER_P_H_ +#ifndef HBPIXMAPICONRENDERER_P_H +#define HBPIXMAPICONRENDERER_P_H #include #include @@ -36,35 +36,31 @@ class HB_CORE_PRIVATE_EXPORT HbPixmapIconRenderer { public: - - HbPixmapIconRenderer(const QPixmap & pixmap, HbIconImpl *impl); - + + HbPixmapIconRenderer(const QPixmap &pixmap, HbIconImpl *impl); + ~HbPixmapIconRenderer(); - - void setColor(const QColor & color) - { + + void setColor(const QColor &color) { this->iconColor = color; } - - void setMode(QIcon::Mode mode) - { + + void setMode(QIcon::Mode mode) { this->iconMode = mode; } - - QColor color() - { + + QColor color() { return iconColor; } - - QIcon::Mode mode() - { + + QIcon::Mode mode() { return iconMode; } - void draw(QPainter* painter, + void draw(QPainter *painter, const QPointF &topLeft, const QPainterPath &clipPath, - HbMaskableIconImpl * maskIconData); + HbMaskableIconImpl *maskIconData); void destroyMaskedData(HbIconMaskedData *data); @@ -72,19 +68,18 @@ void applyIconProperties(); - QPixmap getMaskedPixmap(HbMaskableIconImpl * maskIconData); + QPixmap getMaskedPixmap(HbMaskableIconImpl *maskIconData); - void doDraw(QPainter * painter, - const QPointF & topLeft, - const QPixmap & finalPixmap, - const QPainterPath & clipPath); + void doDraw(QPainter *painter, + const QPointF &topLeft, + const QPixmap &finalPixmap, + const QPainterPath &clipPath); QColor iconColor; QIcon::Mode iconMode; bool iconPropertiesApplied; QPixmap pixmapData; - HbIconImpl * iconImpl; + HbIconImpl *iconImpl; }; #endif - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbsgimageiconimpl_p.cpp --- a/src/hbcore/image/hbsgimageiconimpl_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbsgimageiconimpl_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include @@ -39,7 +39,7 @@ #include "hbpixmapiconrenderer_p.h" typedef EGLImageKHR(*pfnEglCreateImageKHR)(EGLDisplay, EGLContext, - EGLenum, EGLClientBuffer, EGLint*); + EGLenum, EGLClientBuffer, EGLint *); typedef EGLBoolean(*pfnEglDestroyImageKHR)(EGLDisplay, EGLImageKHR); typedef VGImage(*pfnVgCreateEGLImageTargetKHR)(VGeglImageKHR); @@ -53,21 +53,21 @@ if (context != EGL_NO_CONTEXT) { eglDestroyContext(display, context); } HbSgimageIconImpl::HbSgimageIconImpl(const HbSharedIconInfo &iconData, - const QString& name, - const QSizeF& keySize, + const QString &name, + const QSizeF &keySize, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, HbRenderingMode renderMode): - HbIconImpl(iconData, - name, - keySize, - aspectRatioMode, - mode, - mirrored, - renderMode), - vgImageRenderer(0), - pixmapIconRenderer(0) + HbIconImpl(iconData, + name, + keySize, + aspectRatioMode, + mode, + mirrored, + renderMode), + vgImageRenderer(0), + pixmapIconRenderer(0) { retrieveSgImageData(); } @@ -103,15 +103,15 @@ EGLContext eglContext = eglContextPrev; EGLSurface eglSurface = eglSurfacePrevDraw; - + EGLContext eglNewContext = EGL_NO_CONTEXT; EGLContext eglNewSurface = EGL_NO_SURFACE; - + if (eglContext == EGL_NO_CONTEXT) { EGLConfig config; - + EGLint numConfigs; - + const EGLint attribList[] = { EGL_RENDERABLE_TYPE, EGL_OPENVG_BIT, EGL_SURFACE_TYPE, EGL_PBUFFER_BIT | EGL_VG_ALPHA_FORMAT_PRE_BIT, @@ -121,13 +121,13 @@ EGL_ALPHA_SIZE, HB_BITS_PER_COLOR, EGL_NONE }; - + if (eglChooseConfig(display, attribList, &config, 1, &numConfigs) == EGL_FALSE) { return currentPixmap; } - + if (eglSurface == EGL_NO_SURFACE) { - //pixmap is called without EGL being initialized + //pixmap is called without EGL being initialized const EGLint attribList2[] = { EGL_WIDTH, contentSize.width(), @@ -141,22 +141,22 @@ } } eglNewContext = eglContext = eglCreateContext(display, config, EGL_NO_CONTEXT, 0); - if (eglContext == EGL_NO_CONTEXT) { + if (eglContext == EGL_NO_CONTEXT) { EGL_DESTROY_SURFACE(display, eglNewSurface); return currentPixmap; } if (eglMakeCurrent(display, eglSurface, eglSurface, - eglContext) == EGL_FALSE) { - EGL_DESTROY_SURFACE(display, eglNewSurface); + eglContext) == EGL_FALSE) { + EGL_DESTROY_SURFACE(display, eglNewSurface); EGL_DESTROY_CONTEXT(display, eglNewContext); return currentPixmap; } } - - + + VGImage localVgImage = getVgImageFromSgImage(); if (localVgImage == VG_INVALID_HANDLE) { - EGL_DESTROY_SURFACE(display, eglNewSurface); + EGL_DESTROY_SURFACE(display, eglNewSurface); EGL_DESTROY_CONTEXT(display, eglNewContext); if (eglContextPrev) { eglMakeCurrent(display, eglSurfacePrevDraw, eglSurfacePrevRead, eglContextPrev); @@ -179,14 +179,28 @@ currentPixmap = QPixmap::fromImage(image); + // Apply mode + if (this->mode != QIcon::Normal) { + QStyleOption opt(0); + opt.palette = QApplication::palette(); + currentPixmap = QApplication::style()->generatedIconPixmap(this->mode, currentPixmap, &opt); + } + + // Apply color + if (this->color().isValid() && (this->mode != QIcon::Disabled)) { + QPixmap mask = currentPixmap.alphaChannel(); + currentPixmap.fill(this->color()); + currentPixmap.setAlphaChannel(mask); + } + vgDestroyImage(localVgImage); if (eglNewContext != EGL_NO_CONTEXT || eglNewSurface != EGL_NO_SURFACE) { eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - EGL_DESTROY_SURFACE(display, eglNewSurface); + EGL_DESTROY_SURFACE(display, eglNewSurface); EGL_DESTROY_CONTEXT(display, eglNewContext); } - + if (eglContextPrev) { eglMakeCurrent(display, eglSurfacePrevDraw, eglSurfacePrevRead, eglContextPrev); } @@ -206,16 +220,16 @@ contentSize = QSize(sharedIconData.sgImageData.width, sharedIconData.sgImageData.height); } -VGImage HbSgimageIconImpl::getVgImage(HbIconImpl * impl, QPainter *) +VGImage HbSgimageIconImpl::getVgImage(HbIconImpl *impl, QPainter *) { return ((HbSgimageIconImpl *)impl)->getVgImageFromSgImage(); } -void HbSgimageIconImpl::paint(QPainter* painter, - const QRectF& rect, +void HbSgimageIconImpl::paint(QPainter *painter, + const QRectF &rect, Qt::Alignment alignment, const QPainterPath &clipPath, - HbMaskableIconImpl * maskIconData) + HbMaskableIconImpl *maskIconData) { #ifdef HB_ICON_CACHE_DEBUG qDebug() << "HbSgimageIconImpl::paint()-->" << this->fileName; @@ -230,19 +244,20 @@ maskApplied = true; } - if ((painter->paintEngine()->type() != QPaintEngine::OpenVG) || - maskApplied || pixmapIconRenderer) { + QPaintEngine *paintEngine = painter->paintEngine(); + if (!paintEngine || paintEngine->type() != QPaintEngine::OpenVG + || maskApplied || pixmapIconRenderer) { // going to pixmap, vgimage may not be required any more if (vgImageRenderer) { delete vgImageRenderer; vgImageRenderer = 0; } - + if (!pixmapIconRenderer) { painter->beginNativePainting(); pixmap(); painter->endNativePainting(); - + pixmapIconRenderer = new HbPixmapIconRenderer(currentPixmap, this); pixmapIconRenderer->setColor(iconColor); pixmapIconRenderer->setMode(mode); @@ -265,13 +280,13 @@ if (vgImageRenderer) { vgImageRenderer->draw(painter, topLeft, clipPath); - eglWaitClient(); + //eglWaitClient(); return; } } -QPointF HbSgimageIconImpl::setAlignment(const QRectF& rect, - QSizeF& renderSize, +QPointF HbSgimageIconImpl::setAlignment(const QRectF &rect, + QSizeF &renderSize, Qt::Alignment alignment) { QPointF topLeft = rect.topLeft(); @@ -306,8 +321,8 @@ #endif } - - + + EGLDisplay display = eglGetDisplay(EGL_DEFAULT_DISPLAY); // Retrieve the extensions diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbsgimageiconimpl_p.h --- a/src/hbcore/image/hbsgimageiconimpl_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbsgimageiconimpl_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,8 +40,8 @@ { public : HbSgimageIconImpl(const HbSharedIconInfo &iconData, - const QString& name, - const QSizeF& keySize, + const QString &name, + const QSizeF &keySize, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, @@ -49,11 +49,11 @@ ~HbSgimageIconImpl(); QPixmap pixmap(); - void paint(QPainter* painter, + void paint(QPainter *painter, const QRectF &rect, Qt::Alignment alignment, const QPainterPath &clipPath = QPainterPath(), - HbMaskableIconImpl * maskIconData = 0); + HbMaskableIconImpl *maskIconData = 0); QSize defaultSize() const; QSize size(); @@ -62,19 +62,19 @@ private : void retrieveSgImageData(); VGImage getVgImageFromSgImage(); - QPointF setAlignment(const QRectF& rect, - QSizeF& renderSize, + QPointF setAlignment(const QRectF &rect, + QSizeF &renderSize, Qt::Alignment alignment); - void updatePainterTransformation(QPainter * painter, const QPointF & pos); - static VGImage getVgImage(HbIconImpl * impl, QPainter * painter); + void updatePainterTransformation(QPainter *painter, const QPointF &pos); + static VGImage getVgImage(HbIconImpl *impl, QPainter *painter); private: TSgDrawableId sgImageId; QPixmap currentPixmap; QSize contentSize; - HbVgImageIconRenderer * vgImageRenderer; - HbPixmapIconRenderer * pixmapIconRenderer; + HbVgImageIconRenderer *vgImageRenderer; + HbPixmapIconRenderer *pixmapIconRenderer; }; #endif // HBSGIMAGEICONIMPL_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbvgimageiconrenderer.cpp --- a/src/hbcore/image/hbvgimageiconrenderer.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbvgimageiconrenderer.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,15 +29,15 @@ #include -HbVgImageIconRenderer::HbVgImageIconRenderer(VGImage img, const QSize & size, HbIconImpl * impl) - : vgImage(img), - iconMode(QIcon::Normal), - specialCaseApplied(false), - rendersize(size), - addedToStates(false), - opacityPaint(VG_INVALID_HANDLE), - lastOpacity(1.0), - iconImpl(impl) +HbVgImageIconRenderer::HbVgImageIconRenderer(VGImage img, const QSize &size, HbIconImpl *impl) + : vgImage(img), + iconMode(QIcon::Normal), + specialCaseApplied(false), + rendersize(size), + addedToStates(false), + opacityPaint(VG_INVALID_HANDLE), + lastOpacity(1.0), + iconImpl(impl) { eglStates = HbEglStates::global(); eglStates->ref(); @@ -91,7 +91,7 @@ } } -bool HbVgImageIconRenderer::draw(QPainter * painter, const QPointF & topLeft, const QPainterPath & clipPath) +bool HbVgImageIconRenderer::draw(QPainter *painter, const QPointF &topLeft, const QPainterPath &clipPath) { if ((iconColor.isValid()) || (iconMode != QIcon::Normal)) { applyIconProperties(); @@ -107,36 +107,36 @@ addedToStates = true; } - if (vgImage != VG_INVALID_HANDLE) { + if (vgImage != VG_INVALID_HANDLE) { QPainterPath oldPath; - bool clipped = painter->hasClipping(); - + bool wasClipped = painter->hasClipping(); + if (!clipPath.isEmpty()) { - if (!clipped) { + if (!wasClipped) { painter->setClipping(true); } - + QPainterPath intersect(clipPath); - if (clipped) { - oldPath = painter->clipPath(); + oldPath = painter->clipPath(); + if (wasClipped) { intersect = oldPath.intersected(clipPath); if (intersect.isEmpty()) { return true; } } - + painter->setClipPath(intersect, Qt::ReplaceClip); painter->beginNativePainting(); } - + VGint imageMode = vgGeti(VG_IMAGE_MODE); VGint matrixMode = vgGeti(VG_MATRIX_MODE); VGPaint oldFillPaint = VG_INVALID_HANDLE; VGPaint oldStrkPaint = VG_INVALID_HANDLE; VGint blendMode = 0; - + updatePainterTransformation(painter, topLeft); - + qreal opacity = painter->opacity(); if (opacity != lastOpacity || iconMode == QIcon::Selected) { @@ -193,12 +193,8 @@ if (!clipPath.isEmpty()) { painter->endNativePainting(); - if (!clipped) { - painter->setClipPath(oldPath, Qt::NoClip); - } else { - painter->setClipPath(oldPath); - } - painter->setClipping(clipped); + painter->setClipPath(oldPath); + painter->setClipping(wasClipped); } return true; } @@ -207,12 +203,12 @@ } -void HbVgImageIconRenderer::updatePainterTransformation(QPainter * painter, const QPointF & pos) +void HbVgImageIconRenderer::updatePainterTransformation(QPainter *painter, const QPointF &pos) { - VGfloat devh = painter->device()->height() - 1; + VGfloat devh = painter->device()->height(); QTransform viewport(1.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, - 0.5f, devh + 0.5f, 1.0f); + 0.0f, devh, 1.0f); QTransform imageTransform = painter->transform() * viewport; imageTransform.translate(pos.x(), pos.y()); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/image/hbvgimageiconrenderer_p.h --- a/src/hbcore/image/hbvgimageiconrenderer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/image/hbvgimageiconrenderer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBVGIMAGEICONRENDERER_P_H_ -#define HBVGIMAGEICONRENDERER_P_H_ +#ifndef HBVGIMAGEICONRENDERER_P_H +#define HBVGIMAGEICONRENDERER_P_H #include #include @@ -40,55 +40,49 @@ { public: - typedef VGImage(*VgImageCreator)(HbIconImpl * impl, QPainter * painter); + typedef VGImage(*VgImageCreator)(HbIconImpl *impl, QPainter *painter); - HbVgImageIconRenderer(VGImage img, const QSize & size, HbIconImpl *impl); + HbVgImageIconRenderer(VGImage img, const QSize &size, HbIconImpl *impl); ~HbVgImageIconRenderer(); - - void setColor(const QColor & color) - { + + void setColor(const QColor &color) { this->iconColor = color; } - - void setMode(QIcon::Mode mode) - { + + void setMode(QIcon::Mode mode) { this->iconMode = mode; } - - QColor color() - { + + QColor color() { return iconColor; } - - QIcon::Mode mode() - { + + QIcon::Mode mode() { return iconMode; } - - void setVgImageCreator(VgImageCreator vgCreator) - { + + void setVgImageCreator(VgImageCreator vgCreator) { vgImageCreator = vgCreator; } - - bool draw(QPainter * painter, const QPointF & topLeft, const QPainterPath & clipPath); + + bool draw(QPainter *painter, const QPointF &topLeft, const QPainterPath &clipPath); private: void applyIconProperties(); - void updatePainterTransformation(QPainter * painter, const QPointF & pos); + void updatePainterTransformation(QPainter *painter, const QPointF &pos); VGImage vgImage; QColor iconColor; QIcon::Mode iconMode; bool specialCaseApplied; QSize rendersize; - HbEglStates * eglStates; + HbEglStates *eglStates; bool addedToStates; VGPaint opacityPaint; qreal lastOpacity; - HbIconImpl * iconImpl; + HbIconImpl *iconImpl; VgImageCreator vgImageCreator; }; #endif - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/indicatorplugins/hbindicatorinterface.cpp --- a/src/hbcore/indicatorplugins/hbindicatorinterface.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/indicatorplugins/hbindicatorinterface.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -162,6 +162,14 @@ \sa HbIndicatorInterface::processClientRequest */ +/*! + \fn void HbIndicatorInterface::userActivated(const QVariantMap &data) + + The class should emit this signal, when client needs to be notified of the + user interaction. + @param data Data sent by indicator. +*/ + class HbIndicatorInterfacePrivate { public: @@ -260,6 +268,21 @@ } /*! + Called by the framework, when the indicator menu is about to show. + Indicators data can be refreshed here. + + Should return true, if the indicator data is refreshed, false otherwise. + If true is returned then the indicator menu calls indicatorData to get refreshed data. + Default implementation returns false. + + \sa HbIndicatorInterface::indicatorData(int role) +*/ +bool HbIndicatorInterface::refreshData() +{ + return false; +} + +/*! Constructs an indicator. \a indicatorType contains the type of the indicator, diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/indicatorplugins/hbindicatorinterface.h --- a/src/hbcore/indicatorplugins/hbindicatorinterface.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/indicatorplugins/hbindicatorinterface.h Thu Jul 22 16:36:53 2010 +0100 @@ -68,6 +68,7 @@ void processClientRequest(RequestType type, const QVariant ¶meter); virtual bool handleInteraction(InteractionType type); virtual QVariant indicatorData(int role) const = 0; + virtual bool refreshData(); virtual ~HbIndicatorInterface(); signals: void dataChanged(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/indicatorplugins/hbindicatorpluginmanager.cpp --- a/src/hbcore/indicatorplugins/hbindicatorpluginmanager.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/indicatorplugins/hbindicatorpluginmanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -49,8 +49,9 @@ int readOnlyPaths; mPluginPathList = HbDeviceDialogPluginManager::pluginPathList("/indicators/", readOnlyPaths); - // Scan only read-only drives at startup to ensure installed plugins cannot affect device boot - for(int i = 0; i < readOnlyPaths; i++) { + // Scan only read-only drives + allow eclipsing at startup to ensure installed plugins cannot + // affect device boot + for(int i = 0; i < mPluginPathList.count(); i++) { updateCachePath(mPluginPathList.at(i), true); } } @@ -279,23 +280,14 @@ return indicatorList; } -void HbIndicatorPluginManager::connectTo(QObject *widget) +// Signal active indicators to target +void HbIndicatorPluginManager::signalActiveIndicators(QObject *target) { - widget->disconnect(this); - - //connect pluginmanager signals to indicatormenu slots, so that - //popup will get indicator updates. - widget->connect(this, - SIGNAL(indicatorActivated(HbIndicatorInterface*)), - SLOT(indicatorActivated(HbIndicatorInterface*))); - widget->connect(this, - SIGNAL(indicatorRemoved(HbIndicatorInterface*)), - SLOT(indicatorRemoved(HbIndicatorInterface*))); QList addedIndicators = indicators(); if (addedIndicators.count() > 0) { //initialize popup with added indicators. - QMetaObject::invokeMethod(widget, "indicatorsActivated", + QMetaObject::invokeMethod(target, "indicatorsActivated", Qt::DirectConnection, Q_ARG(QList, addedIndicators)); } @@ -367,47 +359,80 @@ // Check if plugin file name is in cache int index = -1; - const QString filePath = mNameCache.find(indicatorType); + QString filePath = mNameCache.find(indicatorType, QString()); if (!filePath.isEmpty()) { - TRACE("cache hit") + TRACE("icache hit") index = loadPlugin(indicatorType, filePath); // If plugin wasn't loaded, the cache has stale information. Rescan the directory. if (index < 0) { - TRACE("cache stale") + TRACE("icache stale") updateCachePath(filePath); } } if (index < 0) { - TRACE("cache miss") + TRACE("icache miss") // Plugin name wasn't in cache, try to find it - index = scanPlugins(indicatorType); - if (index >= 0) { - // Plugin was found, update plugin name cache by scanning the directory - updateCachePath(mPlugins[index].mLoader->fileName()); + filePath = scanPlugins(indicatorType); + if (!filePath.isEmpty()) { + index = loadPlugin(indicatorType, filePath); + if (index >= 0) { + // Plugin was found, update plugin name cache by scanning the directory + updateCachePath(mPlugins[index].mLoader->fileName()); + } } } TRACE_EXIT return index; } -// Scan for and load plugin in file system -int HbIndicatorPluginManager::scanPlugins(const QString &indicatorType) +// Scan plugins to find one implementing the indicator type +QString HbIndicatorPluginManager::scanPlugins(const QString &indicatorType) { TRACE_ENTRY const QString fileNameFilter = HbDeviceDialogPluginManager::pluginFileNameFilter(); - int index = -1; + QString pluginFileName; - foreach (const QString &path, mPluginPathList) { + // Scan plugins. All paths in the list are scanned. Eclipsing is allowed only if file names + // are the same. + QString result; + foreach(const QString &path, mPluginPathList) { QDir pluginDir(path, fileNameFilter, QDir::NoSort, QDir::Files | QDir::Readable); foreach (const QString &fileName, pluginDir.entryList()) { - index = loadPlugin(indicatorType, pluginDir.absoluteFilePath(fileName)); - if (index >= 0) { - break; + if (pluginFileName.isEmpty() || HbPluginNameCache::compare(pluginFileName, fileName) == 0) { + const QString current(pluginDir.absoluteFilePath(fileName)); + if (scanPlugin(indicatorType, current)) { + result = current; + if (pluginFileName.isEmpty()) { + pluginFileName = fileName; + } + } } } } TRACE_EXIT - return index; + return result; +} + +// Scan a plugin to find if it implements the indicator type +bool HbIndicatorPluginManager::scanPlugin(const QString &indicatorType, const QString &filePath) +{ + TRACE_ENTRY + + HbLockedPluginLoader *loader = new HbLockedPluginLoader(mNameCache, filePath); + QObject *pluginInstance = loader->instance(); + + bool result = false; + if (pluginInstance) { + HbIndicatorPluginInterface *plugin = + qobject_cast(pluginInstance); + if (plugin) { + result = plugin->indicatorTypes().contains(indicatorType); + } + } + loader->unload(); + delete loader; + TRACE_EXIT + return result; } // Load plugin from file path name @@ -493,17 +518,26 @@ } // Update plugin name cache watch/scan list -void HbIndicatorPluginManager::updateCachePath(const QString &path, bool updateReadOnly) +void HbIndicatorPluginManager::updateCachePath(const QString &path, bool firstScan) { QString dirPath = HbPluginNameCache::directoryPath(path); QFileInfo fileInfo(dirPath); if (fileInfo.exists()) { // If directory is writable, watch it. Otherwise scan it only once. if (fileInfo.isWritable()) { - mNameCache.addWatchPath(dirPath); + HbPluginNameCache::ScanParameters::Options scanOptions = + HbPluginNameCache::ScanParameters::NoOptions; + Q_UNUSED(firstScan) +#if defined(Q_OS_SYMBIAN) + if (firstScan) { + scanOptions = HbPluginNameCache::ScanParameters::LimitToSet; + } +#endif // defined(Q_OS_SYMBIAN) + mNameCache.addWatchPath(HbPluginNameCache::ScanParameters(dirPath, scanOptions)); } else { - if (updateReadOnly) { - mNameCache.scanDirectory(dirPath); + if (firstScan) { + HbPluginNameCache::ScanParameters parameters(path, HbPluginNameCache::ScanParameters::AddToLimitSet); + mNameCache.scanDirectory(parameters); } } } else { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/indicatorplugins/hbindicatorpluginmanager_p.h --- a/src/hbcore/indicatorplugins/hbindicatorpluginmanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/indicatorplugins/hbindicatorpluginmanager_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -81,7 +81,7 @@ bool removeIndicator(const QString &indicatorType); QList indicatorClientInfoList() const; QList indicators() const; - void connectTo(QObject *widget); + void signalActiveIndicators(QObject *target); signals: void indicatorActivated(HbIndicatorInterface *addedIndicator); void indicatorActivated(const IndicatorClientInfo &clientInfo); @@ -103,14 +103,15 @@ const QVariantMap &securityCredentials); int loadPlugin(const QString &indicatorType); int loadPlugin(const QString &indicatorType, const QString &filePath); - int scanPlugins(const QString &indicatorType); + QString scanPlugins(const QString &indicatorType); + bool scanPlugin(const QString &indicatorType, const QString &filePath); int findPlugin(const QString &indicatorType) const; int findPlugin(const QString &indicatorType, IndicatorInfo **indicatorInfo, int *infoIndex = 0); QString statusAreaIconPath( const HbIndicatorInterface *indicator) const; - void updateCachePath(const QString &path, bool updateReadOnly = false); + void updateCachePath(const QString &path, bool firstScan = false); static QStringList pluginKeys(QObject *pluginInstance); bool hasMenuData(const HbIndicatorInterface &indicator) const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputcontextplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/inputfw/hbinputcontextplugin.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hbinputcontextplugin.h" + +/*! +@proto +@hbcore +\class HbInputContextPlugin +\brief Extends QInputContextPlugin to support HbInputMethod input method selection UI elements. + +Sometimes an input method may want to display several options in input method selection dialog. +This class extends QInputContextPlugin and provides a way to specify several display names instead of one. +Standard input method selection UI sidplays them all and notifies the HbInputMethod in question +which one was selected. This class also makes it possible to asign an icon to each display name. +The icons are then displayed by the default input method selection dialog. +*/ + +HbInputContextPlugin::HbInputContextPlugin(QObject *parent) : QInputContextPlugin(parent) +{ +} + +/*! +\fn QStringList HbInputContextPlugin::displayNames(const QString &key) + +Sometimes an input context may want to display more than one option in input method selection +dialog (or in similar mechanism). This method is a version of base class method displayName and returns a list of strings +instead of just one string. See input method selection widget for details how the default input method selection +dialog passes selected item to the input context. + +\sa displayName +*/ + +/*! +\fn HbIcon HbInputContextPlugin::icon(const QString &key) + +Returns input context specific icon. It may be shown for example in input method selection dialog. +*/ + +/*! +\fn QList HbInputContextPlugin::icons(const QString &key) + +In case input context has more than one display name, it may also want to asign individual icon to +those display names. This method returns a list of icons. It should return same number of items as displayNames method. + +\sa displayNames +\sa icons +*/ + +// End of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputcontextplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/inputfw/hbinputcontextplugin.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,49 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBINPUTCONTEXTPLUGIN_H +#define HBINPUTCONTEXTPLUGIN_H + +#include + +#include +#include + +class HB_CORE_EXPORT HbInputContextPlugin : public QInputContextPlugin +{ + Q_OBJECT + +public: + HbInputContextPlugin(QObject *parent = 0); + + virtual QStringList displayNames(const QString &key) = 0; + virtual HbIcon icon(const QString &key) = 0; + virtual QList icons(const QString &key) = 0; +}; + +#endif // HBINPUTCONTEXTPLUGIN_H + +// End of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputcontextproxy.cpp --- a/src/hbcore/inputfw/hbinputcontextproxy.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputcontextproxy.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,6 +29,7 @@ #include #include #include +#include /*! @alpha @@ -50,7 +51,7 @@ \sa HbInputMethod */ -HbInputContextProxy::HbInputContextProxy(HbInputMethod* target) : mTarget(target) +HbInputContextProxy::HbInputContextProxy(HbInputMethod *target) : mTarget(target) { } @@ -68,7 +69,7 @@ return mTarget->actions(); } - return QList(); + return QList(); } /*! @@ -93,10 +94,14 @@ */ void HbInputContextProxy::setInputFrameworkFocus(QObject *widget) { - if(mTarget) { - if(!widget) { + if (mTarget) { + if (!widget) { mTarget->setFocusObject(0); - } else if (HbInputFocusObject::isEditor(widget) && !HbInputFocusObject::isReadOnlyWidget(widget)) { + } else if (HbInputFocusObject::isEditor(widget) && !HbInputFocusObject::isReadOnlyWidget(widget)) { + if (mTarget->focusObject() && mTarget->focusObject()->object() == widget) { + // Already focused to given widget. + return; + } mTarget->setFocusObject(new HbInputFocusObject(widget)); } } @@ -106,22 +111,25 @@ \internal \reimp */ -bool HbInputContextProxy::filterEvent(const QEvent* event) +bool HbInputContextProxy::filterEvent(const QEvent *event) { if (mTarget) { -#if QT_VERSION >= 0x040600 - if (event->type() == QEvent::CloseSoftwareInputPanel) { + bool orientationCompleted = HbInputSettingProxy::instance()->orientationChangeCompleted(); + if (event->type() == QEvent::CloseSoftwareInputPanel && orientationCompleted) { setInputFrameworkFocus(0); - return true; - } else if (event->type() == QEvent::RequestSoftwareInputPanel) { - if(QWidget * focusedWidget = qApp->focusWidget()) { + return true; + } else if (event->type() == QEvent::RequestSoftwareInputPanel && orientationCompleted) { + if (QWidget *focusedWidget = qApp->focusWidget()) { // see if the focused widget is graphics view, if so get the focused graphics item in the view // and acivate inputmethod for the focused graphics item - if(QGraphicsView * graphicsView = qobject_cast(focusedWidget)) { - if(QGraphicsScene * scene = graphicsView->scene()) { - if(QGraphicsItem * focusingWidget = scene->focusItem()) { - if (focusingWidget->isWidget()) { - setInputFrameworkFocus(static_cast(focusingWidget)); + if (QGraphicsView *graphicsView = qobject_cast(focusedWidget)) { + if (QGraphicsScene *scene = graphicsView->scene()) { + if (QGraphicsItem *fItem = scene->focusItem()) { + QGraphicsProxyWidget *proxy = qgraphicsitem_cast(fItem); + if (proxy) { + setInputFrameworkFocus(proxy->widget()->focusWidget()); + } else { + setInputFrameworkFocus(static_cast(fItem)); } } } @@ -133,13 +141,12 @@ } return true; } -#endif #ifdef Q_OS_SYMBIAN const quint32 HbInputContextProxyExternalKeyboardModifier = 0x00200000; if (event->type() == QEvent::QEvent::KeyPress || event->type() == QEvent::KeyRelease) { - const QKeyEvent *keyEvent = static_cast(event); + const QKeyEvent *keyEvent = static_cast(event); if (keyEvent->nativeModifiers() & HbInputContextProxyExternalKeyboardModifier) { // Operating system indicates that the event originated from an external keyboard. // We let it pass here untouched. @@ -147,19 +154,19 @@ mTarget->reset(); } return false; - } - } + } + } #endif - if(event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { - const QKeyEvent *keyEvent = static_cast(event); - if (Qt::Key_unknown == keyEvent->key()) { - return false; - } - } - return mTarget->filterEvent(event); - } + if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { + const QKeyEvent *keyEvent = static_cast(event); + if (Qt::Key_unknown == keyEvent->key()) { + return false; + } + } + return mTarget->filterEvent(event); + } - return false; + return false; } /*! @@ -206,7 +213,7 @@ \reimp */ QString HbInputContextProxy::language() -{ +{ if (mTarget) { return mTarget->language(); } @@ -218,7 +225,7 @@ \internal \reimp */ -void HbInputContextProxy::mouseHandler(int x, QMouseEvent* event) +void HbInputContextProxy::mouseHandler(int x, QMouseEvent *event) { if (mTarget) { mTarget->mouseHandler(x, event); @@ -240,7 +247,7 @@ \internal \reimp */ -void HbInputContextProxy::sendEvent(const QInputMethodEvent& event) +void HbInputContextProxy::sendEvent(const QInputMethodEvent &event) { if (mTarget) { mTarget->sendEvent(event); @@ -262,7 +269,7 @@ \internal \reimp */ -void HbInputContextProxy::widgetDestroyed(QWidget* widget) +void HbInputContextProxy::widgetDestroyed(QWidget *widget) { if (mTarget) { mTarget->widgetDestroyed(widget); @@ -273,7 +280,7 @@ \internal \reimp */ -void HbInputContextProxy::setFocusWidget(QWidget* widget) +void HbInputContextProxy::setFocusWidget(QWidget *widget) { if (mTarget) { mTarget->setFocusWidget(widget); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputcontextproxy_p.h --- a/src/hbcore/inputfw/hbinputcontextproxy_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputcontextproxy_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,8 +54,8 @@ void reset(); void sendEvent(const QInputMethodEvent &event); void update(); - void widgetDestroyed(QWidget* widget); - void setFocusWidget(QWidget* widget); + void widgetDestroyed(QWidget *widget); + void setFocusWidget(QWidget *widget); private: inline bool hasAlreadyInputFrameworkFocus(HbInputMethod *activeMethod, QObject *editorWidget) const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputdef.h --- a/src/hbcore/inputfw/hbinputdef.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputdef.h Thu Jul 22 16:36:53 2010 +0100 @@ -63,21 +63,21 @@ keyboards have bit HbQwertyKeyboardMask set and all touch keypads have bit HbTouchInputMask set. */ -enum HbKeyboardTypeFlag -{ - HbKeyboardNone = 0x00000000, - - HbKeyboard12Key = 0x00000001, /**< Conventional phone keypad */ +enum HbKeyboardTypeFlag { + HbKeyboardNone = 0x00000000, - HbKeyboardQwerty = 0x00000001 | HbQwertyKeyboardMask, /**< Qwerty keyboard */ - - HbKeyboardVirtual12Key = 0x00000001 | HbTouchInputMask, /**< Touchscreen version of conventional phone keypad */ - HbKeyboardVirtualQwerty = 0x00000002 | HbTouchInputMask| HbQwertyKeyboardMask, /**< Touchscreen version of qwerty keyboard */ - HbKeyboardSctPortrait = 0x00000003 | HbTouchInputMask, /**< Special character selection keypad for portrait view */ - HbKeyboardSctLandscape = 0x00000004 | HbTouchInputMask| HbQwertyKeyboardMask, /**< Special character selection keypad for landscape view */ - HbKeyboardHwr = 0x00000005 | HbTouchInputMask| HbHwrKeyboardMask, /**< Hand writing recognition keypad */ - HbKeyboardThaiStarSctPortrait = 0x00000006 | HbTouchInputMask, /**< Special character selection keypad for star key in Thai portrait view */ - HbKeyboardThaiHashSctPortrait = 0x00000007 | HbTouchInputMask /**< Special character selection keypad for hash key in Thai portrait view */ + HbKeyboard12Key = 0x00000001, /**< Deprecated, use HbKeyboardHardwarePortrait instead. */ + HbKeyboardHardwarePortrait = HbKeyboard12Key, /**< Hardware keyboard for portrait orientation. */ + HbKeyboardQwerty = 0x00000001 | HbQwertyKeyboardMask, /**< Deprecated, use HbKeyboardHardwareLandcape instead */ + HbKeyboardHardwareLandcape = HbKeyboardQwerty, /**< Hardware keyboard for landscape mode. */ + HbKeyboardVirtual12Key = 0x00000001 | HbTouchInputMask, /**< Deprecated, use HbKeyboardTouchPortrait instead. */ + HbKeyboardTouchPortrait = HbKeyboardVirtual12Key, /**< Touch keyboard for portrait mode. */ + HbKeyboardVirtualQwerty = 0x00000002 | HbTouchInputMask | HbQwertyKeyboardMask, /**< Touchscreen version of qwerty keyboard */ + HbKeyboardTouchLandscape = HbKeyboardVirtualQwerty, /**< Touch keyboard for landscape mode. */ + HbKeyboardSctPortrait = 0x00000003 | HbTouchInputMask, /**< Special character selection keypad for portrait view */ + HbKeyboardSctLandscape = 0x00000004 | HbTouchInputMask | HbQwertyKeyboardMask, /**< Special character selection keypad for landscape view */ + HbKeyboardHwr = 0x00000005 | HbTouchInputMask | HbHwrKeyboardMask, /**< Hand writing recognition keypad */ + HbKeyboardVirtual12KeyLabels = 0x00000006 | HbTouchInputMask /**< Key labels for virtual 12 key keyboard */ }; Q_DECLARE_FLAGS(HbKeyboardType, HbKeyboardTypeFlag) @@ -87,13 +87,12 @@ Enumerates known input modes. Specific bits are reserved for classifying different input mode types. For example, all Chinese modes -have bit HbChineseModeMask set and all Japanese modes have +have bit HbChineseModeMask set and all Japanese modes have bit HbJapaneseModeMask set. HbInputModeCustom is a special case. That input mode never appears in standard input mode set, but it must -be activated separately from UI. +be activated separately from UI. */ -enum HbInputModeTypeFlag -{ +enum HbInputModeTypeFlag { HbInputModeNone = 0x00000000, // Default mode @@ -103,7 +102,7 @@ HbInputModeNumeric = 0x00000001 | HbNumericModeMask, /**< Numeric input mode */ // Special modes for all languages - HbInputModeSpeechToText = 0x00000500, /**< Speech-to-text input mode */ + HbInputModeSpeechToText = 0x00000500, /**< Speech-to-text input mode */ // Chinese modes HbInputModePinyin = 0x00000001 | HbChineseModeMask, /**< Chinese PinYin input */ @@ -124,7 +123,7 @@ HbInputModeHwrLatinFull = 0x00000002 | HbHwrModeMask, /**< Latin based hand writing recognition, full screen */ HbInputModeHwrChinese = 0x00000003 | HbHwrModeMask | HbChineseModeMask, /**< Chinese hand writing recognition */ HbInputModeHwrChineseFull = 0x00000004 | HbHwrModeMask | HbChineseModeMask, /**< Chinese hand writing recognition, full screen */ - + // Custom made mode that does not belong to any pre-existing category HbInputModeCustom = HbChineseModeMask - 1 /**< Custom input mode */ }; @@ -137,8 +136,7 @@ shift, fn and chr keys. If a modifier bit is set, then the corresponding key is pressed. */ -enum HbModifier -{ +enum HbModifier { HbModifierNone = 0x00000000, HbModifierShiftPressed = 0x00000001, /**< Shift-key is pressed */ HbModifierChrPressed = 0x00000002, /**< Chr-key is pressed */ @@ -151,8 +149,7 @@ Enumerates keyboard setting flags. */ -enum HbKeyboardSettingFlag -{ +enum HbKeyboardSettingFlag { HbKeyboardSettingNone = 0x00000000, HbKeyboardSetting12key = 0x00000001, HbKeyboardSettingQwerty = 0x00000010 @@ -166,8 +163,7 @@ where the framework automatically tries to conclude when upper case state is needed. */ -enum HbTextCase -{ +enum HbTextCase { HbTextCaseNone, HbTextCaseLower, /**< Lower text case. */ HbTextCaseUpper, /**< Upper text case. */ @@ -179,8 +175,7 @@ Enumerates possible states for Fn key. */ -enum HbFnState -{ +enum HbFnState { HbFnOff, /**< Fn key inactive. */ HbFnNext, /**< Fn key active for the next keypress. */ HbFnOn /**< Fn key locked as active. */ @@ -195,23 +190,22 @@ \sa HbEditorInterface */ -enum HbEditorConstraint -{ +enum HbEditorConstraint { HbEditorConstraintNone = 0, - HbEditorConstraintAutoCompletingField = 0x01, /**< This is auto-completing editor. It remebers what has been typed previously to same editor class. */ + HbEditorConstraintAutoCompletingField = 0x01, /**< This is auto-completing editor. It remembers what has been typed previously to same editor class. */ HbEditorConstraintIgnoreFocus = 0x02, /**< Editor rejects input framework focus. */ HbEditorConstraintFixedInputMode = 0x04, /**< Editor doesn't allow initial input mode to be changed. */ HbEditorConstraintLatinAlphabetOnly = 0x08 /**< Editor allows only languages and input modes that produce latin alphabets. */ }; Q_DECLARE_FLAGS(HbEditorConstraints, HbEditorConstraint) +Q_DECLARE_OPERATORS_FOR_FLAGS(HbEditorConstraints) /*! \enum HbInputDigitType Enumerates known digit type settings. */ -enum HbInputDigitType -{ +enum HbInputDigitType { HbDigitTypeNone = 0, HbDigitTypeLatin, /**< Latin digits in use */ HbDigitTypeArabicIndic, /**< Arabic indic digits in use */ @@ -220,11 +214,11 @@ }; /*! -Enumerates operation modes for touch keypad. +Enumerates operation modes for touch keypad. */ -enum HbKeypadMode{ +enum HbKeypadMode { EModeAbc, /**< Display aplhanumeric keypad */ - EModeNumeric /**< Display number mode keypad */ + EModeNumeric /**< Display number mode keypad */ }; /*! @@ -232,33 +226,33 @@ HbEditorInterface, it will have an effect on some input functionality. */ enum HbInputEditorClass { - HbInputEditorClassUnknown = 0, - HbInputEditorClassEmail, - HbInputEditorClassUrl, - HbInputEditorClassUsername, - HbInputEditorClassPassword, - HbInputEditorClassPhoneNumber, - HbInputEditorClassStreetAddress, - HbInputEditorClassZipCode, - HbInputEditorClassSIPAddress, - HbInputEditorClassFirstName, - HbInputEditorClassLastName, - HbInputEditorClassFullName, - HbInputEditorClassFaxNumber, - HbInputEditorClassTitle, - HbInputEditorClassProfession, - HbInputEditorClassCity, - HbInputEditorClassDestination, - HbInputEditorClassNetworkDomain, - HbInputEditorClassNetworkName, + HbInputEditorClassUnknown = 0, + HbInputEditorClassEmail, + HbInputEditorClassUrl, + HbInputEditorClassUsername, + HbInputEditorClassPassword, + HbInputEditorClassPhoneNumber, + HbInputEditorClassStreetAddress, + HbInputEditorClassZipCode, + HbInputEditorClassSIPAddress, + HbInputEditorClassFirstName, + HbInputEditorClassLastName, + HbInputEditorClassFullName, + HbInputEditorClassFaxNumber, + HbInputEditorClassTitle, + HbInputEditorClassProfession, + HbInputEditorClassCity, + HbInputEditorClassDestination, + HbInputEditorClassNetworkDomain, + HbInputEditorClassNetworkName, - HbInputEditorClassLastItem // Keep this last, but never use. + HbInputEditorClassLastItem // Keep this last, but never use. }; /*! Enumerates primary candidate modes. */ -enum HbPrimaryCandidateMode{ +enum HbPrimaryCandidateMode { HbPrimaryCandidateModeBestPrediction, /**< Display best prediction as the primary candidate */ HbPrimaryCandidateModeExactTyping /**< Display exact typing as the primary candidate */ }; @@ -266,7 +260,7 @@ /*! Enumerates typing correction levels. */ -enum HbTypingCorrectionLevel{ +enum HbTypingCorrectionLevel { HbTypingCorrectionLevelLow, HbTypingCorrectionLevelMedium, HbTypingCorrectionLevelHigh diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputeditorinterface.cpp --- a/src/hbcore/inputfw/hbinputeditorinterface.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputeditorinterface.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,9 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputeditorinterface.h" +#include "hbinputeditorinterface_p.h" + #include #include #include @@ -29,11 +32,10 @@ #include #include -#include "hbinputeditorinterface.h" -#include "hbinputeditorinterface_p.h" #include "hbinputstandardfilters.h" #include "hbinputvkbhost.h" #include "hbabstractvkbhost.h" +#include "hbinpututils.h" /*! @alpha @@ -52,17 +54,17 @@ If the attached editor is deleted, the editor interface will start to return same values as when a null pointer is passed to the constructor. -When any of the values is changed, signal modified() is emited. +When any of the values is changed, signal modified() is emitted. */ /*! Constructs the object and attaches given editor. */ -HbEditorInterface::HbEditorInterface(QObject* editor) +HbEditorInterface::HbEditorInterface(QObject *editor) { mPrivate = HbEditorInterfacePrivateCache::instance()->attachEditor(editor, this); - connect(mPrivate, SIGNAL(destroyed(QObject*)), this, SLOT(backendDestroyed(QObject*))); + connect(mPrivate, SIGNAL(destroyed(QObject *)), this, SLOT(backendDestroyed(QObject *))); } /*! @@ -133,6 +135,10 @@ if (mPrivate) { mPrivate->lock(); mPrivate->mInputMode = inputMode; + if (mPrivate->mLastFocusedState.inputMode() != HbInputModeNone) { + // Update also the last known input state, otherwise it won't really change. + mPrivate->mLastFocusedState.setInputMode(inputMode); + } mPrivate->unlock(); HbEditorInterfacePrivateCache::instance()->notifyValueChanged(mPrivate->mHostEditor); } @@ -172,7 +178,7 @@ /*! Returns active input filter. The input framework will always run any text it produces -through the active filter before it is commited into editor buffer. +through the active filter before it is committed into editor buffer. In some cases, the input framework also automatically sets the filter to match input method hints. The default filter can still be overridden. @@ -285,8 +291,11 @@ // Remove the action first if it's already in the list int index = mPrivate->mActions.indexOf(action); - if (index >= 0) + if (index >= 0) { mPrivate->mActions.removeAt(index); + disconnect(action, SIGNAL(destroyed(QObject *)), + HbEditorInterfacePrivateCache::instance(), SLOT(actionDestroyed(QObject * object))); + } int pos = mPrivate->mActions.indexOf(before); if (pos < 0) { @@ -294,6 +303,9 @@ } mPrivate->mActions.insert(pos, action); + connect(action, SIGNAL(destroyed(QObject *)), + HbEditorInterfacePrivateCache::instance(), SLOT(actionDestroyed(QObject *))); + mPrivate->unlock(); HbEditorInterfacePrivateCache::instance()->notifyValueChanged(mPrivate->mHostEditor); } @@ -314,6 +326,8 @@ if (mPrivate) { mPrivate->lock(); mPrivate->mActions.removeAll(action); + disconnect(action, SIGNAL(destroyed(QObject *)), + HbEditorInterfacePrivateCache::instance(), SLOT(actionDestroyed(QObject * object))); mPrivate->unlock(); HbEditorInterfacePrivateCache::instance()->notifyValueChanged(mPrivate->mHostEditor); } @@ -326,9 +340,9 @@ \sa insertAction \sa removeAction */ -QList HbEditorInterface::actions() const +QList HbEditorInterface::actions() const { - QList ret; + QList ret; if (mPrivate) { mPrivate->lock(); ret = mPrivate->mActions; @@ -448,35 +462,35 @@ QObject *theEditor = editor(); if (theEditor) { - QGraphicsWidget *graphicsWidgetEditor = 0; - QWidget *widgetEditor = qobject_cast(theEditor); + QGraphicsObject *graphicsObjectEditor = 0; + QWidget *widgetEditor = qobject_cast(theEditor); if (widgetEditor) { - if (widgetEditor->graphicsProxyWidget()) { + if (QGraphicsProxyWidget *pw = HbInputUtils::graphicsProxyWidget(widgetEditor)) { HbVkbHost *host = HbVkbHost::getVkbHost(widgetEditor); if (host) { return host; } // it is a proxy widget, let graphics widget loop handle the parent chain. - graphicsWidgetEditor = widgetEditor->graphicsProxyWidget(); + graphicsObjectEditor = pw; } else { for (QWidget *parent = widgetEditor; parent; parent = parent->parentWidget()) { - HbVkbHost* host = HbVkbHost::getVkbHost(parent); + HbVkbHost *host = HbVkbHost::getVkbHost(parent); if (host) { return host; } } - return 0; // Need to add default handler here... + return new HbAbstractVkbHost(widgetEditor->window()); } } - if (!graphicsWidgetEditor) { - graphicsWidgetEditor = qobject_cast(theEditor); + if (!graphicsObjectEditor) { + graphicsObjectEditor = qobject_cast(theEditor); } - if (graphicsWidgetEditor) { - QGraphicsWidget *lastKnownParent = 0; - for (QGraphicsWidget *parent = graphicsWidgetEditor; parent; parent = parent->parentWidget()) { - HbVkbHost* host = HbVkbHost::getVkbHost(parent); + if (graphicsObjectEditor) { + QGraphicsObject *lastKnownParent = 0; + for (QGraphicsObject *parent = graphicsObjectEditor; parent; parent = parent->parentObject()) { + HbVkbHost *host = HbVkbHost::getVkbHost(parent); if (host) { return host; } @@ -496,23 +510,23 @@ /*! Returns true if this instance is attached to same editor as given instance. */ -bool HbEditorInterface::operator==(const HbEditorInterface& interface) const +bool HbEditorInterface::operator==(const HbEditorInterface &editorInterface) const { - return (mPrivate == interface.mPrivate); + return (mPrivate == editorInterface.mPrivate); } /*! Returns true if this instance is not attached to same editor as given instance. */ -bool HbEditorInterface::operator!=(const HbEditorInterface& interface) const +bool HbEditorInterface::operator!=(const HbEditorInterface &editorInterface) const { - return (mPrivate != interface.mPrivate); + return (mPrivate != editorInterface.mPrivate); } /*! Returns pointer to the editor object this interface is attached to. */ -QObject* HbEditorInterface::editor() const +QObject *HbEditorInterface::editor() const { if (mPrivate) { return mPrivate->mHostEditor; @@ -553,12 +567,12 @@ } /*! -A convinience method for setting up the editor as completing email field. +A convenience method for setting up the editor as completing email field. */ void HbEditorInterface::setUpAsCompletingEmailField() { setMode(HbInputModeNone); - setInputConstraints((HbEditorConstraint)(HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField)); + setInputConstraints(HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField); setFilter(HbEmailAddressFilter::instance()); setEditorClass(HbInputEditorClassEmail); setExtraDictionaryId(HbInputEditorClassEmail); @@ -567,12 +581,12 @@ } /*! -A convinience method for setting up the editor as completing url field. +A convenience method for setting up the editor as completing url field. */ void HbEditorInterface::setUpAsCompletingUrlField() { setMode(HbInputModeNone); - setInputConstraints((HbEditorConstraint)(HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField)); + setInputConstraints(HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField); setFilter(HbUrlFilter::instance()); setEditorClass(HbInputEditorClassUrl); setExtraDictionaryId(HbInputEditorClassUrl); @@ -581,7 +595,7 @@ } /*! -A convinience method for setting up the editor as latin alphabet editor. In this mode, the input framework +A convenience method for setting up the editor as latin alphabet editor. In this mode, the input framework will use global input language if it is naturally capable of producing latin aplhabets. Otherwise it will switch locally to english language (is is assumed that english is always available). It is also recommended that prediction is disabled in latin only editors. That's because predictive mode in @@ -614,7 +628,7 @@ */ bool HbEditorInterface::isPredictionAllowed() const { - return !(mPrivate->inputMethodHints() & Qt::ImhNoPredictiveText); + return !(mPrivate->inputMethodHints() & Qt::ImhNoPredictiveText); } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputeditorinterface.h --- a/src/hbcore/inputfw/hbinputeditorinterface.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputeditorinterface.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HB_EDITOR_INTERFACE_H -#define HB_EDITOR_INTERFACE_H +#ifndef HB_INPUT_EDITOR_INTERFACE_H +#define HB_INPUT_EDITOR_INTERFACE_H #include @@ -44,13 +44,13 @@ Q_OBJECT public: - HbEditorInterface(QObject* editor); + HbEditorInterface(QObject *editor); ~HbEditorInterface(); HbTextCase textCase() const; void setTextCase(HbTextCase textCase); - HbInputModeType mode() const; - void setMode(HbInputModeType inputMode); + HbInputModeType mode() const; + void setMode(HbInputModeType inputMode); HbEditorConstraints inputConstraints() const; void setInputConstraints(HbEditorConstraints constraints); HbInputFilter *filter() const; @@ -60,7 +60,7 @@ void addAction(HbAction *action); void insertAction(HbAction *before, HbAction *action); void removeAction(HbAction *action); - QList actions() const; + QList actions() const; int extraDictionaryId() const; void setExtraDictionaryId(int id); HbInputEditorClass editorClass() const; @@ -70,12 +70,12 @@ void lastFocusedState(HbInputState &result) const; void setLastFocusedState(const HbInputState &state); - bool operator==(const HbEditorInterface& interface) const; - bool operator!=(const HbEditorInterface& interface) const; - QObject* editor() const; + bool operator==(const HbEditorInterface &editorInterface) const; + bool operator!=(const HbEditorInterface &editorInterface) const; + QObject *editor() const; HbVkbHost *vkbHost() const; -public: // Convinience methods for setting up standard editor types. +public: // Convenience methods for setting up standard editor types. void setUpAsCompletingEmailField(); void setUpAsCompletingUrlField(); void setUpAsLatinAlphabetOnlyEditor(); @@ -103,7 +103,7 @@ Q_DISABLE_COPY(HbEditorInterface) }; -#endif // HB_EDITOR_INTERFACE_H +#endif // HB_INPUT_EDITOR_INTERFACE_H // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputeditorinterface_p.cpp --- a/src/hbcore/inputfw/hbinputeditorinterface_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputeditorinterface_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,13 +22,14 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputeditorinterface.h" +#include "hbinputeditorinterface_p.h" + #include #include #include #include #include -#include "hbinputeditorinterface_p.h" -#include "hbinputeditorinterface.h" void HbEditorInterfacePrivate::lock() { @@ -42,7 +43,7 @@ bool HbEditorInterfacePrivate::hasInterface(HbEditorInterface *toBeChecked) const { - foreach (HbEditorInterface *iFace, mAttachedInterfaces) { + foreach(HbEditorInterface *iFace, mAttachedInterfaces) { if (iFace == toBeChecked) { return true; } @@ -52,35 +53,35 @@ } void HbEditorInterfacePrivate::setInputMethodHints(Qt::InputMethodHints hints) -{ - if (mHostEditor) { - QGraphicsWidget *graphicsWidget = qobject_cast(mHostEditor); - if (graphicsWidget) { - graphicsWidget->setInputMethodHints(hints); - } else { - QWidget *widget = qobject_cast(mHostEditor); - if (widget) { +{ + if (mHostEditor) { + QGraphicsWidget *graphicsWidget = qobject_cast(mHostEditor); + if (graphicsWidget) { + graphicsWidget->setInputMethodHints(hints); + } else { + QWidget *widget = qobject_cast(mHostEditor); + if (widget) { widget->setInputMethodHints(hints); - } - } + } + } } } Qt::InputMethodHints HbEditorInterfacePrivate::inputMethodHints() const { - if (mHostEditor) { - QGraphicsWidget *graphicsWidget = qobject_cast(mHostEditor); - if (graphicsWidget) { - return graphicsWidget->inputMethodHints(); - } else { - QWidget *widget = qobject_cast(mHostEditor); - if (widget) { + if (mHostEditor) { + QGraphicsWidget *graphicsWidget = qobject_cast(mHostEditor); + if (graphicsWidget) { + return graphicsWidget->inputMethodHints(); + } else { + QWidget *widget = qobject_cast(mHostEditor); + if (widget) { return widget->inputMethodHints(); - } + } } } - return Qt::ImhNone; + return Qt::ImhNone; } void HbEditorInterfacePrivate::notifyCursorPositionChange(int oldPos, int newPos) @@ -97,7 +98,7 @@ // HbEditorInterfaceCache // -HbEditorInterfacePrivateCache* HbEditorInterfacePrivateCache::instance() +HbEditorInterfacePrivateCache *HbEditorInterfacePrivateCache::instance() { static HbEditorInterfacePrivateCache myCache; return &myCache; @@ -114,27 +115,27 @@ } } -HbEditorInterfacePrivate* HbEditorInterfacePrivateCache::attachEditor(QObject* editor, HbEditorInterface* interface) +HbEditorInterfacePrivate *HbEditorInterfacePrivateCache::attachEditor(QObject *editor, HbEditorInterface *interface) { if (editor) { for (int i = 0; i < mObjectCache.count(); i++) { if (mObjectCache[i]->mHostEditor == editor) { if (!mObjectCache[i]->hasInterface(interface)) { mObjectCache[i]->mAttachedInterfaces.append(interface); - connect(interface, SIGNAL(destroyed(QObject*)), this, SLOT(interfaceDestroyed(QObject*))); + connect(interface, SIGNAL(destroyed(QObject *)), this, SLOT(interfaceDestroyed(QObject *))); connect(mObjectCache[i], SIGNAL(cursorPositionChanged(int, int)), interface, SIGNAL(cursorPositionChanged(int, int))); } return mObjectCache[i]; } } - HbEditorInterfacePrivate* newItem = new HbEditorInterfacePrivate(); + HbEditorInterfacePrivate *newItem = new HbEditorInterfacePrivate(); newItem->mHostEditor = editor; newItem->mAttachedInterfaces.append(interface); mObjectCache.append(newItem); - connect(editor, SIGNAL(destroyed(QObject*)), this, SLOT(destroyed(QObject*))); - connect(interface, SIGNAL(destroyed(QObject*)), this, SLOT(interfaceDestroyed(QObject*))); + connect(editor, SIGNAL(destroyed(QObject *)), this, SLOT(destroyed(QObject *))); + connect(interface, SIGNAL(destroyed(QObject *)), this, SLOT(interfaceDestroyed(QObject *))); connect(newItem, SIGNAL(cursorPositionChanged(int, int)), interface, SIGNAL(cursorPositionChanged(int, int))); // Check whether the connected object is a QLineEdit or QTextEdit, plain or wrapped in QGraphicsProxyWidget @@ -142,26 +143,26 @@ if (editor->inherits("HbAbstractEdit")) { connect(editor, SIGNAL(cursorPositionChanged(int, int)), newItem, SIGNAL(cursorPositionChanged(int, int))); } else { - QGraphicsProxyWidget* proxywidget = qobject_cast(editor); + QGraphicsProxyWidget *proxywidget = qobject_cast(editor); if (proxywidget) { - QWidget* editorwidget = proxywidget->widget(); - QLineEdit* lineedit = qobject_cast(editorwidget); + QWidget *editorwidget = proxywidget->widget(); + QLineEdit *lineedit = qobject_cast(editorwidget); if (lineedit) { - connect(lineedit, SIGNAL(cursorPositionChanged(int, int)), newItem, SIGNAL(cursorPositionChanged(int, int))); + connect(lineedit, SIGNAL(cursorPositionChanged(int, int)), newItem, SIGNAL(cursorPositionChanged(int, int))); } else { - QTextEdit* textedit = qobject_cast(editorwidget); + QTextEdit *textedit = qobject_cast(editorwidget); if (textedit) { - connect(textedit, SIGNAL(cursorPositionChanged()), newItem, SLOT(cursorPositionChanged())); + connect(textedit, SIGNAL(cursorPositionChanged()), newItem, SLOT(cursorPositionChanged())); } } } else { - QLineEdit* lineedit = qobject_cast(editor); + QLineEdit *lineedit = qobject_cast(editor); if (lineedit) { - connect(lineedit, SIGNAL(cursorPositionChanged(int, int)), newItem, SIGNAL(cursorPositionChanged(int, int))); + connect(lineedit, SIGNAL(cursorPositionChanged(int, int)), newItem, SIGNAL(cursorPositionChanged(int, int))); } else { - QTextEdit* textedit = qobject_cast(editor); + QTextEdit *textedit = qobject_cast(editor); if (textedit) { - connect(textedit, SIGNAL(cursorPositionChanged()), newItem, SLOT(cursorPositionChanged())); + connect(textedit, SIGNAL(cursorPositionChanged()), newItem, SLOT(cursorPositionChanged())); } } } @@ -173,7 +174,7 @@ return 0; } -void HbEditorInterfacePrivateCache::destroyed(QObject* object) +void HbEditorInterfacePrivateCache::destroyed(QObject *object) { for (int i = 0; i < mObjectCache.count(); i++) { if (mObjectCache[i]->mHostEditor == object) { @@ -184,7 +185,7 @@ } } -void HbEditorInterfacePrivateCache::interfaceDestroyed(QObject* object) +void HbEditorInterfacePrivateCache::interfaceDestroyed(QObject *object) { for (int i = 0; i < mObjectCache.count(); i++) { for (int j = 0; j < mObjectCache[i]->mAttachedInterfaces.count(); j++) { @@ -196,10 +197,23 @@ } } -void HbEditorInterfacePrivateCache::notifyValueChanged(QObject* editor) +void HbEditorInterfacePrivateCache::actionDestroyed(QObject *object) +{ + foreach(HbEditorInterfacePrivate *editorInterfacePrivate, mObjectCache) { + HbAction *action = static_cast(object); + if (editorInterfacePrivate->mActions.contains(action)) { + editorInterfacePrivate->mActions.removeAll(action); + foreach(HbEditorInterface *editorInterface, editorInterfacePrivate->mAttachedInterfaces) { + editorInterface->backendModified(); + } + } + } +} + +void HbEditorInterfacePrivateCache::notifyValueChanged(QObject *editor) { for (int i = 0; i < mObjectCache.count(); i++) { - if (mObjectCache[i]->mHostEditor == editor) { + if (mObjectCache[i]->mHostEditor == editor) { for (int j = 0; j < mObjectCache[i]->mAttachedInterfaces.count(); j++) { mObjectCache[i]->mAttachedInterfaces[j]->backendModified(); } @@ -208,7 +222,7 @@ } } -bool HbEditorInterfacePrivateCache::isConnected(QObject* object) +bool HbEditorInterfacePrivateCache::isConnected(QObject *object) { for (int i = 0; i < mObjectCache.count(); i++) { if (mObjectCache[i]->mHostEditor == object) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputeditorinterface_p.h --- a/src/hbcore/inputfw/hbinputeditorinterface_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputeditorinterface_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HB_EDITOR_INTERFACE_PRIVATE_H -#define HB_EDITOR_INTERFACE_PRIVATE_H +#ifndef HB_INPUT_EDITOR_INTERFACE_P_H +#define HB_INPUT_EDITOR_INTERFACE_P_H #include #include @@ -50,13 +50,12 @@ public: HbEditorInterfacePrivate() : mInputMode(0), - mTextCase(HbTextCaseNone), - mConstraints(0), - mLocalDigitType(HbDigitTypeNone), - mExtraDictionaryId(0), - mClass(0), - mHostEditor(0) - { + mTextCase(HbTextCaseNone), + mConstraints(0), + mLocalDigitType(HbDigitTypeNone), + mExtraDictionaryId(0), + mClass(0), + mHostEditor(0) { } void lock(); @@ -75,10 +74,10 @@ int mExtraDictionaryId; int mClass; HbSmileyTheme mSmileyTheme; - QObject* mHostEditor; - QList mAttachedInterfaces; + QObject *mHostEditor; + QList mAttachedInterfaces; HbInputState mLastFocusedState; - QList mActions; + QList mActions; public slots: void cursorPositionChanged(); @@ -96,28 +95,29 @@ Q_OBJECT public: - static HbEditorInterfacePrivateCache* instance(); + static HbEditorInterfacePrivateCache *instance(); private: HbEditorInterfacePrivateCache(); ~HbEditorInterfacePrivateCache(); public: - HbEditorInterfacePrivate* attachEditor(QObject* editor, HbEditorInterface* interface); - bool isConnected(QObject* object); + HbEditorInterfacePrivate *attachEditor(QObject *editor, HbEditorInterface *interface); + bool isConnected(QObject *object); void notifyValueChanged(QObject *editor); public slots: - void destroyed(QObject* object); - void interfaceDestroyed(QObject* object); + void destroyed(QObject *object); + void interfaceDestroyed(QObject *object); + void actionDestroyed(QObject *object); private: - QVector mObjectCache; + QVector mObjectCache; }; /// @endcond -#endif // HB_EDITOR_INTERFACE_PRIVATE_H +#endif // HB_INPUT_EDITOR_INTERFACE_P_H // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputextradictionarycollection.cpp --- a/src/hbcore/inputfw/hbinputextradictionarycollection.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputextradictionarycollection.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,9 +22,10 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputextradictionarycollection.h" + #include "hbinputextrauserdictionary.h" #include "hbinputextradictionaryfactory.h" -#include "hbinputextradictionarycollection.h" /*! @proto @@ -55,21 +56,29 @@ void addDictionaries(QList& newOnes); void addDictionary(int newId); - void addDictionary(HbExtraUserDictionary* newOne); + void addDictionary(HbExtraUserDictionary *newOne); void removeDictionary(int dictId); - void removeDictionary(HbExtraUserDictionary* dict); + void removeDictionary(HbExtraUserDictionary *dict); bool isAlreadyInList(int dictId) const; - int isDisabled(int index) const { return ((0x0001 << index) & deactivated); } - void enable(int index) { deactivated &= !(0x0001 << index); } - void disable(int index) { deactivated |= (0x0001 << index); } + int isDisabled(int index) const { + return ((0x0001 << index) & deactivated); + } + + void enable(int index) { + deactivated &= !(0x0001 << index); + } + + void disable(int index) { + deactivated |= (0x0001 << index); + } int dictionaryIndex(int id) const; public: - QList dictionaries; + QList dictionaries; unsigned short deactivated; // Bit vector }; @@ -104,10 +113,10 @@ } } -void HbExtraDictionaryCollectionPrivate::addDictionary(HbExtraUserDictionary* newOne) +void HbExtraDictionaryCollectionPrivate::addDictionary(HbExtraUserDictionary *newOne) { if (newOne && !isAlreadyInList(newOne->id())) { - dictionaries.append(newOne); + dictionaries.append(newOne); } } @@ -116,11 +125,11 @@ int index = dictionaryIndex(dictId); if (index >= 0) { dictionaries.removeAt(index); - + } } -void HbExtraDictionaryCollectionPrivate::removeDictionary(HbExtraUserDictionary* dict) +void HbExtraDictionaryCollectionPrivate::removeDictionary(HbExtraUserDictionary *dict) { for (int i = 0; i < dictionaries.count(); i++) { if (dictionaries[i] == dict) { @@ -167,7 +176,7 @@ HbExtraDictionaryCollection::HbExtraDictionaryCollection(QList dictionaries) : d_ptr(new HbExtraDictionaryCollectionPrivate) { Q_D(HbExtraDictionaryCollection); - d->addDictionaries(dictionaries); + d->addDictionaries(dictionaries); } /*! @@ -180,18 +189,18 @@ /*! Adds given dictionary to the collection if it is avaivale. Uses HbExtraDictionaryFactory -for loading the dictionary. Returns true if dictionary was found and succesfully added. +for loading the dictionary. Returns true if dictionary was found and succesfully added. */ bool HbExtraDictionaryCollection::addDictionary(int id) { - Q_D(HbExtraDictionaryCollection); + Q_D(HbExtraDictionaryCollection); - if (d->dictionaries.count() < HbMaxDictionariesInCollection) { - d->addDictionary(id); - return true; - } + if (d->dictionaries.count() < HbMaxDictionariesInCollection) { + d->addDictionary(id); + return true; + } - return false; + return false; } /*! @@ -199,14 +208,14 @@ */ bool HbExtraDictionaryCollection::addDictionary(HbExtraUserDictionary *dictionary) { - Q_D(HbExtraDictionaryCollection); + Q_D(HbExtraDictionaryCollection); - if (d->dictionaries.count() < HbMaxDictionariesInCollection) { - d->addDictionary(dictionary); - return true; - } + if (d->dictionaries.count() < HbMaxDictionariesInCollection) { + d->addDictionary(dictionary); + return true; + } - return false; + return false; } /*! @@ -214,8 +223,8 @@ */ void HbExtraDictionaryCollection::removeDictionary(int id) { - Q_D(HbExtraDictionaryCollection); - d->removeDictionary(id); + Q_D(HbExtraDictionaryCollection); + d->removeDictionary(id); } /*! @@ -223,8 +232,8 @@ */ void HbExtraDictionaryCollection::removeDictionary(HbExtraUserDictionary *dictionary) { - Q_D(HbExtraDictionaryCollection); - d->removeDictionary(dictionary); + Q_D(HbExtraDictionaryCollection); + d->removeDictionary(dictionary); } /*! @@ -239,7 +248,7 @@ for (int i = 0; i < d->dictionaries.count(); i++) { results.append(d->dictionaries[i]->id()); - } + } return QList(results); } @@ -272,7 +281,7 @@ int ret = 0; for (int i = 0; i < d->dictionaries.count(); i++) { - ret += d->dictionaries[i]->numberOfWords(); + ret += d->dictionaries[i]->numberOfWords(); } return ret; @@ -284,7 +293,7 @@ Search is case insensitive. Only enabled dictionaries are part of the search. Empty string will match to all words. */ -QStringList HbExtraDictionaryCollection::findMatches(const QString& aSearchString, Qt::CaseSensitivity caseSensitivity) +QStringList HbExtraDictionaryCollection::findMatches(const QString &aSearchString, Qt::CaseSensitivity caseSensitivity) { Q_D(HbExtraDictionaryCollection); @@ -302,7 +311,7 @@ /*! Diables given dictionary, but still keeps it as part of the collection. All access and search operators will skip disabled dictionary until it is -enabled again. +enabled again. \sa enableDictionary */ @@ -312,7 +321,7 @@ int index = d->dictionaryIndex(id); if (index >= 0) { - d->disable(index); + d->disable(index); } } @@ -321,13 +330,13 @@ \sa disableDictionary */ -void HbExtraDictionaryCollection::enableDictionary(int id) +void HbExtraDictionaryCollection::enableDictionary(int id) { Q_D(HbExtraDictionaryCollection); int index = d->dictionaryIndex(id); if (index >= 0) { - d->enable(index); + d->enable(index); } } @@ -340,9 +349,9 @@ int index = d->dictionaryIndex(dictionaryId); if (index >= 0) { - return d->isDisabled(index); + return d->isDisabled(index); } - + return false; } @@ -372,7 +381,7 @@ /*! Returns true if given word exists in any of the active dictionaries in the collection. */ -bool HbExtraDictionaryCollection::hasWord(const QString& word) const +bool HbExtraDictionaryCollection::hasWord(const QString &word) const { Q_D(const HbExtraDictionaryCollection); @@ -391,7 +400,7 @@ Increments use count (frequency) for given word. Applied to all the instances of given word in enabled part of the collection. */ -void HbExtraDictionaryCollection::incrementUseCount(const QString& word) +void HbExtraDictionaryCollection::incrementUseCount(const QString &word) { Q_D(const HbExtraDictionaryCollection); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputextradictionarycollection.h --- a/src/hbcore/inputfw/hbinputextradictionarycollection.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputextradictionarycollection.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,9 +27,12 @@ #define HB_INPUT_EXTRA_DICTIONARY_COLLECTION_H #include +#include +#include class HbExtraDictionaryCollectionPrivate; class HbExtraUserDictionary; +class QStringList; const int HbMaxDictionariesInCollection = 16; @@ -57,13 +60,13 @@ int totalNumberOfWords() const; QString wordAt(int index) const; - QStringList findMatches(const QString& searchString, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive); + QStringList findMatches(const QString &searchString, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive); - bool hasWord(const QString& word) const; - void incrementUseCount(const QString& word); + bool hasWord(const QString &word) const; + void incrementUseCount(const QString &word); protected: - HbExtraDictionaryCollectionPrivate* const d_ptr; + HbExtraDictionaryCollectionPrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbExtraDictionaryCollection) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputextradictionaryfactory.cpp --- a/src/hbcore/inputfw/hbinputextradictionaryfactory.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputextradictionaryfactory.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,11 +22,12 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputextradictionaryfactory.h" + #include #include "hbinputsettingproxy.h" #include "hbinputextrauserdictionary.h" -#include "hbinputextradictionaryfactory.h" /*! @proto @@ -48,14 +49,14 @@ void shutdown(); public: - HbExtraDictionaryFactory* q_ptr; - QList instances; + HbExtraDictionaryFactory *q_ptr; + QList instances; }; void HbExtraDictionaryFactoryPrivate::shutdown() { - Q_FOREACH(const HbExtraUserDictionary* instance, instances) { + Q_FOREACH(const HbExtraUserDictionary *instance, instances) { delete instance; } @@ -65,11 +66,11 @@ /// @endcond /*! -Returns pointer to the singleton instance. +Returns pointer to the singleton instance. */ HbExtraDictionaryFactory *HbExtraDictionaryFactory::instance() { - static HbExtraDictionaryFactory singletonInstance; + static HbExtraDictionaryFactory singletonInstance; return &singletonInstance; } @@ -103,7 +104,7 @@ { Q_D(HbExtraDictionaryFactory); - foreach (HbExtraUserDictionary* dictPtr, d->instances) { + foreach(HbExtraUserDictionary *dictPtr, d->instances) { if (dictPtr->id() == dictionaryId) { return dictPtr; } @@ -119,12 +120,12 @@ if (newDb->isAlreadyInMemory()) { newDb->attach(); d->instances.append(newDb); - return newDb; + return newDb; } if (newDb->attach()) { // Not available in memory, try to load from permanent memory. - if (newDb->load(newDb->fileName())) { + if (newDb->load(newDb->fileName())) { d->instances.append(newDb); return newDb; } @@ -137,16 +138,16 @@ /*! Creates dictionary if it doesn't already exists. If initialContent is given, new dictionary will be filled with it. If a dictionary for given id already exists, it is returned and initialContent -is discarded. +is discarded. */ -HbExtraUserDictionary *HbExtraDictionaryFactory::createDictionary(int dictionaryId, const QStringList& initialContent) -{ +HbExtraUserDictionary *HbExtraDictionaryFactory::createDictionary(int dictionaryId, const QStringList &initialContent) +{ Q_D(HbExtraDictionaryFactory); HbExtraUserDictionary *newDb = existingDictionary(dictionaryId); if (newDb == 0) { newDb = new HbExtraUserDictionary; - newDb->setId(dictionaryId); + newDb->setId(dictionaryId); if (!newDb->attach()) { delete newDb; return 0; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputextradictionaryfactory.h --- a/src/hbcore/inputfw/hbinputextradictionaryfactory.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputextradictionaryfactory.h Thu Jul 22 16:36:53 2010 +0100 @@ -48,13 +48,13 @@ static HbExtraDictionaryFactory *instance(); HbExtraUserDictionary *existingDictionary(int dictionaryId); - HbExtraUserDictionary *createDictionary(int dictionaryId, const QStringList& initialContent = QStringList()); + HbExtraUserDictionary *createDictionary(int dictionaryId, const QStringList &initialContent = QStringList()); public slots: void shutdown(); protected: - HbExtraDictionaryFactoryPrivate* const d_ptr; + HbExtraDictionaryFactoryPrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbExtraDictionaryFactory) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputextrauserdictionary.cpp --- a/src/hbcore/inputfw/hbinputextrauserdictionary.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputextrauserdictionary.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,9 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputextrauserdictionary.h" +#include "hbinputextrauserdictionary_p.h" + #include // For memmove() #include @@ -29,8 +32,6 @@ #include #include -#include "hbinputextrauserdictionary.h" -#include "hbinputextrauserdictionary_p.h" #include "hbinputsettingproxy.h" const int HbExtraDictMaxFrequency = 255; @@ -65,17 +66,17 @@ bool HbExtraUserDictionaryPrivate::createSharedBlock(int aSize) { - if (sharedMemory.isAttached()) { - return true; - } + if (sharedMemory.isAttached()) { + return true; + } - if (id == 0) { - return false; - } + if (id == 0) { + return false; + } - sharedMemory.setKey(name()); + sharedMemory.setKey(name()); - if (!sharedMemory.attach()) { + if (!sharedMemory.attach()) { if (sharedMemory.error() != QSharedMemory::NotFound) { qDebug("HbExtraUserDictionaryPrivate: QSharedMemory::attached returned error %d", sharedMemory.error()); return false; @@ -90,10 +91,10 @@ dataHeader()->numUsers = 0; dataHeader()->modified = false; dataHeader()->dataSize = 0; - } + } - dataHeader()->numUsers++; - return true; + dataHeader()->numUsers++; + return true; } QString HbExtraUserDictionaryPrivate::name() const @@ -111,21 +112,21 @@ bool HbExtraUserDictionaryPrivate::save(QString fileName) { - QFile file(fileName); - if (file.open( QIODevice::WriteOnly )) { - file.write((char*)&id, sizeof(int)); - if (sharedMemory.isAttached()) { - file.write((char*)sharedMemory.data(), KExtraUDBlockSize); - } - file.close(); - dataHeader()->modified = false; - return true; - } + QFile file(fileName); + if (file.open(QIODevice::WriteOnly)) { + file.write((char *)&id, sizeof(int)); + if (sharedMemory.isAttached()) { + file.write((char *)sharedMemory.data(), KExtraUDBlockSize); + } + file.close(); + dataHeader()->modified = false; + return true; + } - return false; + return false; } -int HbExtraUserDictionaryPrivate::findFirstMatch(int start, int end, const QString& searchString, int knownMatch, Qt::CaseSensitivity caseSensitivity) const +int HbExtraUserDictionaryPrivate::findFirstMatch(int start, int end, const QString &searchString, int knownMatch, Qt::CaseSensitivity caseSensitivity) const { HbExtraUDDirectoryEntry *dir = directory(); QChar *data = dataArea(); @@ -141,7 +142,7 @@ if (QString(&data[dir[half].start], dir[half].length).startsWith(searchString, Qt::CaseInsensitive)) { knownMatch = half; return findFirstMatch(start, half, searchString, knownMatch, caseSensitivity); - } + } if (compareWords(half, searchString, caseSensitivity) > 0) { return findFirstMatch(half + 1, end, searchString, knownMatch, caseSensitivity); @@ -163,7 +164,7 @@ memmove((char *)&dir[index], (char *)&dir[index + 1], (dataHeader()->numWords - index) * sizeof(HbExtraUDDirectoryEntry) + start * sizeof(QChar)); // Then move trailing part of the data area. - memmove(((char*)&data[start]) - sizeof(HbExtraUDDirectoryEntry), (char*)&data[start + length], (dataHeader()->dataSize - (start + length)) * 2); + memmove(((char *)&data[start]) - sizeof(HbExtraUDDirectoryEntry), (char *)&data[start + length], (dataHeader()->dataSize - (start + length)) * 2); // Update word count. dataHeader()->numWords--; @@ -173,11 +174,11 @@ // Then update remaining dictionary entries. const int rounds = dataHeader()->numWords; for (int i = index; i < rounds; i++) { - dir[i].start -= length; + dir[i].start -= length; } } -void HbExtraUserDictionaryPrivate::addEntry(int index, const QString& newWord) +void HbExtraUserDictionaryPrivate::addEntry(int index, const QString &newWord) { HbExtraUDDirectoryEntry *dir = directory(); QChar *data = dataArea(); @@ -186,20 +187,20 @@ if (origNumWords > 0) { if (index < origNumWords) { // First move the trailing part of the data area to make space for the new word. - memmove((char*)&data[dir[index].start + newWord.size()] + sizeof(HbExtraUDDirectoryEntry), - (char*)(&data[dir[index].start]), + memmove((char *)&data[dir[index].start + newWord.size()] + sizeof(HbExtraUDDirectoryEntry), + (char *)(&data[dir[index].start]), (dataHeader()->dataSize - dir[index].start) * 2); // Then move the trailing part of the dictionary and the leading part of the data area. - memmove((char*)(&dir[index + 1]), - (char*)(&dir[index]), + memmove((char *)(&dir[index + 1]), + (char *)(&dir[index]), ((dataHeader()->numWords - index) * sizeof(HbExtraUDDirectoryEntry)) + (dir[index].start * 2)); } else { // This will be the last one. Just make room for new directory entry. - memmove((char*)data + sizeof(HbExtraUDDirectoryEntry), - (char*)data, + memmove((char *)data + sizeof(HbExtraUDDirectoryEntry), + (char *)data, dataHeader()->dataSize * 2); - } + } } // Update word count. @@ -225,11 +226,11 @@ // Then update remaining dictionary entries. const int rounds = dataHeader()->numWords; for (int i = index + 1; i < rounds; i++) { - dir[i].start += newWord.size(); + dir[i].start += newWord.size(); } } -int HbExtraUserDictionaryPrivate::findWord(int startIndex, int endIndex, const QString& newWord, Qt::CaseSensitivity caseSensitivity) const +int HbExtraUserDictionaryPrivate::findWord(int startIndex, int endIndex, const QString &newWord, Qt::CaseSensitivity caseSensitivity) const { if (startIndex >= endIndex) { if (startIndex < dataHeader()->numWords && compareWords(startIndex, newWord, caseSensitivity) == 0) { @@ -250,7 +251,7 @@ } } -int HbExtraUserDictionaryPrivate::findIndexForNewWord(int start, int end, const QString& newWord) const +int HbExtraUserDictionaryPrivate::findIndexForNewWord(int start, int end, const QString &newWord) const { if (start >= end) { if (dataHeader()->numWords == 0) { @@ -275,38 +276,38 @@ } } -int HbExtraUserDictionaryPrivate::compareWords(int index, const QString& otherWord, Qt::CaseSensitivity caseSensitivity) const +int HbExtraUserDictionaryPrivate::compareWords(int index, const QString &otherWord, Qt::CaseSensitivity caseSensitivity) const { HbExtraUDDirectoryEntry *dir = directory(); QChar *data = dataArea(); const int start = dir[index].start; const int rounds = (dir[index].length > otherWord.size() ? otherWord.size() : dir[index].length); - if (caseSensitivity == Qt::CaseSensitive) { - for (int i = 0; i < rounds; i++) { - if (data[start + i] == otherWord[i]) { - continue; - } + if (caseSensitivity == Qt::CaseSensitive) { + for (int i = 0; i < rounds; i++) { + if (data[start + i] == otherWord[i]) { + continue; + } - if (otherWord[i] > data[start + i]) { - return 1; - } + if (otherWord[i] > data[start + i]) { + return 1; + } - return -1; - } - } else { - for (int i = 0; i < rounds; i++) { - if (data[start + i].toCaseFolded() == otherWord[i].toCaseFolded()) { - continue; - } + return -1; + } + } else { + for (int i = 0; i < rounds; i++) { + if (data[start + i].toCaseFolded() == otherWord[i].toCaseFolded()) { + continue; + } - if (otherWord[i].toCaseFolded() > data[start + i].toCaseFolded()) { - return 1; - } + if (otherWord[i].toCaseFolded() > data[start + i].toCaseFolded()) { + return 1; + } - return -1; - } + return -1; } + } if (dir[index].length == otherWord.size()) { return 0; // Match! @@ -319,7 +320,7 @@ return -1; } -bool HbExtraUserDictionaryPrivate::hasEnoughSpaceForNewWord(const QString& newWord) const +bool HbExtraUserDictionaryPrivate::hasEnoughSpaceForNewWord(const QString &newWord) const { if ((unsigned int)dataAreaSize() - (dataHeader()->dataSize * 2) >= (newWord.size() * 2) + sizeof(HbExtraUDDirectoryEntry)) { return true; @@ -377,13 +378,13 @@ /*! Adds single word to the database. Returns true if there was enough space for new -word and the word was succesfully added. Returns false if word already +word and the word was successfully added. Returns false if word already exists. \sa addWords \sa removeWord */ -bool HbExtraUserDictionary::addWord(const QString& newWord, HbPredictionCallback* callback) +bool HbExtraUserDictionary::addWord(const QString &newWord, HbPredictionCallback *callback) { Q_UNUSED(callback); Q_D(HbExtraUserDictionary); @@ -399,12 +400,12 @@ if (newWord.size() < KExtraUserDictionaryMaxWordLength && d->hasEnoughSpaceForNewWord(newWord) && d->dataHeader()->numWords < KExtraUserDictionaryMaxWords) { - int newIndex = d->findIndexForNewWord(0, d->dataHeader()->numWords - 1, newWord); - d->addEntry(newIndex, newWord); + int newIndex = d->findIndexForNewWord(0, d->dataHeader()->numWords - 1, newWord); + d->addEntry(newIndex, newWord); - d->unlock(); - return true; - } + d->unlock(); + return true; + } d->unlock(); return false; @@ -417,7 +418,7 @@ \sa addWord \sa removeWord */ -bool HbExtraUserDictionary::addWords(const QStringList& wordList) +bool HbExtraUserDictionary::addWords(const QStringList &wordList) { bool ret = true; @@ -434,7 +435,7 @@ \sa addWord \sa addWords */ -bool HbExtraUserDictionary::removeWord(const QString& toBeRemoved) +bool HbExtraUserDictionary::removeWord(const QString &toBeRemoved) { Q_D(HbExtraUserDictionary); @@ -442,9 +443,9 @@ int index = d->findWord(0, d->dataHeader()->numWords - 1, toBeRemoved, Qt::CaseInsensitive); if (index >= 0) { - d->removeEntry(index); - d->unlock(); - return true; + d->removeEntry(index); + d->unlock(); + return true; } d->unlock(); @@ -517,7 +518,7 @@ Returns all the dictionary words that begin with contents of searchString. Search is case insensitive. Empty string will match to all words. */ -QStringList HbExtraUserDictionary::findMatches(const QString& searchString, bool sortByFrequency, Qt::CaseSensitivity caseSensitivity) +QStringList HbExtraUserDictionary::findMatches(const QString &searchString, bool sortByFrequency, Qt::CaseSensitivity caseSensitivity) { Q_UNUSED(caseSensitivity); // Will be taken into use... Q_D(HbExtraUserDictionary); @@ -572,7 +573,7 @@ /*! Returns pointer to host prediction engine. */ -HbPredictionBase* HbExtraUserDictionary::hostEngine() const +HbPredictionBase *HbExtraUserDictionary::hostEngine() const { Q_D(const HbExtraUserDictionary); return d->hostEngine; @@ -581,7 +582,7 @@ /*! Sets host prediction engine. */ -void HbExtraUserDictionary::setHostEngine(HbPredictionBase* host) +void HbExtraUserDictionary::setHostEngine(HbPredictionBase *host) { Q_D(HbExtraUserDictionary); d->hostEngine = host; @@ -590,31 +591,31 @@ /*! Loads dictionary from disk. */ -bool HbExtraUserDictionary::load(const QString& nameOfTheFile) +bool HbExtraUserDictionary::load(const QString &nameOfTheFile) { - Q_D(HbExtraUserDictionary); + Q_D(HbExtraUserDictionary); - QString realFileName = nameOfTheFile; - if (realFileName.size() == 0) { - realFileName = fileName(); - } + QString realFileName = nameOfTheFile; + if (realFileName.size() == 0) { + realFileName = fileName(); + } - if (attach()) { - d->lock(); - QFile file(realFileName); - if (file.open( QIODevice::ReadOnly )) { - int numUsers = d->dataHeader()->numUsers; - file.read((char*)&d->id, sizeof(int)); - file.read((char*)d->sharedMemory.data(), KExtraUDBlockSize); - file.close(); - d->dataHeader()->numUsers = numUsers; - d->unlock(); - return true; - } - d->unlock(); - } + if (attach()) { + d->lock(); + QFile file(realFileName); + if (file.open(QIODevice::ReadOnly)) { + int numUsers = d->dataHeader()->numUsers; + file.read((char *)&d->id, sizeof(int)); + file.read((char *)d->sharedMemory.data(), KExtraUDBlockSize); + file.close(); + d->dataHeader()->numUsers = numUsers; + d->unlock(); + return true; + } + d->unlock(); + } - return false; + return false; } /*! @@ -623,21 +624,21 @@ \sa fileName */ -bool HbExtraUserDictionary::save(const QString& nameOfTheFile) +bool HbExtraUserDictionary::save(const QString &nameOfTheFile) { - Q_D(HbExtraUserDictionary); + Q_D(HbExtraUserDictionary); - QString realFileName = nameOfTheFile; - if (realFileName.size() == 0) { - realFileName = fileName(); - } + QString realFileName = nameOfTheFile; + if (realFileName.size() == 0) { + realFileName = fileName(); + } - bool ret = false; - d->lock(); - ret = d->save(realFileName); - d->unlock(); + bool ret = false; + d->lock(); + ret = d->save(realFileName); + d->unlock(); - return ret; + return ret; } /*! @@ -707,7 +708,7 @@ \sa rawDataAreaSize \sa directory */ -QChar* HbExtraUserDictionary::rawDataArea() const +QChar *HbExtraUserDictionary::rawDataArea() const { Q_D(const HbExtraUserDictionary); return d->dataArea(); @@ -760,7 +761,7 @@ /*! Increases word frequency counter for given word if it is in the dictionary. */ -void HbExtraUserDictionary::incrementUseCount(const QString& word) +void HbExtraUserDictionary::incrementUseCount(const QString &word) { Q_D(const HbExtraUserDictionary); @@ -771,38 +772,38 @@ if (first >= 0 && dir[first].frequency < HbExtraDictMaxFrequency) { dir[first].frequency++; d->dataHeader()->modified = true; - } } + } } /*! Returns true if given word exits in the dictionary. */ -bool HbExtraUserDictionary::hasWord(const QString& word, Qt::CaseSensitivity caseSensitivity) const +bool HbExtraUserDictionary::hasWord(const QString &word, Qt::CaseSensitivity caseSensitivity) const { Q_D(const HbExtraUserDictionary); if (d->dataHeader()->numWords) { QChar *data = d->dataArea(); HbExtraUDDirectoryEntry *dir = d->directory(); - int first = d->findFirstMatch(0, d->dataHeader()->numWords - 1, word,-1, caseSensitivity); - if (first >= 0) { - if (caseSensitivity == Qt::CaseSensitive) { - if (QString(&data[dir[first].start], dir[first].length) == word) { - return true; - } + int first = d->findFirstMatch(0, d->dataHeader()->numWords - 1, word, -1, caseSensitivity); + if (first >= 0) { + if (caseSensitivity == Qt::CaseSensitive) { + if (QString(&data[dir[first].start], dir[first].length) == word) { + return true; + } - const int rounds = d->dataHeader()->numWords; - for (int i = first + 1; i <= rounds; i++) { - QString candidate(&data[dir[i].start], dir[i].length); - if (candidate.startsWith(word, Qt::CaseInsensitive)) { - if (candidate == word) { - return true; - } - } else { - break; - } + const int rounds = d->dataHeader()->numWords; + for (int i = first + 1; i <= rounds; i++) { + QString candidate(&data[dir[i].start], dir[i].length); + if (candidate.startsWith(word, Qt::CaseInsensitive)) { + if (candidate == word) { + return true; + } + } else { + break; } + } } else { if (QString(&data[dir[first].start], dir[first].length).toCaseFolded() == word.toCaseFolded()) { return true; @@ -818,7 +819,7 @@ break; } } - } + } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputextrauserdictionary.h --- a/src/hbcore/inputfw/hbinputextrauserdictionary.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputextrauserdictionary.h Thu Jul 22 16:36:53 2010 +0100 @@ -63,28 +63,28 @@ public: // from HbUserDictionary int id() const; - bool addWord(const QString& newWord, HbPredictionCallback* callback = 0); - bool addWords(const QStringList& wordList); - bool removeWord(const QString& toBeRemoved); + bool addWord(const QString &newWord, HbPredictionCallback *callback = 0); + bool addWords(const QStringList &wordList); + bool removeWord(const QString &toBeRemoved); int numberOfWords() const; QStringList listWords(); void clear(); - HbPredictionBase* hostEngine() const; + HbPredictionBase *hostEngine() const; public: QString wordAt(int index) const; - QStringList findMatches(const QString& searchString, bool sortByFrequency = false, Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive); - bool hasWord(const QString& word, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) const; + QStringList findMatches(const QString &searchString, bool sortByFrequency = false, Qt::CaseSensitivity caseSensitivity = Qt::CaseInsensitive); + bool hasWord(const QString &word, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) const; - void setHostEngine(HbPredictionBase* host); - bool load(const QString& nameOfTheFile = QString()); - bool save(const QString& nameOfTheFile = QString()); + void setHostEngine(HbPredictionBase *host); + bool load(const QString &nameOfTheFile = QString()); + bool save(const QString &nameOfTheFile = QString()); void setId(int dbId); bool isAlreadyInMemory() const; bool attach(); QString name(); QString fileName(); - void incrementUseCount(const QString& word); + void incrementUseCount(const QString &word); public: QChar *rawDataArea() const; @@ -92,7 +92,7 @@ HbExtraUDDirectoryEntry *directory() const; protected: - HbExtraUserDictionaryPrivate* const d_ptr; + HbExtraUserDictionaryPrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbExtraUserDictionary) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputextrauserdictionary_p.h --- a/src/hbcore/inputfw/hbinputextrauserdictionary_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputextrauserdictionary_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -53,7 +53,7 @@ { public: HbExtraUDHeader() : numUsers(0), numWords(0), modified(false), dataSize(0) - {} + {} public: int numUsers; @@ -67,46 +67,51 @@ { public: HbExtraUserDictionaryPrivate() : id(0), hostEngine(0) - {} + {} - bool createSharedBlock(int aSize); - QString name() const; - QString fileName() const; + bool createSharedBlock(int aSize); + QString name() const; + QString fileName() const; - void removeEntry(int index); - void addEntry(int index, const QString& newWord); + void removeEntry(int index); + void addEntry(int index, const QString &newWord); - HbExtraUDDirectoryEntry *directory() const { - return (HbExtraUDDirectoryEntry*)((char*)sharedMemory.data() + sizeof(HbExtraUDHeader)); - } + HbExtraUDDirectoryEntry *directory() const { + return (HbExtraUDDirectoryEntry *)((char *)sharedMemory.data() + sizeof(HbExtraUDHeader)); + } - QChar *dataArea() const { - return (QChar*)((char*)sharedMemory.data() + sizeof(HbExtraUDHeader) + (dataHeader()->numWords * sizeof(HbExtraUDDirectoryEntry))); - } + QChar *dataArea() const { + return (QChar *)((char *)sharedMemory.data() + sizeof(HbExtraUDHeader) + (dataHeader()->numWords * sizeof(HbExtraUDDirectoryEntry))); + } - int findWord(int start, int end, const QString& newWord, Qt::CaseSensitivity caseSensitivity= Qt::CaseSensitive) const; - int findIndexForNewWord(int start, int end, const QString& newWord) const; - int findFirstMatch(int start, int end, const QString& searchString, int knownMatch = -1, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) const; - int compareWords(int index, const QString& otherWord, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) const; - bool hasEnoughSpaceForNewWord(const QString& newWord) const; + int findWord(int start, int end, const QString &newWord, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) const; + int findIndexForNewWord(int start, int end, const QString &newWord) const; + int findFirstMatch(int start, int end, const QString &searchString, int knownMatch = -1, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) const; + int compareWords(int index, const QString &otherWord, Qt::CaseSensitivity caseSensitivity = Qt::CaseSensitive) const; + bool hasEnoughSpaceForNewWord(const QString &newWord) const; - bool save(QString aFileName); + bool save(QString aFileName); + + HbExtraUDHeader *dataHeader() const { + return (HbExtraUDHeader *)sharedMemory.data(); + } - HbExtraUDHeader* dataHeader() const { - return (HbExtraUDHeader*)sharedMemory.data(); - } + int dataAreaSize() const { + return sharedMemory.size() - sizeof(HbExtraUDHeader) - (dataHeader()->numWords * sizeof(HbExtraUDDirectoryEntry)); + } - int dataAreaSize() const { - return sharedMemory.size() - sizeof(HbExtraUDHeader) - (dataHeader()->numWords * sizeof(HbExtraUDDirectoryEntry)); - } + void lock() { + sharedMemory.lock(); + } - void lock() { sharedMemory.lock(); } - void unlock() { sharedMemory.unlock(); } + void unlock() { + sharedMemory.unlock(); + } public: - int id; - HbPredictionBase* hostEngine; - QSharedMemory sharedMemory; + int id; + HbPredictionBase *hostEngine; + QSharedMemory sharedMemory; }; /// @endcond diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputfilter.cpp --- a/src/hbcore/inputfw/hbinputfilter.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputfilter.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -50,7 +50,7 @@ Performs filtering operation for string "in". Filtered string "out" is a copy of "in" without invalid characters. */ -void HbInputFilter::filterString(const QString& in, QString& out) +void HbInputFilter::filterString(const QString &in, QString &out) { for (int i = 0; i < in.length(); i++) { if (filter(in[i])) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputfocusobject.cpp --- a/src/hbcore/inputfw/hbinputfocusobject.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputfocusobject.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputfocusobject.h" + #include #include #include @@ -29,14 +31,15 @@ #include #include #include +#include #include "hbinputmethod.h" -#include "hbinputfocusobject.h" #include "hbinputeditorinterface.h" #include "hbinputvkbhost.h" #include "hbinputstandardfilters.h" +#include "hbinpututils.h" #include "hbnamespace_p.h" - +#include "hbevent.h" /*! @alpha @hbcore @@ -65,7 +68,7 @@ void ensureCursorVisible(QObject *widget) { if (widget) { - QTextEdit *textEdit = qobject_cast(widget); + QTextEdit *textEdit = qobject_cast(widget); if (textEdit) { textEdit->ensureCursorVisible(); } @@ -93,11 +96,24 @@ HbInputFocusObject::HbInputFocusObject(QObject *focusedObject) : d_ptr(new HbInputFocusObjectPrivate(focusedObject)) { + if (focusedObject) { + HbEvent *event = new HbEvent(HbEvent::InputMethodFocusIn); + QCoreApplication::sendEvent(focusedObject, event); + delete event; + } } HbInputFocusObject::~HbInputFocusObject() { + Q_D(HbInputFocusObject); + + if (d->mFocusedObject) { + HbEvent *event = new HbEvent(HbEvent::InputMethodFocusOut); + QCoreApplication::sendEvent(d->mFocusedObject, event); + delete event; + } + delete d_ptr; } @@ -105,7 +121,7 @@ Creates an input method event where given string is a pre-edit string and sends it to focused editor. See QInputMethodEvent for more information on pre-edit strings. */ -void HbInputFocusObject::sendPreEditString(const QString& string) +void HbInputFocusObject::sendPreEditString(const QString &string) { QList list; QInputMethodEvent event(string, list); @@ -116,7 +132,7 @@ Creates an input method event where given string is a commit string and sends it to focused editor. See QInputMethodEvent for more information on commit strings. */ -void HbInputFocusObject::sendCommitString(const QString& string) +void HbInputFocusObject::sendCommitString(const QString &string) { QList list; QInputMethodEvent event(QString(), list); @@ -127,41 +143,51 @@ /*! Sends given event to focused editor. */ -void HbInputFocusObject::sendEvent(QEvent& event) +void HbInputFocusObject::sendEvent(QEvent &event) { Q_D(HbInputFocusObject); if (event.type() == QEvent::InputMethod) { - QInputMethodEvent* imEvent = static_cast(&event); + QInputMethodEvent *imEvent = static_cast(&event); if (imEvent->commitString().size() > 0) { - d->mPreEditString = QString(); + d->mPreEditString.clear(); } else { d->mPreEditString = imEvent->preeditString(); } } if (d->mFocusedObject) { - QApplication::sendEvent(d->mFocusedObject, &event); if (event.type() == QEvent::InputMethod) { + QInputContext *ic = qApp->inputContext(); + QInputMethodEvent *imEvent = static_cast(&event); + if (ic) { + ic->sendEvent(*imEvent); + } // Currently in Qt, QTextEdit doesn't ensure cursor visibility // in case we are sending text in the form of QInputMethodEvent. So we need // to call QTextEdit:ensureCursorVisible() here till we get a fix from Qt. ensureCursorVisible(d->mFocusedObject); + } else { + QInputContext *ic = qApp->inputContext(); + if (ic && ic->focusWidget()) { + QApplication::sendEvent(ic->focusWidget(), &event); + } } } } + /*! Posts given event to focused editor in an asynchronous manner. */ -void HbInputFocusObject::postEvent(QEvent& event) +void HbInputFocusObject::postEvent(QEvent &event) { Q_D(HbInputFocusObject); if (event.type() == QEvent::InputMethod) { - QInputMethodEvent* imEvent = static_cast(&event); + QInputMethodEvent *imEvent = static_cast(&event); if (imEvent->commitString().size() > 0) { - d->mPreEditString = QString(); + d->mPreEditString.clear(); } else { d->mPreEditString = imEvent->preeditString(); } @@ -179,14 +205,27 @@ { Q_D(const HbInputFocusObject); - QGraphicsWidget *graphicsWidget = qobject_cast(d->mFocusedObject); - if (graphicsWidget && graphicsWidget->scene()) { - return graphicsWidget->scene()->inputMethodQuery(query); + QGraphicsObject *graphicsObject = qobject_cast(d->mFocusedObject); + if (graphicsObject && graphicsObject->scene()) { + return graphicsObject->scene()->inputMethodQuery(query); } - QWidget *widget = qobject_cast(d->mFocusedObject); + // check if QWidget is embedded as a proxy in scene. If yes try to get details + // from the scene. + QWidget *widget = qobject_cast(d->mFocusedObject); + QGraphicsProxyWidget *pw = HbInputUtils::graphicsProxyWidget(widget); + if (pw && pw->scene()) { + return pw->scene()->inputMethodQuery(query); + } + if (widget) { - return widget->inputMethodQuery(query); + // QWidget returns microfocus in local coordinate. + // we need to map it to global coordinate. + QVariant v = widget->inputMethodQuery(query); + if (v.type() == QVariant::Rect) { + v = v.toRect().translated(widget->mapToGlobal(QPoint(0, 0))); + } + return v; } return QVariant(); @@ -227,7 +266,7 @@ /*! Returns editor interface object pointing to focused editor. */ -HbEditorInterface& HbInputFocusObject::editorInterface() const +HbEditorInterface &HbInputFocusObject::editorInterface() const { return d_ptr->mEditorInterface; } @@ -257,20 +296,19 @@ { Q_D(HbInputFocusObject); - QGraphicsWidget *graphicsWidget = qobject_cast(d->mFocusedObject); - if (!graphicsWidget) { - QWidget *widget = qobject_cast(d->mFocusedObject); + QGraphicsObject *graphicsObject = qobject_cast(d->mFocusedObject); + if (!graphicsObject) { + QWidget *widget = qobject_cast(d->mFocusedObject); if (widget) { - if (widget->graphicsProxyWidget()) { - graphicsWidget = widget->graphicsProxyWidget(); - } else { + if (!(graphicsObject = HbInputUtils::graphicsProxyWidget(widget))) { widget->clearFocus(); + return; } } } - if (graphicsWidget && graphicsWidget->scene()) { - graphicsWidget->scene()->setFocusItem(0); + if (graphicsObject && graphicsObject->scene()) { + graphicsObject->scene()->setFocusItem(0); } } @@ -308,26 +346,41 @@ } /*! -Returns editor widget geometry. In case of QGraphicsWidget, the returned value is in scene coordinates. +Returns editor widget geometry. In case of QGraphicsObject, the returned value is in scene coordinates. */ QRectF HbInputFocusObject::editorGeometry() const { Q_D(const HbInputFocusObject); - QGraphicsWidget *graphicsWidget = qobject_cast(d->mFocusedObject); - if (!graphicsWidget) { - QWidget *widget = qobject_cast(d->mFocusedObject); + QGraphicsObject *graphicsObject = qobject_cast(d->mFocusedObject); + if (!graphicsObject) { + QWidget *widget = qobject_cast(d->mFocusedObject); if (widget) { - if (widget->graphicsProxyWidget()) { - graphicsWidget = widget->graphicsProxyWidget(); + // check if widget is inside a proxy. + QGraphicsProxyWidget *pw = HbInputUtils::graphicsProxyWidget(widget); + if (pw) { + // check if we are pointing to the toplevel + // proxy widget, if not then we must check for + // the widgets window and see if it is a proxy. + if (pw->widget() == widget) { + graphicsObject = pw; + } else if (pw->widget() == widget->window()) { + // focused object is not a proxy but it is + // inside a proxy, query to proxy about + // the focused objects rect. + QRectF rect = pw->subWidgetRect(widget); + rect.translate(pw->scenePos()); + return rect; + } } else { - return widget->geometry(); + return QRectF(widget->mapToGlobal(QPoint(0, 0)), widget->size()); } } } - if (graphicsWidget) { - return QRectF(graphicsWidget->scenePos(), graphicsWidget->size()); + // we need to find the editor which is inside + if (graphicsObject) { + return QRectF(graphicsObject->scenePos(), graphicsObject->boundingRect().size()); } return QRectF(); @@ -335,11 +388,19 @@ /*! Returns cursor micro focus by sending Qt::ImMicroFocus to focused editor. -In case of QGraphicsWidget, the returned rectangle is in scene coordinates. +In case of QGraphicsObject, the returned rectangle is in scene coordinates. */ QRectF HbInputFocusObject::microFocus() const { - return inputMethodQuery(Qt::ImMicroFocus).toRectF(); + Q_D(const HbInputFocusObject); + + QRectF rect = inputMethodQuery(Qt::ImMicroFocus).toRectF(); + QGraphicsObject *editorWidget = qobject_cast(d->mFocusedObject); + if (editorWidget) { + rect = editorWidget->mapRectToScene(rect); + } + + return rect; } /*! @@ -360,39 +421,41 @@ { Q_D(const HbInputFocusObject); - QGraphicsWidget *editorWidget = qobject_cast(d->mFocusedObject); + QGraphicsObject *editorWidget = qobject_cast(d->mFocusedObject); if (!editorWidget) { - QWidget *widget = qobject_cast(d->mFocusedObject); + QWidget *widget = qobject_cast(d->mFocusedObject); if (widget) { - editorWidget = widget->graphicsProxyWidget(); + editorWidget = HbInputUtils::graphicsProxyWidget(widget); } } if (editorWidget) { qreal result = editorWidget->zValue(); - for (QGraphicsWidget *parent = editorWidget->parentWidget(); parent; parent = parent->parentWidget()) { + for (QGraphicsObject *parent = editorWidget->parentObject(); parent; parent = parent->parentObject()) { result += parent->zValue(); } - - return result + HbPrivate::VKBValueUnit; + result += HbPrivate::VKBValueUnit; + if (result >= 0) { + return result; + } } return 0.0; } /*! -Returns input method hints. See QWidget and QGraphicsWidget documentation for more information. +Returns input method hints. See QWidget and QGraphicsItem documentation for more information. */ Qt::InputMethodHints HbInputFocusObject::inputMethodHints() const { Q_D(const HbInputFocusObject); - QGraphicsWidget *graphicsWidget = qobject_cast(d->mFocusedObject); - if (graphicsWidget) { - return graphicsWidget->inputMethodHints(); + QGraphicsObject *graphicsObject = qobject_cast(d->mFocusedObject); + if (graphicsObject) { + return graphicsObject->inputMethodHints(); } - QWidget *widget = qobject_cast(d->mFocusedObject); + QWidget *widget = qobject_cast(d->mFocusedObject); if (widget) { return widget->inputMethodHints(); } @@ -407,13 +470,13 @@ { Q_D(HbInputFocusObject); - QGraphicsWidget *graphicsWidget = qobject_cast(d->mFocusedObject); - if (graphicsWidget) { - graphicsWidget->setInputMethodHints(hints); + QGraphicsObject *graphicsObject = qobject_cast(d->mFocusedObject); + if (graphicsObject) { + graphicsObject->setInputMethodHints(hints); return; } - QWidget *widget = qobject_cast(d->mFocusedObject); + QWidget *widget = qobject_cast(d->mFocusedObject); if (widget) { widget->setInputMethodHints(hints); } @@ -423,7 +486,7 @@ A convenience method for filtering strings. Uses filter attached to connected editor and filters given string with it. */ -void HbInputFocusObject::filterStringWithEditorFilter(const QString& source, QString& result) +void HbInputFocusObject::filterStringWithEditorFilter(const QString &source, QString &result) { QString intermediate = source; @@ -473,21 +536,37 @@ /*! Returns the scenePos of the associated editor widget, if the concept makes sense -in its context (i.e. the editor is part of a scene, either being a QGraphicsWidget or +in its context (i.e. the editor is part of a scene, either being a QGraphicsObject or a QWidget embedded in a QGraphicsProxyWidget). Otherwise returns QPointF(0.0, 0.0). */ QPointF HbInputFocusObject::scenePos() const { Q_D(const HbInputFocusObject); - QGraphicsWidget *graphicsWidget = qobject_cast(d->mFocusedObject); - if (graphicsWidget) { - return graphicsWidget->scenePos(); + QGraphicsObject *graphicsObject = qobject_cast(d->mFocusedObject); + if (graphicsObject) { + return graphicsObject->scenePos(); } - QWidget *widget = qobject_cast(d->mFocusedObject); - if (widget && widget->graphicsProxyWidget()) { - return widget->graphicsProxyWidget()->scenePos(); + QWidget *w = qobject_cast(d->mFocusedObject); + // check if widget is inside a proxy. + QGraphicsProxyWidget *pw = HbInputUtils::graphicsProxyWidget(w); + if (pw) { + // check if we are pointing to the toplevel + // proxy widget, if not then we must check for + // the widgets window and see if it is a proxy. + if (pw->widget() == w) { + return pw->scenePos(); + } else if (pw->widget() == w->window()) { + QRectF rect = pw->subWidgetRect(w); + rect.translate(pw->scenePos()); + return rect.topLeft(); + } + } + + if (w) { + // not a proxy.. Meaning widget is inside a QWidget window. + return w->mapToGlobal(QPoint(0, 0)); } return QPointF(0.0, 0.0); @@ -496,7 +575,7 @@ /*! Returns true if all the characters in given string are allowed in active editor. */ -bool HbInputFocusObject::stringAllowedInEditor(const QString& string) const +bool HbInputFocusObject::stringAllowedInEditor(const QString &string) const { // Two pass filtering. This can be a case constrained editor with a filter. Qt::InputMethodHints hints; @@ -529,11 +608,11 @@ */ void HbInputFocusObject::commitSmiley(QString smiley) { - Q_D(HbInputFocusObject); + Q_D(HbInputFocusObject); - if (d->mFocusedObject) { - d->mFocusedObject->setProperty("SmileyIcon", smiley); - } + if (d->mFocusedObject) { + d->mFocusedObject->setProperty("SmileyIcon", smiley); + } } /*! @@ -552,27 +631,27 @@ bool HbInputFocusObject::isReadOnlyWidget(QObject *editorObject) { if (editorObject) { - QWidget *widget = qobject_cast(editorObject); + QWidget *widget = qobject_cast(editorObject); if (widget) { if (!widget->testAttribute(Qt::WA_InputMethodEnabled)) { return true; } - QLineEdit *lineEdit = qobject_cast(widget); + QLineEdit *lineEdit = qobject_cast(widget); if (lineEdit) { return lineEdit->isReadOnly(); } - QTextEdit *textEdit = qobject_cast(widget); + QTextEdit *textEdit = qobject_cast(widget); if (textEdit) { return textEdit->isReadOnly(); } return false; } else { - QGraphicsWidget *graphicsWidget = qobject_cast(editorObject); - if (graphicsWidget) { - if (!(graphicsWidget->flags() & QGraphicsItem::ItemAcceptsInputMethod)) { + QGraphicsObject *graphicsObject = qobject_cast(editorObject); + if (graphicsObject) { + if (!(graphicsObject->flags() & QGraphicsItem::ItemAcceptsInputMethod)) { return true; } } @@ -583,23 +662,21 @@ return true; } - /*! Returns true if the input framework recognizes given object as editor. */ bool HbInputFocusObject::isEditor(QObject *object) { - QGraphicsObject *graphicsObject = qobject_cast(object); - if (graphicsObject) { - return ((graphicsObject->flags() & QGraphicsItem::ItemAcceptsInputMethod) != 0); + if (QWidget *w = qobject_cast(object)) { + if (w->testAttribute(Qt::WA_InputMethodEnabled)) { + return true; + } } - if (qobject_cast(object)) { - return true; - } - - if (qobject_cast(object)) { - return true; + if (QGraphicsObject *gw = qobject_cast(object)) { + if (gw->flags() & QGraphicsItem::ItemAcceptsInputMethod) { + return true; + } } return false; @@ -615,11 +692,11 @@ { Q_D(HbInputFocusObject); - QGraphicsWidget *graphicsWidget = qobject_cast(d->mFocusedObject); - if (graphicsWidget && graphicsWidget->scene()) { - graphicsWidget->scene()->setFocusItem(graphicsWidget); + QGraphicsObject *graphicsObject = qobject_cast(d->mFocusedObject); + if (graphicsObject && graphicsObject->scene()) { + graphicsObject->scene()->setFocusItem(graphicsObject); } else { - QWidget *widget = qobject_cast(d->mFocusedObject); + QWidget *widget = qobject_cast(d->mFocusedObject); if (widget) { widget->setFocus(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputfocusobject.h --- a/src/hbcore/inputfw/hbinputfocusobject.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputfocusobject.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,16 +49,16 @@ explicit HbInputFocusObject(QObject *focusedObject); ~HbInputFocusObject(); - void sendPreEditString(const QString& string); - void sendCommitString(const QString& string); - void sendEvent(QEvent& event); - void postEvent(QEvent& event); + void sendPreEditString(const QString &string); + void sendCommitString(const QString &string); + void sendEvent(QEvent &event); + void postEvent(QEvent &event); QVariant inputMethodQuery(Qt::InputMethodQuery query) const; int editorCursorPosition(); QFont editorFont(); QString editorTextSelection(); QString editorSurroundingText(); - HbEditorInterface& editorInterface() const; + HbEditorInterface &editorInterface() const; void cursorLeft(Qt::KeyboardModifiers modifiers = Qt::NoModifier); void cursorRight(Qt::KeyboardModifiers modifiers = Qt::NoModifier); void releaseFocus(); @@ -71,9 +71,9 @@ void setInputMethodHints(Qt::InputMethodHints hints); QPointF scenePos() const; - void filterStringWithEditorFilter(const QString& source, QString& result); + void filterStringWithEditorFilter(const QString &source, QString &result); bool characterAllowedInEditor(QChar character) const; - bool stringAllowedInEditor(const QString& string) const; + bool stringAllowedInEditor(const QString &string) const; void commitSmiley(QString smiley); QObject *object() const; void setFocus(); @@ -82,7 +82,7 @@ static bool isEditor(QObject *object); protected: - HbInputFocusObjectPrivate * const d_ptr; + HbInputFocusObjectPrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputFocusObject) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputkeymap.cpp --- a/src/hbcore/inputfw/hbinputkeymap.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputkeymap.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,7 @@ #include #include -#include +#include const int DeadKeyTable[14] = {0x060, 0x0B4, 0x05E, 0x0A8, 0x022, 0x2C7, 0x2D8, 0x0B0, 0x2DB, 0x2DD, 0x07E, 0x0B8, 0x201A, 0x0B7}; @@ -37,7 +37,7 @@ {0x060, 0x069, 0x0ec}, {0x060, 0x06F, 0x0f2}, {0x060, 0x075, 0x0f9}, - + {0x0b4, 0x061, 0x0e1}, {0x0b4, 0x065, 0x0e9}, {0x0b4, 0x069, 0x0ed}, @@ -57,21 +57,21 @@ {0x05e, 0x069, 0x0ee}, {0x05e, 0x06F, 0x0f4}, {0x05e, 0x075, 0x0fb}, - + {0x0a8, 0x061, 0x0e4}, {0x0a8, 0x065, 0x0eb}, {0x0a8, 0x069, 0x0ef}, {0x0a8, 0x06F, 0x0f6}, {0x0a8, 0x075, 0x0fc}, {0x0a8, 0x079, 0x0ff}, - + {0x022, 0x061, 0x0e4}, {0x022, 0x065, 0x0eb}, {0x022, 0x069, 0x0ef}, {0x022, 0x06F, 0x0f6}, {0x022, 0x075, 0x0fc}, {0x022, 0x079, 0x0ff}, - + {0x2c7, 0x065, 0x11b}, {0x2c7, 0x063, 0x10d}, {0x2c7, 0x064, 0x10f}, @@ -81,7 +81,7 @@ {0x2c7, 0x053, 0x161}, {0x2c7, 0x074, 0x165}, {0x2c7, 0x07A, 0x17E}, - + {0x2d8, 0x061, 0x103}, {0x0b0, 0x061, 0x0c5}, @@ -103,7 +103,8 @@ {0x201a, 0x063, 0x0e7}, {0x201a, 0x072, 0x15f}, - {0x0b7, 0x07A, 0x17c}}; + {0x0b7, 0x07A, 0x17c} +}; class HbKeymapPrivate { @@ -113,20 +114,20 @@ ~HbKeymapPrivate(); public: - QMap mKeyboards; + QMap mKeyboards; HbInputLanguage mLanguage; }; HbKeymapPrivate::HbKeymapPrivate(HbInputLanguage language) -: mLanguage(language) + : mLanguage(language) { } HbKeymapPrivate::~HbKeymapPrivate() { - foreach (HbKeyboardMap* keymap, mKeyboards) { - foreach (HbMappedKey* key, keymap->keys) { + foreach(HbKeyboardMap *keymap, mKeyboards) { + foreach(HbMappedKey *key, keymap->keys) { delete key; } delete keymap; @@ -250,7 +251,7 @@ */ const HbKeyboardMap *HbKeymap::keyboard(HbKeyboardType keyboard) const { - HbKeyboardMap* keyboardMap = 0; + HbKeyboardMap *keyboardMap = 0; if (mPrivate->mKeyboards.contains(keyboard)) { keyboardMap = mPrivate->mKeyboards.value(keyboard); } @@ -275,9 +276,9 @@ */ const HbMappedKey *HbKeymap::keyForIndex(HbKeyboardType keyboard, int keyIndex) const { - HbMappedKey* key = 0; + HbMappedKey *key = 0; if (mPrivate->mKeyboards.contains(keyboard)) { - HbKeyboardMap* keymap = mPrivate->mKeyboards.value(keyboard); + HbKeyboardMap *keymap = mPrivate->mKeyboards.value(keyboard); if (keymap->keys.count() > keyIndex && keyIndex >= 0) { key = keymap->keys.at(keyIndex); } @@ -294,10 +295,10 @@ */ const HbMappedKey *HbKeymap::keyForKeycode(HbKeyboardType keyboard, QChar keycode) const { - HbMappedKey* key = 0; + HbMappedKey *key = 0; if (mPrivate->mKeyboards.contains(keyboard)) { - HbKeyboardMap* keymap = mPrivate->mKeyboards.value(keyboard); - foreach (HbMappedKey* mappedKey, keymap->keys) { + HbKeyboardMap *keymap = mPrivate->mKeyboards.value(keyboard); + foreach(HbMappedKey *mappedKey, keymap->keys) { if (mappedKey->keycode == keycode) { key = mappedKey; break; @@ -317,11 +318,11 @@ */ const HbMappedKey *HbKeymap::keyForCharacter(HbKeyboardType keyboard, QChar character) const { - HbMappedKey* key = 0; + HbMappedKey *key = 0; if (mPrivate->mKeyboards.contains(keyboard)) { - HbKeyboardMap* keymap = mPrivate->mKeyboards.value(keyboard); - foreach (HbMappedKey* mappedKey, keymap->keys) { - foreach (QString charstring, mappedKey->chars) { + HbKeyboardMap *keymap = mPrivate->mKeyboards.value(keyboard); + foreach(HbMappedKey *mappedKey, keymap->keys) { + foreach(const QString &charstring, mappedKey->chars) { if (charstring.contains(character)) { key = mappedKey; break; @@ -345,8 +346,8 @@ bool HbKeymap::isDeadKey(int key) { int size = sizeof(DeadKeyTable) / sizeof(DeadKeyTable[0]); - for (int i=0; i keys; + QList keys; }; class HB_CORE_EXPORT HbKeymap @@ -67,11 +66,11 @@ virtual const HbMappedKey *keyForIndex(HbKeyboardType keyboard, int keyIndex) const; virtual const HbMappedKey *keyForKeycode(HbKeyboardType keyboard, QChar keyCode) const; virtual const HbMappedKey *keyForCharacter(HbKeyboardType keyboard, QChar character) const; - static bool isDeadKey (int key); + static bool isDeadKey(int key); static void combineCharacter(QChar deadKey, QChar key, QChar &firstKey, QChar &secondKey); private: - HbKeymapPrivate* mPrivate; + HbKeymapPrivate *mPrivate; }; #endif // HB_INPUT_KEYMAP_DATA_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputkeymapfactory.cpp --- a/src/hbcore/inputfw/hbinputkeymapfactory.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputkeymapfactory.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,7 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputkeymapfactory.h" #include #include @@ -29,7 +30,6 @@ #include #include -#include "hbinputkeymapfactory.h" #include "hbinputkeymap.h" #include "hbinputsettingproxy.h" @@ -40,10 +40,12 @@ public: HbKeymapFactoryPrivate(); ~HbKeymapFactoryPrivate(); - void parseFiles(QStringList& files, QList& languages); + void parseFiles(QStringList &files, QList& languages); + bool isValidKeymap(QFile &file); + qreal keymapVersion(QFile &file); public: - QList mKeymaps; + QList mKeymaps; QList mRomLanguages; }; @@ -54,19 +56,19 @@ HbKeymapFactoryPrivate::~HbKeymapFactoryPrivate() { - foreach (HbKeymap* keymap, mKeymaps) { + foreach(HbKeymap *keymap, mKeymaps) { delete keymap; } mKeymaps.clear(); mRomLanguages.clear(); } -void HbKeymapFactoryPrivate::parseFiles(QStringList& files, QList& languages) +void HbKeymapFactoryPrivate::parseFiles(QStringList &files, QList& languages) { bool ok = false; QLocale::Language language = QLocale::C; QLocale::Country country = QLocale::AnyCountry; - foreach(QString file, files) { + foreach(const QString &file, files) { int underscorePos = file.indexOf('_'); int periodPos = file.indexOf('.'); if (underscorePos > 0 && underscorePos < periodPos) { @@ -74,7 +76,7 @@ if (!ok) { continue; } - country = static_cast(file.mid(underscorePos+1, periodPos-underscorePos-1).toUInt(&ok)); + country = static_cast(file.mid(underscorePos + 1, periodPos - underscorePos - 1).toUInt(&ok)); if (!ok) { continue; } @@ -95,6 +97,97 @@ } } +bool HbKeymapFactoryPrivate::isValidKeymap(QFile &file) +{ + QTextStream stream(&file); + HbKeyboardType keyboardType = HbKeyboardNone; + bool retunResult = false; + + while (!stream.atEnd()) { + QString line = stream.readLine(); + + if (keyboardType == HbKeyboardSctPortrait || keyboardType == HbKeyboardSctLandscape) { + continue; + } + + // When an empty line is encountered, an ongoing keyboard definition ends + if (line.isEmpty()) { + if (keyboardType != HbKeyboardNone) { + keyboardType = HbKeyboardNone; + } + continue; + } + // Line starting with "//" is a comment + if (line.length() >= 2 && line.at(0) == '/' && line.at(1) == '/') { + continue; + } + // Non-empty line without ongoing keyboard definition is the start of a definition, + // containing the keyboard type as hex + if (keyboardType == HbKeyboardNone) { + bool ok = false; + int keyType = line.toInt(&ok, 16); + if (ok) { + keyboardType = static_cast(keyType); + } + retunResult = true; + // Non-empty line with ongoing keyboard definition contains a key definition + // Format: + // Keycode and keys_nomod should always be present, but the rest are optional + + } else { + QStringList splitResult = line.split('\t'); + if (splitResult.count() == 0) { + continue; + } + + if ((splitResult.count() < 2 || splitResult.count() > 5)) { + retunResult = false; + break; + } else { + retunResult = true; + } + } + } + //Make the Reading position at the start of the file + stream.seek(0); + return retunResult; +} + +qreal HbKeymapFactoryPrivate::keymapVersion(QFile &file) +{ + QTextStream stream(&file); + qreal versionNumber = -1.0; + while (!stream.atEnd()) { + QString line = stream.readLine(); + if (line.isEmpty() || (line.length() >= 2 && line.at(0) == '/' && line.at(1) == '/')) { + continue; + } + QStringList splitResult = line.split('\t'); + + if (splitResult.at(0).toLower() == QString("version")) { + QStringList periodSplits = splitResult.at(1).split('.'); + QString version = periodSplits.at(0); + version.append('.'); + int count = periodSplits.count() - 1; + int i = 1; + while (i < count) { + version.append(periodSplits.at(i++)); + } + versionNumber = version.toFloat(); + break; + } else { + QString filename = file.fileName(); + if (filename.left(2) == ":/" || filename.left(2).toLower() == "z:") { + versionNumber = 0; + break; + } + } + } + + //Make the Reading position at the start of the file + stream.seek(0); + return versionNumber; +} /// @endcond /*! @@ -112,7 +205,7 @@ /*! Returns reference to singleton instance. */ -HbKeymapFactory* HbKeymapFactory::instance() +HbKeymapFactory *HbKeymapFactory::instance() { static HbKeymapFactory myInstance; return &myInstance; @@ -135,7 +228,7 @@ } /*! -Returns a HbKeymap object initialized using keymap resource data in the system. Ownership of the +Returns a HbKeymap object initialized using keymap resource data in the system. Ownership of the HbKeymap object remains with HbKeymapFactory. If no data is found for the given language, 0 is returned. @@ -145,13 +238,13 @@ \sa HbKeymap */ -const HbKeymap* HbKeymapFactory::keymap(const QLocale::Language language, const QLocale::Country country) +const HbKeymap *HbKeymapFactory::keymap(const QLocale::Language language, const QLocale::Country country) { return keymap(HbInputLanguage(language, country)); } /*! -Returns a HbKeymap object initialized using keymap resource data in the system. Ownership of the +Returns a HbKeymap object initialized using keymap resource data in the system. Ownership of the HbKeymap object remains with HbKeymapFactory. If no data is found for the given input language, 0 is returned. If the variant of the input language @@ -162,33 +255,47 @@ \sa HbKeymap \sa HbInputLanguage */ -const HbKeymap* HbKeymapFactory::keymap(const HbInputLanguage language) +const HbKeymap *HbKeymapFactory::keymap(const HbInputLanguage language) { - foreach (HbKeymap* keymap, mPrivate->mKeymaps) { + foreach(HbKeymap *keymap, mPrivate->mKeymaps) { if (keymap->language() == language) { return keymap; } } - QString filename; + QString filename, latestVersionFilename; + QFile file; + qreal maxVersionNumber = -1.0; - foreach (QString path, HbInputSettingProxy::keymapPluginPaths()) { + foreach(const QString &path, HbInputSettingProxy::keymapPluginPaths()) { if (language.variant() == QLocale::AnyCountry) { filename = path + '/' + QString::number(language.language()) + ".txt"; } else { - filename = path + '/' + QString::number(language.language()) + "_" - + QString::number(language.variant()) + ".txt"; + filename = path + '/' + QString::number(language.language()) + '_' + + QString::number(language.variant()) + ".txt"; } + if (QFile::exists(filename)) { - break; + file.setFileName(filename); + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + qreal fileVersion = mPrivate->keymapVersion(file); + if ((fileVersion > maxVersionNumber) && mPrivate->isValidKeymap(file)) { + //Found the valid keymap with latest version + latestVersionFilename = filename; + maxVersionNumber = fileVersion; + } + //Close the file + file.close(); + } } } - QFile file(filename); + file.setFileName(latestVersionFilename); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { if (language.variant() == QLocale::AnyCountry) { // File not found when trying to open with AnyCountry (no location specified), check whether // the language is available as a country-specific version - foreach(HbInputLanguage availableLanguage, availableLanguages()) { + + foreach(const HbInputLanguage &availableLanguage, availableLanguages()) { if (availableLanguage.language() == language.language()) { return keymap(availableLanguage); } @@ -196,10 +303,11 @@ } return 0; } + QTextStream stream(&file); - HbKeymap* keymap = 0; - HbKeyboardMap* keyboard = 0; + HbKeymap *keymap = 0; + HbKeyboardMap *keyboard = 0; while (!stream.atEnd()) { QString line = stream.readLine(); @@ -227,15 +335,15 @@ keyboard = new HbKeyboardMap(); keyboard->type = static_cast(keyType); } - // Non-empty line with ongoing keyboard definition contains a key definition - // Format: - // Keycode and keys_nomod should always be present, but the rest are optional + // Non-empty line with ongoing keyboard definition contains a key definition + // Format: + // Keycode and keys_nomod should always be present, but the rest are optional } else { - QStringList splitResult = line.split("\t"); + QStringList splitResult = line.split('\t'); if (splitResult.count() == 0) { continue; } - HbMappedKey* mappedKey = new HbMappedKey(); + HbMappedKey *mappedKey = new HbMappedKey(); mappedKey->keycode = splitResult.at(0).at(0); for (int i = 1; i < splitResult.count(); ++i) { switch (i) { @@ -251,6 +359,9 @@ case 4: mappedKey->chars.append(splitResult.at(4)); break; + case 5: + mappedKey->chars.append(splitResult.at(5)); + break; default: break; } @@ -261,6 +372,7 @@ if (keymap) { mPrivate->mKeymaps.append(keymap); } + file.close(); return keymap; } @@ -271,12 +383,12 @@ */ QList HbKeymapFactory::availableLanguages() { - HbKeymapFactory* instance = HbKeymapFactory::instance(); + HbKeymapFactory *instance = HbKeymapFactory::instance(); bool romLanguagesCached = !instance->mPrivate->mRomLanguages.isEmpty(); QList languages; QStringList files; QStringList romFiles; - foreach (QString path, HbInputSettingProxy::keymapPluginPaths()) { + foreach(const QString &path, HbInputSettingProxy::keymapPluginPaths()) { if (path.left(2) == ":/" || path.left(2) == "z:") { if (romLanguagesCached) { continue; @@ -292,12 +404,10 @@ languages = instance->mPrivate->mRomLanguages; } else { instance->mPrivate->parseFiles(romFiles, languages); + instance->mPrivate->mRomLanguages = languages; } instance->mPrivate->parseFiles(files, languages); - if (instance->mPrivate->mRomLanguages.isEmpty()) { - instance->mPrivate->mRomLanguages = languages; - } return languages; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputkeymapfactory.h --- a/src/hbcore/inputfw/hbinputkeymapfactory.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputkeymapfactory.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,10 +23,11 @@ ** ****************************************************************************/ -#ifndef HB_KEYMAP_FACTORY_H -#define HB_KEYMAP_FACTORY_H +#ifndef HB_INPUT_KEYMAP_FACTORY_H +#define HB_INPUT_KEYMAP_FACTORY_H #include +#include class HbKeymapFactoryPrivate; class HbKeymap; @@ -35,11 +36,11 @@ class HB_CORE_EXPORT HbKeymapFactory { public: - static HbKeymapFactory* instance(); + static HbKeymapFactory *instance(); - const HbKeymap* keymap(const QLocale::Language language, + const HbKeymap *keymap(const QLocale::Language language, const QLocale::Country country = QLocale::AnyCountry); - const HbKeymap* keymap(const HbInputLanguage language); + const HbKeymap *keymap(const HbInputLanguage language); static QList availableLanguages(); @@ -50,9 +51,9 @@ Q_DISABLE_COPY(HbKeymapFactory) private: - HbKeymapFactoryPrivate* mPrivate; + HbKeymapFactoryPrivate *mPrivate; }; -#endif // HB_KEYMAP_FACTORY_H +#endif // HB_INPUT_KEYMAP_FACTORY_H // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputlanguage.cpp --- a/src/hbcore/inputfw/hbinputlanguage.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputlanguage.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,72 +22,72 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputlanguage.h" #include "hbinpututils.h" -#include "hbinputlanguage.h" /*! \alpha \class HbInputLanguage -\brief Holds Input language value. +\brief Holds Input language value. When enumerating input languages, sometimes a single QLocale::Language value is not enough. For example in case of Chinese. QLocale defines only one language constant for Chinese, QLocale::Chinese, but input framework supports three Chinese dialect. We need a secondary value for the dialect and we're using QLocale::Country values for that. In most cases, however, the variant field is not needed. QLocale itself has those two fields but using it would have been an overkill for this purpuse. -This class also implements a set of language related convinience methods. +This class also implements a set of language related convenience methods. */ // // Localized language names. // -const ushort HbLangNameEnglish[] = {'E','n','g','l','i','s','h',0}; -const ushort HbLangNameLithuanian[] = {'L','i','e','t','u','v',0x0173,0}; -const ushort HbLangNameMalay[] = {'M','e','l','a','y','u',0}; -const ushort HbLangNamePolish[] = {'P','o','l','s','k','i',0}; -const ushort HbLangNamePortuguese[] = {'P','o','r','t','u','g',0x00ea,'s',0}; -const ushort HbLangNameRomanian[] = {'R','o',0x00e2,'n',0x0103,0}; -const ushort HbLangNameSerbian[] = {'S','r','p','s','k','i',0}; -const ushort HbLangNameSlovak[] = {'S','l','o','v','e','n',0x010d,'i','n','a',0}; -const ushort HbLangNameSlovene[] = {'S','l','o','v','e','n',0x0161,0x010d,'i','n','a',0}; -const ushort HbLangNameSpanish[] = {'E','s','p','a',0x00f1,'o','l',0}; -const ushort HbLangNameSwedish[] = {'S','w','e','d','i','s','h',0}; -const ushort HbLangNameTagalog[] = {'P','i','l','i','p','i','n','o',0}; -const ushort HbLangNameCzech[] = {0x010c,'e',0x0161,'t','i','n','a',0}; -const ushort HbLangNameDutch[] = {'N','e','d','e','r','l','a','n','d','s',0}; -const ushort HbLangNameTurkish[] = {'T',0x00fc,'r','k',0x00e7,'e',0}; -const ushort HbLangNameEstonian[] = {'E','e','s','t','i',0}; -const ushort HbLangNameFrench[] = {'F','r','a','n',0x00e7,'a','i','s',0}; -const ushort HbLangNameGreek[] = {0x0395,0x03bb,0x03bb,0x03b7,0x03bd,0x03b9,0x03ba,0x03ac,0}; -const ushort HbLangNameIcelandic[] = {0x00cd,'s','l','e','n','s','k','a',0}; -const ushort HbLangNameIndonesian[] = {'I','n','d','o','n','e','s','i','a',0}; -const ushort HbLangNameItalian[] = {'I','t','a','l','i','a','n','o',0}; -const ushort HbLangNameLatvian[] = {'L','a','t','v','i','e',0x0161,'u',0}; -const ushort HbLangNameCroatian[] = {'C','r','o','a','t','i','a','n',0}; -const ushort HbLangNameGerman[] = {'D','e','u','t','c','h',0}; -const ushort HbLangNameHungarian[] = {'M','a','g','y','a','r',0}; -const ushort HbLangNameBulgarian[] = {0x0411,0x044a,0x043b,0x0433,0x0430,0x0440,0x0441,0x043a, 0x0438,0}; -const ushort HbLangNameFinnish[] = {'S','u','o','m','i',0}; -const ushort HbLangNameRussian[] = {0x0420,0x0443,0x0441,0x0441,0x043a,0x0438,0x0439,0}; -const ushort HbLangNameDanish[] = {'D','a','n','s','k',0}; -const ushort HbLangNameNorwegian[] = {'N','o','r','s','k',0}; -const ushort HbLangNameUkrainian[] = {0x0423, 0x043a, 0x0440, 0x0430, 0x0457, 0x043d, 0x0441, 0x044c, 0x043a, 0x0430,0}; -const ushort HbLangNameArabic[] = {0x0627,0x0644,0x0639,0x0631,0x0628,0x064a,0x0629,0}; -const ushort HbLangNameHebrew[] = {0x05e2,0x05d1,0x05e8,0x05d9,0x05ea,0}; -const ushort HbLangNameThai[] = {0x0e20,0x0e32,0x0e29,0x0e32,0x0e44,0x0e17,0x0e22,0}; -const ushort HbLangNameJapanese[] = {0x65e5,0x672c,0x8a9e,0}; -const ushort HbLangNameVietnamese[] = {'T','i',0x00ea,0x0301,'n','g',' ','V','i',0x00ea,0x0323,'t',0}; -const ushort HbLangNameFarsi[] = {0x0641,0x0627,0x0631,0x0633,0x0649,0}; -const ushort HbLangNameHindi[] = {0x0939,0x093f,0x0928,0x0928,0x094d,0x0926,0x0940,0}; -const ushort HbLangNameUrdu[] = {0x0627,0x0631,0x062f,0x0648,0}; -const ushort HbLangNameCatalan[] = {'C','a','t','a','l',0x00e0,0}; -const ushort HbLangNameGalician[] = {'G','a','l','e','g','o',0}; -const ushort HbLangNameBasque[] = {'E','u','s','k','a','r','a',0}; -const ushort HbLangNameMarathi[] = {0x092e,0x0930,0x093e,0x0920,0x0940,0}; -const ushort HbLangNameChinesePrc[] = {0x7B80,0x4F53,0x4E2D,0x6587,0}; -const ushort HbLangNameChineseHongKong[] = {0x7E41,0x9AD4,0x4E2D,0x6587,0x0028,0x9999,0x6E2F,0x0029,0}; -const ushort HbLangNameChineseTaiwan[] = {0x7E41,0x9AD4,0x4E2D,0x6587,0x0028,0x53F0,0x7063,0x0029,0}; -const ushort HbLangNameKorean[] = {'K','o','r','e','a','n',0}; +const ushort HbLangNameEnglish[] = {'E', 'n', 'g', 'l', 'i', 's', 'h', 0}; +const ushort HbLangNameLithuanian[] = {'L', 'i', 'e', 't', 'u', 'v', 0x0173, 0}; +const ushort HbLangNameMalay[] = {'M', 'e', 'l', 'a', 'y', 'u', 0}; +const ushort HbLangNamePolish[] = {'P', 'o', 'l', 's', 'k', 'i', 0}; +const ushort HbLangNamePortuguese[] = {'P', 'o', 'r', 't', 'u', 'g', 0x00ea, 's', 0}; +const ushort HbLangNameRomanian[] = {'R', 'o', 0x00e2, 'n', 0x0103, 0}; +const ushort HbLangNameSerbian[] = {'S', 'r', 'p', 's', 'k', 'i', 0}; +const ushort HbLangNameSlovak[] = {'S', 'l', 'o', 'v', 'e', 'n', 0x010d, 'i', 'n', 'a', 0}; +const ushort HbLangNameSlovene[] = {'S', 'l', 'o', 'v', 'e', 'n', 0x0161, 0x010d, 'i', 'n', 'a', 0}; +const ushort HbLangNameSpanish[] = {'E', 's', 'p', 'a', 0x00f1, 'o', 'l', 0}; +const ushort HbLangNameSwedish[] = {'S', 'w', 'e', 'd', 'i', 's', 'h', 0}; +const ushort HbLangNameTagalog[] = {'P', 'i', 'l', 'i', 'p', 'i', 'n', 'o', 0}; +const ushort HbLangNameCzech[] = {0x010c, 'e', 0x0161, 't', 'i', 'n', 'a', 0}; +const ushort HbLangNameDutch[] = {'N', 'e', 'd', 'e', 'r', 'l', 'a', 'n', 'd', 's', 0}; +const ushort HbLangNameTurkish[] = {'T', 0x00fc, 'r', 'k', 0x00e7, 'e', 0}; +const ushort HbLangNameEstonian[] = {'E', 'e', 's', 't', 'i', 0}; +const ushort HbLangNameFrench[] = {'F', 'r', 'a', 'n', 0x00e7, 'a', 'i', 's', 0}; +const ushort HbLangNameGreek[] = {0x0395, 0x03bb, 0x03bb, 0x03b7, 0x03bd, 0x03b9, 0x03ba, 0x03ac, 0}; +const ushort HbLangNameIcelandic[] = {0x00cd, 's', 'l', 'e', 'n', 's', 'k', 'a', 0}; +const ushort HbLangNameIndonesian[] = {'I', 'n', 'd', 'o', 'n', 'e', 's', 'i', 'a', 0}; +const ushort HbLangNameItalian[] = {'I', 't', 'a', 'l', 'i', 'a', 'n', 'o', 0}; +const ushort HbLangNameLatvian[] = {'L', 'a', 't', 'v', 'i', 'e', 0x0161, 'u', 0}; +const ushort HbLangNameCroatian[] = {'C', 'r', 'o', 'a', 't', 'i', 'a', 'n', 0}; +const ushort HbLangNameGerman[] = {'D', 'e', 'u', 't', 'c', 'h', 0}; +const ushort HbLangNameHungarian[] = {'M', 'a', 'g', 'y', 'a', 'r', 0}; +const ushort HbLangNameBulgarian[] = {0x0411, 0x044a, 0x043b, 0x0433, 0x0430, 0x0440, 0x0441, 0x043a, 0x0438, 0}; +const ushort HbLangNameFinnish[] = {'S', 'u', 'o', 'm', 'i', 0}; +const ushort HbLangNameRussian[] = {0x0420, 0x0443, 0x0441, 0x0441, 0x043a, 0x0438, 0x0439, 0}; +const ushort HbLangNameDanish[] = {'D', 'a', 'n', 's', 'k', 0}; +const ushort HbLangNameNorwegian[] = {'N', 'o', 'r', 's', 'k', 0}; +const ushort HbLangNameUkrainian[] = {0x0423, 0x043a, 0x0440, 0x0430, 0x0457, 0x043d, 0x0441, 0x044c, 0x043a, 0x0430, 0}; +const ushort HbLangNameArabic[] = {0x0627, 0x0644, 0x0639, 0x0631, 0x0628, 0x064a, 0x0629, 0}; +const ushort HbLangNameHebrew[] = {0x05e2, 0x05d1, 0x05e8, 0x05d9, 0x05ea, 0}; +const ushort HbLangNameThai[] = {0x0e20, 0x0e32, 0x0e29, 0x0e32, 0x0e44, 0x0e17, 0x0e22, 0}; +const ushort HbLangNameJapanese[] = {0x65e5, 0x672c, 0x8a9e, 0}; +const ushort HbLangNameVietnamese[] = {'T', 'i', 0x00ea, 0x0301, 'n', 'g', ' ', 'V', 'i', 0x00ea, 0x0323, 't', 0}; +const ushort HbLangNameFarsi[] = {0x0641, 0x0627, 0x0631, 0x0633, 0x0649, 0}; +const ushort HbLangNameHindi[] = {0x0939, 0x093f, 0x0928, 0x0928, 0x094d, 0x0926, 0x0940, 0}; +const ushort HbLangNameUrdu[] = {0x0627, 0x0631, 0x062f, 0x0648, 0}; +const ushort HbLangNameCatalan[] = {'C', 'a', 't', 'a', 'l', 0x00e0, 0}; +const ushort HbLangNameGalician[] = {'G', 'a', 'l', 'e', 'g', 'o', 0}; +const ushort HbLangNameBasque[] = {'E', 'u', 's', 'k', 'a', 'r', 'a', 0}; +const ushort HbLangNameMarathi[] = {0x092e, 0x0930, 0x093e, 0x0920, 0x0940, 0}; +const ushort HbLangNameChinesePrc[] = {0x7B80, 0x4F53, 0x4E2D, 0x6587, 0}; +const ushort HbLangNameChineseHongKong[] = {0x7E41, 0x9AD4, 0x4E2D, 0x6587, 0x0028, 0x9999, 0x6E2F, 0x0029, 0}; +const ushort HbLangNameChineseTaiwan[] = {0x7E41, 0x9AD4, 0x4E2D, 0x6587, 0x0028, 0x53F0, 0x7063, 0x0029, 0}; +const ushort HbLangNameKorean[] = {'K', 'o', 'r', 'e', 'a', 'n', 0}; // // Helper class for binding language names to QLocale constants. @@ -96,14 +96,13 @@ { public: int mLanguage; - const ushort* mName; + const ushort *mName; }; // // This table binds QLocale language value to language name string. // -const HbLocNameBinding nameBindings[] = -{ +const HbLocNameBinding nameBindings[] = { {QLocale::English, HbLangNameEnglish}, {QLocale::Lithuanian, HbLangNameLithuanian}, {QLocale::Malay, HbLangNameMalay}, @@ -152,13 +151,13 @@ }; /*! -\fn QLocale::Language language() const +\fn QLocale::Language language() const Returns languge code as QLocale::Language. */ /*! -\fn QLocale::Country variant() const +\fn QLocale::Country variant() const Returns variant code as QLocale::Country. */ @@ -170,7 +169,7 @@ */ /*! -\fn bool defined() +\fn bool defined() Returns true if this structure is initialised to contain a valid language/variant pair. */ @@ -189,17 +188,17 @@ if (mLanguage == QLocale::Chinese) { switch (mVariant) { - case QLocale::China: - result = QString::fromUtf16(HbLangNameChinesePrc); - break; - case QLocale::Taiwan: - result = QString::fromUtf16(HbLangNameChineseTaiwan); - break; - case QLocale::HongKong: - result = QString::fromUtf16(HbLangNameChineseHongKong); - break; - default: - break; + case QLocale::China: + result = QString::fromUtf16(HbLangNameChinesePrc); + break; + case QLocale::Taiwan: + result = QString::fromUtf16(HbLangNameChineseTaiwan); + break; + case QLocale::HongKong: + result = QString::fromUtf16(HbLangNameChineseHongKong); + break; + default: + break; } } @@ -218,10 +217,10 @@ */ bool HbInputLanguage::isCaseSensitiveLanguage() const { - if (mLanguage == QLocale::Arabic || mLanguage == QLocale::Hebrew + if (mLanguage == QLocale::Arabic || mLanguage == QLocale::Hebrew || mLanguage == QLocale::Urdu || mLanguage == QLocale::Chinese || mLanguage == QLocale::Thai || mLanguage == QLocale::Japanese - || mLanguage == QLocale::Persian) { + || mLanguage == QLocale::Persian) { // These languageas don't have a concept of upper and lower case. return false; } @@ -229,9 +228,8 @@ return true; } -const int knownLatinAlphabetLanguages[] = -{ - QLocale::English, +const int knownLatinAlphabetLanguages[] = { + QLocale::English, QLocale::Lithuanian, QLocale::Malay, QLocale::Polish, @@ -285,7 +283,7 @@ */ bool HbInputLanguage::isRightToLeftLanguage() const { - if (mLanguage == QLocale::Arabic || mLanguage == QLocale::Hebrew + if (mLanguage == QLocale::Arabic || mLanguage == QLocale::Hebrew || mLanguage == QLocale::Urdu || mLanguage == QLocale::Persian) { return true; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputlanguage.h --- a/src/hbcore/inputfw/hbinputlanguage.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputlanguage.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,22 +34,33 @@ class HB_CORE_EXPORT HbInputLanguage { public: - HbInputLanguage() : mLanguage((QLocale::Language)0), mVariant(QLocale::AnyCountry) - {} + HbInputLanguage() : mLanguage((QLocale::Language)0), mVariant(QLocale::AnyCountry) + {} HbInputLanguage(QLocale::Language language, QLocale::Country variant = QLocale::AnyCountry) : mLanguage(language), mVariant(variant) - {} + {} HbInputLanguage(const HbInputLanguage &other) { mLanguage = other.mLanguage; mVariant = other.mVariant; } - QLocale::Language language() const { return mLanguage; } - QLocale::Country variant() const { return mVariant; } - bool undefined() const { return (mLanguage == (QLocale::Language)0); } - bool defined() const { return (mLanguage != (QLocale::Language)0); } + QLocale::Language language() const { + return mLanguage; + } + + QLocale::Country variant() const { + return mVariant; + } + + bool undefined() const { + return (mLanguage == (QLocale::Language)0); + } + + bool defined() const { + return (mLanguage != (QLocale::Language)0); + } bool operator==(const HbInputLanguage &other) const { return (mLanguage == other.mLanguage && mVariant == other.mVariant); @@ -64,7 +75,7 @@ } bool operator!=(const QLocale::Language language) const { - return (mLanguage != language); + return (mLanguage != language); } QString localisedName(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputlanguagedatabase.h --- a/src/hbcore/inputfw/hbinputlanguagedatabase.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputlanguagedatabase.h Thu Jul 22 16:36:53 2010 +0100 @@ -22,8 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ -#ifndef HB_LANGUAGE_DATABASE_H -#define HB_LANGUAGE_DATABASE_H +#ifndef HB_INPUT_LANGUAGE_DATABASE_H +#define HB_INPUT_LANGUAGE_DATABASE_H #include #include @@ -33,13 +33,12 @@ class HB_CORE_EXPORT HbLanguageDatabase { public: - virtual ~HbLanguageDatabase() - { + virtual ~HbLanguageDatabase() { } virtual int hostId() const = 0; virtual int languageCode() const = 0; - virtual char* languageData(void* aNativeParams = 0) const = 0; + virtual char *languageData(void *aNativeParams = 0) const = 0; virtual int nativeId() const = 0; }; @@ -48,13 +47,12 @@ Q_OBJECT public: - virtual ~HbLanguageDatabaseInterface() - { + virtual ~HbLanguageDatabaseInterface() { } virtual QList listLanguages() = 0; - virtual HbLanguageDatabase* languageDatabase(int aLanguage) = 0; + virtual HbLanguageDatabase *languageDatabase(int aLanguage) = 0; }; -#endif // HB_LANGUAGE_DATABASE_H +#endif // HB_INPUT_LANGUAGE_DATABASE_H // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/inputfw/hbinputmainwindow.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,329 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#include "hbinputmainwindow_p.h" + +#include +#include +#include +#include + +#include "hbinputregioncollector_p.h" +#include "hbinstance.h" +#include "hbwidget.h" +#include "hbview.h" +#include "hbnamespace_p.h" +#include "hbstackedlayout.h" + +#if defined (Q_OS_SYMBIAN) +#include +#include +#include + +TRect qt_QRect2TRect(const QRectF &rect) +{ + TRect trect; + trect.SetRect(rect.topLeft().x(), rect.topLeft().y(), + rect.bottomRight().x() + 1, rect.bottomRight().y() + 1); + return trect; +} + +Q_DECLARE_TYPEINFO(TRect, Q_MOVABLE_TYPE); +#endif + +class HbInputTransparentWindow : public HbWidget +{ +public: + + HbInputTransparentWindow(QGraphicsItem *parent = 0); + ~HbInputTransparentWindow(); + + enum { Type = Hb::ItemType_TransparentWindow }; + int type() const { + return Type; + } + + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); +}; + +HbInputTransparentWindow::HbInputTransparentWindow(QGraphicsItem *parent) : + HbWidget(parent) +{ + setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); +} + + +/*! + Destructs the transparent window. + */ +HbInputTransparentWindow::~HbInputTransparentWindow() +{ +} + +void HbInputTransparentWindow::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +{ + Q_UNUSED(widget) + QPainter::CompositionMode compositionMode = painter->compositionMode(); + painter->setCompositionMode(QPainter::CompositionMode_Source); + painter->fillRect(option->exposedRect, QColor(0, 0, 0, 0)); + painter->setCompositionMode(compositionMode); +} + +/* +creates an instance of HbInputMainWindow. +*/ +HbInputMainWindow *HbInputMainWindow::instance() +{ + static HbInputMainWindow *mainWindow = new HbInputMainWindow(); + return mainWindow; +} + +HbInputMainWindow::~HbInputMainWindow() +{ + delete mProxyWindow; +} + +// constructor. +HbInputMainWindow::HbInputMainWindow() +// HbMainWindow creates a background QGraphicsItem, which has the background image. we need to hide it that. + : HbMainWindow(0, Hb::WindowFlagTransparent), mLastFocusedWidget(0), mSpellQueryLaunched(false), mProxyWindow(0) +{ + // We need a window which is of type Qt::Window flag at the same time does not show + // any decorators Qt::Tool seems to be the option, and we want this window to be always on top so Qt::WindowStaysOnTopHint. + // And since transparency requires to have a frameless window we are setting that too. + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool | Qt::FramelessWindowHint); + + // By default QGraphicsView has a background which is white in color (Other controls eg. QPushButton + // have a grey background), we need to make that transparent too. + setStyleSheet("background: transparent"); + + // No focus is necessary as we don't want the hbmainwindw to steal focus. + setFocusPolicy(Qt::NoFocus); + + // add transparency begin. + HbView *view = new HbView; + view->hideItems(Hb::AllItems); + view->setContentFullScreen(); + +#if defined (Q_OS_SYMBIAN) + CCoeControl *c = effectiveWinId(); + c->SetFocusing(false); + RWindow *rw = static_cast(c->DrawableWindow()); + rw->SetRequiredDisplayMode(EColor16MA); + TInt err = rw->SetTransparencyAlphaChannel(); + if (err == KErrNone) { + rw->SetBackgroundColor(~0); + } +#endif // Q_OS_SYMBIAN + + HbInputTransparentWindow *transparentWindow = new HbInputTransparentWindow; + HbStackedLayout *stackedLayout = new HbStackedLayout; + stackedLayout->addItem(transparentWindow); + view->setLayout(stackedLayout); + addView(view); + // add transparency ends. + + connect(HbInputRegionCollector::instance(), SIGNAL(updateRegion(QRegion)), this, SLOT(updateRegion(QRegion))); + + // QApplication signal for getting notification of any focus change. If therer + // is a switch between application window and HbInputMainWindow then we need to + // set the focus back to the application window, if we don't do that it will + // result in focusLost call inside framework. + connect(qApp, SIGNAL(focusChanged(QWidget *, QWidget *)), + this, SLOT(saveFocusWidget(QWidget *, QWidget *))); +} + + +void HbInputMainWindow::updateRegion(QRegion region) +{ + mMask = region; +#if defined (Q_OS_SYMBIAN) + RWindowBase *rwindow = effectiveWinId()->DrawableWindow(); + if (region.isEmpty()) { + TRegionFix<1> tregion(TRect(TPoint(0, 0), TSize(0, 0))); + rwindow->SetShape(tregion); + } else { + // Using QVector assumes the memory layout is the same as RRegion + QVector rects = region.rects(); + QVector trects(rects.count()); + for (int i = 0; i < trects.count(); ++i) { + trects[i] = qt_QRect2TRect(rects.at(i)); + } + RRegion rregion(trects.count(), trects.data()); + if (!rregion.CheckError()) { + rwindow->SetShape(rregion); + } + } +#else + setMask(region); +#endif +} + + +/* +we should always set the focus back to the application window. +*/ +bool HbInputMainWindow::event(QEvent *e) +{ + switch (e->type()) { + case QEvent::WindowActivate: + if (mLastFocusedWidget && !mSpellQueryLaunched) { + qApp->setActiveWindow(mLastFocusedWidget); + } + break; + default: + break; + } + return HbMainWindow::event(e); +} + +/* +This function checks for any modal dialog present in the HbGraphicsScene by checking DynamicPropertyChange +and blocks the events to the application window by launching a widget which sits exactly in between the applicaion +and HbInputMainWindow. +*/ +bool HbInputMainWindow::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == QEvent::DynamicPropertyChange) { + const QString p = static_cast(event)->propertyName(); + if (p == "SpellQueryLaunched") { + QVariant variant = obj->property("SpellQueryLaunched"); + if (variant.isValid()) { + mSpellQueryLaunched = variant.toBool(); + if (mSpellQueryLaunched) { + qApp->setActiveWindow(this); + setFocus(Qt::OtherFocusReason); + } else { + if (mLastFocusedWidget) { + qApp->setActiveWindow(mLastFocusedWidget); + } + } + } + // return true as we are interested party! + return true; + } + } + + // we need to only check for spontaneous events. + if (event->spontaneous() && (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease)) { + QMouseEvent *mouseEvent = static_cast(event); + if (mouseEvent) { + // get the top level widget at the point, and see if that widget is a HbMainWindow, + // If it is a HbMainWindow then do not do any thing, as events will propagate + // correctly. But when it is clicked inside application window then send the event to + // viewport as we might want to close a popup. + if (!mMask.contains(mouseEvent->globalPos())) { + qApp->sendEvent(viewport(), event); + } + } + } + + return HbMainWindow::eventFilter(obj, event); +} + +/* +Since hbmainwindow is overlapped on top of the application window, we need to +set the focus back to the application window. Not doing so will result in a focus +lost. +*/ +void HbInputMainWindow::saveFocusWidget(QWidget * /*Old*/, QWidget *newFocus) +{ + if (newFocus && !this->isAncestorOf(newFocus)) { + mLastFocusedWidget = newFocus; + } +} + +void HbInputMainWindow::showInputWindow() +{ + // installing event filter to the application.. this is needed to get + // the events happening in other vanilla windows. + qApp->installEventFilter(this); + QInputContext *ic = qApp->inputContext(); + QWidget *fw = ic ? ic->focusWidget() : 0 ; + QWidget *win = 0; + if (fw) { + win = fw->window(); + } +#ifdef Q_WS_WIN + // As in windows OS HbMainWindow can come anywhere on the screen. + // so we need to launch main window exactly at the top windows position. + if (win) { + move(win->frameGeometry().x(), win->pos().y()); + } +#endif + + HbInputRegionCollector::instance()->setEnabled(true); + if (win && win->windowModality() != Qt::NonModal) { + if (!mProxyWindow) { + mProxyWindow = new HbProxyWindow(); + } + mProxyWindow->setWindow(this); + // since the focused widget is inside a modal dialog which blocks events to other_window. + // and since hbinputmainwindow also comes under the other_window. It does will not get the + // mouse click events. + mProxyWindow->setParent(win); + // setParent resets the window flags, so we have to set the flags once again before show() is called. + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool | Qt::FramelessWindowHint); + show(); + } else { + if (mProxyWindow && mProxyWindow->isAncestorOf(this)) { + mProxyWindow->setWindow(0); + setParent(0); + // setParent resets the window flags, so we have to set the flags once again before show is called. + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::Tool | Qt::FramelessWindowHint); + } + show(); + } + +#if defined(Q_OS_SYMBIAN) + // this is done to come on top of all the controls in symbian OS, done to overlap soft keys as well. + RWindow *rWindow = static_cast(effectiveWinId()->DrawableWindow()); + const int positionForeground(0); + rWindow->SetOrdinalPosition(positionForeground); +#endif +} + +void HbInputMainWindow::hideInputWindow() +{ + if (mSpellQueryLaunched) { + return; + } + + if (isVisible()) { + hide(); +#if defined(Q_OS_SYMBIAN) + RWindow *rWindow = static_cast(effectiveWinId()->DrawableWindow()); + const int positionBackground(-1); + rWindow->SetOrdinalPosition(positionBackground); +#endif + } + + HbInputRegionCollector::instance()->setEnabled(false); + + // installing event filter to the application.. this is needed to get + // the events happening in other vanilla windows. + qApp->removeEventFilter(this); +} + +//EOF diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmainwindow_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/inputfw/hbinputmainwindow_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,87 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include + +#include "hbmainwindow.h" +#include "hbwidget.h" + +#ifndef HB_INPUT_MAINWINDOW +#define HB_INPUT_MAINWINDOW + +class HbProxyWindow; + +class HbInputMainWindow : public HbMainWindow +{ + Q_OBJECT +public: + static HbInputMainWindow *instance(); + void showInputWindow(); + void hideInputWindow(); +private: + HbInputMainWindow(); + virtual ~HbInputMainWindow(); + + bool event(QEvent *e); + bool eventFilter(QObject *obj, QEvent *event); + +public slots: + void saveFocusWidget(QWidget * /*Old*/, QWidget *newFocus); + void updateRegion(QRegion region); + +private: + QPointer mLastFocusedWidget; + QRegion mMask; + bool mSpellQueryLaunched; + QPointer mProxyWindow; +}; + +class HbProxyWindow: public QWidget +{ +public: + HbProxyWindow() + { + setGeometry(0,0,0,0); + } + void setWindow(QWidget* window) + { + this->window = window; + if (window) { + window->setParent(this); + } + } + ~HbProxyWindow() + { + if (window) { + window->setParent(0); + } + } +private: + QPointer window; +}; + +#endif //HB_INPUT_MAINWINDOW + +// End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethod.cpp --- a/src/hbcore/inputfw/hbinputmethod.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethod.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,13 +22,14 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputmethod.h" +#include "hbinputmethod_p.h" + #include #include #include #include -#include "hbinputmethod.h" -#include "hbinputmethod_p.h" #include "hbinputmodecache_p.h" #include "hbinputsettingproxy.h" #include "hbinputcontextproxy_p.h" @@ -39,6 +40,7 @@ #include "hbinputstandardfilters.h" #include "hbinpututils.h" #include "hbinputvkbhost.h" +#include "hbinputvkbhostbridge.h" /*! @alpha @@ -62,19 +64,95 @@ activated from UI, input mode cache stops resolving input methods upon focus operations and the custom input is active in all editors until it is deactivated. -Following is the basic input framework program flow: +\bold The input framework program flow + +1. An editor gains input focus.
+2. Editor sets requestSoftwareInputPanel event to active input context.
+3. The input framework creates input state based on editor attributes and the input mode cache
+ resolves correct mode handler and activates it.
+4. A virtual function HbInputMethod::focusReceived is called. At this point the input method
+ initializes whatever it needs to initialize in order to start the input operation (for example,
+ opens the virtual keyboard by using HbVkbHost API) and waits for user actions.
+5. Text is written. The input method delivers results to the editor buffer by using HbInputFocusObject API.
+ It can access editor attributes via HbEditorInterface API.
+6. The active editor loses focus. At this point the input method receives a call to virtual function
+ HbInputMethod::focusLost and is expected to conclude any ongoing input operations and shut down active
+ UI elements (such as the virtual keyboard).
+7. The input method waits for next focusReceived() call.
+ +\bold Input method resolving + +The input framework resolves correct input state handler based on three attributes: input mode, +keyboard type and input language. + +The framework recognizes three different input modes: default, numeric and custom. +Default and numeric input modes are something that the framework resolves for active +input language and keyboard type. Custom input mode is something that the framework never +activates automatically, but it is activated from UI or directly from application +(or input method) code. + +Numeric input mode is something that can handle those editors that are configured to only accept +numeric data (for example those that have Qt::ImhDigitsOnly hints on). + +Language attribute is matched either as a direct match or as a language range. Language range +means the input method is capable of handling all the languages that +HbKeymapFactory::availableLanguages() returns. Direct match always wins so it is possible +to override language range for specific languages. + +The keyboard attribute is always matched directly. Note that event though the constant +has term "keyboard" in it, it covers all input devices such as hand writing recognition widgets +that don't utilize traditional keys. it is up the the input method what that constant +really means. + +The input method resolving parameters are part of input plugin meta data and they are returned +by QInputContextPlugin::languages() method. A single entry in the returned string list +is formed by packing resolving parameters into HbInputModeProperties structure and calling +HbInputModeProperties::asString() method. -1. An editor gains input focus. -2 Input mode cache resolves correct mode handler and activates it. -3. A virtual function HbInputMethod::focusReceived is called. At this point the input method - initializes whatever it needs to initialize in order to start the input operation (for example, - opens the virtual keyboard by using HbVkbHost API) and waits for user actions. -4. Text is written. The input method delivers results to the editor buffer by using HbInputFocusObject API. - It can access editor attributes via HbEditorInterface API. -5. The active editor loses focus. At this point the input method receives a call to virtual function - HbInputMethod::focusLost and is expected to conclude any ongoing input operations and shut down active - UI elements (such as the virtual keyboard). -6. The input method waits for next focusReceived() call. +Following code snippet shows how the input context plugin returns resolving parameters + +\snippet{unittest_hbinputmethod/unittest_hbinputmethod.cpp,1} + +\bold Input method resolving example + +Say that we have implemented touch input methods for 12 key portrait mode and qwerty landscape mode. +Then we have Chinese touch input method for both portrait and landscape orientations and also +Chinese handwriting recognition input mode for portrait mode. + +Touch input methods resolve to language range, which means that they will handle all +the other languages, except Chinese, which has its own designated input method. + +Touch input methods also implement support for numeric mode. Because Chinese language uses +same numeric system as "latin" based languages, we only want to implement numeric mode +handling in one input method and arrange resolving parameters so that the numeric mode +is handled by default touch input method even when the global input language is Chinese. + +Chinese handwriting input method is something that is a custom mode, and will be activated +from UI. + +Following example shows how the resolving attributes are set up to achieve above configuration. + +Portait touch input method returns following attributes + +\snippet{unittest_hbinputmethod/unittest_hbinputmethod.cpp,2} + +Landscape touch input method returns following attributes + +\snippet{unittest_hbinputmethod/unittest_hbinputmethod.cpp,3} + +Chinese portrait input method returns following attributes + +\snippet{unittest_hbinputmethod/unittest_hbinputmethod.cpp,4} + +Chinese landscape input method returns following attributes + +\snippet{unittest_hbinputmethod/unittest_hbinputmethod.cpp,5} + +Chinese handwriting recognition input method returns following attributes +(note use of HbInputModeCustom, in this example HWR is something that we +want to active from UI separately). + +\snippet{unittest_hbinputmethod/unittest_hbinputmethod.cpp,6} \sa QInputContext \sa HbInputFocusObject @@ -103,7 +181,7 @@ /*! Initializes the input framework. */ -bool HbInputMethod::initializeFramework(QApplication& app) +bool HbInputMethod::initializeFramework(QApplication &app) { // Activate singleton shutdown. connect(&app, SIGNAL(aboutToQuit()), HbInputModeCache::instance(), SLOT(shutdown())); @@ -120,8 +198,12 @@ master->d_ptr->mIsActive = true; // Finally set application input context. - QInputContext* proxy = master->d_ptr->newProxy(); - app.setInputContext(proxy); + QInputContext *proxy = master->d_ptr->proxy(); + // A check required so that Qt does not delete inputcontext + // which we are passing. + if (proxy != app.inputContext()) { + app.setInputContext(proxy); + } return true; } @@ -131,20 +213,20 @@ InitializeFramework method has been called, even when there is no focused editor (in some cases it may be so called null input method). */ -HbInputMethod* HbInputMethod::activeInputMethod() +HbInputMethod *HbInputMethod::activeInputMethod() { // First try, try app input context directly. It is possible that it is an instance // of HbInputMethod that is installed directly there without framework knowing about it // (that shouldn't be done, but it is possible). That's why we rely on app input context as // a primary source instead of mode cache. - QInputContext* context = qApp->inputContext(); + QInputContext *context = qApp->inputContext(); if (context && context->inherits("HbInputMethod")) { - HbInputMethod* active = static_cast(context); + HbInputMethod *active = static_cast(context); return active; } // Then check if the 'null' is active. - HbInputMethod* nullInstance = HbInputMethodNull::Instance(); + HbInputMethod *nullInstance = HbInputMethodNull::Instance(); if (nullInstance && nullInstance->isActiveMethod()) { return nullInstance; } @@ -155,7 +237,7 @@ } /*! -Lists custom input methods. +Lists all custom input methods. */ QList HbInputMethod::listCustomInputMethods() { @@ -163,8 +245,23 @@ } /*! -Activates given input method. Input context is -switched to custom method. Returns false if input method was not found +Lists custom input methods for given parameters. +*/ +QList HbInputMethod::listCustomInputMethods(Qt::Orientation orientation, const HbInputLanguage &language) +{ + return HbInputModeCache::instance()->listCustomInputMethods(orientation, language); +} + +/*! +Returns default input method for given orientation. +*/ +HbInputMethodDescriptor HbInputMethod::defaultInputMethod(Qt::Orientation orientation) +{ + return HbInputModeCache::instance()->defaultInputMethod(orientation); +} + +/*! +Activates given input method. Returns false if input method was not found or the framework was not able to activate it. */ bool HbInputMethod::activateInputMethod(const HbInputMethodDescriptor &inputMethod) @@ -172,17 +269,15 @@ Q_D(HbInputMethod); if (!inputMethod.isEmpty()) { - HbInputSettingProxy::instance()->setActiveCustomInputMethod(inputMethod); - if (inputMethod.isDefault()) { - d->setFocusCommon(); - return true; + d->setFocusCommon(); + return true; } else { HbInputMethod *customMethod = HbInputModeCache::instance()->loadInputMethod(inputMethod); - if (customMethod) { + if (customMethod && HbInputModeCache::instance()->acceptsState(customMethod, d->mInputState)) { d->contextSwitch(customMethod); - return true; - } + return true; + } } } @@ -238,12 +333,14 @@ */ void HbInputMethod::activeKeyboardChanged(HbKeyboardType newKeyboard) { - if (!isActiveMethod()) { + if (!isActiveMethod() || !HbInputSettingProxy::instance()->orientationChangeCompleted()) { return; } + Q_D(HbInputMethod); + d->mInputState.setKeyboard(newKeyboard); - HbInputMethod* stateHandler = d->findStateHandler(d->mInputState); + HbInputMethod *stateHandler = d->findStateHandler(d->mInputState); if (stateHandler) { d->inputStateToEditor(d->mInputState); if (stateHandler != this) { @@ -283,7 +380,7 @@ /*! Returns pointer to active focus object. */ -HbInputFocusObject* HbInputMethod::focusObject() const +HbInputFocusObject *HbInputMethod::focusObject() const { Q_D(const HbInputMethod); return d->mFocusObject; @@ -296,7 +393,7 @@ \sa setFocusObject */ -void HbInputMethod::setFocusWidget(QWidget* widget) +void HbInputMethod::setFocusWidget(QWidget *widget) { Q_D(HbInputMethod); @@ -304,19 +401,32 @@ return; } - QInputContext::setFocusWidget(widget); + if (!widget) { + bool unfocus = true; - if (!widget) { + if (d->mFocusObject) { + // If the input focus is inside HbGraphicsScene then do not unfocus automatically. + if (d->ignoreFrameworkFocusRelease(d->mFocusObject->object())) { + unfocus = false; + } + } + // Losing focus. - if (d->mFocusObject) { + if (d->mFocusObject && unfocus) { focusLost(false); + d->hideMainWindow(); delete d->mFocusObject; d->mFocusObject = 0; } + return; } + + // attach focuswidget to prxoy inputcontext as proxy is + // the only inputcotext known to qt framework. + d->proxy()->QInputContext::setFocusWidget(widget); - QGraphicsView* gView = qobject_cast(widget); + QGraphicsView *gView = qobject_cast(widget); if (gView) { // We don't want to focus to graphics view but the items inside the scene, so just return return; @@ -337,6 +447,7 @@ if (readOnly && HbInputFocusObject::isReadOnlyWidget(widget)) { if (d->mFocusObject) { focusLost(); + d->hideMainWindow(); } return; } @@ -363,7 +474,7 @@ // Attach focus. d->mFocusObject = new HbInputFocusObject(widget); - connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(editorDeleted(QObject*))); + connect(widget, SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *))); d->setFocusCommon(); @@ -381,13 +492,17 @@ Checks if the destroyed widget is currently focused and clears the focus if needed. This method should not be overridden. */ -void HbInputMethod::widgetDestroyed(QWidget* widget) +void HbInputMethod::widgetDestroyed(QWidget *widget) { Q_D(HbInputMethod); if (d->mFocusObject && d->mFocusObject->object() == widget) { delete d->mFocusObject; d->mFocusObject = 0; + // passing to actual QInputContext which is attached to Qt framework. + // which will internally set QInputContext::focusWidget to Null. + d->proxy()->QInputContext::widgetDestroyed(widget); + d->proxy()->QInputContext::setFocusWidget(0); } } @@ -401,7 +516,7 @@ \sa setFocusWidget \sa HbInputFocusObject */ -void HbInputMethod::setFocusObject(HbInputFocusObject* focusObject) +void HbInputMethod::setFocusObject(HbInputFocusObject *focusObject) { Q_D(HbInputMethod); @@ -412,22 +527,18 @@ if (focusObject == 0) { // Losing focus. if (d->mFocusObject != 0) { + disconnect(d->mFocusObject->object(), SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *))); focusLost(false); + d->hideMainWindow(); delete d->mFocusObject; d->mFocusObject = 0; } return; } - if(d->compareWithCurrentFocusObject( focusObject )) { - // The incoming focus object is either same or points to same - // widget that the framework is already focused to and nothing needs to be done here. - // But because the ownership of the focus object is transferred to the - // the framework, we need to delete the the incoming focus object in case it is - // dirrefent than current one. - if (d->mFocusObject != focusObject) { - delete focusObject; - } + if (d->compareWithCurrentFocusObject(focusObject)) { + // The incoming focus object is either same or points to same + // widget that the framework is already focused to and nothing needs to be done here. return; } @@ -437,21 +548,14 @@ if (d->mFocusObject) { refreshHost = true; focusLost(true); - disconnect(d->mFocusObject->object(), SIGNAL(destroyed(QObject*)), this, SLOT(editorDeleted(QObject*))); + disconnect(d->mFocusObject->object(), SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *))); delete d->mFocusObject; d->mFocusObject = 0; } - QInputContext::setFocusWidget(0); // Attach focus. d->mFocusObject = focusObject; - connect(d->mFocusObject->object(), SIGNAL(destroyed(QObject*)), this, SLOT(editorDeleted(QObject*))); - - // If this is embedded QWidget, then set base class focus too. - QWidget *widget = qobject_cast(focusObject->object()); - if (widget) { - QInputContext::setFocusWidget(widget); - } + connect(d->mFocusObject->object(), SIGNAL(destroyed(QObject *)), this, SLOT(editorDeleted(QObject *))); d->setFocusCommon(); @@ -513,7 +617,7 @@ The framework calls this method every time the input state changes. This is an empty default implementation and the inheriting class should override it. */ -void HbInputMethod::inputStateActivated(const HbInputState& newState) +void HbInputMethod::inputStateActivated(const HbInputState &newState) { Q_UNUSED(newState); // Empty default implementation. @@ -563,7 +667,7 @@ \sa activateNextState \sa InputState */ -bool HbInputMethod::activateState(const HbInputState& state) +bool HbInputMethod::activateState(const HbInputState &state) { Q_D(HbInputMethod); @@ -573,7 +677,7 @@ d->mStateChangeInProgress = true; - HbInputMethod* stateHandler = HbInputModeCache::instance()->findStateHandler(state); + HbInputMethod *stateHandler = HbInputModeCache::instance()->findStateHandler(state); if (!stateHandler) { stateHandler = HbInputMethodNull::Instance(); @@ -619,7 +723,7 @@ currentTextCase = HbTextCaseLower; refresh = true; } - } else if (autoCaseNeeded && currentTextCase != HbTextCaseUpper ) { + } else if (autoCaseNeeded && currentTextCase != HbTextCaseUpper) { if (!d->isFixedCaseEditor()) { currentTextCase = HbTextCaseAutomatic; refresh = true; @@ -641,18 +745,14 @@ */ void HbInputMethod::orientationChanged(Qt::Orientation orientation) { + Q_D(HbInputMethod); Q_UNUSED(orientation); - if (isActiveMethod()) { - // Make sure that if there was an editor focus before the orientation change, - // it will re-focus. - QInputContext *ic = qApp->inputContext(); - if (ic) { - QEvent *event = new QEvent(QEvent::RequestSoftwareInputPanel); - ic->filterEvent(event); - delete event; - } + if (d->mOldFocusObject) { + setFocusObject(d->mOldFocusObject); + d->mOldFocusObject = 0; } + } /*! @@ -663,6 +763,16 @@ */ void HbInputMethod::orientationAboutToChange() { + Q_D(HbInputMethod); + if(isActiveMethod()) { + reset(); + } + d->inputStateToEditor(d->mInputState); + if (d->mFocusObject) { + d->mOldFocusObject = d->mFocusObject; + d->mFocusObject = 0; + } + HbVkbHostBridge::instance()->closeKeypad(true); } /*! @@ -712,22 +822,24 @@ (such as touch keypads). This may be needed in some special cases where the underlying application wants to make sure that there are no input related elements on the screen. -This is a if-all-else fails backup method. Same can be done (more efficiently) by doing +This is a if-all-else fails backup method. Same can be done by doing following. \code -QInputContext* inputContext = qApp->inputContext(); -if (inputContext) { - inputContext->setFocusWidget(0); +QInputContext* ic = qApp->inputContext(); +if (ic) { + QEvent *closeEvent = new QEvent(QEvent::CloseSoftwareInputPanel); + ic->filterEvent(closeEvent); + delete closeEvent; } \endcode */ void HbInputMethod::forceUnfocus() { - HbInputMethod* active = activeInputMethod(); + HbInputMethod *active = activeInputMethod(); if (active) { - active->focusLost(false); + active->focusLost(false); delete active->d_ptr->mFocusObject; active->d_ptr->mFocusObject = 0; } @@ -745,7 +857,7 @@ /*! Deep copies the input state back to editor interface. */ -void HbInputMethod::inputStateToEditor(const HbInputState& source) +void HbInputMethod::inputStateToEditor(const HbInputState &source) { Q_D(HbInputMethod); d->inputStateToEditor(source); @@ -774,12 +886,22 @@ Q_UNUSED(obj); focusLost(); - + d->hideMainWindow(); delete d->mFocusObject; d->mFocusObject = 0; reset(); } +/*! +Returns the input method descriptor the framework used for loading this plugin. +Returns empty descriptor if the framework doesn't recognize this input method +(ie. it was not resolved by input mode cache). +*/ +HbInputMethodDescriptor HbInputMethod::descriptor() const +{ + return HbInputModeCache::instance()->descriptor(this); +} + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethod.h --- a/src/hbcore/inputfw/hbinputmethod.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethod.h Thu Jul 22 16:36:53 2010 +0100 @@ -46,51 +46,55 @@ HbInputMethod(); virtual ~HbInputMethod(); - static bool initializeFramework(QApplication& app); + static bool initializeFramework(QApplication &app); static void forceUnfocus(); - static HbInputMethod* activeInputMethod(); + static HbInputMethod *activeInputMethod(); static QList listCustomInputMethods(); + static QList listCustomInputMethods(Qt::Orientation orientation, const HbInputLanguage &language); + static HbInputMethodDescriptor defaultInputMethod(Qt::Orientation orientation); virtual void focusReceived(); virtual void focusLost(bool focusSwitch = true); bool isActiveMethod() const; - HbInputFocusObject* focusObject() const; - void setFocusObject(HbInputFocusObject* focusObject); + HbInputFocusObject *focusObject() const; + void setFocusObject(HbInputFocusObject *focusObject); void lockFocus(); void unlockFocus(); // From QInputContext (do not override). - void widgetDestroyed(QWidget* widget); - void setFocusWidget(QWidget* widget); + void widgetDestroyed(QWidget *widget); + void setFocusWidget(QWidget *widget); HbInputState inputState() const; - bool activateState(const HbInputState& state); + bool activateState(const HbInputState &state); void updateState(); void editorRootState(HbInputState &result) const; bool automaticTextCaseNeeded() const; bool activateInputMethod(const HbInputMethodDescriptor &inputMethod); protected: - virtual void inputStateActivated(const HbInputState& newState); + virtual void inputStateActivated(const HbInputState &newState); virtual void inputLanguageChanged(const HbInputLanguage &newLanguage); - virtual void secondaryInputLanguageChanged(const HbInputLanguage &newLanguage); + virtual void secondaryInputLanguageChanged(const HbInputLanguage &newLanguage); bool stateChangeInProgress() const; HbInputLanguage activeLanguage() const; bool modeAllowedInEditor(HbInputModeType mode) const; - void inputStateToEditor(const HbInputState& source); + void inputStateToEditor(const HbInputState &source); void constructLatinState(HbInputState &result) const; + HbInputMethodDescriptor descriptor() const; + public slots: void globalInputLanguageChanged(const HbInputLanguage &newLanguage); void globalSecondaryInputLanguageChanged(const HbInputLanguage &newLanguage); - void activeKeyboardChanged(HbKeyboardType newKeyboard); + void activeKeyboardChanged(HbKeyboardType newKeyboard); void orientationChanged(Qt::Orientation orientation); virtual void orientationAboutToChange(); void editorDeleted(QObject *obj); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethod_p.cpp --- a/src/hbcore/inputfw/hbinputmethod_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethod_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,22 +22,34 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputmethod_p.h" +#include "hbinputmethod.h" + #include #include +#include #include #include #include +#include -#include "hbinputmethod.h" -#include "hbinputmethod_p.h" #include "hbinputmodecache_p.h" #include "hbinputsettingproxy.h" -#include "hbinputcontextproxy_p.h" +#include "hbinputcontextproxy_p.h" #include "hbinputfilter.h" #include "hbinputmethodnull_p.h" #include "hbinpututils.h" #include "hbinputstandardfilters.h" +#include "hbinputmainwindow_p.h" +#include "hbgraphicsscene.h" +#include +#include +#if defined(Q_OS_SYMBIAN) +#include +#include +#include +#endif /// @cond /*! @@ -80,26 +92,26 @@ Reads input state information from focused editor using editor interface and creates a local copy of it. Finds out correct values for those fields that have not been initialized by the client application. */ -void HbInputMethodPrivate::inputStateFromEditor(HbInputState& result) -{ +void HbInputMethodPrivate::inputStateFromEditor(HbInputState &result) +{ if (mFocusObject) { - HbEditorInterface& editorInterface = mFocusObject->editorInterface(); + HbEditorInterface &editorInterface = mFocusObject->editorInterface(); editorInterface.lastFocusedState(result); - if (result != HbInputState()) { + if (result != HbInputState()) { // The editor has been focused before. Let's see if the input language has changed since the editor - // was last focused. + // was last focused. HbInputLanguage language = findStateLanguage(); if (language != result.language()) { - // Reconstruct the state since we don't know if the last one is valid for the new language. - editorRootState(result); + // Reconstruct the state since we don't know if the last one is valid for the new language. + editorRootState(result); return; } // Keyboard may have changed since the last focus. Re-initialize it. - result.setKeyboard(activeKeyboard()); - return; - } + result.setKeyboard(activeKeyboard()); + return; + } // this editor has not been focused before, return the root state. editorRootState(result); @@ -118,7 +130,7 @@ \internal Transfers local copy of the input state back to the editor using editor interface. */ -void HbInputMethodPrivate::inputStateToEditor(const HbInputState& source) +void HbInputMethodPrivate::inputStateToEditor(const HbInputState &source) { if (mFocusObject) { mFocusObject->editorInterface().setLastFocusedState(source); @@ -143,8 +155,8 @@ !ret.isLatinAlphabetLanguage()) { // This is latin alphabet flagged editor, but the language isn't // latin alphabet language. Switch to english locally. - ret = QLocale::English; - } + ret = QLocale::English; + } } } @@ -166,7 +178,7 @@ return false; } - if (constraints & HbEditorConstraintFixedInputMode){ + if (constraints & HbEditorConstraintFixedInputMode) { if (!mFocusObject || mFocusObject->editorInterface().mode() != mode) { // This is fixed mode editor but proposed mode is something else. // Reject. @@ -177,7 +189,7 @@ if ((constraints & HbEditorConstraintLatinAlphabetOnly) && (mode & HbChineseModeMask)) { // Editor is flagged to be latin-alphabet only but // the input mode indicates non-latin mode. Reject. - return false; + return false; } return true; } @@ -186,7 +198,7 @@ \internal Returns true if given state is valid in focused editor. */ -bool HbInputMethodPrivate::stateAllowedInEditor(const HbInputState& state) +bool HbInputMethodPrivate::stateAllowedInEditor(const HbInputState &state) { if (!modeAllowedInEditor(state.inputMode())) { return false; @@ -213,16 +225,42 @@ \internal Finds state handler for given input state. */ -HbInputMethod* HbInputMethodPrivate::findStateHandler(HbInputState& state) -{ +HbInputMethod *HbInputMethodPrivate::findStateHandler(HbInputState &state) +{ + HbInputMethod *stateHandler = 0; + + if (mFocusObject && + (mFocusObject->editorInterface().inputConstraints() & HbEditorConstraintIgnoreFocus)) { + return HbInputMethodNull::Instance(); + } + if (stateAllowedInEditor(state)) { - HbInputMethod* stateHandler = HbInputModeCache::instance()->findStateHandler(state); - if (stateHandler) { - return stateHandler; + HbInputMethodDescriptor preferredMethod = HbInputSettingProxy::instance()->preferredInputMethod(); + if (!preferredMethod.isEmpty()) { + stateHandler = HbInputModeCache::instance()->loadInputMethod(preferredMethod); + if (stateHandler && !HbInputModeCache::instance()->acceptsState(stateHandler, state)) { + stateHandler = 0; + } + } + + if (!stateHandler) { + stateHandler = HbInputModeCache::instance()->findStateHandler(state); + } + + if (!stateHandler && + state.inputMode() == HbInputModeNumeric && + state.language() != QLocale::English && + mFocusObject && + (mFocusObject->editorInterface().inputConstraints() & HbEditorConstraintFixedInputMode)) { + // This is number only editor but there was no numeric handler + // for specified language. Use default numeric hanlder + // as a fallback. + state.setLanguage(QLocale::English); + stateHandler = HbInputModeCache::instance()->findStateHandler(state); } } - return 0; + return stateHandler; } /*! @@ -238,8 +276,8 @@ // This is latin alphabet flagged editor, but the language isn't // latin alphabet language. Switch to english locally. lang = QLocale::English; - } - + } + return lang; } @@ -257,7 +295,8 @@ } if (mFocusObject) { - if (mFocusObject->inputMethodHints() & (Qt::ImhNoAutoUppercase | Qt::ImhPreferLowercase | Qt::ImhPreferUppercase)) { + if (mFocusObject->inputMethodHints() & (Qt::ImhNoAutoUppercase | Qt::ImhPreferLowercase | + Qt::ImhPreferUppercase | Qt::ImhDialableCharactersOnly | Qt::ImhEmailCharactersOnly | Qt::ImhUrlCharactersOnly)) { // Input method hint forbids auto-capitalisation or prefers either case. return false; } @@ -275,22 +314,22 @@ QString sText = mFocusObject->editorSurroundingText(); int cursorPosition = mFocusObject->editorCursorPosition(); - if(cursorPosition >= 2) { - QString previousChar = sText.mid(cursorPosition-1, 1); - QString previousToPreviousChar = sText.mid(cursorPosition-2, 1); + if (cursorPosition >= 2) { + QString previousChar = sText.mid(cursorPosition - 1, 1); + QString previousToPreviousChar = sText.mid(cursorPosition - 2, 1); - if (QString::compare( previousChar, " " ) == 0) { - if (QString::compare( previousToPreviousChar, "." ) == 0) { + if (QString::compare(previousChar, " ") == 0) { + if (QString::compare(previousToPreviousChar, ".") == 0) { return true; } - if (QString::compare( previousToPreviousChar, "!" ) == 0) { + if (QString::compare(previousToPreviousChar, "!") == 0) { return true; } - if (QString::compare( previousToPreviousChar, "?" ) == 0) { + if (QString::compare(previousToPreviousChar, "?") == 0) { return true; } } - } else if(cursorPosition == 0) { + } else if (cursorPosition == 0) { // when the cursor is at the beginning of the editor, auto-capitalisation is needed return true; } @@ -342,7 +381,8 @@ { Q_Q(HbInputMethod); - if (mFocusObject) { + if (mFocusObject && + !(mFocusObject->editorInterface().inputConstraints() & HbEditorConstraintIgnoreFocus)) { Qt::InputMethodHints hints = mFocusObject->inputMethodHints(); if (hints & Qt::ImhDialableCharactersOnly) { setUpFocusedObjectAsPhoneNumberEditor(); @@ -354,7 +394,7 @@ setUpFocusedObjectAsUrlEditor(); } else if (hints & Qt::ImhEmailCharactersOnly) { setUpFocusedObjectAsEmailEditor(); - } + } if (mFocusObject->editorInterface().editorClass() != HbInputEditorClassUnknown && mFocusObject->editorInterface().extraDictionaryId() == 0) { @@ -363,34 +403,19 @@ } } - // Create input state. + // Create input state. inputStateFromEditor(mInputState); // Find state handler - HbInputMethod* stateHandler = 0; - HbInputMethodDescriptor activeMethod = HbInputSettingProxy::instance()->activeCustomInputMethod(); - if (!activeMethod.isEmpty() && !activeMethod.isDefault()) { - // A custom method is active. Don't resolve, just try to load it. - stateHandler = HbInputModeCache::instance()->loadInputMethod(activeMethod); - } - - if (!stateHandler) { - // It either wasn't a custom method or we were not able to load the custom method. - // Resolve normally. - stateHandler = findStateHandler(mInputState); - } - - if (editorConstraints() & HbEditorConstraintIgnoreFocus) { - // The editor requests us to ignore the focus. - stateHandler = 0; - } - + HbInputMethod *stateHandler = findStateHandler(mInputState); if (stateHandler == 0) { // No state handler found (this should never happen under normal circumstances). // Fall back to null method. stateHandler = HbInputMethodNull::Instance(); } + checkAndShowMainWindow(); + if (stateHandler != q_ptr) { // This method cannot handle requested input state. Switch to another one. contextSwitch(stateHandler); @@ -420,14 +445,14 @@ \internal Returns true if given focus object is same as currently focused or points to same editor instance. */ -bool HbInputMethodPrivate::compareWithCurrentFocusObject(HbInputFocusObject* focusObject) const +bool HbInputMethodPrivate::compareWithCurrentFocusObject(HbInputFocusObject *focusObject) const { // both null pointer - if ( !mFocusObject ) { + if (!mFocusObject) { return false; } - if ( !focusObject ) { + if (!focusObject) { return false; } @@ -442,18 +467,21 @@ \internal Creates and returns new input context proxy. */ -QInputContext* HbInputMethodPrivate::newProxy() +QInputContext *HbInputMethodPrivate::proxy() { - return new HbInputContextProxy(q_ptr); + if (!mProxy) { + mProxy = new HbInputContextProxy(q_ptr); + } + return mProxy; } /*! \internal -Returns true if currently focused editor is fixed text case editor. +Returns true if currently focused editor is fixed text case editor. */ bool HbInputMethodPrivate::isFixedCaseEditor() const { - if (mFocusObject) { + if (mFocusObject) { return (mFocusObject->inputMethodHints() & (Qt::ImhLowercaseOnly | Qt::ImhUppercaseOnly)); } @@ -467,7 +495,7 @@ bool HbInputMethodPrivate::isLowerCaseOnlyEditor() const { if (mFocusObject) { - return (mFocusObject->inputMethodHints() & Qt::ImhLowercaseOnly); + return (mFocusObject->inputMethodHints() & Qt::ImhLowercaseOnly); } return false; @@ -480,7 +508,7 @@ bool HbInputMethodPrivate::isUpperCaseOnlyEditor() const { if (mFocusObject) { - return (mFocusObject->inputMethodHints() & Qt::ImhUppercaseOnly); + return (mFocusObject->inputMethodHints() & Qt::ImhUppercaseOnly); } return false; @@ -491,7 +519,7 @@ This method is needed during context switch operation. It transfers relevant parts of input method's internal state to the input method that is about to assume control. */ -void HbInputMethodPrivate::transfer(HbInputMethod* source) +void HbInputMethodPrivate::transfer(HbInputMethod *source) { Q_Q(HbInputMethod); @@ -504,8 +532,8 @@ mFocusObject = source->d_ptr->mFocusObject; source->d_ptr->mFocusObject = 0; if (mFocusObject) { - q->disconnect(mFocusObject->object(), SIGNAL(destroyed(QObject*)), source, SLOT(editorDeleted(QObject*))); - q->connect(mFocusObject->object(), SIGNAL(destroyed(QObject*)), q, SLOT(editorDeleted(QObject*))); + q->disconnect(mFocusObject->object(), SIGNAL(destroyed(QObject *)), source, SLOT(editorDeleted(QObject *))); + q->connect(mFocusObject->object(), SIGNAL(destroyed(QObject *)), q, SLOT(editorDeleted(QObject *))); } // Makes sure there isn't focus lock. @@ -514,6 +542,15 @@ // Transfer state. mInputState = source->d_ptr->mInputState; + // we need to transfer focuswidget from current proxy to the next proxy. + // Qt may clear the flag in case the focus widget is scene scene with an editor and + // the editor is unfocused. Hb input framework does not lose focus in this way, so + // we reset the flag if it is unset. + if (source->d_ptr->proxy()->focusWidget() && !source->d_ptr->proxy()->focusWidget()->testAttribute(Qt::WA_InputMethodEnabled)) { + source->d_ptr->proxy()->focusWidget()->setAttribute(Qt::WA_InputMethodEnabled); + } + proxy()->QInputContext::setFocusWidget(source->d_ptr->proxy()->focusWidget()); + // Set this one active. mIsActive = true; source->d_ptr->mIsActive = false; @@ -528,18 +565,20 @@ calls this method to switch active input method. After successful call, the given input method will be application's active input context. */ -void HbInputMethodPrivate::contextSwitch(HbInputMethod* toBeActive) +void HbInputMethodPrivate::contextSwitch(HbInputMethod *toBeActive) { Q_Q(HbInputMethod); if (q == toBeActive) { + // Already same input context, just notify focus received + q->focusReceived(); return; } // Deactivate before focus event. That way input method is able to // recognize in focus handler that the focus lost event was a result of // context switch and close all its open UI-elements. This needs to be done - // even there is no active focus object (to make sure that virtual keyboard & + // even there is no active focus object (to make sure that virtual keyboard & // other potential UI elements will be removed). mIsActive = false; q->focusLost(false); @@ -551,8 +590,10 @@ toBeActive->d_ptr->transfer(q); // Active new context. - QInputContext* proxy = toBeActive->d_ptr->newProxy(); - qApp->setInputContext(proxy); + QInputContext *proxy = toBeActive->d_ptr->proxy(); + if (proxy != qApp->inputContext()) { + qApp->setInputContext(proxy); + } if (toBeActive->focusObject()) { // Notify focus change. @@ -568,15 +609,15 @@ Constructs the first input state for an editor that hasn't been focused before. */ void HbInputMethodPrivate::editorRootState(HbInputState &result) const -{ +{ - if (mFocusObject) { + if (mFocusObject) { HbInputLanguage language = findStateLanguage(); - HbInputModeType inputMode = initialInputMode(language); + HbInputModeType inputMode = initialInputMode(language); result = HbInputState(inputMode, initialTextCase(inputMode), activeKeyboard(), - language); + language); } else { result = HbInputState(); } @@ -625,28 +666,28 @@ } return ret; -} +} /*! \internal Finds the first input mode for an editor that hasn't been focus before. */ HbInputModeType HbInputMethodPrivate::initialInputMode(const HbInputLanguage &language) const -{ +{ HbInputModeType ret = HbInputModeNone; - if (mFocusObject) { + if (mFocusObject) { if (mFocusObject->editorInterface().inputConstraints() & HbEditorConstraintFixedInputMode) { // This is fixed mode editor, always trust what editor interface gives us. ret = (HbInputModeType)mFocusObject->editorInterface().mode(); } else { - // Editor doesn't have mode asigned. Propose default mode. + // Editor doesn't have mode asigned. Propose default mode. Qt::InputMethodHints hints = mFocusObject->inputMethodHints(); if (mFocusObject->editorInterface().isNumericEditor()) { // It is fixed numeric editor. ret = HbInputModeNumeric; } else { - ret = defaultInputMode(language); + ret = defaultInputMode(language); } } } @@ -661,10 +702,10 @@ */ void HbInputMethodPrivate::constructLatinState(HbInputState &result) const { - result.setLanguage(HbInputLanguage(QLocale::English)); - result.setInputMode(HbInputModeDefault); - result.setKeyboard(activeKeyboard()); - result.setTextCase(initialTextCase(HbInputModeDefault)); + result.setLanguage(HbInputLanguage(QLocale::English)); + result.setInputMode(HbInputModeDefault); + result.setKeyboard(activeKeyboard()); + result.setTextCase(initialTextCase(HbInputModeDefault)); } /*! @@ -673,15 +714,7 @@ */ HbInputModeType HbInputMethodPrivate::defaultInputMode(const HbInputLanguage &inputLanguage) const { - if (inputLanguage == HbInputLanguage(QLocale::Chinese, QLocale::China)) { - return HbInputModePinyin; - } - if (inputLanguage == HbInputLanguage(QLocale::Chinese, QLocale::HongKong)) { - return HbInputModeStroke; - } - if (inputLanguage == HbInputLanguage(QLocale::Chinese, QLocale::Taiwan)) { - return HbInputModeZhuyin; - } + Q_UNUSED(inputLanguage); return HbInputModeDefault; } @@ -692,10 +725,10 @@ */ void HbInputMethodPrivate::setUpFocusedObjectAsDigitsOnlyEditor() { - if(mFocusObject) { + if (mFocusObject) { mFocusObject->editorInterface().setMode(HbInputModeNumeric); mFocusObject->editorInterface().setInputConstraints(HbEditorConstraintFixedInputMode); - if(!mFocusObject->editorInterface().filter()) { + if (!mFocusObject->editorInterface().filter()) { mFocusObject->editorInterface().setFilter(HbDigitsOnlyFilter::instance()); } mFocusObject->setInputMethodHints(Qt::ImhDigitsOnly | Qt::ImhNoPredictiveText); @@ -708,10 +741,10 @@ */ void HbInputMethodPrivate::setUpFocusedObjectAsFormattedNumberEditor() { - if(mFocusObject) { + if (mFocusObject) { mFocusObject->editorInterface().setMode(HbInputModeNumeric); mFocusObject->editorInterface().setInputConstraints(HbEditorConstraintFixedInputMode); - if(!mFocusObject->editorInterface().filter()) { + if (!mFocusObject->editorInterface().filter()) { mFocusObject->editorInterface().setFilter(HbFormattedNumbersFilter::instance()); } mFocusObject->setInputMethodHints(Qt::ImhFormattedNumbersOnly | Qt::ImhNoPredictiveText); @@ -724,10 +757,10 @@ */ void HbInputMethodPrivate::setUpFocusedObjectAsPhoneNumberEditor() { - if(mFocusObject) { + if (mFocusObject) { mFocusObject->editorInterface().setMode(HbInputModeNumeric); mFocusObject->editorInterface().setInputConstraints(HbEditorConstraintFixedInputMode); - if(!mFocusObject->editorInterface().filter()) { + if (!mFocusObject->editorInterface().filter()) { mFocusObject->editorInterface().setFilter(HbPhoneNumberFilter::instance()); } mFocusObject->setInputMethodHints(Qt::ImhDialableCharactersOnly | Qt::ImhNoPredictiveText); @@ -740,14 +773,14 @@ */ void HbInputMethodPrivate::setUpFocusedObjectAsEmailEditor() { - if(mFocusObject) { + if (mFocusObject) { mFocusObject->editorInterface().setMode(HbInputModeNone); mFocusObject->editorInterface().setInputConstraints(HbEditorConstraintLatinAlphabetOnly); - if(!mFocusObject->editorInterface().filter()) { + if (!mFocusObject->editorInterface().filter()) { mFocusObject->editorInterface().setFilter(HbEmailAddressFilter::instance()); } - mFocusObject->setInputMethodHints(Qt::ImhEmailCharactersOnly | Qt::ImhNoPredictiveText - | Qt::ImhPreferLowercase); + mFocusObject->setInputMethodHints(Qt::ImhEmailCharactersOnly | Qt::ImhNoPredictiveText + | Qt::ImhPreferLowercase); } } /*! @@ -756,19 +789,115 @@ */ void HbInputMethodPrivate::setUpFocusedObjectAsUrlEditor() { - if(mFocusObject) { + if (mFocusObject) { mFocusObject->editorInterface().setMode(HbInputModeNone); mFocusObject->editorInterface().setInputConstraints(HbEditorConstraintLatinAlphabetOnly); - if(!mFocusObject->editorInterface().filter()) { + if (!mFocusObject->editorInterface().filter()) { mFocusObject->editorInterface().setFilter(HbUrlFilter::instance()); } - mFocusObject->setInputMethodHints(Qt::ImhUrlCharactersOnly | Qt::ImhNoPredictiveText - | Qt::ImhPreferLowercase); + mFocusObject->setInputMethodHints(Qt::ImhUrlCharactersOnly | Qt::ImhNoPredictiveText + | Qt::ImhPreferLowercase); } } +/*! +\internal +Create an instance of HbInputMainWindow which is a transparent window. +*/ +void HbInputMethodPrivate::showMainWindow() +{ + // QGraphicsWidget is inside a graphics view which is not inside a HbMainWindow. + HbInputMainWindow *mainWindow = HbInputMainWindow::instance(); + mainWindow->showInputWindow(); + mInsideVanillaWindow = true; +} + +/*! +\internal + This function checks if focused object is inside a hbmainwindow, if it is inside a HbMainWindow + then it doesn't do anything. And if it finds that focused object is inside a vanilla window (windw != HbMainWindow) + then it creates a transparent window. +*/ +void HbInputMethodPrivate::checkAndShowMainWindow() +{ + // check if focused object is inside HbMainWindow. + mInsideVanillaWindow = false; + QWidget *focusedWidget = proxy()->focusWidget(); + if (focusedWidget) { + if (focusedWidget->inherits("HbMainWindow")) { + return; + } + +#if defined(HB_CSS_INSPECTOR) || defined(HB_SETTINGS_WINDOW) + QWidget *owningWindow = focusedWidget->window(); + // combo box lists spawn a new window for the popup + if (owningWindow->parentWidget()) { + owningWindow = owningWindow->parentWidget()->window(); + } +#ifdef HB_CSS_INSPECTOR + if (owningWindow == HbCssInspectorWindow::instance()->window()){ + return; + } +#endif +#ifdef HB_SETTINGS_WINDOW + if (owningWindow == HbSettingsWindow::instance()->window()){ + return; + } +#endif +#endif + + // in symbian while launching a window on top of another + // there is a CCoeControl::FocusChange call on the vanilla window. + // causing it to lots of wiered problem. +#if defined(Q_OS_SYMBIAN) + mFocusLocked = true; +#endif + showMainWindow(); +#if defined(Q_OS_SYMBIAN) + // activating this at this time.. + // will not require creation of new focus object + // as we already have one ..as we ignored the focus switch due to + // main window show. + focusedWidget->activateWindow(); + mFocusLocked = false; +#endif + } +} + +/*! +\internal +hides HbInputMainWindow. +*/ +void HbInputMethodPrivate::hideMainWindow() +{ + // QGraphicsWidget is inside a graphics view which is not inside a HbMainWindow. + if (mInsideVanillaWindow) { + HbInputMainWindow *mainWindow = HbInputMainWindow::instance(); + mainWindow->hideInputWindow(); + } +} + +/*! +\internal +Returns true if given object lives inside HbGraphicsScene. In that case, +Qt-level setFocusWidget(0) calls should be ignored because input focusing rules inside +that scene variant are different. +*/ +bool HbInputMethodPrivate::ignoreFrameworkFocusRelease(QObject *object) const +{ + QGraphicsObject *graphicsObject = qobject_cast(object); + if (graphicsObject) { + return (qobject_cast(graphicsObject->scene()) != 0); + } + + QWidget *widget = qobject_cast(object); + if (widget && widget->graphicsProxyWidget()) { + return (qobject_cast(widget->graphicsProxyWidget()->scene()) != 0); + } + + return false; +} + /// @endcond // End of file - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethod_p.h --- a/src/hbcore/inputfw/hbinputmethod_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethod_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,71 +26,85 @@ #define HB_INPUT_METHOD_P_H #include +#include #include #include #include +#include "hbinputcontextproxy_p.h" class HbInputStateMachine; class HbInputFilter; class HbInputMethod; +class HbInputMainWindow; +class HbInputContextProxy; class HB_CORE_PRIVATE_EXPORT HbInputMethodPrivate { Q_DECLARE_PUBLIC(HbInputMethod) public: - explicit HbInputMethodPrivate(HbInputMethod* owner) + explicit HbInputMethodPrivate(HbInputMethod *owner) : q_ptr(owner), - mIsActive(false), - mFocusObject(0), - mInputState(HbInputModeNone, HbTextCaseNone, HbKeyboardNone), - mFocusLocked(false), - mStateChangeInProgress(false) + mProxy(0), + mIsActive(false), + mFocusObject(0), + mOldFocusObject(0), + mInputState(HbInputModeNone, HbTextCaseNone, HbKeyboardNone), + mFocusLocked(false), + mStateChangeInProgress(false), + mInsideVanillaWindow(false) {} ~HbInputMethodPrivate(); HbInputFilter *editorFilter() const; int editorConstraints() const; - void inputStateFromEditor(HbInputState& result); - void inputStateToEditor(const HbInputState& source); + void inputStateFromEditor(HbInputState &result); + void inputStateToEditor(const HbInputState &source); HbInputLanguage activeLanguage() const; bool modeAllowedInEditor(HbInputModeType mode) const; - bool stateAllowedInEditor(const HbInputState& state); - HbInputMethod* findStateHandler(HbInputState& startingState); + bool stateAllowedInEditor(const HbInputState &state); + HbInputMethod *findStateHandler(HbInputState &startingState); HbInputLanguage findStateLanguage() const; bool automaticTextCaseNeeded() const; bool textCaseApplies() const; HbKeyboardType activeKeyboard() const; void setFocusCommon(); void refreshState(); - bool compareWithCurrentFocusObject(HbInputFocusObject* focusObject) const; - QInputContext* newProxy(); + bool compareWithCurrentFocusObject(HbInputFocusObject *focusObject) const; + QInputContext *proxy(); bool isFixedCaseEditor() const; bool isLowerCaseOnlyEditor() const; bool isUpperCaseOnlyEditor() const; - void transfer(HbInputMethod* source); - void contextSwitch(HbInputMethod* toBeActive); + void transfer(HbInputMethod *source); + void contextSwitch(HbInputMethod *toBeActive); void editorRootState(HbInputState &result) const; void constructLatinState(HbInputState &result) const; - HbTextCase initialTextCase(HbInputModeType inputMode) const; + HbTextCase initialTextCase(HbInputModeType inputMode) const; HbInputModeType initialInputMode(const HbInputLanguage &language) const; - HbInputModeType defaultInputMode(const HbInputLanguage &inputLanguage) const; + HbInputModeType defaultInputMode(const HbInputLanguage &inputLanguage) const; void setUpFocusedObjectAsDigitsOnlyEditor(); void setUpFocusedObjectAsFormattedNumberEditor(); void setUpFocusedObjectAsPhoneNumberEditor(); void setUpFocusedObjectAsEmailEditor(); void setUpFocusedObjectAsUrlEditor(); + void initMainWindow(QWidget *window); + void checkAndShowMainWindow(); + void showMainWindow(); + void hideMainWindow(); + bool ignoreFrameworkFocusRelease(QObject *object) const; public: HbInputMethod *q_ptr; + QPointer mProxy; bool mIsActive; - HbInputFocusObject* mFocusObject; - HbInputState mInputState; + HbInputFocusObject *mFocusObject; + HbInputFocusObject *mOldFocusObject; + HbInputState mInputState; bool mFocusLocked; bool mStateChangeInProgress; QList mInputModes; - + bool mInsideVanillaWindow; private: // For unit test. static HbInputMethodPrivate *d_ptr(HbInputMethod *inputMethod) { Q_ASSERT(inputMethod); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethoddescriptor.cpp --- a/src/hbcore/inputfw/hbinputmethoddescriptor.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethoddescriptor.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -48,6 +48,9 @@ mPluginNameAndPath = desc.mPluginNameAndPath; mKey = desc.mKey; mDisplayName = desc.mDisplayName; + mDisplayNames = desc.mDisplayNames; + mIcon = desc.mIcon; + mIcons = desc.mIcons; } /*! @@ -100,6 +103,54 @@ } /*! +Returns the display names of the input method. +*/ +QStringList HbInputMethodDescriptor::displayNames() const +{ + return mDisplayNames; +} + +/*! +Sets the display names of the input method. +*/ +void HbInputMethodDescriptor::setDisplayNames(const QStringList &names) +{ + mDisplayNames = names; +} + +/*! +Returns the icon of the input method. +*/ +HbIcon HbInputMethodDescriptor::icon() const +{ + return mIcon; +} + +/*! +Sets the icon of the input method. +*/ +void HbInputMethodDescriptor::setIcon(const HbIcon &icon) +{ + mIcon = icon; +} + +/*! +Returns the icons of the input method. +*/ +QList HbInputMethodDescriptor::icons() const +{ + return mIcons; +} + +/*! +Sets the icons of the input method. +*/ +void HbInputMethodDescriptor::setIcons(const QList &icons) +{ + mIcons = icons; +} + +/*! Returns true if the descriptor is empty and doesn't point to an input plugin. */ bool HbInputMethodDescriptor::isEmpty() const @@ -108,13 +159,16 @@ } /*! -Asign operator. +Assign operator. */ void HbInputMethodDescriptor::operator=(const HbInputMethodDescriptor &descriptor) { mPluginNameAndPath = descriptor.mPluginNameAndPath; mKey = descriptor.mKey; mDisplayName = descriptor.mDisplayName; + mDisplayNames = descriptor.mDisplayNames; + mIcon = descriptor.mIcon; + mIcons = descriptor.mIcons; } /*! @@ -128,7 +182,7 @@ void HbInputMethodDescriptor::setDefault() { mPluginNameAndPath = HbInputDefaultMethodString; - mKey = QString(); + mKey.clear(); mDisplayName = QString("Default"); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethoddescriptor.h --- a/src/hbcore/inputfw/hbinputmethoddescriptor.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethoddescriptor.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,7 @@ #include #include +#include class HB_CORE_EXPORT HbInputMethodDescriptor { @@ -40,6 +41,12 @@ void setKey(const QString &newKey); QString displayName() const; void setDisplayName(const QString &name); + QStringList displayNames() const; + void setDisplayNames(const QStringList &names); + HbIcon icon() const; + void setIcon(const HbIcon &icon); + QList icons() const; + void setIcons(const QList &icons); bool isEmpty() const; void operator=(const HbInputMethodDescriptor &descriptor); void setDefault(); @@ -49,6 +56,9 @@ QString mPluginNameAndPath; QString mKey; QString mDisplayName; + QStringList mDisplayNames; + HbIcon mIcon; + QList mIcons; }; #endif // HB_INPUT_METHOD_DESCRIPTOR_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethodnull.cpp --- a/src/hbcore/inputfw/hbinputmethodnull.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethodnull.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ /*! \internal */ -HbInputMethodNull* HbInputMethodNull::Instance() +HbInputMethodNull *HbInputMethodNull::Instance() { static HbInputMethodNull myInstance; return &myInstance; @@ -83,7 +83,7 @@ /*! \internal */ -bool HbInputMethodNull::filterEvent(const QEvent* event) +bool HbInputMethodNull::filterEvent(const QEvent *event) { Q_UNUSED(event); return false; @@ -92,7 +92,7 @@ /*! \internal */ -void HbInputMethodNull::mouseHandler(int x, QMouseEvent* event) +void HbInputMethodNull::mouseHandler(int x, QMouseEvent *event) { Q_UNUSED(x); Q_UNUSED(event); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmethodnull_p.h --- a/src/hbcore/inputfw/hbinputmethodnull_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmethodnull_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,7 @@ class HB_CORE_PRIVATE_EXPORT HbInputMethodNull : public HbInputMethod { public: - static HbInputMethodNull* Instance(); + static HbInputMethodNull *Instance(); private: // This is singleton HbInputMethodNull(); @@ -43,7 +43,7 @@ QString language(); void reset(); bool filterEvent(const QEvent *event); - void mouseHandler(int x, QMouseEvent* event); + void mouseHandler(int x, QMouseEvent *event); }; #endif // HB_INPUT_METHOD_NULL_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmodecache.cpp --- a/src/hbcore/inputfw/hbinputmodecache.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmodecache.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputmodecache_p.h" + #include #include #include @@ -29,9 +31,9 @@ #include #include -#include "hbinputmodecache_p.h" #include "hbinpututils.h" #include "hbinputmethod.h" +#include "hbinputcontextplugin.h" #include "hbinputsettingproxy.h" #include "hbinputmodeproperties.h" #include "hbinputkeymapfactory.h" @@ -69,12 +71,13 @@ HbInputModeCachePrivate() : mWatcher(new QFileSystemWatcher()), mShuttingDown(false) {} ~HbInputModeCachePrivate() {} void refresh(const QString &directory = QString()); - QInputContextPlugin *pluginInstance(const QString& pluginFileName) const; + QInputContextPlugin *pluginInstance(const QString &pluginFileName) const; HbInputMethod *methodInstance(const QString &pluginFileName, const QString &key) const; HbInputModeProperties propertiesFromString(const QString &entry) const; HbInputModeProperties propertiesFromState(const HbInputState &state) const; HbInputMethod *cachedMethod(HbInputMethodListItem &item); void updateMonitoredPaths(); + bool isMappedLanguage(const HbInputLanguage &language) const; public: QFileSystemWatcher *mWatcher; @@ -82,13 +85,13 @@ bool mShuttingDown; }; -QInputContextPlugin* HbInputModeCachePrivate::pluginInstance(const QString& pluginFileName) const +QInputContextPlugin *HbInputModeCachePrivate::pluginInstance(const QString &pluginFileName) const { if (QLibrary::isLibrary(pluginFileName)) { QPluginLoader loader(pluginFileName); - QObject* plugin = loader.instance(); + QObject *plugin = loader.instance(); if (plugin) { - return qobject_cast(plugin); + return qobject_cast(plugin); } } @@ -100,12 +103,12 @@ QInputContextPlugin *plugin = pluginInstance(pluginFileName); if (plugin) { QInputContext *instance = plugin->create(key); - HbInputMethod *result = qobject_cast(instance); + HbInputMethod *result = qobject_cast(instance); if (result) { QStringList languages = plugin->languages(key); QList modeList; - foreach (QString language, languages) { - modeList.append(propertiesFromString(language)); + foreach(const QString &language, languages) { + modeList.append(propertiesFromString(language)); } result->d_ptr->mInputModes = modeList; } @@ -129,7 +132,7 @@ // Query plugin paths and scan the folders. QStringList folders = HbInputSettingProxy::instance()->inputMethodPluginPaths(); - foreach (QString folder, folders) { + foreach(const QString &folder, folders) { QDir dir(folder); for (unsigned int i = 0; i < dir.count(); i++) { QString path = QString(dir.absolutePath()); @@ -137,7 +140,7 @@ path += QDir::separator(); } path += dir[i]; - QInputContextPlugin* inputContextPlugin = pluginInstance(path); + QInputContextPlugin *inputContextPlugin = pluginInstance(path); if (inputContextPlugin) { HbInputMethodListItem listItem; listItem.descriptor.setPluginNameAndPath(dir.absolutePath() + QDir::separator() + dir[i]); @@ -145,10 +148,17 @@ // For each found plugin, check if there is already a list item for it. // If not, then add one. QStringList contextKeys = inputContextPlugin->keys(); - foreach (QString key, contextKeys) { + foreach(const QString &key, contextKeys) { listItem.descriptor.setKey(key); listItem.descriptor.setDisplayName(inputContextPlugin->displayName(key)); + HbInputContextPlugin *extension = qobject_cast(inputContextPlugin); + if (extension) { + listItem.descriptor.setDisplayNames(extension->displayNames(key)); + listItem.descriptor.setIcon(extension->icon(key)); + listItem.descriptor.setIcons(extension->icons(key)); + } + int index = mMethods.indexOf(listItem); if (index >= 0) { // The method is already in the list, the situation hasn't changed. @@ -171,17 +181,22 @@ // If the item to be removed happens to be the active one, // try to deal with the situation. mMethods[i].cached->forceUnfocus(); - if (mMethods[i].descriptor.pluginNameAndPath() == HbInputSettingProxy::instance()->activeCustomInputMethod().pluginNameAndPath()) { - // The active custom method is being removed. - // Clear out related setting proxy values. - HbInputSettingProxy::instance()->setActiveCustomInputMethod(HbInputMethodDescriptor()); + // The active custom method is being removed. + // Clear out related setting proxy values. + if (mMethods[i].descriptor.pluginNameAndPath() == HbInputSettingProxy::instance()->preferredInputMethod(Qt::Horizontal).pluginNameAndPath()) { + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, HbInputMethodDescriptor()); + } + if (mMethods[i].descriptor.pluginNameAndPath() == HbInputSettingProxy::instance()->preferredInputMethod(Qt::Vertical).pluginNameAndPath()) { + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Vertical, HbInputMethodDescriptor()); } // Replace it with null input context. HbInputMethod *master = HbInputMethodNull::Instance(); master->d_ptr->mIsActive = true; - QInputContext* proxy = master->d_ptr->newProxy(); - qApp->setInputContext(proxy); + QInputContext *proxy = master->d_ptr->proxy(); + if (proxy != qApp->inputContext()) { + qApp->setInputContext(proxy); + } } delete mMethods[i].cached; mMethods.removeAt(i); @@ -194,7 +209,7 @@ { HbInputModeProperties result; - QStringList parts = entry.split(" "); + QStringList parts = entry.split(' '); if (parts.count() == 4) { // See HbInputModeProperties::toString() for details, QString languageStr = parts[0] + QString(" ") + parts[1]; @@ -236,7 +251,7 @@ } QStringList paths = HbInputSettingProxy::instance()->inputMethodPluginPaths(); - foreach (QString path, paths) { + foreach(const QString &path, paths) { QDir dir(path); if (!dir.exists() && path.left(1) == "f") { mWatcher->addPath(QString("f:") + QDir::separator()); @@ -245,13 +260,28 @@ } } } + +bool HbInputModeCachePrivate::isMappedLanguage(const HbInputLanguage &language) const +{ + if (language.defined()) { + QList languages = HbKeymapFactory::instance()->availableLanguages(); + foreach(const HbInputLanguage &mappedLanguage, languages) { + if (mappedLanguage == language) { + return true; + } + } + } + + return false; +} + /// @endcond /*! \internal Returns the singleton instance. */ -HbInputModeCache* HbInputModeCache::instance() +HbInputModeCache *HbInputModeCache::instance() { static HbInputModeCache theCache; return &theCache; @@ -309,7 +339,7 @@ Q_D(HbInputModeCache); d->mShuttingDown = true; - foreach (HbInputMethodListItem method, d->mMethods) { + foreach(HbInputMethodListItem method, d->mMethods) { delete method.cached; method.cached = 0; } @@ -322,7 +352,7 @@ \internal Loads given input method and caches it. */ -HbInputMethod* HbInputModeCache::loadInputMethod(const HbInputMethodDescriptor &inputMethod) +HbInputMethod *HbInputModeCache::loadInputMethod(const HbInputMethodDescriptor &inputMethod) { Q_D(HbInputModeCache); @@ -342,7 +372,7 @@ /*! \internal -Lists custom input methods. +Lists all custom input methods. */ QList HbInputModeCache::listCustomInputMethods() { @@ -350,8 +380,8 @@ QList result; - foreach (HbInputMethodListItem item, d->mMethods) { - foreach (QString language, item.languages) { + foreach(const HbInputMethodListItem &item, d->mMethods) { + foreach(const QString &language, item.languages) { HbInputModeProperties properties = d->propertiesFromString(language); if (properties.inputMode() == HbInputModeCustom) { result.append(item.descriptor); @@ -365,9 +395,64 @@ /*! \internal +Lists custom input methods for given parameters. +*/ +QList HbInputModeCache::listCustomInputMethods(Qt::Orientation orientation, const HbInputLanguage &language) +{ + Q_D(HbInputModeCache); + + QList result; + + foreach (const HbInputMethodListItem &item, d->mMethods) { + foreach (const QString &lang, item.languages) { + HbInputModeProperties properties = d->propertiesFromString(lang); + + // Find custom methods that supports given language or any language and + // supports given orientation + if (properties.inputMode() == HbInputModeCustom && + (properties.language() == language || properties.language() == HbInputLanguage()) && + ((orientation == Qt::Vertical && properties.keyboard() == HbKeyboardTouchPortrait) || + (orientation == Qt::Horizontal && properties.keyboard() == HbKeyboardTouchLandscape))) { + result.append(item.descriptor); + break; + } + } + } + + return result; +} + +/*! +\internal +Returns default input method for given orientation. +*/ +HbInputMethodDescriptor HbInputModeCache::defaultInputMethod(Qt::Orientation orientation) +{ + Q_D(HbInputModeCache); + + HbInputMethodDescriptor result; + foreach (const HbInputMethodListItem &item, d->mMethods) { + foreach (const QString &language, item.languages) { + HbInputModeProperties properties = d->propertiesFromString(language); + + // Find default method that supports given orientation + if (properties.inputMode() == HbInputModeDefault && + ((orientation == Qt::Vertical && properties.keyboard() == HbKeyboardTouchPortrait) || + (orientation == Qt::Horizontal && properties.keyboard() == HbKeyboardTouchLandscape))) { + result = item.descriptor; + break; + } + } + } + + return result; +} + +/*! +\internal Find correct handler for given input state. */ -HbInputMethod* HbInputModeCache::findStateHandler(const HbInputState& state) +HbInputMethod *HbInputModeCache::findStateHandler(const HbInputState &state) { Q_D(HbInputModeCache); @@ -377,7 +462,7 @@ // First check if there is a method that matches excatly (ie. also specifies // the language). for (int i = 0; i < d->mMethods.count(); i++) { - foreach (QString language, d->mMethods[i].languages) { + foreach(const QString &language, d->mMethods[i].languages) { HbInputModeProperties properties = d->propertiesFromString(language); if (properties.language().undefined() && properties.keyboard() == stateProperties.keyboard() && @@ -389,7 +474,7 @@ if (properties.inputMode() != HbInputModeCustom) { if (properties == stateProperties) { - return d->cachedMethod(d->mMethods[i]); + return d->cachedMethod(d->mMethods[i]); } } } @@ -401,12 +486,12 @@ if (languageRangeIndex >= 0) { QList languages = HbKeymapFactory::instance()->availableLanguages(); - foreach(HbInputLanguage language, languages) { + foreach(const HbInputLanguage &language, languages) { // exact match is returned If the country variant is specified in state language, // otherwise a method that matches to only language range is returned. bool exactMatchFound = (stateProperties.language().variant() != QLocale::AnyCountry) ? - (language == stateProperties.language()) : - (language.language() == stateProperties.language().language()); + (language == stateProperties.language()) : + (language.language() == stateProperties.language().language()); if (exactMatchFound) { return d->cachedMethod(d->mMethods[languageRangeIndex]); } @@ -422,11 +507,11 @@ \sa HbInputMethod */ -HbInputMethod* HbInputModeCache::activeMethod() const +HbInputMethod *HbInputModeCache::activeMethod() const { Q_D(const HbInputModeCache); - foreach (HbInputMethodListItem item, d->mMethods) { + foreach(const HbInputMethodListItem &item, d->mMethods) { if (item.cached && item.cached->isActiveMethod()) { return item.cached; } @@ -445,15 +530,15 @@ QList result; - foreach (HbInputMethodListItem item, d->mMethods) { - foreach (QString language, item.languages) { + foreach(const HbInputMethodListItem &item, d->mMethods) { + foreach(const QString &language, item.languages) { HbInputModeProperties mode = d->propertiesFromString(language); if (mode.inputMode() != HbInputModeCustom) { if (mode.language().undefined()) { // This is language range. Let's add everything // we have key mappings for. QList languages = HbKeymapFactory::instance()->availableLanguages(); - foreach (HbInputLanguage mappedLanguage, languages) { + foreach(const HbInputLanguage &mappedLanguage, languages) { if (!result.contains(mappedLanguage)) { result.append(mappedLanguage); } @@ -470,4 +555,58 @@ return result; } +/*! +\internal +Returns true if given input method is able to handle given input state. +*/ +bool HbInputModeCache::acceptsState(const HbInputMethod *inputMethod, const HbInputState &state) const +{ + Q_D(const HbInputModeCache); + + foreach(const HbInputMethodListItem &item, d->mMethods) { + if (item.cached == inputMethod) { + foreach(const QString &language, item.languages) { + HbInputModeProperties mode = d->propertiesFromString(language); + // Check if keyboard type matches. + if (mode.keyboard() == state.keyboard()) { + // Check if input mode matches or it is a custom input method but + // state's mode is not numeric. + if (mode.inputMode() == state.inputMode() || + ((mode.inputMode() == HbInputModeCustom) && + (state.inputMode() != HbInputModeNumeric))) { + // Check if language matches or input method supports + // all mapped languages and state's language is among them. + if (mode.language() == state.language() || + (mode.language().undefined() && d->isMappedLanguage(state.language()))) { + return true; + } + } + } + } + } + } + + return false; +} + +/*! +\internal +Returns input method descriptor for given input method. Returns empty descriptor if the framework +doesn't recognize given input method. +*/ +HbInputMethodDescriptor HbInputModeCache::descriptor(const HbInputMethod *inputMethod) const +{ + Q_D(const HbInputModeCache); + + foreach(const HbInputMethodListItem &item, d->mMethods) { + if (item.cached == inputMethod) { + return item.descriptor; + } + } + + return HbInputMethodDescriptor(); +} + + // End of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmodecache_p.h --- a/src/hbcore/inputfw/hbinputmodecache_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmodecache_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,25 +41,29 @@ Q_OBJECT public: - static HbInputModeCache* instance(); + static HbInputModeCache *instance(); private: HbInputModeCache(); ~HbInputModeCache(); -public: - HbInputMethod* loadInputMethod(const HbInputMethodDescriptor &inputMethod); +public: + HbInputMethod *loadInputMethod(const HbInputMethodDescriptor &inputMethod); QList listCustomInputMethods(); - HbInputMethod* findStateHandler(const HbInputState& state); - HbInputMethod* activeMethod() const; + QList listCustomInputMethods(Qt::Orientation orientation, const HbInputLanguage &language); + HbInputMethodDescriptor defaultInputMethod(Qt::Orientation orientation); + HbInputMethod *findStateHandler(const HbInputState &state); + HbInputMethod *activeMethod() const; QList listInputLanguages() const; + bool acceptsState(const HbInputMethod *inputMethod, const HbInputState &state) const; + HbInputMethodDescriptor descriptor(const HbInputMethod *inputMethod) const; public slots: void shutdown(); void directoryChanged(const QString &directory); private: - HbInputModeCachePrivate * const d_ptr; + HbInputModeCachePrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputModeCache) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputmodeproperties.h --- a/src/hbcore/inputfw/hbinputmodeproperties.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputmodeproperties.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,7 @@ This class is needed when the framework resolves input state handler. An input method plugin reports a set of implemented input modes as an array of HbInputModeProperties -coverted to strings. +converted to strings. This class is not needed in application code. @@ -47,36 +47,34 @@ class HbInputModeProperties { public: - HbInputModeProperties() - { + HbInputModeProperties() { } HbInputModeProperties(HbInputModeType mode, const HbInputLanguage &language, HbKeyboardType keyboard) - : iMode(mode), iLanguage(language), iKeyboard(keyboard) - { + : mMode(mode), mLanguage(language), mKeyboard(keyboard) { } - HbInputModeProperties& operator=(const HbInputModeProperties& other) { - iMode = other.iMode; - iLanguage = other.iLanguage; - iKeyboard = other.iKeyboard; + HbInputModeProperties &operator=(const HbInputModeProperties &other) { + mMode = other.mMode; + mLanguage = other.mLanguage; + mKeyboard = other.mKeyboard; return *this; } - bool operator==(const HbInputModeProperties& other) const { - if (iMode == other.iMode - && iLanguage == other.iLanguage - && iKeyboard == other.iKeyboard) { - return true; + bool operator==(const HbInputModeProperties &other) const { + if (mMode == other.mMode + && mLanguage == other.mLanguage + && mKeyboard == other.mKeyboard) { + return true; } return false; } - bool operator!=(const HbInputModeProperties& other) const { - if (iMode != other.iMode - || iLanguage != other.iLanguage - || iKeyboard != other.iKeyboard) { - return true; + bool operator!=(const HbInputModeProperties &other) const { + if (mMode != other.mMode + || mLanguage != other.mLanguage + || mKeyboard != other.mKeyboard) { + return true; } return false; } @@ -84,45 +82,57 @@ /*! Returns input mode. */ - HbInputModeType inputMode() const { return iMode; } + HbInputModeType inputMode() const { + return mMode; + } /*! Sets input mode. */ - void setInputMode(HbInputModeType newInputMode) { iMode = newInputMode; } + void setInputMode(HbInputModeType newInputMode) { + mMode = newInputMode; + } /*! Return language. */ - HbInputLanguage language() const { return HbInputLanguage(iLanguage); } + HbInputLanguage language() const { + return HbInputLanguage(mLanguage); + } /*! Sets language. */ - void setLanguage(const HbInputLanguage &newLanguage) { iLanguage = newLanguage; } + void setLanguage(const HbInputLanguage &newLanguage) { + mLanguage = newLanguage; + } /*! Returns keyboard type. */ - HbKeyboardType keyboard() const { return iKeyboard; } + HbKeyboardType keyboard() const { + return mKeyboard; + } /*! Sets keyboard type. */ - void setKeyboard(HbKeyboardType newKeyboard) { iKeyboard = newKeyboard; } + void setKeyboard(HbKeyboardType newKeyboard) { + mKeyboard = newKeyboard; + } /*! Returns mode properties in string format. This is used for input method resolving and only needed by input method developers. */ QString asString() const { - return iLanguage.asString() + QString(" ") + QString::number(iMode) + QString(" ") + QString::number(iKeyboard); + return mLanguage.asString() + QString(" ") + QString::number(mMode) + QString(" ") + QString::number(mKeyboard); } private: - HbInputModeType iMode; - HbInputLanguage iLanguage; - HbKeyboardType iKeyboard; + HbInputModeType mMode; + HbInputLanguage mLanguage; + HbKeyboardType mKeyboard; }; #endif // HB_INPUT_MODE_PROPERTIES_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputpredictioncallback.h --- a/src/hbcore/inputfw/hbinputpredictioncallback.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputpredictioncallback.h Thu Jul 22 16:36:53 2010 +0100 @@ -47,8 +47,7 @@ virtual QString surroundingText() = 0; virtual int cursorPosition() = 0; - virtual QList probableKeypresses() - { + virtual QList probableKeypresses() { return QList(); } }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputpredictionengine.cpp --- a/src/hbcore/inputfw/hbinputpredictionengine.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputpredictionengine.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -46,7 +46,7 @@ /*! \fn virtual void HbPredictionBase::setWord(const QString& word, HbPredictionCallback* callback = 0) -Sets current word. Given word will be the active word. +Sets current word. Given word will be the active word. */ /*! @@ -59,7 +59,7 @@ \fn bool HbPredictionBase::updateCandidates(int& bestGuessLocation) Updates the candidate list to match active input sequence. Typically appendKeyPress and deleteKeyPress do that automatically but in same cases it may be required to update the situation explicitly. -Paramter bestGuessLocation specifies the best match index in the candidate list. Typically it is +Parameter bestGuessLocation specifies the best match index in the candidate list. Typically it is the first location but with some engines it may vary. Returns true if active input sequence produces valid candidates. Otherwise returns false and doesn not update the existing candidate list (in other words HbPredictionEngine::candidates() will @@ -71,7 +71,7 @@ Handles a key press event. \sa appendCharacter -*/ +*/ /*! \fn virtual void HbPredictionBase::deleteKeyPress(HbPredictionCallback* callback = 0) @@ -86,7 +86,7 @@ /*! \fn virtual void HbPredictionBase::clear() -Clears the active word without commiting it. +Clears the active word without committing it. */ /*! @@ -115,7 +115,7 @@ */ /*! -\fn virtual bool HbPredictionBase::supportsKeyboardType(const HbInputLanguage &language, HbKeyboardType keyboard) +\fn virtual bool HbPredictionBase::supportsKeyboardType(const HbInputLanguage& language, HbKeyboardType keyboard) const Returns true if the engine supports given combination of language and keyboard type. */ @@ -155,31 +155,31 @@ /*! Returns pointer to active user dictionary. There are two kind of user dictionaries, default and -extra. This one returns the default user dictionary. Default implementation of this method is empty, +extra. This one returns the default user dictionary. Default implementation of this method is empty, override if the engine supports user dictionaries. \sa setExtraUserDictionary \sa HbExtraUserDictionary */ -HbUserDictionary* HbPredictionBase::userDictionary() const +HbUserDictionary *HbPredictionBase::userDictionary() const { return 0; } /*! Sets active prediction language. Returns true if given language is recognized -by the engine and was succesfully activated. +by the engine and was successfully activated. */ bool HbPredictionBase::setLanguage(const HbInputLanguage &language, HbInputModeType inputMode) { - Q_UNUSED(language); + Q_UNUSED(language); Q_UNUSED(inputMode); return false; } /*! -Returns active prediction language. +Returns active prediction language. */ HbInputLanguage HbPredictionBase::language() const { @@ -198,7 +198,7 @@ \class HbPredictionEngine \brief Prediction API for latin based langauges. -This interface defines abstract prediction API for latin-based languages. +This interface defines abstract prediction API for latin-based languages. Also some non-latin languages whose prediction features are functionally similar to latin-based languages use this API. Those are for example Arabic and Hebrew. */ @@ -267,16 +267,16 @@ /*! Sets active secondary language for prediction engine. Returns true if given language is recognized -by the engine and was succesfully activated. +by the engine and was successfully activated. */ -bool HbPredictionEngine::setSecondaryLanguage(const HbInputLanguage& language) +bool HbPredictionEngine::setSecondaryLanguage(const HbInputLanguage &language) { Q_UNUSED(language); return false; } /*! -Returns active secondary prediction language. +Returns active secondary prediction language. */ HbInputLanguage HbPredictionEngine::secondaryLanguage() const { @@ -294,7 +294,7 @@ } /*! -Enables a specified feature for the prediction engine. +Enables a specified feature for the prediction engine. Returns true if the engine supports the feature and is able to enable the feature, otherwise, returns false. @@ -321,7 +321,7 @@ } /*! -Disables a specified feature for the prediction engine. +Disables a specified feature for the prediction engine. Returns true if the engine supports the feature and is able to disable the feature, otherwise, returns false. Note: There is temporary default implementation for this method. It will be made @@ -343,7 +343,7 @@ \sa supportedFeatures */ -QStringList HbPredictionEngine::nextWordCandidateList(HbPredictionCallback* callback) +QStringList HbPredictionEngine::nextWordCandidateList(HbPredictionCallback *callback) { Q_UNUSED(callback); return QStringList(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputpredictionengine.h --- a/src/hbcore/inputfw/hbinputpredictionengine.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputpredictionengine.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HB_PREDICTION_ENGINE_H -#define HB_PREDICTION_ENGINE_H +#ifndef HB_INPUT_PREDICTION_ENGINE_H +#define HB_INPUT_PREDICTION_ENGINE_H #include #include @@ -74,20 +74,20 @@ public: virtual QList languages() const = 0; - virtual void setWord(const QString& word, HbPredictionCallback* callback = 0) = 0; - virtual void updateCandidates(int& bestGuessLocation, bool& noMoreCandidates) = 0; - virtual bool updateCandidates(int& bestGuessLocation) = 0; - virtual void appendKeyPress(const int keycode, const Qt::KeyboardModifiers modifiers, const HbTextCase textCase = HbTextCaseNone, HbPredictionCallback* callback = 0) = 0; - virtual void deleteKeyPress(HbPredictionCallback* callback = 0) = 0; + virtual void setWord(const QString &word, HbPredictionCallback *callback = 0) = 0; + virtual void updateCandidates(int &bestGuessLocation, bool &noMoreCandidates) = 0; + virtual bool updateCandidates(int &bestGuessLocation) = 0; + virtual void appendKeyPress(const int keycode, const Qt::KeyboardModifiers modifiers, const HbTextCase textCase = HbTextCaseNone, HbPredictionCallback *callback = 0) = 0; + virtual void deleteKeyPress(HbPredictionCallback *callback = 0) = 0; virtual void commit(const QString &word = QString()) = 0; virtual void clear() = 0; - virtual void addUsedWord(const QString& word) = 0; + virtual void addUsedWord(const QString &word) = 0; virtual HbInputPredictionFeature features() const = 0; virtual QString vendorIdString() const = 0; virtual QString engineVersion() const = 0; - virtual bool supportsKeyboardType(const HbInputLanguage& language, HbKeyboardType keyboard) const = 0; + virtual bool supportsKeyboardType(const HbInputLanguage &language, HbKeyboardType keyboard) const = 0; - virtual HbUserDictionary* userDictionary() const; + virtual HbUserDictionary *userDictionary() const; virtual void setExtraUserDictionary(int id); virtual void setExtraUserDictionaries(const QList& idList); virtual bool setLanguage(const HbInputLanguage &language, HbInputModeType inputMode = HbInputModeNone); @@ -111,16 +111,16 @@ }; public: - virtual void setCandidateList(QStringList* candidateList) = 0; + virtual void setCandidateList(QStringList *candidateList) = 0; virtual QStringList candidateList() = 0; virtual QStringList candidates() = 0; virtual int inputLength() = 0; - virtual void appendCharacter(const QChar character, const HbTextCase textCase = HbTextCaseNone, HbPredictionCallback* callback = 0) = 0; + virtual void appendCharacter(const QChar character, const HbTextCase textCase = HbTextCaseNone, HbPredictionCallback *callback = 0) = 0; - virtual QStringList nextWordCandidateList(HbPredictionCallback* callback = 0); + virtual QStringList nextWordCandidateList(HbPredictionCallback *callback = 0); virtual bool setErrorCorrectionLevel(HbErrorCorrectionLevel level); virtual HbErrorCorrectionLevel errorCorrectionLevel() const; - virtual bool setSecondaryLanguage(const HbInputLanguage& language); + virtual bool setSecondaryLanguage(const HbInputLanguage &language); virtual HbInputLanguage secondaryLanguage() const; virtual QString currentWord() const; virtual bool enableFeature(HbInputPredictionFeature feature); @@ -132,8 +132,14 @@ class HB_CORE_EXPORT HbPredictionEngineChinese : public HbPredictionEngine { public: + virtual void updateCnInputMode() = 0; + // HbInputModeType deprecated, int are used currently virtual void setInputMode(HbInputModeType imMode) = 0; + virtual bool setCnInputMode(int imMode) = 0; + + // HbInputModeType deprecated, int are used currently virtual HbInputModeType inputMode() const = 0; + virtual int cnInputMode() = 0; virtual bool spelling(int index, QString &out) = 0; virtual bool selectSpelling(int index) = 0; @@ -142,16 +148,23 @@ virtual QStringList getCandidates(int startIndex, int count) = 0; virtual bool selectCandidate(int index) = 0; - virtual bool selectCandidate(const QString& candidate) = 0; + virtual bool selectCandidate(const QString &candidate) = 0; virtual bool candidateExist(int index) = 0; virtual bool pressKey(const int keycode, const Qt::KeyboardModifiers modifiers, const int textCase = 0) = 0; + + // HbInputModeType deprecated, int are used currently virtual bool isInputModeSupported(HbInputModeType imMode) = 0; + virtual bool isCnInputModeSupported(int imMode) = 0; + // used for hwr engine virtual bool addStroke(const QList& traceData) = 0; virtual bool inlineSpelling(int idx, QString &out) = 0; + virtual QByteArray itutZhuyinKeySequences() = 0; + virtual int setInputAreaSize(QSize &size) = 0; + virtual int setScreenSize(QSize &size) = 0; }; -#endif // HB_PREDICTION_ENGINE +#endif // HB_INPUT_PREDICTION_ENGINE_H // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputpredictionfactory.cpp --- a/src/hbcore/inputfw/hbinputpredictionfactory.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputpredictionfactory.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputpredictionfactory.h" + #include #include #include @@ -31,7 +33,6 @@ #include #include -#include "hbinputpredictionfactory.h" #include "hbinputsettingproxy.h" #include "hbinputpredictionengine.h" @@ -55,11 +56,9 @@ { public: HbEngineData() - : cachedInstance(0) - { + : cachedInstance(0) { } - ~HbEngineData() - { + ~HbEngineData() { delete cachedInstance; } @@ -67,7 +66,7 @@ QList languages; HbPredictionInterfaceType type; int handle; - HbPredictionEngine* cachedInstance; + HbPredictionEngine *cachedInstance; QString filename; QString vendorId; }; @@ -78,13 +77,15 @@ HbPredictionFactoryPrivate() : leadingHandle(0) {} ~HbPredictionFactoryPrivate(); void initialize(); - HbPredictionEngine* predictionEngineForLanguage(const HbInputLanguage &language); + HbPredictionEngine *predictionEngineForLanguage(const HbInputLanguage &language); void clearEngineData(); - HbPredictionEngine* createInstance(int index); - int newHandle() { return ++leadingHandle; } + HbPredictionEngine *createInstance(int index); + int newHandle() { + return ++leadingHandle; + } public: - QList activePlugins; + QList activePlugins; QList engines; int leadingHandle; QMutex mutex; @@ -121,10 +122,10 @@ } QPluginLoader loader(dir.absoluteFilePath(fileName)); - QObject* engine_base = loader.instance(); + QObject *engine_base = loader.instance(); if (engine_base) { - HbPredictionPlugin* plugin = qobject_cast(engine_base); - if (plugin) { + HbPredictionPlugin *plugin = qobject_cast(engine_base); + if (plugin) { HbEngineData data; data.languages = plugin->languages(); data.type = plugin->type(); @@ -144,19 +145,19 @@ } void HbPredictionFactoryPrivate::clearEngineData() -{ +{ engines.clear(); } -HbPredictionEngine* HbPredictionFactoryPrivate::predictionEngineForLanguage(const HbInputLanguage &language) +HbPredictionEngine *HbPredictionFactoryPrivate::predictionEngineForLanguage(const HbInputLanguage &language) { bool anyVariant = (language.variant() == QLocale::AnyCountry); for (int i = 0; i < engines.count(); ++i) { for (int j = 0; j < engines[i].languages.count(); ++j) { if ((engines[i].type & HbPredInterfaceHidden) == 0) { // Include only those that are not hidden. bool checkLangOnly = (anyVariant || (engines[i].languages[j].variant() == QLocale::AnyCountry)); - if ((checkLangOnly && (engines[i].languages[j].language() == language.language())) - || engines[i].languages[j] == language) { + if ((checkLangOnly && (engines[i].languages[j].language() == language.language())) + || engines[i].languages[j] == language) { return createInstance(i); } } @@ -166,7 +167,7 @@ return 0; } -HbPredictionEngine* HbPredictionFactoryPrivate::createInstance(int index) +HbPredictionEngine *HbPredictionFactoryPrivate::createInstance(int index) { if (index < engines.count()) { if (engines[index].cachedInstance) { @@ -181,17 +182,17 @@ fullName += engines[index].filename; QPluginLoader loader(fullName); - QObject* plugin_base = loader.instance(); + QObject *plugin_base = loader.instance(); if (plugin_base) { - HbPredictionPlugin* plugin = qobject_cast(plugin_base); + HbPredictionPlugin *plugin = qobject_cast(plugin_base); if (plugin) { - HbPredictionEngine* newEngine = plugin->createInterface(); + HbPredictionEngine *newEngine = plugin->createInterface(); if (newEngine) { engines[index].cachedInstance = newEngine; activePlugins.append(plugin); return newEngine; } - } + } } } } @@ -204,7 +205,7 @@ /*! Returns reference to singleton object. */ -HbPredictionFactory* HbPredictionFactory::instance() +HbPredictionFactory *HbPredictionFactory::instance() { static HbPredictionFactory myInstance; return &myInstance; @@ -235,7 +236,7 @@ \sa allPredictionEnginesForLanguage \sa allPredictionEngines */ -HbPredictionEngine* HbPredictionFactory::predictionEngineForLanguage(const HbInputLanguage &language) +HbPredictionEngine *HbPredictionFactory::predictionEngineForLanguage(const HbInputLanguage &language) { QMutexLocker locker(&d->mutex); return d->predictionEngineForLanguage(language); @@ -328,7 +329,7 @@ \sa allPredictionEnginesForLanguage \sa allPredictionEngines */ -HbPredictionEngine* HbPredictionFactory::createEngine(int handle) +HbPredictionEngine *HbPredictionFactory::createEngine(int handle) { QMutexLocker locker(&d->mutex); @@ -350,7 +351,7 @@ \sa HbPredictionEngine \sa HbPredictionPlugin */ -HbPredictionEngine* HbPredictionFactory::createEngine(const QString& vendorIdString) +HbPredictionEngine *HbPredictionFactory::createEngine(const QString &vendorIdString) { QMutexLocker locker(&d->mutex); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputpredictionfactory.h --- a/src/hbcore/inputfw/hbinputpredictionfactory.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputpredictionfactory.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HB_PREDICTION_FACTORY_H -#define HB_PREDICTION_FACTORY_H +#ifndef HB_INPUT_PREDICTION_FACTORY_H +#define HB_INPUT_PREDICTION_FACTORY_H #include #include @@ -39,7 +39,7 @@ { public: virtual ~HbPredictionPlugin() {} - virtual HbPredictionEngine* createInterface() = 0; + virtual HbPredictionEngine *createInterface() = 0; virtual HbPredictionInterfaceType type() const = 0; virtual QList languages() const = 0; virtual QString vendorId() const = 0; @@ -49,15 +49,15 @@ class HB_CORE_EXPORT HbPredictionFactory : public QObject { -Q_OBJECT + Q_OBJECT public: - static HbPredictionFactory* instance(); + static HbPredictionFactory *instance(); - HbPredictionEngine* predictionEngineForLanguage(const HbInputLanguage &language); + HbPredictionEngine *predictionEngineForLanguage(const HbInputLanguage &language); QList allPredictionEnginesForLanguage(const HbInputLanguage &language); QList allPredictionEngines(); - HbPredictionEngine* createEngine(int handle); - HbPredictionEngine* createEngine(const QString& vendorIdString); + HbPredictionEngine *createEngine(int handle); + HbPredictionEngine *createEngine(const QString &vendorIdString); void initialize(); void clearEngineData(); @@ -70,13 +70,13 @@ HbPredictionFactory(); // Prevent copying - HbPredictionFactory(const HbPredictionFactory&); - HbPredictionFactory& operator = (const HbPredictionFactory& other); + HbPredictionFactory(const HbPredictionFactory &); + HbPredictionFactory &operator = (const HbPredictionFactory &other); private: - HbPredictionFactoryPrivate* d; + HbPredictionFactoryPrivate *d; }; -#endif // HB_PREDICTION_FACTORY_H +#endif // HB_INPUT_PREDICTION_FACTORY_H // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputregioncollector.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/inputfw/hbinputregioncollector.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,240 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#include "hbinputregioncollector_p.h" + +#include +#include +#include + +#include "hbwidget.h" +#include "hbmainwindow.h" +#include "hbpopup.h" +#include "hbdeviceprofile.h" + +/*! +\proto +\class HbInputRegionCollector +\brief Installs a filter on a HbWidget and observes for a change in position, size and visibility +of the attached widget. As soon as it detects a change in size, position or visibility it calculates +total of the region of all the widgets attached and emits updateRegion signal. + +It is enabled and disabled by input framework, it is enabled when ever input framework detects +that the application is not having any HbMainWindow. + +*/ + +/// @cond + +class HbWidgetFilterList +{ +public: + HbWidgetFilterList(HbWidget *w) + : mWidget(w), mIsVisible(false) { + } + bool operator ==(const HbWidgetFilterList &other) const { + return mWidget == other.mWidget; + } + QPointer mWidget; + // visibility is needed as the time when we get show event inside eventFilter + // widget is not visible. + bool mIsVisible; +}; + +class HbInputRegionCollectorPrivate +{ +public: + HbInputRegionCollectorPrivate() + : mEnabled(false), mModalDialogs(0) {} + QList < HbWidgetFilterList > mInputWidgets; + bool mEnabled; + int mModalDialogs; +}; + + +/*! +Creates a static instance of HbInputRegionCollector. +*/ +HbInputRegionCollector *HbInputRegionCollector::instance() +{ + static HbInputRegionCollector regionCollector; + return ®ionCollector; +} + +/*! +Constructor. +*/ +HbInputRegionCollector::HbInputRegionCollector() + : d_ptr(new HbInputRegionCollectorPrivate()) +{ +} + +/*! +Destructor. +*/ +HbInputRegionCollector::~HbInputRegionCollector() +{ + delete d_ptr; +} + +/*! +Installs a even filter on the passed widget. +*/ +void HbInputRegionCollector::attach(HbWidget *widget) +{ + if (widget && !d_ptr->mInputWidgets.contains(widget)) { + if (d_ptr->mEnabled) { + widget->installEventFilter(this); + } + d_ptr->mInputWidgets.append(HbWidgetFilterList(widget)); + } +} + +/*! +Detaches widget from region collection and updates current region if region collection is enabled. +*/ +void HbInputRegionCollector::detach(HbWidget *widget) +{ + if (widget && d_ptr->mInputWidgets.contains(widget)) { + widget->removeEventFilter(this); + d_ptr->mInputWidgets.removeOne(widget); + if (d_ptr->mEnabled) { + update(); + } + } +} + +/*! +Observes size, position and move events of all attached widgets and calls update(). +*/ +bool HbInputRegionCollector::eventFilter(QObject *obj, QEvent *event) +{ + HbWidget *widget = qobject_cast(obj); + if (widget) { + switch (event->type()) { + case QEvent::GraphicsSceneResize: + case QEvent::GraphicsSceneMove: + update(); + break; + case QEvent::Show: { + // We can not query for HbWidget visiblility at this point + // so have to set it inside the strcuture variable. + int pos = d_ptr->mInputWidgets.indexOf(widget); + if (pos != -1) { + // Temporary TODO ++ + // TODO write a HbInputWidgetStore class which will hold all the + // active widgets and will emit signals for example sceneBlocked() + // sceneUnBlocked(). And then connect to region collector. + HbPopup *popup = qobject_cast(obj); + // since there is a bug in Qt that QGraphicsItem geenrates two show events + // once when you do a show() and once when you added it to the scene(), + // so need a check on visibility. + if (popup && popup->isModal() && !d_ptr->mInputWidgets[pos].mIsVisible) { + d_ptr->mModalDialogs++; + } + // Temporary TODO -- + d_ptr->mInputWidgets[pos].mIsVisible = true; + update(); + } + break; + } + case QEvent::Hide: { + int pos = d_ptr->mInputWidgets.indexOf(widget); + if (pos != -1) { + // Temporary TODO ++ + HbPopup *popup = qobject_cast(obj); + if (popup && popup->isModal()) { + d_ptr->mModalDialogs--; + } + // Temporary TODO -- + d_ptr->mInputWidgets[pos].mIsVisible = false; + update(); + } + break; + } + default: + break; + }; + } + return false; +} + +/*! +Calculates all the attached HbWidget's rectangle and prepares a region out of it and then +emits updateRegion. +*/ +void HbInputRegionCollector::update() +{ + QRegion region; + + // since there is a modal dialog launched we need to mask the entire window. + if (d_ptr->mModalDialogs) { + region += QRect(QPoint(0, 0), HbDeviceProfile::current().logicalSize()); + emit updateRegion(region); + return; + } + + QList list = d_ptr->mInputWidgets; + for (int i = 0; i < list.size(); ++i) { + if (list.at(i).mIsVisible) { + HbWidget *widget = list.at(i).mWidget; + if (widget) { + HbMainWindow *window = widget->mainWindow(); + if (window) { + QRectF rect = widget->rect(); + rect.translate(widget->pos()); + // we need to check transformation of the QGraphicsView. + // for example when there is a orientation switch transformation + // is 270 degree. We should map it to get transformed rectangle. + QTransform t = window->viewportTransform(); + QRectF tRect = t.mapRect(rect); + QRectF intersection = QRectF(window->geometry()).intersected(tRect); + region += intersection.toRect(); + } + } + } + } + emit updateRegion(region); +} + +/*! +Enables region collection, this function is called by input framework. +*/ +void HbInputRegionCollector::setEnabled(bool enabled) +{ + d_ptr->mEnabled = enabled; + QList& list = d_ptr->mInputWidgets; + for (int i = 0; i < list.size(); ++i) { + HbWidget *widget = list.at(i).mWidget; + if (widget) { + if (enabled) { + widget->installEventFilter(this); + } else { + widget->removeEventFilter(this); + } + } + } +} + +//EOF diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputregioncollector_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/inputfw/hbinputregioncollector_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,64 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HB_INPUT_REGION_COLLECTOR_H +#define HB_INPUT_REGION_COLLECTOR_H + +#include "hbinputdef.h" + +#include +#include + +class HbWidget; +class HbInputRegionCollectorPrivate; + +class HB_CORE_PRIVATE_EXPORT HbInputRegionCollector : public QObject +{ + Q_OBJECT +public: + static HbInputRegionCollector *instance(); + ~HbInputRegionCollector(); + + void attach(HbWidget *widget); + void detach(HbWidget *widget); + void setEnabled(bool enabled); + void update(); + +protected: + bool eventFilter(QObject *obj, QEvent *event); + +signals: + void updateRegion(QRegion region); + +private: + HbInputRegionCollector(); + HbInputRegionCollectorPrivate *const d_ptr; + +private: + Q_DECLARE_PRIVATE_D(d_ptr, HbInputRegionCollector) + Q_DISABLE_COPY(HbInputRegionCollector) +}; + +#endif // HB_INPUT_REGION_COLLECTOR_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputsettingproxy.cpp --- a/src/hbcore/inputfw/hbinputsettingproxy.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputsettingproxy.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,9 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputsettingproxy.h" +#include "hbinputsettingproxy_p.h" + #include #include #include @@ -31,8 +34,6 @@ #include #include -#include "hbinputsettingproxy.h" -#include "hbinputsettingproxy_p.h" #include "hbinputmodecache_p.h" #include "hbinputfilter.h" @@ -68,18 +69,87 @@ /// @cond +HbSettingProxyInputMethodDescriptor::HbSettingProxyInputMethodDescriptor() +{ + pluginNameAndPathSize = 0; + keySize = 0; + displayNameSize = 0; +} + +HbSettingProxyInputMethodDescriptor::HbSettingProxyInputMethodDescriptor(const HbInputMethodDescriptor &descriptor) +{ + *this = descriptor; +} + +void HbSettingProxyInputMethodDescriptor::operator=(const HbInputMethodDescriptor &descriptor) +{ + pluginNameAndPathSize = 0; + keySize = 0; + displayNameSize = 0; + + if (!descriptor.pluginNameAndPath().isEmpty() && + (descriptor.pluginNameAndPath().size() * sizeof(QChar) < HbActiveMethodNameMax)) { + pluginNameAndPathSize = descriptor.pluginNameAndPath().size(); + memcpy((void *)pluginNameAndPath, (void *)descriptor.pluginNameAndPath().unicode(), descriptor.pluginNameAndPath().size() * sizeof(QChar)); + } + if (!descriptor.key().isEmpty() && + (descriptor.key().size() * sizeof(QChar) < HbActiveMethodKeyMax)) { + memcpy((void *)key, (void *)descriptor.key().unicode(), descriptor.key().size() * sizeof(QChar)); + keySize = descriptor.key().size(); + } + if (!descriptor.displayName().isEmpty() && + (descriptor.displayName().size() * sizeof(QChar) < HbActiveMethodKeyMax)) { + memcpy((void *)displayName, (void *)descriptor.displayName().unicode(), descriptor.displayName().size() * sizeof(QChar)); + displayNameSize = descriptor.displayName().size(); + } +} + +HbInputMethodDescriptor HbSettingProxyInputMethodDescriptor::descriptor() const +{ + HbInputMethodDescriptor result; + + if (pluginNameAndPathSize > 0) { + result.setPluginNameAndPath(QString(pluginNameAndPath, pluginNameAndPathSize)); + } + if (keySize > 0) { + result.setKey(QString(key, keySize)); + } + if (displayNameSize > 0) { + result.setDisplayName(QString(displayName, displayNameSize)); + } + + return result; +} + +QByteArray HbSettingProxyInputMethodDescriptor::data() const +{ + if (customDataSize > 0) { + return QByteArray(customData, customDataSize); + } + + return QByteArray(); +} + +void HbSettingProxyInputMethodDescriptor::setData(const QByteArray &data) +{ + customDataSize = 0; + + if (data.size() > 0 && data.size() <= (int)HbActiveMethodKeyMax * 2) { + memcpy(customData, data.data(), data.size()); + customDataSize = data.size(); + } +} + // Special character classifier class for bookkeeping // of how popular a SC is. class HbScClassifier { public: HbScClassifier(QChar aChar = 0, int aCount = 0) - : mChar(aChar), mCount(aCount) - { + : mChar(aChar), mCount(aCount) { } - void operator=(const HbScClassifier& aOther) - { + void operator=(const HbScClassifier &aOther) { mChar = aOther.mChar; mCount = aOther.mCount; } @@ -89,8 +159,6 @@ int mCount; }; -/// @endcond - HbInputSettingProxyPrivate::HbInputSettingProxyPrivate() { iSharedMemory = new QSharedMemory(KInputSettingProxyKey); @@ -111,7 +179,7 @@ lock(); - HbSettingProxyInternalData* prData = proxyData(); + HbSettingProxyInternalData *prData = proxyData(); if (prData) { ++prData->iReferences; } @@ -130,7 +198,7 @@ void HbInputSettingProxyPrivate::shutdownDataArea() { lock(); - HbSettingProxyInternalData* prData = proxyData(); + HbSettingProxyInternalData *prData = proxyData(); if (prData) { prData->iReferences--; if (prData->iReferences <= 0) { @@ -142,12 +210,12 @@ QString HbInputSettingProxyPrivate::dataFilePath() { - return HbInputSettingProxy::writablePath()+QDir::separator()+QString("settings"); + return HbInputSettingProxy::writablePath() + QDir::separator() + QString("settings"); } QString HbInputSettingProxyPrivate::dataFileNameAndPath() { - return dataFilePath()+QDir::separator()+QString("proxy.dat"); + return dataFilePath() + QDir::separator() + QString("proxy.dat"); } void HbInputSettingProxyPrivate::initializeDataArea() @@ -155,7 +223,7 @@ lock(); bool wasLoaded = load(); - HbSettingProxyInternalData* prData = proxyData(); + HbSettingProxyInternalData *prData = proxyData(); if (prData) { prData->iReferences = 0; prData->iOrientationChangeCompleted = true; @@ -170,9 +238,7 @@ prData->iActiveKeyboard = HbKeyboardVirtual12Key; prData->iTouchKeyboard = HbKeyboardVirtual12Key; prData->iHwKeyboard = HbKeyboardQwerty; - prData->iActiveCustomMethodName[0] = 0; - prData->iActiveCustomMethodKey[0] = 0; - prData->iPredictiveInputState = HbKeyboardSettingNone; + prData->iPredictiveInputState = (HbKeyboardSettingFlags)HbKeyboardSetting12key | HbKeyboardSettingQwerty; prData->iDigitType = HbDigitTypeLatin; prData->iQwertyTextCasing = true; prData->iQwertyCharacterPreview = true; @@ -181,6 +247,10 @@ prData->iAutocompletion = (HbKeyboardSettingFlags)(HbKeyboardSetting12key | HbKeyboardSettingQwerty); prData->iTypingCorrectionLevel = HbTypingCorrectionLevelHigh; prData->iPrimaryCandidateMode = HbPrimaryCandidateModeBestPrediction; + prData->iPreferredMethodHorizontal = HbInputMethodDescriptor(); + prData->iPreferredMethodHorizontal.setData(QByteArray()); + prData->iPreferredMethodVertical = HbInputMethodDescriptor(); + prData->iPreferredMethodVertical.setData(QByteArray()); } } unlock(); @@ -195,12 +265,12 @@ QByteArray rawData = file.read(sizeof(HbSettingProxyInternalData)); if (rawData.size() == sizeof(HbSettingProxyInternalData)) { - HbSettingProxyInternalData* ldData = (HbSettingProxyInternalData*)rawData.constData(); + HbSettingProxyInternalData *ldData = (HbSettingProxyInternalData *)rawData.constData(); if (ldData) { if (ldData->iVersion == HbProxyDataRequiredVersion) { - HbSettingProxyInternalData* prData = proxyData(); - memcpy((void*)prData, (void*)ldData, sizeof(HbSettingProxyInternalData)); + HbSettingProxyInternalData *prData = proxyData(); + memcpy((void *)prData, (void *)ldData, sizeof(HbSettingProxyInternalData)); prData->iActiveKeyboard = ldData->iActiveKeyboard; // Temporarily like this, will be moved as part of shared data later... @@ -209,7 +279,7 @@ iTopScs.clear(); for (int jj = 0; jj < numItems; jj++) { HbScClassifier tmpItem; - file.read((char*)&tmpItem, sizeof(HbScClassifier)); + file.read((char *)&tmpItem, sizeof(HbScClassifier)); iTopScs.append(tmpItem); } @@ -229,19 +299,19 @@ QDir settingDir; settingDir.mkpath(dataFilePath()); - HbSettingProxyInternalData* prData = proxyData(); + HbSettingProxyInternalData *prData = proxyData(); if (prData) { QFile file(iSaveFile); if (!file.open(QIODevice::WriteOnly)) { return; } - file.write((const char*)prData, sizeof(HbSettingProxyInternalData)); + file.write((const char *)prData, sizeof(HbSettingProxyInternalData)); // Temporarily like this, will be moved to shared data later... int numItems = iTopScs.count(); - file.write((const char*)&numItems, sizeof(int)); - file.write((const char*)iTopScs.constData(), numItems * sizeof(HbScClassifier)); + file.write((const char *)&numItems, sizeof(int)); + file.write((const char *)iTopScs.constData(), numItems * sizeof(HbScClassifier)); file.close(); } } @@ -265,9 +335,9 @@ string[i] = 0; } -HbSettingProxyInternalData* HbInputSettingProxyPrivate::proxyData() const +HbSettingProxyInternalData *HbInputSettingProxyPrivate::proxyData() const { - return static_cast(iSharedMemory->data()); + return static_cast(iSharedMemory->data()); } void HbInputSettingProxyPrivate::flipToggle() @@ -277,13 +347,13 @@ bool HbInputSettingProxyPrivate::flipStatus() { - HbSettingProxyInternalData* prData = proxyData(); + HbSettingProxyInternalData *prData = proxyData(); return prData->iFlipStatus; } void HbInputSettingProxyPrivate::setFlipStatus(bool flipStatus) { - HbSettingProxyInternalData* prData = proxyData(); + HbSettingProxyInternalData *prData = proxyData(); prData->iFlipStatus = flipStatus; handleDeviceSpecificOriantationAndFlipChange(); @@ -296,7 +366,7 @@ if (HbInputSettingProxy::instance()->screenOrientation() == Qt::Vertical) { keyboard = HbKeyboardVirtual12Key; } else { - if(flipStatus()) { + if (flipStatus()) { keyboard = HbKeyboardQwerty; } else { keyboard = HbKeyboardVirtualQwerty; @@ -306,14 +376,12 @@ HbInputSettingProxy::instance()->setActiveKeyboard(keyboard); } -// -// HbInputSettingProxy -// +/// @endcond /*! Returns pointer to the singleton object. */ -HbInputSettingProxy* HbInputSettingProxy::instance() +HbInputSettingProxy *HbInputSettingProxy::instance() { static HbInputSettingProxy theProxy; return &theProxy; @@ -376,7 +444,7 @@ \sa typingCorrectionLevelChanged \sa primaryCandidateModeChanged */ -void HbInputSettingProxy::connectObservingObject(QObject* aObserver) +void HbInputSettingProxy::connectObservingObject(QObject *aObserver) { if (aObserver) { connect(this, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalInputLanguageChanged(const HbInputLanguage &))); @@ -392,7 +460,7 @@ \sa connectObservingObject */ -void HbInputSettingProxy::disconnectObservingObject(QObject* aObserver) +void HbInputSettingProxy::disconnectObservingObject(QObject *aObserver) { if (aObserver) { disconnect(this, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), aObserver, SLOT(globalInputLanguageChanged(const HbInputLanguage &))); @@ -416,7 +484,7 @@ HbInputLanguage res; d->lock(); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iGlobalPrimaryInputLanguage; } @@ -437,7 +505,7 @@ HbInputLanguage res; d->lock(); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iGlobalSecondaryInputLanguage; } @@ -466,7 +534,7 @@ Q_D(const HbInputSettingProxy); HbKeyboardType res = HbKeyboardNone; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iHwKeyboard; } @@ -485,7 +553,7 @@ Q_D(const HbInputSettingProxy); HbKeyboardType res = HbKeyboardNone; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iTouchKeyboard; } @@ -503,7 +571,7 @@ Q_D(const HbInputSettingProxy); HbKeyboardType res = HbKeyboardNone; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iActiveKeyboard; } @@ -512,14 +580,117 @@ } /*! +Returns the preferred input method for given screen orientation. Initially this value is empty +and the framework will resolve the default handler. + +\sa setPreferredInputMethod +*/ +HbInputMethodDescriptor HbInputSettingProxy::preferredInputMethod(Qt::Orientation orientation) const +{ + Q_D(const HbInputSettingProxy); + + HbInputMethodDescriptor result; + + HbSettingProxyInternalData *prData = d->proxyData(); + if (prData) { + d->lock(); + if (orientation == Qt::Horizontal) { + result = prData->iPreferredMethodHorizontal.descriptor(); + } else { + result = prData->iPreferredMethodVertical.descriptor(); + } + d->unlock(); + } + + return result; +} + +/*! +Returns the preferred input method for current screen orientation. Initially this value is empty +and the framework will resolve the default handler. + +\sa setPreferredInputMethod +*/ +HbInputMethodDescriptor HbInputSettingProxy::preferredInputMethod() const +{ + Q_D(const HbInputSettingProxy); + + HbInputMethodDescriptor result; + + HbSettingProxyInternalData *prData = d->proxyData(); + if (prData) { + d->lock(); + if (prData->iScreenOrientation == Qt::Horizontal) { + result = prData->iPreferredMethodHorizontal.descriptor(); + } else { + result = prData->iPreferredMethodVertical.descriptor(); + } + d->unlock(); + } + + return result; +} + +/*! +Returns custom data associated to preferred input method. + +\sa setPreferredInputMethod +*/ +QByteArray HbInputSettingProxy::preferredInputMethodCustomData(Qt::Orientation orientation) const +{ + Q_D(const HbInputSettingProxy); + + QByteArray result; + + HbSettingProxyInternalData *prData = d->proxyData(); + if (prData) { + d->lock(); + if (orientation == Qt::Horizontal) { + result = prData->iPreferredMethodHorizontal.data(); + } else { + result = prData->iPreferredMethodVertical.data(); + } + d->unlock(); + } + + return result; +} + +/*! +Sets preferred input method for given screen orientation. The parameter \a customdata may contain +any information the preferred input method needs to remember as part of settings data. +Note that only 128 bytes is reserved for custom data. Larger amount of it needs to be +handled by other means. +This method is for input method developers only. There should never be need to call it from application code. + +\sa preferredInputMethod +*/ +void HbInputSettingProxy::setPreferredInputMethod(Qt::Orientation orientation, const HbInputMethodDescriptor &inputMethod, const QByteArray &customData) +{ + Q_D(HbInputSettingProxy); + HbSettingProxyInternalData *prData = d->proxyData(); + if (prData) { + d->lock(); + if (orientation == Qt::Horizontal) { + prData->iPreferredMethodHorizontal = inputMethod; + prData->iPreferredMethodHorizontal.setData(customData); + } else { + prData->iPreferredMethodVertical = inputMethod; + prData->iPreferredMethodVertical.setData(customData); + } + d->unlock(); + } +} + +/*! Sets system wide input language. Will emit signal globalInputLanguageChanged if language is changed. \sa globalInputLanguage */ -void HbInputSettingProxy::setGlobalInputLanguage(const HbInputLanguage& language) +void HbInputSettingProxy::setGlobalInputLanguage(const HbInputLanguage &language) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -542,7 +713,7 @@ void HbInputSettingProxy::setGlobalSecondaryInputLanguage(const HbInputLanguage &language) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -568,7 +739,7 @@ void HbInputSettingProxy::setActiveHwKeyboard(HbKeyboardType keyboard) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -594,7 +765,7 @@ void HbInputSettingProxy::setActiveTouchKeyboard(HbKeyboardType keyboard) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -620,7 +791,7 @@ void HbInputSettingProxy::setActiveKeyboard(HbKeyboardType keyboard) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -647,7 +818,7 @@ Q_D(const HbInputSettingProxy); bool res = false; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iPredictiveInputState & keyboardType; } @@ -663,11 +834,11 @@ void HbInputSettingProxy::setPredictiveInputStatus(HbKeyboardSettingFlags keyboardType, bool newStatus) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); - + HbKeyboardSettingFlags newValue = prData->iPredictiveInputState; if (newStatus) { newValue |= keyboardType; @@ -696,7 +867,7 @@ Q_D(const HbInputSettingProxy); bool res = false; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { if (activeKeyboard() & HbQwertyKeyboardMask) { res = prData->iPredictiveInputState & HbKeyboardSettingQwerty; @@ -736,7 +907,7 @@ return QString(HB_INSTALL_DIR) + QDir::separator() + QString(".hbinputs"); } else { #ifdef Q_OS_UNIX - return QDir::homePath() + QDir::separator() + QString(".hbinputs"); + return QDir::homePath() + QDir::separator() + QString(".hbinputs"); #else return HBI_BASE_WRITABLE_PATH ; #endif @@ -769,11 +940,20 @@ QStringList HbInputSettingProxy::keymapPluginPaths() { QStringList result; + QFileInfoList list = QDir::drives(); + #ifdef Q_OS_SYMBIAN - result.append(QString("z:/resource/keymaps")); + for (int counter = 0; counter < list.count(); counter ++) { + result.append(list.at(counter).absoluteFilePath() + QString("/resource/keymaps")); + } #else result.append(HB_RESOURCES_DIR + (QDir::separator() + QString("keymaps"))); + for (int counter = 0; counter < list.count(); counter ++) { + result.append(list.at(counter).absoluteFilePath() + QString("resource/keymaps")); + } #endif + result.sort(); + //Append the default resource at the end result.append(":/keymaps"); return QStringList(result); } @@ -841,7 +1021,7 @@ Q_D(const HbInputSettingProxy); HbInputDigitType res = HbDigitTypeLatin; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iDigitType; } @@ -857,7 +1037,7 @@ void HbInputSettingProxy::setGlobalDigitType(HbInputDigitType digitType) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { d->lock(); if (prData->iDigitType != digitType) { @@ -877,7 +1057,7 @@ Q_D(HbInputSettingProxy); bool res = false; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iQwertyTextCasing; } @@ -893,7 +1073,7 @@ void HbInputSettingProxy::setAutomaticTextCasingForQwerty(bool status) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -906,7 +1086,7 @@ emit automaticTextCasingStateForQwertyChanged(status); } } - + } /*! @@ -917,7 +1097,7 @@ void HbInputSettingProxy::setCharacterPreviewForQwerty(bool previewEnabled) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -930,7 +1110,7 @@ emit characterPreviewStateForQwertyChanged(previewEnabled); } } - + } /*! @@ -944,7 +1124,7 @@ bool res = false; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iQwertyCharacterPreview; } @@ -953,53 +1133,36 @@ } /*! +\deprecated HbInputSettingProxy::activeCustomInputMethod() const + is deprecated. Use preferredInputMethod instead. Returns active custom input method. The pluginNameAndPath field is empty if no custom input methid is active. \sa setActiveCustomInputMethod */ HbInputMethodDescriptor HbInputSettingProxy::activeCustomInputMethod() const { - Q_D(const HbInputSettingProxy); - - HbInputMethodDescriptor result; - - d->lock(); - HbSettingProxyInternalData* prData = d->proxyData(); - if (prData) { - result.setPluginNameAndPath(d->stringFromProxyDataElement(prData->iActiveCustomMethodName)); - result.setKey(d->stringFromProxyDataElement(prData->iActiveCustomMethodKey)); - } - d->unlock(); - - return HbInputMethodDescriptor(result); + return HbInputMethodDescriptor(); } /*! - +\deprecated HbInputSettingProxy::setActiveCustomInputMethod(const HbInputMethodDescriptor&) + is deprecated. Use setPreferredInputMethod instead. \sa activeCustomInputMethod */ void HbInputSettingProxy::setActiveCustomInputMethod(const HbInputMethodDescriptor &inputMethod) { - Q_D(HbInputSettingProxy); - - d->lock(); - HbSettingProxyInternalData* prData = d->proxyData(); - if (prData) { - d->stringToProxyDataElement(prData->iActiveCustomMethodName, inputMethod.pluginNameAndPath(), HbActiveMethodNameMax); - d->stringToProxyDataElement(prData->iActiveCustomMethodKey, inputMethod.key(), HbActiveMethodKeyMax); - } - d->unlock(); + Q_UNUSED(inputMethod) } /*! -Returns the current screen orientation in settings +Returns the current screen orientation in settings */ Qt::Orientation HbInputSettingProxy::screenOrientation() { Q_D(HbInputSettingProxy); Qt::Orientation orientation = Qt::Vertical; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { orientation = prData->iScreenOrientation; } @@ -1008,32 +1171,31 @@ /*! Sets the current screen orientation in settings. This completes orientation change -started with notifyScreenOrientationChange. +started with notifyScreenOrientationChange. Nothing is done, If + notifyScreenOrientationChange has not been called before calling this. */ void HbInputSettingProxy::setScreenOrientation(Qt::Orientation screenOrientation) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { - bool notify = false; - d->lock(); - if (screenOrientation != prData->iScreenOrientation) { - prData->iScreenOrientation = screenOrientation; - notify = true; + if (prData->iOrientationChangeCompleted) { + d->unlock(); + return; } + prData->iScreenOrientation = screenOrientation; d->unlock(); - if (notify) { - // notify everyone that the orientation has changed. - d->handleDeviceSpecificOriantationAndFlipChange(); - emit orientationChanged(screenOrientation); - // set orientation change operation completed. - d->lock(); - prData->iOrientationChangeCompleted = true; - d->unlock(); - } + // notify everyone that the orientation has changed. + d->handleDeviceSpecificOriantationAndFlipChange(); + emit orientationChanged(screenOrientation); + + // set orientation change operation completed. + d->lock(); + prData->iOrientationChangeCompleted = true; + d->unlock(); } } @@ -1049,13 +1211,20 @@ { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { + bool notify = false; d->lock(); - prData->iOrientationChangeCompleted = false; + if (prData->iOrientationChangeCompleted) { + prData->iOrientationChangeCompleted = false; + notify = true; + } d->unlock(); + if (notify) { + emit orientationAboutToChange(); + } } - emit orientationAboutToChange(); + } /*! @@ -1066,7 +1235,7 @@ Q_D(const HbInputSettingProxy); bool completed = true; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { completed = prData->iOrientationChangeCompleted; } @@ -1082,7 +1251,7 @@ Q_D(HbInputSettingProxy); // call handleDeviceSpecificOriantationAndFlipChange method - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { d->lock(); prData->iScreenOrientation = screenOrientation; @@ -1096,7 +1265,7 @@ } /*! -Returns the status of regional input correction feature. +Returns the status of regional input correction feature. \sa enableRegionalCorrection. */ @@ -1104,7 +1273,7 @@ { Q_D(const HbInputSettingProxy); bool res = false; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iRegionalCorrectionStatus; } @@ -1119,7 +1288,7 @@ void HbInputSettingProxy::enableRegionalCorrection(bool newStatus) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -1142,7 +1311,7 @@ void HbInputSettingProxy::setKeypressTimeout(int timeout) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -1158,7 +1327,7 @@ } /*! -Returns the keypress timeout value. +Returns the keypress timeout value. \sa setKeypressTimeout. */ @@ -1166,7 +1335,7 @@ { Q_D(const HbInputSettingProxy); int res = 0; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iKeypressTimeout; } @@ -1181,7 +1350,7 @@ void HbInputSettingProxy::setAutocompletionStatus(HbKeyboardSettingFlags keyboardType, bool state) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -1212,7 +1381,7 @@ { Q_D(const HbInputSettingProxy); bool res = false; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iAutocompletion & keyboardType; } @@ -1227,7 +1396,7 @@ void HbInputSettingProxy::setTypingCorrectionLevel(HbTypingCorrectionLevel level) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -1252,7 +1421,7 @@ { Q_D(const HbInputSettingProxy); HbTypingCorrectionLevel res = HbTypingCorrectionLevelHigh; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iTypingCorrectionLevel; } @@ -1267,7 +1436,7 @@ void HbInputSettingProxy::setPrimaryCandidateMode(HbPrimaryCandidateMode mode) { Q_D(HbInputSettingProxy); - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { bool notify = false; d->lock(); @@ -1291,7 +1460,7 @@ { Q_D(const HbInputSettingProxy); HbPrimaryCandidateMode res = HbPrimaryCandidateModeExactTyping; - HbSettingProxyInternalData* prData = d->proxyData(); + HbSettingProxyInternalData *prData = d->proxyData(); if (prData) { res = prData->iPrimaryCandidateMode; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputsettingproxy.h --- a/src/hbcore/inputfw/hbinputsettingproxy.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputsettingproxy.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,7 +40,7 @@ Q_OBJECT public: - static HbInputSettingProxy* instance(); + static HbInputSettingProxy *instance(); static QStringList inputMethodPluginPaths(); static QStringList keymapPluginPaths(); static QString languageDatabasePath(); @@ -54,8 +54,8 @@ virtual ~HbInputSettingProxy(); public: - void connectObservingObject(QObject* observer); - void disconnectObservingObject(QObject* observer); + void connectObservingObject(QObject *observer); + void disconnectObservingObject(QObject *observer); HbInputLanguage globalInputLanguage() const; void availableHwKeyboard(QList& listOfAvailableKeyboards) const; HbInputLanguage globalSecondaryInputLanguage() const; @@ -94,6 +94,10 @@ HbTypingCorrectionLevel typingCorrectionLevel() const; void setPrimaryCandidateMode(HbPrimaryCandidateMode mode); HbPrimaryCandidateMode primaryCandidateMode() const; + HbInputMethodDescriptor preferredInputMethod(Qt::Orientation orientation) const; + HbInputMethodDescriptor preferredInputMethod() const; + QByteArray preferredInputMethodCustomData(Qt::Orientation orientation) const; + void setPreferredInputMethod(Qt::Orientation orientation, const HbInputMethodDescriptor &inputMethod, const QByteArray &customData = QByteArray()); signals: void globalInputLanguageChanged(const HbInputLanguage &newLanguage); @@ -120,7 +124,7 @@ friend class ContentWidget; private: - HbInputSettingProxyPrivate * const d_ptr; + HbInputSettingProxyPrivate *const d_ptr; private: Q_DISABLE_COPY(HbInputSettingProxy) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputsettingproxy_p.h --- a/src/hbcore/inputfw/hbinputsettingproxy_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputsettingproxy_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,21 +27,44 @@ #include #include +#include +#include "hbinputmethoddescriptor.h" #include "hbinputlanguage.h" -const int HbProxyDataRequiredVersion = 13; +const int HbProxyDataRequiredVersion = 18; const QString KInputSettingProxyKey("HbInputSettingProxy"); -const int HbActiveMethodNameMax = 255; -const int HbActiveMethodKeyMax = 64; +const unsigned int HbActiveMethodNameMax = 255; +const unsigned int HbActiveMethodKeyMax = 64; class HbScClassifier; class HbInputSettingProxy; +class HbSettingProxyInputMethodDescriptor +{ +public: + HbSettingProxyInputMethodDescriptor(); + HbSettingProxyInputMethodDescriptor(const HbInputMethodDescriptor &descriptor); + void operator=(const HbInputMethodDescriptor &descriptor); + HbInputMethodDescriptor descriptor() const; + QByteArray data() const; + void setData(const QByteArray &data); + +public: + unsigned int pluginNameAndPathSize; + QChar pluginNameAndPath[HbActiveMethodNameMax]; + unsigned int keySize; + QChar key[HbActiveMethodKeyMax]; + unsigned int displayNameSize; + QChar displayName[HbActiveMethodKeyMax]; + unsigned int customDataSize; + char customData[HbActiveMethodKeyMax * 2]; +}; + + // REMEMBER to increase HbProxyDataRequiredVersion every time you add fields // to this class or change related constants! -struct HbSettingProxyInternalData -{ +struct HbSettingProxyInternalData { int iVersion; int iReferences; HbInputLanguage iGlobalPrimaryInputLanguage; @@ -53,8 +76,6 @@ HbInputDigitType iDigitType; bool iQwertyTextCasing; bool iQwertyCharacterPreview; - QChar iActiveCustomMethodName[HbActiveMethodNameMax]; - QChar iActiveCustomMethodKey[HbActiveMethodKeyMax]; Qt::Orientation iScreenOrientation; bool iOrientationChangeCompleted; bool iFlipStatus; @@ -63,6 +84,8 @@ HbKeyboardSettingFlags iAutocompletion; HbTypingCorrectionLevel iTypingCorrectionLevel; HbPrimaryCandidateMode iPrimaryCandidateMode; + HbSettingProxyInputMethodDescriptor iPreferredMethodHorizontal; + HbSettingProxyInputMethodDescriptor iPreferredMethodVertical; }; class HB_CORE_PRIVATE_EXPORT HbInputSettingProxyPrivate @@ -78,12 +101,12 @@ bool load(); void save(); void shutdownDataArea(); - HbSettingProxyInternalData* proxyData() const; + HbSettingProxyInternalData *proxyData() const; void flipToggle(); bool flipStatus(); void setFlipStatus(bool flipStatus); - + void handleDeviceSpecificOriantationAndFlipChange(); void lock() const { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputstandardfilters.cpp --- a/src/hbcore/inputfw/hbinputstandardfilters.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputstandardfilters.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,6 +25,12 @@ #include "hbinputstandardfilters.h" #include "hbinputsettingproxy.h" + +#define HB_DIGIT_ARABIC_INDIC_START_VALUE 0x0660 +#define HB_DIGIT_ARABIC_INDIC_END_VALUE 0x0669 +#define HB_DIGIT_EASTERN_ARABIC_START_VALUE 0x06F0 +#define HB_DIGIT_EASTERN_ARABIC_END_VALUE 0x06F9 + /*! @alpha @hbcore @@ -40,28 +46,37 @@ /* Returns true if the character is a valid number in the current input language */ - + static bool isValidNumber(QChar aChar) { bool ret = false; QLocale::Language language = HbInputSettingProxy::instance()->globalInputLanguage().language(); - QLocale::Language systemLanguage = QLocale::system().language(); + QLocale::Language systemLanguage = QLocale::system().language(); - if (language != systemLanguage) { - if (aChar >= '0' && aChar <= '9') { + // If both phone language and writing language are same, then language specific + // digits should be allowed in phone number and digits only editors. If the current + // language is Arabic, then Arabic-indic digits are supported. Eastern-Arabic digits + // are supported in Persian and Urdu languages. + if (language == systemLanguage) { + if (language == QLocale::Arabic && + (aChar >= HB_DIGIT_ARABIC_INDIC_START_VALUE && + aChar <= HB_DIGIT_ARABIC_INDIC_END_VALUE)) { ret = true; - } - } else if (language == QLocale::Arabic) { - if (aChar >= 0x0660 && aChar <= 0x0669) { + } else if ((language == QLocale::Persian || + language == QLocale::Urdu) && + (aChar >= HB_DIGIT_EASTERN_ARABIC_START_VALUE && + aChar <= HB_DIGIT_EASTERN_ARABIC_END_VALUE)) { + ret = true; + } else if (aChar >= '0' && aChar <= '9') { ret = true; } } else if (aChar >= '0' && aChar <= '9') { ret = true; - } - return ret; + } + return ret; } -HbPhoneNumberFilter* HbPhoneNumberFilter::instance() +HbPhoneNumberFilter *HbPhoneNumberFilter::instance() { static HbPhoneNumberFilter myInstance; return &myInstance; @@ -86,7 +101,7 @@ return true; } else if (isValidNumber(character)) { return true; - } + } return false; } @@ -103,7 +118,7 @@ \sa HbEditorInterface */ -HbFormattedNumbersFilter* HbFormattedNumbersFilter::instance() +HbFormattedNumbersFilter *HbFormattedNumbersFilter::instance() { static HbFormattedNumbersFilter myInstance; return &myInstance; @@ -142,7 +157,7 @@ \sa HbEditorInterface */ -HbDigitsOnlyFilter* HbDigitsOnlyFilter::instance() +HbDigitsOnlyFilter *HbDigitsOnlyFilter::instance() { static HbDigitsOnlyFilter myInstance; return &myInstance; @@ -179,7 +194,7 @@ \sa HbEditorInterface */ -HbUrlFilter* HbUrlFilter::instance() +HbUrlFilter *HbUrlFilter::instance() { static HbUrlFilter myInstance; return &myInstance; @@ -218,7 +233,7 @@ \sa HbEditorInterface */ -HbEmailAddressFilter* HbEmailAddressFilter::instance() +HbEmailAddressFilter *HbEmailAddressFilter::instance() { static HbEmailAddressFilter myInstance; return &myInstance; @@ -240,10 +255,10 @@ if ((character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z') || (character >= '0' && character <= '9')) { - return true; + return true; } - const QString others(".@,;?'-_&/~*+="); + const QString others(".@,;?'-_&/~*+="); for (int i = 0; i < others.size(); i++) { if (others[i] == character) { return true; @@ -268,7 +283,7 @@ /*! Returns the singleton instance. */ -HbInputLowerCaseFilter* HbInputLowerCaseFilter::instance() +HbInputLowerCaseFilter *HbInputLowerCaseFilter::instance() { static HbInputLowerCaseFilter theInstance; return &theInstance; @@ -302,7 +317,7 @@ /*! Returns the singleton instance. */ -HbInputUpperCaseFilter* HbInputUpperCaseFilter::instance() +HbInputUpperCaseFilter *HbInputUpperCaseFilter::instance() { static HbInputUpperCaseFilter theInstance; return &theInstance; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputstandardfilters.h --- a/src/hbcore/inputfw/hbinputstandardfilters.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputstandardfilters.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,7 +34,7 @@ class HB_CORE_EXPORT HbPhoneNumberFilter : public HbInputFilter { public: - static HbPhoneNumberFilter* instance(); + static HbPhoneNumberFilter *instance(); virtual ~HbPhoneNumberFilter(); bool filter(QChar character); @@ -51,12 +51,12 @@ class HB_CORE_EXPORT HbFormattedNumbersFilter : public HbInputFilter { public: - static HbFormattedNumbersFilter* instance(); + static HbFormattedNumbersFilter *instance(); virtual ~HbFormattedNumbersFilter(); bool filter(QChar character); private: - HbFormattedNumbersFilter(); + HbFormattedNumbersFilter(); private: Q_DISABLE_COPY(HbFormattedNumbersFilter) @@ -68,12 +68,12 @@ class HB_CORE_EXPORT HbDigitsOnlyFilter : public HbInputFilter { public: - static HbDigitsOnlyFilter* instance(); + static HbDigitsOnlyFilter *instance(); virtual ~HbDigitsOnlyFilter(); bool filter(QChar character); private: - HbDigitsOnlyFilter(); + HbDigitsOnlyFilter(); private: Q_DISABLE_COPY(HbDigitsOnlyFilter) @@ -84,13 +84,13 @@ // class HB_CORE_EXPORT HbUrlFilter : public HbInputFilter { -public: - static HbUrlFilter* instance(); +public: + static HbUrlFilter *instance(); virtual ~HbUrlFilter(); bool filter(QChar character); private: - HbUrlFilter(); + HbUrlFilter(); private: Q_DISABLE_COPY(HbUrlFilter) @@ -102,8 +102,8 @@ // class HB_CORE_EXPORT HbEmailAddressFilter : public HbInputFilter { -public: - static HbEmailAddressFilter* instance(); +public: + static HbEmailAddressFilter *instance(); virtual ~HbEmailAddressFilter(); bool filter(QChar character); @@ -120,7 +120,7 @@ class HB_CORE_EXPORT HbInputLowerCaseFilter : public HbInputFilter { public: - static HbInputLowerCaseFilter* instance(); + static HbInputLowerCaseFilter *instance(); virtual ~HbInputLowerCaseFilter() {} bool filter(QChar character); @@ -137,7 +137,7 @@ class HB_CORE_EXPORT HbInputUpperCaseFilter : public HbInputFilter { public: - static HbInputUpperCaseFilter* instance(); + static HbInputUpperCaseFilter *instance(); virtual ~HbInputUpperCaseFilter() {} bool filter(QChar character); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputstate.h --- a/src/hbcore/inputfw/hbinputstate.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputstate.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ This class describes the state of the input framework. Active input method is notified every time the state changes. -If the active input method cannot handle new state, the framework will find +If the active input method cannot handle new state, the framework will find suitable handler for it. The input state is a combination of input mode, text case, keyboard type and language. @@ -61,19 +61,19 @@ mLanguage(language) {} - void operator=(const HbInputState& other) { + void operator=(const HbInputState &other) { mModeType = other.mModeType; mTextCase = other.mTextCase; mKeyboardType = other.mKeyboardType; mLanguage = other.mLanguage; } - bool operator==(const HbInputState& other) { + bool operator==(const HbInputState &other) const { if (mModeType == other.mModeType && mTextCase == other.mTextCase && mKeyboardType == other.mKeyboardType && mLanguage == other.mLanguage) { - return true; + return true; } return false; } @@ -83,24 +83,24 @@ states being compared has undefined language value, it will match to any language. If both language values are defined, then they are compared directly. */ - bool isMatch(const HbInputState& other) { + bool isMatch(const HbInputState &other) const { if (mModeType == other.mModeType && mTextCase == other.mTextCase && mKeyboardType == other.mKeyboardType && (mLanguage == other.mLanguage || mLanguage.undefined() || // Undefined matches to anything. - other.mLanguage.undefined())) { - return true; + other.mLanguage.undefined())) { + return true; } return false; } - bool operator!=(const HbInputState& other) { + bool operator!=(const HbInputState &other) const { if (mModeType != other.mModeType || mTextCase != other.mTextCase || mKeyboardType != other.mKeyboardType || mLanguage != other.mLanguage) { - return true; + return true; } return false; } @@ -108,42 +108,58 @@ /*! Returns input mode. */ - HbInputModeType inputMode() const { return mModeType; } + HbInputModeType inputMode() const { + return mModeType; + } /*! Sets input mode. */ - void setInputMode(HbInputModeType newMode) { mModeType = newMode; } + void setInputMode(HbInputModeType newMode) { + mModeType = newMode; + } /*! Returns text case. */ - HbTextCase textCase() const { return mTextCase; } + HbTextCase textCase() const { + return mTextCase; + } /*! Sets text case. */ - void setTextCase(HbTextCase newCase) { mTextCase = newCase; } + void setTextCase(HbTextCase newCase) { + mTextCase = newCase; + } /*! Returns keyboard type. */ - HbKeyboardType keyboard() const { return mKeyboardType; } + HbKeyboardType keyboard() const { + return mKeyboardType; + } /*! Sets keyboard type. */ - void setKeyboard(HbKeyboardType newKeyboard) { mKeyboardType = newKeyboard; } + void setKeyboard(HbKeyboardType newKeyboard) { + mKeyboardType = newKeyboard; + } /*! Returns language. */ - HbInputLanguage language() const { return HbInputLanguage(mLanguage); } + HbInputLanguage language() const { + return HbInputLanguage(mLanguage); + } /*! - Sets language. + Sets language. */ - void setLanguage(const HbInputLanguage &newLanguage) { mLanguage = newLanguage; } + void setLanguage(const HbInputLanguage &newLanguage) { + mLanguage = newLanguage; + } private: HbInputModeType mModeType; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputuserdictionary.h --- a/src/hbcore/inputfw/hbinputuserdictionary.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputuserdictionary.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,13 +45,13 @@ virtual ~HbUserDictionary() {} virtual int id() const = 0; - virtual bool addWord(const QString& word, HbPredictionCallback* callback = 0) = 0; - virtual bool addWords(const QStringList& wordList) = 0; - virtual bool removeWord(const QString& word) = 0; + virtual bool addWord(const QString &word, HbPredictionCallback *callback = 0) = 0; + virtual bool addWords(const QStringList &wordList) = 0; + virtual bool removeWord(const QString &word) = 0; virtual int numberOfWords() const = 0; virtual QStringList listWords() = 0; virtual void clear() = 0; - virtual HbPredictionBase* hostEngine() const = 0; + virtual HbPredictionBase *hostEngine() const = 0; }; #endif // HB_INPUT_USER_DICTIONARY_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinpututils.cpp --- a/src/hbcore/inputfw/hbinpututils.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinpututils.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinpututils.h" + #include #include #include @@ -40,40 +42,16 @@ #include "hbinputlanguagedatabase.h" #include "hbinputmodecache_p.h" #include "hbinputlanguage.h" -#include "hbinpututils.h" - -#define HB_DIGIT_ARABIC_INDIC_START_VALUE 0x0660 - - -/// @cond -static bool usesLatinDigits(QLocale::Language language, HbInputDigitType digitType) -{ - if (digitType == HbDigitTypeDevanagari) { - return false; - } - if (language == QLocale::Urdu || language == QLocale::Persian) { - // Latin digits are used in Persian and Urdu ITU-T keypads - if (HbInputSettingProxy::instance()->activeKeyboard() == HbKeyboardVirtual12Key) { - return true; - } else { - return false; - } - } - if (language == QLocale::Arabic && digitType == HbDigitTypeArabicIndic) { - return false; - } +#define HB_DIGIT_ARABIC_INDIC_START_VALUE 0x0660 +#define HB_DIGIT_EASTERN_ARABIC_START_VALUE 0x06F0 - return true; -} - -/// @endcond /*! \class HbInputUtils \brief A collection input related utility methods. -This class contains a collection of static input related utility methods that do not +This class contains a collection of static input related utility methods that do not naturally belong to any other scope. There are convenience methods for testing attributes of keyboard and input mode types, instantiating plugins etc. @@ -83,18 +61,16 @@ /*! Finds the fist number character bound to key using given mapping data. -@param keyboardType Type of the keyboard -@param key Key code where to look for number character -@param keymapData Pointer to keymap data where to look -@param digitType Type of digit if not latin */ -QChar HbInputUtils::findFirstNumberCharacterBoundToKey(const HbMappedKey* key, - const HbInputLanguage language, - const HbInputDigitType digitType) +QChar HbInputUtils::findFirstNumberCharacterBoundToKey(const HbMappedKey *key, + const HbInputLanguage language, + const HbInputDigitType digitType) { + Q_UNUSED(language); + if (key) { QString chars = key->characters(HbModifierNone); - if (usesLatinDigits(language.language(), digitType)) { + if (digitType == HbDigitTypeLatin) { for (int i = 0; i < chars.length(); i++) { if (chars.at(i) >= '0' && chars.at(i) <= '9') { return chars.at(i); @@ -110,13 +86,14 @@ for (int i = 0; i < chars.length(); i++) { if (chars.at(i) >= '0' && chars.at(i) <= '9') { return HB_DIGIT_ARABIC_INDIC_START_VALUE + - (chars.at(i).toAscii() - '0'); + (chars.at(i).unicode() - '0'); } } } else if (digitType == HbDigitTypeEasternArabic) { for (int i = 0; i < chars.length(); i++) { - if (chars.at(i) >= 0x06F0 && chars.at(i) <= 0x06F9) { - return chars.at(i); + if (chars.at(i) >= '0' && chars.at(i) <= '9') { + return HB_DIGIT_EASTERN_ARABIC_START_VALUE + + (chars.at(i).unicode() - '0'); } } } @@ -130,7 +107,7 @@ For example Chinese and Japanese modes do not have text case. */ bool HbInputUtils::isCaseSensitiveMode(HbInputModeType inputMode) -{ +{ if (isChineseInputMode(inputMode)) { return false; } @@ -145,7 +122,7 @@ \sa languageDatabasePluginInstance */ -void HbInputUtils::listAvailableLanguageDatabasePlugins(QStringList& result, const QString& subfolder) +void HbInputUtils::listAvailableLanguageDatabasePlugins(QStringList &result, const QString &subfolder) { QString path(HbInputSettingProxy::languageDatabasePath()); path += QDir::separator(); @@ -163,14 +140,14 @@ /*! Creates an instance of given language database plugin, if valid. */ -HbLanguageDatabaseInterface* HbInputUtils::languageDatabasePluginInstance(const QString& pluginFileName, const QString& subfolder) +HbLanguageDatabaseInterface *HbInputUtils::languageDatabasePluginInstance(const QString &pluginFileName, const QString &subfolder) { if (!QLibrary::isLibrary(pluginFileName)) { qDebug("HbInputUtils::languageDatabasePluginInstance: Not a library!"); return NULL; } - HbLanguageDatabaseInterface* res = NULL; + HbLanguageDatabaseInterface *res = NULL; QString fullName(HbInputSettingProxy::languageDatabasePath()); fullName += QDir::separator(); @@ -181,10 +158,10 @@ fullName += pluginFileName; QPluginLoader loader(fullName); - QObject* plugin = loader.instance(); + QObject *plugin = loader.instance(); if (plugin) { - res = qobject_cast(plugin); + res = qobject_cast(plugin); } else { qDebug("HbInputUtils::languageDatabasePluginInstance: Unable to instantiate plugin"); } @@ -205,7 +182,7 @@ It creates QGraphicsScene, adds given widget there and creates a view to the scene inside returned QWidget. This is utility method is mainly for internal use. */ -QWidget* HbInputUtils::createWrapperWidget(QGraphicsWidget* graphicsWidget) +QWidget *HbInputUtils::createWrapperWidget(QGraphicsWidget *graphicsWidget) { QWidget *ret = 0; @@ -227,10 +204,10 @@ } /*! -A convinience method that wraps given widget inside QGraphicsProxyWidget +A convenience method that wraps given widget inside QGraphicsProxyWidget and returns it. This is utility method is mainly for internal use. */ -QGraphicsWidget* HbInputUtils::createGraphicsProxyWidget(QWidget* widget) +QGraphicsWidget *HbInputUtils::createGraphicsProxyWidget(QWidget *widget) { QGraphicsProxyWidget *proxy = 0; @@ -252,14 +229,38 @@ HbInputDigitType digitType = HbDigitTypeNone; switch (language.language()) { - case QLocale::Arabic: - digitType = HbDigitTypeArabicIndic; - break; - default: - digitType = HbDigitTypeLatin; - break; + case QLocale::Arabic: + digitType = HbDigitTypeArabicIndic; + break; + case QLocale::Persian: + case QLocale::Urdu: + digitType = HbDigitTypeEasternArabic; + break; + case QLocale::Hindi: + digitType = HbDigitTypeDevanagari; + break; + default: + digitType = HbDigitTypeLatin; + break; } return digitType; } + + +/*! +Returns the proxy widget of the embedded widget in a graphics view ; +if widget does not have the proxy widget then it returns the proxy widget of its window. + otherwise returns 0. +*/ +QGraphicsProxyWidget *HbInputUtils::graphicsProxyWidget(const QWidget *w) +{ + QGraphicsProxyWidget *pw = w ? w->graphicsProxyWidget() : 0; + if (w && !pw) { + pw = w->window() ? w->window()->graphicsProxyWidget() : w->graphicsProxyWidget(); + } + return pw; +} + + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinpututils.h --- a/src/hbcore/inputfw/hbinpututils.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinpututils.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,9 +36,9 @@ class QInputContextPlugin; class QWidget; class QGraphicsWidget; +class QGraphicsProxyWidget; -struct HbInputMethodList -{ +struct HbInputMethodList { QStringList dllName; QStringList key; }; @@ -50,18 +50,19 @@ static inline bool isQwertyKeyboard(HbKeyboardType keyboardType); static inline bool isTouchKeyboard(HbKeyboardType keyboardType); static bool isCaseSensitiveMode(HbInputModeType inputMode); - static QChar findFirstNumberCharacterBoundToKey(const HbMappedKey* key, - const HbInputLanguage language, - const HbInputDigitType digitType = HbDigitTypeLatin); + static QChar findFirstNumberCharacterBoundToKey(const HbMappedKey *key, + const HbInputLanguage language, + const HbInputDigitType digitType = HbDigitTypeLatin); - static void listAvailableLanguageDatabasePlugins(QStringList& result, const QString& subfolder); - static HbLanguageDatabaseInterface* languageDatabasePluginInstance(const QString& pluginFileName, const QString& subfolder); + static void listAvailableLanguageDatabasePlugins(QStringList &result, const QString &subfolder); + static HbLanguageDatabaseInterface *languageDatabasePluginInstance(const QString &pluginFileName, const QString &subfolder); static void listSupportedInputLanguages(QList& results); - static QWidget* createWrapperWidget(QGraphicsWidget* graphicsWidget); - static QGraphicsWidget* createGraphicsProxyWidget(QWidget* widget); - static HbInputDigitType inputDigitType(HbInputLanguage language); + static QWidget *createWrapperWidget(QGraphicsWidget *graphicsWidget); + static QGraphicsWidget *createGraphicsProxyWidget(QWidget *widget); + static HbInputDigitType inputDigitType(HbInputLanguage language); + static QGraphicsProxyWidget *graphicsProxyWidget(const QWidget *w); }; /*! @@ -85,7 +86,7 @@ */ inline bool HbInputUtils::isTouchKeyboard(HbKeyboardType keyboardType) { - return (keyboardType & HbTouchInputMask) != 0; + return (keyboardType & HbTouchInputMask) != 0; } #endif // HB_INPUT_UTILS_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputvirtualkeyboard.cpp --- a/src/hbcore/inputfw/hbinputvirtualkeyboard.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputvirtualkeyboard.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ class will fill and layout the keyboard contents. The virtual keyboard host calls aboutToOpen() method when it is about to open the keyboard -and aboutToClose() when it is about to close it. Similarily, it calls keyboardOpened() +and aboutToClose() when it is about to close it. Similarly, it calls keyboardOpened() and keyboardClosed() methods when open and close operations have been completed. Every time the host runs keyboard related animations, it calls keyboardAnimationFrame() diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputvirtualkeyboard.h --- a/src/hbcore/inputfw/hbinputvirtualkeyboard.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputvirtualkeyboard.h Thu Jul 22 16:36:53 2010 +0100 @@ -24,7 +24,7 @@ ****************************************************************************/ #ifndef HB_INPUT_VIRTUAL_KEYBOARD_H -#define HB_INPUT_VIRTUAL_KEYBAORD_H +#define HB_INPUT_VIRTUAL_KEYBOARD_H #include @@ -39,7 +39,7 @@ public: /*! Specifies known virtual keyboard animation types. - */ + */ enum HbVkbAnimationType { HbVkbAnimOpen, HbVkbAnimClose @@ -47,9 +47,11 @@ public: virtual ~HbVirtualKeyboard() {} - virtual HbKeyboardType keyboardType() const { return HbKeyboardNone; } - virtual QWidget* asWidget() = 0; - virtual QGraphicsWidget* asGraphicsWidget() = 0; + virtual HbKeyboardType keyboardType() const { + return HbKeyboardNone; + } + virtual QWidget *asWidget() = 0; + virtual QGraphicsWidget *asGraphicsWidget() = 0; virtual QSizeF preferredKeyboardSize() = 0; virtual QSizeF minimizedKeyboardSize() = 0; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputvkbhost.cpp --- a/src/hbcore/inputfw/hbinputvkbhost.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputvkbhost.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,9 +22,10 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputvkbhost.h" + #include -#include "hbinputvkbhost.h" #include "hbinputmethod.h" const char HbVkbHostPropertyName[] = "HbVkbHost"; @@ -47,7 +48,7 @@ developer doesn't need to care about that. There can be several vkb hosts in the system because in some situations the keyboard -needs to behave differently than in others. +needs to behave differently than in others. The input framework finds active vkb host by traversing editor widget's parent chain to see if there is a host attached to editor widget or any of its parents. If @@ -61,7 +62,7 @@ */ /*! -\fn virtual void HbVkbHost::openKeypad(HbVirtualKeyboard *vkb, bool animationAllowed = true) +\fn virtual void HbVkbHost::openKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner, bool animationAllowed = true) Opens given virtual keyboard. If animation is used, emits signal keypadOpened after animation is completed. */ @@ -78,9 +79,9 @@ /*! \fn virtual QSizeF HbVkbHost::keyboardArea() const -Returns the size of a rectangular area of the screen where virtual keyboard will be displayed. If +Returns the size of a rectangular area of the screen where virtual keyboard will be displayed. If virtual keyboard's preferredKeyboardSize method returns larger area than returned by this method, -the vkb host will shrink keyboard to fit into this rectangle. +the vkb host will shrink keyboard to fit into this rectangle. */ /*! @@ -115,7 +116,7 @@ /*! Attaches given host to given object. Deletes previously attached host. */ -void HbVkbHost::attachHost(HbVkbHost* host, QObject* object) +void HbVkbHost::attachHost(HbVkbHost *host, QObject *object) { if (object) { delete getVkbHost(object); // delete previous host. @@ -128,7 +129,7 @@ /*! Removes (possible) vkb host from given object. */ -void HbVkbHost::detachHost(QObject* object) +void HbVkbHost::detachHost(QObject *object) { if (object) { QObject *hostObject = 0; @@ -146,8 +147,8 @@ if (object) { QVariant variant = object->property(HbVkbHostPropertyName); if (variant.isValid()) { - QObject *hostObject = variant.value(); - HbVkbHost *host = static_cast(hostObject); + QObject *hostObject = variant.value(); + HbVkbHost *host = static_cast(hostObject); return host; } } @@ -156,7 +157,7 @@ } /*! -Returns active virtual keyboard host if there is one currently available. +Returns active virtual keyboard host if there is one currently available. */ HbVkbHost *HbVkbHost::activeVkbHost() { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputvkbhost.h --- a/src/hbcore/inputfw/hbinputvkbhost.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputvkbhost.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,29 +43,29 @@ Q_OBJECT public: - /*! - Enumerates different keypad states. - */ - enum HbVkbStatus { + /*! + Enumerates different keypad states. + */ + enum HbVkbStatus { HbVkbStatusClosed, HbVkbStatusMinimized, HbVkbStatusOpened, - }; + }; public: virtual ~HbVkbHost() {} - virtual void openKeypad(HbVirtualKeyboard *vkb = 0, HbInputMethod* owner = 0, bool animationAllowed = true) = 0; - virtual void openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner) = 0; + virtual void openKeypad(HbVirtualKeyboard *vkb = 0, HbInputMethod *owner = 0, bool animationAllowed = true) = 0; + virtual void openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner) = 0; virtual void closeKeypad(bool animationAllowed = true) = 0; virtual void minimizeKeypad(bool animationAllowed = true) = 0; - virtual HbVkbStatus keypadStatus() const = 0; + virtual HbVkbStatus keypadStatus() const = 0; virtual QSizeF keyboardArea() const = 0; - virtual HbVirtualKeyboard* activeKeypad() const = 0; + virtual HbVirtualKeyboard *activeKeypad() const = 0; virtual QRectF applicationArea() const = 0; virtual HbVkbStatus keypadStatusBeforeOrientationChange() const = 0; - static void attachHost(HbVkbHost* host, QObject* object); - static void detachHost(QObject* object); + static void attachHost(HbVkbHost *host, QObject *object); + static void detachHost(QObject *object); static HbVkbHost *getVkbHost(QObject *object); static HbVkbHost *activeVkbHost(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputvkbhostbridge.cpp --- a/src/hbcore/inputfw/hbinputvkbhostbridge.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputvkbhostbridge.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,11 +22,11 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputvkbhostbridge.h" + #include #include -#include "hbinputvkbhostbridge.h" - /*! \proto \class HbVkbHostBridge @@ -42,7 +42,7 @@ Note that there is active host only when editor widget is focused. The bridge virtual keyboard host also has has an important internal role in synchronising state transitions between several -active virtual keyboard hosts. +active virtual keyboard hosts. \sa HbVkbHost */ @@ -75,7 +75,7 @@ /*! \reimp */ -void HbVkbHostBridge::openKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner, bool animationAllowed) +void HbVkbHostBridge::openKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner, bool animationAllowed) { Q_D(HbVkbHostBridge); if (d->mActiveHost) { @@ -86,7 +86,7 @@ /*! \reimp */ -void HbVkbHostBridge::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner) +void HbVkbHostBridge::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner) { Q_D(HbVkbHostBridge); if (d->mActiveHost) { @@ -132,7 +132,7 @@ /*! \reimp -*/ +*/ QSizeF HbVkbHostBridge::keyboardArea() const { Q_D(const HbVkbHostBridge); @@ -146,7 +146,7 @@ /*! \reimp */ -HbVirtualKeyboard* HbVkbHostBridge::activeKeypad() const +HbVirtualKeyboard *HbVkbHostBridge::activeKeypad() const { Q_D(const HbVkbHostBridge); if (d->mActiveHost) { @@ -203,19 +203,21 @@ { Q_D(HbVkbHostBridge); - if (d->mActiveHost && d->mActiveHost->stateTransitionOngoing()) { + if (d->mActiveHost && d->mActiveHost->stateTransitionOngoing()) { return false; } if (d->mActiveHost != host) { if (d->mActiveHost) { + // Closing the previous vkb hosts keypad so that if necessary can be launched again for that same vkb host. + d->mActiveHost->closeKeypad(false); disconnect(d->mActiveHost, SIGNAL(aboutToOpen()), this, SIGNAL(aboutToOpen())); disconnect(d->mActiveHost, SIGNAL(aboutToClose()), this, SIGNAL(aboutToClose())); disconnect(d->mActiveHost, SIGNAL(keypadOpened()), this, SIGNAL(keypadOpened())); disconnect(d->mActiveHost, SIGNAL(keypadClosed()), this, SIGNAL(keypadClosed())); disconnect(d->mActiveHost, SIGNAL(keypadOpened()), this, SIGNAL(stateTransitionCompleted())); disconnect(d->mActiveHost, SIGNAL(keypadClosed()), this, SIGNAL(stateTransitionCompleted())); - } + } d->mActiveHost = host; if (d->mActiveHost) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/hbinputvkbhostbridge.h --- a/src/hbcore/inputfw/hbinputvkbhostbridge.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/hbinputvkbhostbridge.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,13 +38,13 @@ static HbVkbHostBridge *instance(); ~HbVkbHostBridge(); - void openKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner, bool animationAllowed); - void openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner); + void openKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner, bool animationAllowed); + void openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner); void closeKeypad(bool animationAllowed); void minimizeKeypad(bool animationAllowed); HbVkbStatus keypadStatus() const; - QSizeF keyboardArea() const; - HbVirtualKeyboard* activeKeypad() const; + QSizeF keyboardArea() const; + HbVirtualKeyboard *activeKeypad() const; QRectF applicationArea() const; HbVkbStatus keypadStatusBeforeOrientationChange() const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/inputfw/inputfw.pri --- a/src/hbcore/inputfw/inputfw.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/inputfw/inputfw.pri Thu Jul 22 16:36:53 2010 +0100 @@ -53,6 +53,7 @@ PUBLIC_HEADERS += $$PWD/hbinputstandardfilters.h PUBLIC_HEADERS += $$PWD/hbinputmethoddescriptor.h PUBLIC_HEADERS += $$PWD/hbinputvkbhostbridge.h +PUBLIC_HEADERS += $$PWD/hbinputcontextplugin.h # private framework headers PRIVATE_HEADERS += $$PWD/hbinputmodecache_p.h @@ -62,9 +63,12 @@ PRIVATE_HEADERS += $$PWD/hbinputextrauserdictionary_p.h PRIVATE_HEADERS += $$PWD/hbinputmethod_p.h PRIVATE_HEADERS += $$PWD/hbinputsettingproxy_p.h +PRIVATE_HEADERS += $$PWD/hbinputmainwindow_p.h +PRIVATE_HEADERS += $$PWD/hbinputregioncollector_p.h # framework sources -SOURCES += $$PWD/hbinputmethod.cpp +SOURCES += $$PWD/hbinputmethod.cpp \ + inputfw/hbinputregioncollector.cpp SOURCES += $$PWD/hbinputkeymap.cpp SOURCES += $$PWD/hbinputpredictionengine.cpp SOURCES += $$PWD/hbinputkeymapfactory.cpp @@ -88,4 +92,6 @@ SOURCES += $$PWD/hbinputmethod_p.cpp SOURCES += $$PWD/hbinputmethoddescriptor.cpp SOURCES += $$PWD/hbinputvkbhostbridge.cpp +SOURCES += $$PWD/hbinputmainwindow.cpp +SOURCES += $$PWD/hbinputcontextplugin.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbanchor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/layouts/hbanchor.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,428 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hbanchor.h" +#include "hbanchor_p.h" +#include "hbanchorlayout.h" + +#ifndef HB_BOOTSTRAPPED +#include // QWIDGETSIZE_MAX +#else +#define QWIDGETSIZE_MAX ((1<<24)-1) +#endif + +/*! + \class HbAnchor + \brief HbAnchor class represents anchors used by HbAnchorLayout. + + HbAnchor instance has own size hints and size policy. It can have + minimum/maximum/preferred sizes and any of size policies supported by Qt. + By default size policy is QSizePolicy::Fixed and anchor size is zero. + + HbAnchor cannot have negative size hints, instead you can use + HbAnchor::Direction for turning anchor to opposite side. + + Note: when you pass negative number to size hint, direction is + changed automatically to HbAnchor::Negative, and absolute value + is for requested size hint. + + \stable +*/ + +/*! + internal +*/ +HbAnchorPrivate::HbAnchorPrivate() + : mStartItem(0), mStartId(), mEndItem(0), mEndId(), mMinValue(0), mPrefValue(0), mMaxValue(QWIDGETSIZE_MAX), + mPolicy(QSizePolicy::Fixed), mDir(HbAnchor::Positive), mParent(0), mAnchorId() + { + } + + +/*! + internal +*/ +void HbAnchorPrivate::setInitialLength( qreal length ) +{ + mDir = (length < 0) ? HbAnchor::Negative : HbAnchor::Positive; + mPrefValue = qAbs(length); +} + +/*! + Constructor. +*/ +HbAnchor::HbAnchor( const QString& startNodeId, Hb::Edge startEdge, const QString& endNodeId, Hb::Edge endEdge, qreal length ) : d_ptr( new HbAnchorPrivate ) +{ + Q_D( HbAnchor ); + d->mStartEdge = startEdge; + d->mStartId = startNodeId; + d->mEndEdge = endEdge; + d->mEndId = endNodeId; + + d->setInitialLength( length ); +} + +/*! + Constructor. +*/ +HbAnchor::HbAnchor( const QString& startNodeId, Hb::Edge startEdge, QGraphicsLayoutItem *endItem, Hb::Edge endEdge, qreal length ) : d_ptr( new HbAnchorPrivate ) +{ + Q_D( HbAnchor ); + d->mStartId = startNodeId; + d->mStartEdge = startEdge; + d->mEndEdge = endEdge; + d->mEndItem = endItem; + + d->setInitialLength( length ); +} + +/*! + Constructor. +*/ +HbAnchor::HbAnchor( QGraphicsLayoutItem *startItem, Hb::Edge startEdge, const QString& endNodeId, Hb::Edge endEdge, qreal length ) : d_ptr( new HbAnchorPrivate ) +{ + Q_D( HbAnchor ); + d->mStartEdge = startEdge; + d->mStartItem = startItem; + d->mEndEdge = endEdge; + d->mEndId = endNodeId; + + d->setInitialLength( length ); +} + +/*! + Constructor. +*/ +HbAnchor::HbAnchor( QGraphicsLayoutItem *startItem, Hb::Edge startEdge, QGraphicsLayoutItem *endItem, Hb::Edge endEdge, qreal length ) : d_ptr( new HbAnchorPrivate ) +{ + Q_D( HbAnchor ); + d->mStartEdge = startEdge; + d->mStartItem = startItem; + d->mEndEdge = endEdge; + d->mEndItem = endItem; + + d->setInitialLength( length ); +} + + +/*! + Destructor. +*/ +HbAnchor::~HbAnchor() +{ + delete d_ptr; +} + + +/*! + Returns reference to HbAnchorLayout, where this anchor is set. If this anchor has not + been set to any layout yet, then this function returns zero. + + \return reference to HbAnchorLayout, or zero. +*/ +HbAnchorLayout *HbAnchor::parent() const +{ + Q_D( const HbAnchor ); + return d->mParent; +} + +/*! + Assigns other to this anchor and returns a reference to this anchor. +*/ +HbAnchor &HbAnchor::operator=(const HbAnchor &other) +{ + Q_D( HbAnchor ); + if (this != &other) { + d->mStartItem = other.startItem(); + d->mStartId = other.startNodeId(); + d->mStartEdge = other.startEdge(); + d->mEndItem = other.endItem(); + d->mEndId = other.endNodeId(); + d->mEndEdge = other.endEdge(); + d->mMinValue = other.minimumLength(); + d->mPrefValue = other.preferredLength(); + d->mMaxValue = other.maximumLength(); + d->mPolicy = other.sizePolicy(); + setDirection( other.direction() ); + d->mParent = other.parent(); + } + return *this; +} + + +/*! + Sets size policy to this anchor. + + \param policy size policy to be set +*/ +void HbAnchor::setSizePolicy( QSizePolicy::Policy policy ) +{ + Q_D( HbAnchor ); + if ( d->mPolicy != policy ) { + d->mPolicy = policy; + if( d->mParent ) { + d->mParent->updateGeometry(); + } + } +} + + +/*! + Returns current size policy. By default size policy is QSizePolicy::Fixed + + \return current size policy +*/ +QSizePolicy::Policy HbAnchor::sizePolicy() const +{ + Q_D( const HbAnchor ); + return d->mPolicy; +} + +/*! + Sets minimum length to this anchor. + + Note: only non-negative values accepted. + + \param length minimum length to be set +*/ +void HbAnchor::setMinimumLength( qreal length ) +{ + Q_D( HbAnchor ); + Q_ASSERT( length >= 0 ); + if ( d->mMinValue != length ) { + d->mMinValue = length; + if( d->mParent ) { + d->mParent->updateGeometry(); + } + } +} + +/*! + Sets preferred length to this anchor. + + Note: only non-negative values accepted. + + \param length preferred length to be set +*/ +void HbAnchor::setPreferredLength( qreal length ) +{ + Q_D( HbAnchor ); + Q_ASSERT( length >= 0 ); + if ( d->mPrefValue != length ) { + d->mPrefValue = length; + if( d->mParent ) { + d->mParent->updateGeometry(); + } + } +} + +/*! + Sets maximum length to this anchor. + + Note: only non-negative values accepted. + + \param length maximum length to be set +*/ +void HbAnchor::setMaximumLength( qreal length ) +{ + Q_D( HbAnchor ); + Q_ASSERT( length >= 0 ); + if ( d->mMaxValue != length ) { + d->mMaxValue = length; + if( d->mParent ) { + d->mParent->updateGeometry(); + } + } +} + +/*! + Returns minimum length of this anchor. + + \return minimum length of this anchor +*/ +qreal HbAnchor::minimumLength() const +{ + Q_D( const HbAnchor ); + return d->mMinValue; +} + +/*! + Returns preferred length of this anchor. + + \return preferred length of this anchor +*/ +qreal HbAnchor::preferredLength() const +{ + Q_D( const HbAnchor ); + return d->mPrefValue; +} + +/*! + Returns maximum length of this anchor. + + \return maximum length of this anchor +*/ +qreal HbAnchor::maximumLength() const +{ + Q_D( const HbAnchor ); + return d->mMaxValue; +} + +/*! + Returns length hint of this anchor. + + \param which here you specify which size hint to return + \return value of requested length hint +*/ +qreal HbAnchor::lengthHint( Qt::SizeHint which ) const +{ + Q_D( const HbAnchor ); + if (which == Qt::MinimumSize) { + return d->mMinValue; + } else if (which == Qt::PreferredSize ) { + return d->mPrefValue; + } else { + return d->mMaxValue; + } + +} + +/*! + Returns current start item, or zero if it is not set. + + \return reference to start item +*/ +QGraphicsLayoutItem *HbAnchor::startItem() const +{ + Q_D( const HbAnchor ); + return d->mStartItem; +} + +/*! + Returns current start node id, or null-string if it is not set. + + \return start node id +*/ +QString HbAnchor::startNodeId() const +{ + Q_D( const HbAnchor ); + return d->mStartId; +} + +/*! + Returns start edge of this anchor. + + \return start edge +*/ +Hb::Edge HbAnchor::startEdge() const +{ + Q_D( const HbAnchor ); + return d->mStartEdge; +} + +/*! + Returns current end item, or zero if it is not set. + + \return reference to end item +*/ +QGraphicsLayoutItem *HbAnchor::endItem() const +{ + Q_D( const HbAnchor ); + return d->mEndItem; +} + +/*! + Returns current end node id, or null-string if it is not set. + + \return start end id +*/ +QString HbAnchor::endNodeId() const +{ + Q_D( const HbAnchor ); + return d->mEndId; +} + +/*! + Returns end edge of this anchor. + + \return end edge +*/ +Hb::Edge HbAnchor::endEdge() const +{ + Q_D( const HbAnchor ); + return d->mEndEdge; +} + +/*! + Returns current direction of this anchor. + + \return direction +*/ +HbAnchor::Direction HbAnchor::direction() const +{ + Q_D( const HbAnchor ); + return d->mDir; +} + +/*! + Sets direction to this anchor. + + \param dir direction to set +*/ +void HbAnchor::setDirection( HbAnchor::Direction dir ) +{ + Q_D( HbAnchor ); + + if ( d->mDir != dir ) { + d->mDir = dir; + if( d->mParent ) { + d->mParent->updateGeometry(); + } + } +} + +/*! + Returns anchor id of this anchor, or null-string if it is not set. + + \return anchor id +*/ +QString HbAnchor::anchorId() const +{ + Q_D( const HbAnchor ); + return d->mAnchorId; +} + +/*! + Sets anchor id for this anchor. + + \param anchorId id to be set +*/ +void HbAnchor::setAnchorId( const QString &anchorId ) +{ + Q_D( HbAnchor ); + d->mAnchorId = anchorId; +} + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbanchor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/layouts/hbanchor.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBANCHOR_H +#define HBANCHOR_H + +#include + +class HbAnchorPrivate; + +class HB_CORE_EXPORT HbAnchor +{ +public: + + enum Direction { + Positive, + Negative + }; + + // - always: min < pref < max + // - no negative lenghts (could be added later, though) + // - Positive means "to-the-right" or "down" + // - Negative means "to-the-left" or "up" + + HbAnchor( const QString& startNodeId, Hb::Edge startEdge, const QString& endNodeId, Hb::Edge endEdge, qreal length = 0 ); + HbAnchor( const QString& startNodeId, Hb::Edge startEdge, QGraphicsLayoutItem *endItem, Hb::Edge endEdge, qreal length = 0 ); + HbAnchor( QGraphicsLayoutItem *startItem, Hb::Edge startEdge, const QString& endNodeId, Hb::Edge endEdge, qreal length = 0 ); + HbAnchor( QGraphicsLayoutItem *startItem, Hb::Edge startEdge, QGraphicsLayoutItem *endItem, Hb::Edge endEdge, qreal length = 0 ); + ~HbAnchor(); + + HbAnchorLayout *parent() const; + + HbAnchor &operator=(const HbAnchor &other); + + void setSizePolicy( QSizePolicy::Policy policy ); + QSizePolicy::Policy sizePolicy() const; + + void setMaximumLength( qreal length ); + void setPreferredLength( qreal length ); + void setMinimumLength( qreal length ); + + qreal minimumLength() const; + qreal preferredLength() const; + qreal maximumLength() const; + + qreal lengthHint( Qt::SizeHint which ) const; + + QGraphicsLayoutItem *startItem() const; + QString startNodeId() const; + Hb::Edge startEdge() const; + + QGraphicsLayoutItem *endItem() const; + QString endNodeId() const; + Hb::Edge endEdge() const; + + Direction direction() const; + void setDirection( Direction dir ); + + QString anchorId() const; + void setAnchorId( const QString &anchorId ); + +protected: + HbAnchorPrivate * const d_ptr; + +private: + Q_DECLARE_PRIVATE_D(d_ptr, HbAnchor) + + friend class HbAnchorLayout; // for setting/removing parent, for example... + friend class HbAnchorLayoutPrivate; +}; + +#endif // HBANCHOR_H + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbanchor_p.h --- a/src/hbcore/layouts/hbanchor_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/layouts/hbanchor_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,30 +23,41 @@ ** ****************************************************************************/ -#ifndef HBANCHORPRIVATE_H -#define HBANCHORPRIVATE_H +#ifndef HBANCHOR_P_H +#define HBANCHOR_P_H -#include +#include +#include -class HB_CORE_PRIVATE_EXPORT HbAnchor +class HbAnchorLayout; +class QGraphicsLayoutItem; + +class HbAnchorPrivate { public: - HbAnchor(); - HbAnchor( - QGraphicsLayoutItem *startItem, - Hb::Edge startEdge, - QGraphicsLayoutItem *endItem, - Hb::Edge endEdge, - qreal value ); - HbAnchor(const HbAnchor &anchor); - HbAnchor &operator=(const HbAnchor &anchor); + HbAnchorPrivate(); + void setInitialLength( qreal length ); QGraphicsLayoutItem *mStartItem; Hb::Edge mStartEdge; + QString mStartId; QGraphicsLayoutItem *mEndItem; Hb::Edge mEndEdge; - qreal mValue; + QString mEndId; + + qreal mMinValue; + qreal mPrefValue; + qreal mMaxValue; + + QSizePolicy::Policy mPolicy; + + HbAnchor::Direction mDir; + + HbAnchorLayout *mParent; + + QString mAnchorId; }; -#endif +#endif // HBANCHOR_P_H + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbanchorlayout.cpp --- a/src/hbcore/layouts/hbanchorlayout.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/layouts/hbanchorlayout.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,68 +24,74 @@ ****************************************************************************/ #include "hbanchorlayout.h" +#include "hbanchor.h" #include "hbanchor_p.h" -#include "hbanchorlayoutdebug_p.h" #include "hbanchorlayoutengine_p.h" #include +#include #include "hblayoututils_p.h" + //Uncomment next define in order to get more debug prints. //Similar define exists also in the engine side. //#define HBANCHORLAYOUT_DEBUG -#include - /*! - @stable - @hbcore \class HbAnchorLayout - \brief HbAnchorLayout manages geometries of its child items with anchors that + \brief HbAnchorLayout manages geometries of its child items with anchors that connect the layout items with each other. - The anchors have a start edge, an end edge and a value. The start and - end edges are defined by (layout item, edge) pairs. See setAnchor() for - more details. + It also allows layout items to be missing and can fix anchor attachments. + Here is an example and some simple rules how anchor fixing works (the example is + only for horizontal direction - the same needs to be done for portrait as well). + + If anchors set allow ambiguos positioning of items, then layout tries to set items + size as close to preferred as possible. + + \image html hbanchorlayout1.png - If anchors set allow ambiguos positioning of items, then layout tries to set items size as close to preferred as possible. + From the image above, we have decided that the green node is always present. This + means that all the other nodes in the horizontal graph can be optional. + + \image html hbanchorlayout2.png + + Then, we create the anchors starting from the non-optional node and point towards + the edges of the layout. The anchor layout definition in the WidgetML would look like: + + \code - Example code: - \snippet{anchorlayoutsample.cpp,1} + + + + + + + \endcode - The picture below illustrates the anchors defined by the above example code. + As mentioned, the green node needs be present always. In practice, this means that the + parent widget, which owns this anchor layout, needs to have a child widget with item + name "green_item". \c HbStyle::setItemName for more details. + + If an optional node is missing, the anchors pointing to the node are + changed to point to the node after (=towards the parent layout) the missing one. - \image html hbanchorlayout.png + \image html hbanchorlayout3.png + + In the picture above, the blue and yellow items are missing. The anchor is fixed by removing + the anchor definitions starting from the missing nodes. + + \stable */ /*! - \enum Hb::Edge + \enum HbAnchorLayout::Edge This enum defines the edges of a layout item. */ -/*! - \var HbAnchorLayout::Left - Left edge. -*/ - -/*! - \var HbAnchorLayout::Top - Top edge. -*/ - -/*! - \var HbAnchorLayout::Right - Right edge. -*/ - -/*! - \var HbAnchorLayout::Bottom - Bottom edge. -*/ - -/*! +/* \enum EdgeType \internal */ @@ -94,54 +100,28 @@ Vertical }; - -/*! +/* + Type for mapping from layout item to node identifier. \internal */ -HbAnchor::HbAnchor() - : mStartItem(0), - mStartEdge(Hb::LeftEdge), - mEndItem(0), - mEndEdge(Hb::LeftEdge), - mValue(0) -{ -} - -HbAnchor::HbAnchor(const HbAnchor &anchor) -: mStartItem(anchor.mStartItem), - mStartEdge(anchor.mStartEdge), - mEndItem(anchor.mEndItem), - mEndEdge(anchor.mEndEdge), - mValue(anchor.mValue) -{ -} - -HbAnchor::HbAnchor( QGraphicsLayoutItem *startItem, - HbAnchorLayout::Edge startEdge, - QGraphicsLayoutItem *endItem, - HbAnchorLayout::Edge endEdge, - qreal value ) - : mStartItem(startItem), - mStartEdge(startEdge), - mEndItem(endItem), - mEndEdge(endEdge), - mValue(value) -{ -} +typedef QMap ItemToNodeIdMap; +typedef ItemToNodeIdMap::iterator ItemToNodeIdMapIterator; +typedef ItemToNodeIdMap::const_iterator ItemToNodeIdMapConstIterator; -HbAnchor &HbAnchor::operator=(const HbAnchor &anchor) +/* + Result of findEndItem. +*/ +struct HbFixedEndItemResult { - if (this != &anchor) { - mStartItem = anchor.mStartItem; - mStartEdge = anchor.mStartEdge; - mEndItem = anchor.mEndItem; - mEndEdge = anchor.mEndEdge; - mValue = anchor.mValue; - } - return *this; -} - + QGraphicsLayoutItem *mItem; + HbAnchorLayout::Edge mEdge; + qreal mMin; + qreal mPref; + qreal mMax; + QSizePolicy::Policy mPolicy; + HbAnchor::Direction mDirection; +}; class HbAnchorLayoutPrivate { @@ -151,34 +131,54 @@ HbAnchorLayoutPrivate(); ~HbAnchorLayoutPrivate(); - void addItemIfNeeded( QGraphicsLayoutItem *item ); - EdgeType edgeType( const Hb::Edge edge ) const; - HbAnchor* getAnchor( QGraphicsLayoutItem *startItem, - Hb::Edge startEdge, - QGraphicsLayoutItem *endItem, - Hb::Edge endEdge ); + void addItemIfNeeded(QGraphicsLayoutItem *item); + static EdgeType edgeType( HbAnchorLayout::Edge edge ); void setItemGeometries(); + void updateAnchorsAndItems(); void createEquations( EdgeType type ); + + int getEdgeIndex(QGraphicsLayoutItem *item, Hb::Edge edge); + + bool findEndItem( + QList &resultList, + const HbAnchor *anchor, + QStringList &ids) const; + void resolveAnchors(); + void removeItemIfNeeded( QGraphicsLayoutItem *item ); + + HbAnchor *setAnchor( HbAnchor *anchor ); + void setSizeProp( SizeProperty *v, QGraphicsLayoutItem *item, EdgeType type ); + void setSizeProp( SizeProperty *v, HbAnchor *item ); GraphVertex *createCenterEdge( EdgeType type, QGraphicsLayoutItem *item, Hb::Edge edge ); void defineNextGeometry( const int itemIndexStart, const int itemIndexEnd, const int anchorIndex, const int definedItemIndex ); - QSizeF sizeHint( Qt::SizeHint which ); + + QSizeF sizeHint(Qt::SizeHint which); public: HbAnchorLayout * q_ptr; - QList mItems; - QList mAnchors; + bool mEquationsDirty; // if true, we needed to re-create the equations (e.g. when new anchor is set) bool mValid; // result of the calculations. false, if the equations cannot be solved. - bool mWrongAnchors; // need to recreate anchors, these ones are unsolvable with any layout geometry bool mInvalidateCalled; // set true in ::invalidate() and cleared after geometry is set in ::setGeometry + bool mWrongAnchors; + QList mAllAnchors; // anchors that are set by user + QList mResolvedDynamicAnchors; // references to generated anchors + QList mResolvedStaticAnchors; // references to anchors, that remains the same after resolving + QList mResolvedAnchors; // anchors that are passed to engine + + QList mItems; // for addItem + QList mActualItems; // layouted items + ItemToNodeIdMap mItemToNodeIdMap; QRectF mUsedRect; + // new items + QList mEdgesVertical; QList mEdgesHorizontal; QList mVerticesVertical; @@ -192,7 +192,7 @@ Variable *mLayoutVarH; Variable *mLayoutVarV; - QVector mAnchorsVisited; + QVector< bool > mAnchorsVisited; QVector< bool > mGeometryDefinedH; QVector< bool > mGeometryDefinedV; typedef struct { @@ -203,23 +203,108 @@ Solution mSolutionHorizontal; Solution mSolutionVertical; + }; + + /*! + \internal functions +*/ + +inline bool idConditionStartStart( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( !anchor1->startNodeId().isNull() ) && ( anchor1->startNodeId() == anchor2->startNodeId() ); +} +inline bool idConditionEndEnd( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( !anchor1->endNodeId().isNull() ) && ( anchor1->endNodeId() == anchor2->endNodeId() ); +} +inline bool idConditionStartEnd( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( !anchor1->startNodeId().isNull() ) && ( anchor1->startNodeId() == anchor2->endNodeId() ); +} +inline bool idConditionEndStart( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( !anchor1->endNodeId().isNull() ) && ( anchor1->endNodeId() == anchor2->startNodeId() ); +} + +inline bool itemConditionStartStart( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( anchor1->startItem() != 0 ) && ( anchor1->startItem() == anchor2->startItem() ); +} +inline bool itemConditionEndEnd( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( anchor1->endItem() != 0 ) && ( anchor1->endItem() == anchor2->endItem() ); +} +inline bool itemConditionStartEnd( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( anchor1->startItem() != 0 ) && ( anchor1->startItem() == anchor2->endItem() ); +} +inline bool itemConditionEndStart( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return ( anchor1->endItem() != 0 ) && ( anchor1->endItem() == anchor2->startItem() ); +} + +inline bool edgeConditionStartStart( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return anchor1->startEdge() == anchor2->startEdge(); +} +inline bool edgeConditionEndEnd( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return anchor1->endEdge() == anchor2->endEdge(); +} +inline bool edgeConditionStartEnd( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return anchor1->startEdge() == anchor2->endEdge(); +} +inline bool edgeConditionEndStart( HbAnchor *anchor1, HbAnchor *anchor2 ) +{ + return anchor1->endEdge() == anchor2->startEdge(); +} + +inline int directionMultiplier( HbAnchor *anchor ) +{ + return ( ( anchor->direction() == HbAnchor::Positive )?(1):(-1) ); +} + + +/*! + Returns list of effective anchors - those which has mappings to QGraphicsItem + \return list of effective anchors. +*/ +QList HbAnchorLayout::effectiveAnchors() +{ + Q_D( HbAnchorLayout ); + d->resolveAnchors(); + return d->mResolvedAnchors; +} + +/*! + Returns list of all anchors set to this layout + \return list of all anchors. +*/ +QList HbAnchorLayout::anchors() const +{ + Q_D( const HbAnchorLayout ); + return d->mAllAnchors; +} + +/* + \class HbAnchorLayoutPrivate \internal */ -HbAnchorLayoutPrivate::HbAnchorLayoutPrivate() : mEquationsDirty( false ), mValid( true ), mWrongAnchors( false ), mInvalidateCalled(false), - mLayoutVarH( 0 ), mLayoutVarV( 0 ) +HbAnchorLayoutPrivate::HbAnchorLayoutPrivate() : mEquationsDirty(false), mValid(true), mInvalidateCalled( false ), mWrongAnchors( false ), + mUsedRect( 0, 0, 0, 0 ), mLayoutVarH( 0 ), mLayoutVarV( 0 ) + { } -/*! +/* \internal */ HbAnchorLayoutPrivate::~HbAnchorLayoutPrivate() { - qDeleteAll( mAnchors ); - qDeleteAll( mEdgesVertical ); qDeleteAll( mEdgesHorizontal ); @@ -228,101 +313,385 @@ qDeleteAll( mEquationsHorizontal ); qDeleteAll( mEquationsVertical ); + + qDeleteAll( mAllAnchors ); + qDeleteAll( mResolvedDynamicAnchors ); } -/*! +/* \internal */ -void HbAnchorLayoutPrivate::addItemIfNeeded( QGraphicsLayoutItem *item ) -{ - Q_Q(HbAnchorLayout); - if ( item != q && !mItems.contains(item) ) { - HbLayoutUtils::addChildItem(q, item); - - mItems.append( item ); - } -} - -/*! - \internal -*/ -EdgeType HbAnchorLayoutPrivate::edgeType( const Hb::Edge edge ) const +EdgeType HbAnchorLayoutPrivate::edgeType( HbAnchorLayout::Edge edge ) { EdgeType type( Horizontal ); - if ( edge == Hb::TopEdge || edge == Hb::BottomEdge || edge == Hb::CenterVEdge) { + if( edge == Hb::TopEdge || edge == Hb::BottomEdge || edge == Hb::CenterVEdge ) { type = Vertical; } return type; } -/*! +#ifdef HBANCHORLAYOUT_DEBUG +/* + Returns string representation of value in \c Edge enumeration. + \internal +*/ +static QString edgeAsText(HbAnchorLayout::Edge edge) +{ + QString result; + switch (edge) { + case Hb::LeftEdge: + result = "LEFT"; + break; + + case Hb::RightEdge: + result = "RIGHT"; + break; + + case Hb::CenterHEdge: + result = "CENTERH"; + break; + + case Hb::TopEdge: + result = "TOP"; + break; + + case Hb::BottomEdge: + result = "BOTTOM"; + break; + + case Hb::CenterVEdge: + result = "CENTERV"; + break; + + default: + result = ""; + break; + } + + return result; +} + +static QString itemAsText(QGraphicsLayoutItem* item, QGraphicsLayout *layout) +{ + QString result = ""; + if ( item ) { + result = (item == layout) ? "HbAnchorLayout" : ""; + QGraphicsItem *gItem = item->graphicsItem(); + if (gItem) { + if (gItem->isWidget()) { + result = static_cast(gItem)->metaObject()->className(); + } + } + } + return result; +} + +#endif // HBANCHORLAYOUT_DEBUG + +/* \internal */ -HbAnchor* HbAnchorLayoutPrivate::getAnchor( - QGraphicsLayoutItem *startItem, - Hb::Edge startEdge, - QGraphicsLayoutItem *endItem, - Hb::Edge endEdge ) +void HbAnchorLayoutPrivate::updateAnchorsAndItems() { - for ( int i = mAnchors.count()-1 ; i >= 0; i-- ) { - HbAnchor* anchor = mAnchors.at(i); - if ( anchor->mStartItem == startItem && - anchor->mStartEdge == startEdge && - anchor->mEndItem == endItem && - anchor->mEndEdge == endEdge ) { - return anchor; + Q_Q(HbAnchorLayout); + resolveAnchors(); + +#ifdef HBANCHORLAYOUT_DEBUG + QGraphicsWidget* w = HbLayoutUtils::parentWidget( q ); + if ( w ) { + qDebug() << "AnchorLayout: Updating anchors for" << w->metaObject()->className(); + } + const QString parentId = + mItemToNodeIdMap.contains(q) ? mItemToNodeIdMap.value(q) : QString(); + qDebug() << "-- -- resolved"; + qDebug() << "-- count: " << mResolvedAnchors.size() << ", parent: " << parentId; + foreach (const HbAnchor *item, mResolvedAnchors) { + const QString itemTemplate("-- (%1 [%2], %3) - (%4 [%5], %6) = %7"); + qDebug() << + itemTemplate + .arg(item->startNodeId()) + .arg(itemAsText(item->startItem(), q)) + .arg(edgeAsText(item->startEdge())) + .arg(item->endNodeId()) + .arg(itemAsText(item->endItem(), q)) + .arg(edgeAsText(item->endEdge())) + .arg(item->preferredLength()).toAscii().data(); + } + qDebug() << "-- -- all"; + qDebug() << "-- count: " << mAllAnchors.size() << ", parent: " << parentId; + foreach (const HbAnchor *item, mAllAnchors) { + const QString itemTemplate("-- (%1 [%2], %3) - (%4 [%5], %6) = %7"); + qDebug() << + itemTemplate + .arg(item->startNodeId()) + .arg(itemAsText(item->startItem(), q)) + .arg(edgeAsText(item->startEdge())) + .arg(item->endNodeId()) + .arg(itemAsText(item->endItem(), q)) + .arg(edgeAsText(item->endEdge())) + .arg(item->preferredLength()).toAscii().data(); + } + qDebug() << "-- "; +#endif // HBANCHORLAYOUT_DEBUG + + // HbAnchorLayout will only touch items that have anchors defined. + mActualItems.clear(); + for (QList::const_iterator it = mResolvedAnchors.constBegin(); + it != mResolvedAnchors.constEnd(); + ++it) { + + const HbAnchor* item = *it; + + if (item->startItem() != q && !mActualItems.contains(item->startItem())) { + mActualItems.append(item->startItem()); + } + if (item->endItem() != q && !mActualItems.contains(item->endItem())) { + mActualItems.append(item->endItem()); } } - return 0; + +} + +void HbAnchorLayoutPrivate::setSizeProp( SizeProperty *v, HbAnchor *item ) +{ + const QSizePolicy::Policy policy = item->sizePolicy(); + + if ( policy & QSizePolicy::ShrinkFlag ) { + v->min = item->minimumLength(); + } else { + v->min = item->preferredLength(); + } + + if ( policy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag) ) { + v->max = item->maximumLength(); + } else { + v->max = item->preferredLength(); + } + + v->pref = qBound( v->min, item->preferredLength(), v->max ); + + v->flags |= (v->min == v->max) ? SizeProperty::FlagFixed : 0; + v->flags |= (policy & QSizePolicy::ExpandFlag) ? SizeProperty::FlagExpanding : 0; + + if( policy & QSizePolicy::IgnoreFlag ) { + v->pref = v->min; + v->flags |= SizeProperty::FlagExpanding; + } +} + + + +void HbAnchorLayoutPrivate::setSizeProp( SizeProperty *v, QGraphicsLayoutItem *item, EdgeType type ) +{ + if( type == Vertical ) { + const QSizePolicy::Policy verticalPolicy = item->sizePolicy().verticalPolicy(); + + if ( verticalPolicy & QSizePolicy::ShrinkFlag ) { + v->min = item->minimumHeight(); + } else { + v->min = item->preferredHeight(); + } + + if ( verticalPolicy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag) ) { + v->max = item->maximumHeight(); + } else { + v->max = item->preferredHeight(); + } + + v->pref = qBound( v->min, item->preferredHeight(), v->max ); + + v->flags |= (v->min == v->max) ? SizeProperty::FlagFixed : 0; + v->flags |= (verticalPolicy & QSizePolicy::ExpandFlag) ? SizeProperty::FlagExpanding : 0; + + if( verticalPolicy & QSizePolicy::IgnoreFlag ) { + v->pref = v->min; + v->flags |= SizeProperty::FlagExpanding; + } + } else { + const QSizePolicy::Policy horizontalPolicy = item->sizePolicy().horizontalPolicy(); + + if ( horizontalPolicy & QSizePolicy::ShrinkFlag ) { + v->min = item->minimumWidth(); + } else { + v->min = item->preferredWidth(); + } + + if ( horizontalPolicy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag) ) { + v->max = item->maximumWidth(); + } else { + v->max = item->preferredWidth(); + } + + v->pref = qBound( v->min, item->preferredWidth(), v->max ); + + v->flags |= (v->min == v->max) ? SizeProperty::FlagFixed : 0; + v->flags |= (horizontalPolicy & QSizePolicy::ExpandFlag) ? SizeProperty::FlagExpanding : 0; + + if( horizontalPolicy & QSizePolicy::IgnoreFlag ) { + v->pref = v->min; + v->flags |= SizeProperty::FlagExpanding; + } + } } -void HbAnchorLayoutPrivate::defineNextGeometry( const int itemIndexStart, const int itemIndexEnd, const int anchorIndex, const int definedItemIndex ) + +GraphVertex *HbAnchorLayoutPrivate::createCenterEdge( EdgeType type, QGraphicsLayoutItem *item, Hb::Edge edge ) +{ + GraphVertex *middle; + GraphVertex *start = 0; + GraphVertex *end = 0; + + QList *edges = &mEdgesHorizontal; + QList *vertices = &mVerticesHorizontal; + + if( type == Vertical ) { + if( edge != Hb::CenterVEdge ) { + qWarning() << "HbAnchorLayout: something wrong " << __LINE__; + return 0; + } + + edges = &mEdgesVertical; + vertices = &mVerticesVertical; + + for( int j = 0; j < vertices->size(); j++ ) { + GraphVertex *current = vertices->at(j); + if( current->itemRef == item ) { + if( current->itemSide == Hb::TopEdge ) { + start = current; + } else if( current->itemSide == Hb::BottomEdge ) { + end = current; + } + } + } + } else { + if( edge != Hb::CenterHEdge ) { + qWarning() << "HbAnchorLayout: something wrong " << __LINE__; + return 0; + } + + for( int j = 0; j < vertices->size(); j++ ) { + GraphVertex *current = vertices->at(j); + if( current->itemRef == item ) { + if( current->itemSide == Hb::LeftEdge ) { + start = current; + } else if( current->itemSide == Hb::RightEdge ) { + end = current; + } + } + } + } + + if( !( start && end ) ) { + qWarning() << "HbAnchorLayout: something wrong " << __LINE__; + return 0; + } + + GraphEdge *oldEdge = 0; + + for( int i = 0; i < edges->size(); i++ ) { + oldEdge = edges->at(i); + if( ( oldEdge->ref == item ) && ( oldEdge->startVertex == start ) && ( oldEdge->endVertex == end ) ){ + break; + } + } + + if( !oldEdge ) { + qWarning() << "HbAnchorLayout: something wrong " << __LINE__; + return 0; + } + + middle = new GraphVertex(); + middle->itemRef = ( void* )item; + middle->itemSide = edge; + middle->special = false; + + GraphEdge *newEdge1 = new GraphEdge(); + GraphEdge *newEdge2 = new GraphEdge(); + + newEdge1->startVertex = start; + newEdge1->endVertex = middle; + newEdge1->ref = ( void* )item; + + newEdge1->expr->plusExpression( oldEdge->expr ); + newEdge1->expr->multiply( 0.5 ); + + + newEdge2->startVertex = middle; + newEdge2->endVertex = end; + newEdge2->ref = ( void* )item; + newEdge2->expr->plusExpression( oldEdge->expr ); + newEdge2->expr->multiply( 0.5 ); + + + middle->edges.append( newEdge1 ); + start->edges.append( newEdge1 ); + middle->edges.append( newEdge2 ); + end->edges.append( newEdge2 ); + + edges->append( newEdge1 ); + edges->append( newEdge2 ); + vertices->append( middle ); + + + return middle; +} + +void HbAnchorLayoutPrivate::defineNextGeometry( + const int itemIndexStart, + const int itemIndexEnd, + const int anchorIndex, + const int definedItemIndex ) { ItemGeometry *knownItemGeom, *unKnownItemGeom; Hb::Edge knownEdge, unKnownEdge; int sign; qreal itemSize; + qreal anchorSize; bool isHorizontal; - HbAnchor *anchor = mAnchors.at( anchorIndex ); + HbAnchor *anchor = mResolvedAnchors.at( anchorIndex ); qreal leftPoint(0), rightPoint(0), sourcePoint(0), dstPointLeft(0); mAnchorsVisited[ anchorIndex ] = true; - if( edgeType( anchor->mStartEdge ) == Horizontal ) { + if( edgeType( anchor->startEdge() ) == Horizontal ) { isHorizontal = true; } else { isHorizontal = false; } if( itemIndexEnd != definedItemIndex ) { - knownEdge = anchor->mStartEdge; - unKnownEdge = anchor->mEndEdge; + knownEdge = anchor->startEdge(); + unKnownEdge = anchor->endEdge(); knownItemGeom = &mItemsGeometry[itemIndexStart]; unKnownItemGeom = &mItemsGeometry[itemIndexEnd]; if( isHorizontal ) { mGeometryDefinedH[itemIndexEnd] = true; - itemSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( mItems.at(itemIndexEnd) ) ); + itemSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( mActualItems.at(itemIndexEnd) ) ); + anchorSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( anchor ) ) * directionMultiplier( anchor ); } else { mGeometryDefinedV[itemIndexEnd] = true; - itemSize = mSolutionVertical.value( mVariablesVertical.findVariable( mItems.at(itemIndexEnd) ) ); + itemSize = mSolutionVertical.value( mVariablesVertical.findVariable( mActualItems.at(itemIndexEnd) ) ); + anchorSize = mSolutionVertical.value( mVariablesVertical.findVariable( anchor ) ) * directionMultiplier( anchor ); } sign = 1; } else { - knownEdge = anchor->mEndEdge; - unKnownEdge = anchor->mStartEdge; + knownEdge = anchor->endEdge(); + unKnownEdge = anchor->startEdge(); knownItemGeom = &mItemsGeometry[itemIndexEnd]; unKnownItemGeom = &mItemsGeometry[itemIndexStart]; if( isHorizontal ) { mGeometryDefinedH[itemIndexStart] = true; - itemSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( mItems.at(itemIndexStart) ) ); + itemSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( mActualItems.at(itemIndexStart) ) ); + anchorSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( anchor ) ) * directionMultiplier( anchor ); } else { mGeometryDefinedV[itemIndexStart] = true; - itemSize = mSolutionVertical.value( mVariablesVertical.findVariable( mItems.at(itemIndexStart) ) ); + itemSize = mSolutionVertical.value( mVariablesVertical.findVariable( mActualItems.at(itemIndexStart) ) ); + anchorSize = mSolutionVertical.value( mVariablesVertical.findVariable( anchor ) ) * directionMultiplier( anchor ); } sign = -1; @@ -361,19 +730,19 @@ case Hb::LeftEdge: case Hb::TopEdge: { - dstPointLeft = sourcePoint + sign * anchor->mValue; + dstPointLeft = sourcePoint + sign * anchorSize; break; } case Hb::CenterHEdge: case Hb::CenterVEdge: { - dstPointLeft = sourcePoint + sign * anchor->mValue - itemSize / 2; + dstPointLeft = sourcePoint + sign * anchorSize - itemSize / 2; break; } case Hb::RightEdge: case Hb::BottomEdge: { - dstPointLeft = sourcePoint + sign * anchor->mValue - itemSize; + dstPointLeft = sourcePoint + sign * anchorSize - itemSize; break; } } @@ -387,10 +756,10 @@ unKnownItemGeom->y1 = dstPointLeft; unKnownItemGeom->y2 = dstPointLeft + itemSize; } - } -/*! + +/* \internal */ void HbAnchorLayoutPrivate::setItemGeometries() @@ -398,16 +767,18 @@ Q_Q(HbAnchorLayout); const QRectF newRect = q->geometry(); - if( mWrongAnchors || ( mItems.isEmpty() ) ) { + if( mWrongAnchors || ( mActualItems.isEmpty() ) ) { return; } - if ( (newRect != mUsedRect) || mInvalidateCalled ) { + if( (newRect != mUsedRect) || mInvalidateCalled ) { + mInvalidateCalled = false; mUsedRect = newRect; if ( mEquationsDirty ) { + updateAnchorsAndItems(); createEquations( Horizontal ); createEquations( Vertical ); mEquationsDirty = false; @@ -487,29 +858,31 @@ mGeometryDefinedV[i] = false; } - int layoutIndex = mItems.size(); + int layoutIndex = mActualItems.size(); mItemsGeometry[ layoutIndex ].x1 = 0; mItemsGeometry[ layoutIndex ].x2 = newRect.width(); mItemsGeometry[ layoutIndex ].y1 = 0; mItemsGeometry[ layoutIndex ].y2 = newRect.height(); + mGeometryDefinedH[ layoutIndex ] = true; + mGeometryDefinedV[ layoutIndex ] = true; for( int i = 0; i < mAnchorsVisited.size(); i++ ) { - HbAnchor *anchor = mAnchors.at(i); + HbAnchor *anchor = mResolvedAnchors.at(i); - if( ( anchor->mStartItem != q ) && ( anchor->mEndItem != q ) ) { + if( ( anchor->startItem() != q ) && ( anchor->endItem() != q ) ) { continue; } - int startIndex = mItems.indexOf( anchor->mStartItem ); // returns -1 if not found => this is layout - int endIndex = mItems.indexOf( anchor->mEndItem ); + int startIndex = mActualItems.indexOf( anchor->startItem() ); // returns -1 if not found => this is layout + int endIndex = mActualItems.indexOf( anchor->endItem() ); - mAnchorsVisited[i] = true; // Temporary overkill, if both anchors connected to layout. Must be restricted on setAnchor() level + mAnchorsVisited[i] = true; - if( edgeType( anchor->mStartEdge ) == Horizontal ) { + if( edgeType( anchor->startEdge() ) == Horizontal ) { if( startIndex > -1 ) { if( ! mGeometryDefinedH.at( startIndex ) ) { defineNextGeometry( startIndex, layoutIndex, i, layoutIndex ); @@ -544,14 +917,14 @@ if( mAnchorsVisited.at(i) ) { continue; } - HbAnchor *anchor = mAnchors.at(i); + HbAnchor *anchor = mResolvedAnchors.at(i); - startIndex = mItems.indexOf( anchor->mStartItem ); - endIndex = mItems.indexOf( anchor->mEndItem ); + startIndex = mActualItems.indexOf( anchor->startItem() ); + endIndex = mActualItems.indexOf( anchor->endItem() ); #ifdef HBANCHORLAYOUT_DEBUG qDebug() << "startIndex:" << startIndex << " endIndex" << endIndex; #endif //HBANCHORLAYOUT_DEBUG - if( edgeType( anchor->mStartEdge ) == Horizontal ) { + if( edgeType( anchor->startEdge() ) == Horizontal ) { startDefined = mGeometryDefinedH.at( startIndex ); endDefined = mGeometryDefinedH.at( endIndex ); } else { @@ -569,9 +942,16 @@ } } +#ifdef HBANCHORLAYOUT_DEBUG + QGraphicsWidget* w = HbLayoutUtils::parentWidget( q ); + if ( w ) { + qDebug() << "Items of " << w->metaObject()->className(); + } +#endif + Qt::LayoutDirection layoutDir = HbLayoutUtils::visualDirection(q); - for( int i = 0; i < layoutIndex; i++ ) { + for( int i = 0; i < mActualItems.size(); i++ ) { QRectF geom; ItemGeometry calcGeom = mItemsGeometry.at(i); if( mGeometryDefinedH.at(i) ) { @@ -579,196 +959,27 @@ geom.setRight( mUsedRect.left() + calcGeom.x2 ); } else { geom.setLeft( mUsedRect.left() ); - geom.setRight( mUsedRect.left() + mItems.at(i)->preferredWidth() ); + geom.setRight( mUsedRect.left() + mActualItems.at(i)->preferredWidth() ); } if( mGeometryDefinedV.at(i) ) { geom.setTop( mUsedRect.top() + calcGeom.y1 ); geom.setBottom( mUsedRect.top() + calcGeom.y2 ); } else { geom.setTop( mUsedRect.top() ); - geom.setBottom( mUsedRect.top() + mItems.at(i)->preferredHeight() ); + geom.setBottom( mUsedRect.top() + mActualItems.at(i)->preferredHeight() ); } - HbLayoutUtils::visualRect(layoutDir, geom, newRect); + HbLayoutUtils::visualRect( layoutDir, geom, newRect ); #ifdef HBANCHORLAYOUT_DEBUG qDebug( "Item %d: (%lf, %lf) : (%lf %lf)", i, calcGeom.x1, calcGeom.y1, calcGeom.x2, calcGeom.y2 ); #endif // HBANCHORLAYOUT_DEBUG - - mItems.at(i)->setGeometry( geom ); + mActualItems.at(i)->setGeometry( geom ); } } } } -void HbAnchorLayoutPrivate::setSizeProp( SizeProperty *v, QGraphicsLayoutItem *item, EdgeType type ) -{ - if( type == Vertical ) { - const QSizePolicy::Policy verticalPolicy = item->sizePolicy().verticalPolicy(); - - if ( verticalPolicy & QSizePolicy::ShrinkFlag ) { - v->min = item->minimumHeight(); - } else { - v->min = item->preferredHeight(); - } - - if ( verticalPolicy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag) ) { - v->max = item->maximumHeight(); - } else { - v->max = item->preferredHeight(); - } - - v->pref = qBound( v->min, item->preferredHeight(), v->max ); - - v->flags |= (v->min == v->max) ? SizeProperty::FlagFixed : 0; - v->flags |= (verticalPolicy & QSizePolicy::ExpandFlag) ? SizeProperty::FlagExpanding : 0; - - if( verticalPolicy & QSizePolicy::IgnoreFlag ) { - v->pref = v->min; - v->flags |= SizeProperty::FlagExpanding; - } - } else { - const QSizePolicy::Policy horizontalPolicy = item->sizePolicy().horizontalPolicy(); - - if ( horizontalPolicy & QSizePolicy::ShrinkFlag ) { - v->min = item->minimumWidth(); - } else { - v->min = item->preferredWidth(); - } - - if ( horizontalPolicy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag) ) { - v->max = item->maximumWidth(); - } else { - v->max = item->preferredWidth(); - } - - v->pref = qBound( v->min, item->preferredWidth(), v->max ); - - v->flags |= (v->min == v->max) ? SizeProperty::FlagFixed : 0; - v->flags |= (horizontalPolicy & QSizePolicy::ExpandFlag) ? SizeProperty::FlagExpanding : 0; - - if( horizontalPolicy & QSizePolicy::IgnoreFlag ) { - v->pref = v->min; - v->flags |= SizeProperty::FlagExpanding; - } - } -} - - -GraphVertex *HbAnchorLayoutPrivate::createCenterEdge( EdgeType type, QGraphicsLayoutItem *item, Hb::Edge edge ) -{ - GraphVertex *middle; - GraphVertex *start = 0; - GraphVertex *end = 0; - - QList *edges = &mEdgesHorizontal; - QList *vertices = &mVerticesHorizontal; - - if( type == Vertical ) { - if( edge != Hb::CenterVEdge ) { -#ifdef HBANCHORLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBANCHORLAYOUT_DEBUG - return 0; - } - - edges = &mEdgesVertical; - vertices = &mVerticesVertical; - - for( int j = 0; j < vertices->size(); j++ ) { - GraphVertex *current = vertices->at(j); - if( current->itemRef == item ) { - if( current->itemSide == Hb::TopEdge ) { - start = current; - } else if( current->itemSide == Hb::BottomEdge ) { - end = current; - } - } - } - } else { - if( edge != Hb::CenterHEdge ) { -#ifdef HBANCHORLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBANCHORLAYOUT_DEBUG - return 0; - } - - for( int j = 0; j < vertices->size(); j++ ) { - GraphVertex *current = vertices->at(j); - if( current->itemRef == item ) { - if( current->itemSide == Hb::LeftEdge ) { - start = current; - } else if( current->itemSide == Hb::RightEdge ) { - end = current; - } - } - } - } - - if( !( start && end ) ) { -#ifdef HBANCHORLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBANCHORLAYOUT_DEBUG - return 0; - } - - GraphEdge *oldEdge = 0; - - for( int i = 0; i < edges->size(); i++ ) { - oldEdge = edges->at(i); - if( oldEdge->ref == item ) { - if( ( oldEdge->startVertex == start ) && ( oldEdge->endVertex == end ) ){ -/* edges->removeOne( oldEdge ); - start->edges.removeOne( oldEdge ); - end->edges.removeOne( oldEdge );*/ - break; - } - } - } - - if( !oldEdge ) { -#ifdef HBANCHORLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBANCHORLAYOUT_DEBUG - return 0; - } - - middle = new GraphVertex(); - middle->itemRef = ( void* )item; - middle->itemSide = edge; - middle->special = false; - - GraphEdge *newEdge1 = new GraphEdge(); - GraphEdge *newEdge2 = new GraphEdge(); - - newEdge1->startVertex = start; - newEdge1->endVertex = middle; - newEdge1->ref = ( void* )item; - - newEdge1->expr->plusExpression( oldEdge->expr ); - newEdge1->expr->multiply( 0.5 ); - - - newEdge2->startVertex = middle; - newEdge2->endVertex = end; - newEdge2->ref = ( void* )item; - newEdge2->expr->plusExpression( oldEdge->expr ); - newEdge2->expr->multiply( 0.5 ); - - - middle->edges.append( newEdge1 ); - start->edges.append( newEdge1 ); - middle->edges.append( newEdge2 ); - end->edges.append( newEdge2 ); - - edges->append( newEdge1 ); - edges->append( newEdge2 ); - vertices->append( middle ); - - - return middle; -} - /*! \internal */ @@ -833,8 +1044,8 @@ } - for ( int i = 0; i < mItems.count(); i++ ) { - QGraphicsLayoutItem *item = mItems.at( i ); + for ( int i = 0; i < mActualItems.count(); i++ ) { + QGraphicsLayoutItem *item = mActualItems.at( i ); itemStart = new GraphVertex(); itemEnd = new GraphVertex(); newEdge = new GraphEdge(); @@ -879,24 +1090,39 @@ v1->sizeProp.flags = SizeProperty::FlagFixed; - for( int i = 0; i < mAnchors.count(); i++) { - HbAnchor* anchor = mAnchors.at(i); - if ( edgeType( anchor->mStartEdge ) == type ) { + for( int i = 0; i < mResolvedAnchors.count(); i++) { + HbAnchor* anchor = mResolvedAnchors.at(i); + if ( edgeType( anchor->startEdge() ) == type ) { itemStart = 0; itemEnd = 0; for( int j = 0; j < vertices->size(); j++ ) { - if( ( vertices->at(j)->itemRef == anchor->mStartItem ) && ( vertices->at(j)->itemSide == anchor->mStartEdge ) ) { + if( ( vertices->at(j)->itemRef == anchor->startItem() ) && + ( vertices->at(j)->itemSide == anchor->startEdge() ) ) { itemStart = vertices->at(j); - } else if( ( vertices->at(j)->itemRef == anchor->mEndItem ) && ( vertices->at(j)->itemSide == anchor->mEndEdge ) ) { + } else if( ( vertices->at(j)->itemRef == anchor->endItem() ) && + ( vertices->at(j)->itemSide == anchor->endEdge() ) ) { itemEnd = vertices->at(j); } } if( !itemStart ) { - itemStart = createCenterEdge( type, anchor->mStartItem, anchor->mStartEdge ); + itemStart = createCenterEdge( type, anchor->startItem(), anchor->startEdge() ); } if( !itemEnd ) { - itemEnd = createCenterEdge( type, anchor->mEndItem, anchor->mEndEdge ); + itemEnd = createCenterEdge( type, anchor->endItem(), anchor->endEdge() ); + } + + if( !itemStart ){ + qWarning() << "HbAnchorLayout: internal error, line " << __LINE__; + mWrongAnchors = true; + AnchorLayoutEngine::instance()->cleanUp( layoutStart, layoutMiddle, layoutEnd, edges, vertices, el ); + return; + } + if( !itemEnd ) { + qWarning() << "HbAnchorLayout: internal error, line " << __LINE__; + mWrongAnchors = true; + AnchorLayoutEngine::instance()->cleanUp( layoutStart, layoutMiddle, layoutEnd, edges, vertices, el ); + return; } newEdge = new GraphEdge(); @@ -905,9 +1131,12 @@ newEdge->startVertex = itemStart; newEdge->endVertex = itemEnd; - se.mVar = v1; - se.mCoef = anchor->mValue; + + se.mVar = vs->createVariable(anchor); + se.mCoef = directionMultiplier( anchor ); + setSizeProp( &(se.mVar->sizeProp), anchor ); newEdge->expr->plusSimpleExpression( se ); + edges->append( newEdge ); } } @@ -952,9 +1181,9 @@ if( ! AnchorLayoutEngine::instance()->processItems( edges, vertices, vs, el ) ) { mWrongAnchors = true; AnchorLayoutEngine::instance()->cleanUp( layoutStart, layoutMiddle, layoutEnd, edges, vertices, el ); -//#ifdef HBANCHORLAYOUT_DEBUG - qDebug() << "FAIL line:" << __LINE__; -//#endif //HBANCHORLAYOUT_DEBUG +#ifdef HBANCHORLAYOUT_DEBUG + qDebug() << "FAIL! " << __LINE__; +#endif //HBANCHORLAYOUT_DEBUG return; } @@ -985,14 +1214,16 @@ layoutVar->sizeProp.pref = 100; layoutVar->sizeProp.flags = 0; - AnchorLayoutEngine::instance()->attachToLayout( layoutStart, layoutMiddle, layoutEnd, layoutVar, el ); - AnchorLayoutEngine::instance()->cleanUp( layoutStart, layoutMiddle, layoutEnd, edges, vertices, el ); + AnchorLayoutEngine::instance()->attachToLayout( + layoutStart, layoutMiddle, layoutEnd, layoutVar, el ); + AnchorLayoutEngine::instance()->cleanUp( + layoutStart, layoutMiddle, layoutEnd, edges, vertices, el ); - mAnchorsVisited.resize( mAnchors.size() * sizeof( bool ) ); - mGeometryDefinedH.resize( mItems.size() * sizeof( bool ) ); - mGeometryDefinedV.resize( mItems.size() * sizeof( bool ) ); - mItemsGeometry.resize( ( mItems.size() + 1 ) * sizeof( ItemGeometry ) ); + mAnchorsVisited.resize( mResolvedAnchors.size() * sizeof( bool ) ); + mGeometryDefinedH.resize( ( mActualItems.size() + 1 ) * sizeof( bool ) ); + mGeometryDefinedV.resize( ( mActualItems.size() + 1 ) * sizeof( bool ) ); + mItemsGeometry.resize( ( mActualItems.size() + 1 ) * sizeof( ItemGeometry ) ); if( type == Vertical ) { mLayoutVarV = layoutVar; @@ -1002,15 +1233,213 @@ } } +/* + Finds new end item for problematic anchor. -/*! - \internal + Follows the anchor that have the same start edge + as the problematic anchor. + + Invariant: + \a ids must be the exactly same in return. It is the array + which nodes have already been visited - so in order to avoid + infinite recursion, don't visit already visited. +*/ +bool HbAnchorLayoutPrivate::findEndItem( + QList &resultList, + const HbAnchor *problem, + QStringList &ids) const +{ + HbFixedEndItemResult result; + bool found = false; + + for (QList::const_iterator it = mAllAnchors.constBegin(); + it != mAllAnchors.constEnd(); + ++it) { + + const HbAnchor* currentItem = *it; + + if (!currentItem->startNodeId().isNull() && + currentItem->startNodeId() == problem->endNodeId() && + currentItem->startEdge() == problem->startEdge() && + !ids.contains(currentItem->startNodeId())) { + + QGraphicsLayoutItem *item = currentItem->endItem(); + + if (item) { + found = true; + result.mEdge = currentItem->endEdge(); + result.mItem = item; + result.mMin = currentItem->minimumLength(); + result.mPref = currentItem->preferredLength(); + result.mMax = currentItem->maximumLength(); + result.mPolicy = currentItem->sizePolicy(); + result.mDirection = currentItem->direction(); + resultList.append( result ); + } else { + ids.append(currentItem->startNodeId()); + found |= findEndItem(resultList, currentItem, ids); + ids.takeLast(); + } + } + } + + return found; +} + +/* + Resolves anchors to be used in anchor layout calculations. + + For each anchor x with start id, start edge, end id, end edge: + + If there is layout items corresponding to both start id and end id, + anchor is used automatically. + If there is layout item corresponding to start id, then we try to + "fix" anchor by looking for a path of anchors (same direction, with spacing defined) + from anchor x's end id as starting point to such end id that has layout item. + If found, anchor is fixed by replacing end id with found end id. + + So direction of anchors affect this resolution process, but not in the + anchor layout calculations. + + \sa findEndItem */ -QList HbAnchorLayoutDebug::getAnchors( HbAnchorLayout* layout ) +void HbAnchorLayoutPrivate::resolveAnchors() +{ + HbAnchor *item; + + qDeleteAll( mResolvedDynamicAnchors ); + mResolvedDynamicAnchors.clear(); + mResolvedStaticAnchors.clear(); + + for ( int i = 0; i < mAllAnchors.size(); i++ ) { + + HbAnchor *anchor = mAllAnchors.at(i); + + if( ( anchor->startItem() ) && ( anchor->endItem() ) ) { + mResolvedStaticAnchors.append( anchor ); + continue; + } + + if (anchor->startItem() && !anchor->endNodeId().isNull()) { + QList resultList; + + QStringList ids; + ids.append(anchor->startNodeId()); + + if (findEndItem(resultList, anchor, ids)) { + for( int j = 0; j < resultList.size(); j++ ) { + item = new HbAnchor( anchor->startItem(), anchor->startEdge(), resultList.at(j).mItem, resultList.at(j).mEdge ); + item->setMinimumLength( resultList.at(j).mMin ); + item->setPreferredLength( resultList.at(j).mPref ); + item->setMaximumLength( resultList.at(j).mMax ); + item->setSizePolicy( resultList.at(j).mPolicy ); + item->setDirection( resultList.at(j).mDirection ); + mResolvedDynamicAnchors.append(item); + } + } + } else { + // Nothing needed. + } + } + + mResolvedAnchors = mResolvedDynamicAnchors + mResolvedStaticAnchors; +} + +HbAnchor *HbAnchorLayoutPrivate::setAnchor( HbAnchor *anchor ) { - return layout->d_ptr->mAnchors; + Q_Q( HbAnchorLayout ); + // This method is called from HbAnchorLayout::setAnchor. + + if (HbAnchorLayoutPrivate::edgeType(anchor->startEdge()) != + HbAnchorLayoutPrivate::edgeType(anchor->endEdge())) { + qWarning() << "HbAnchorLayout::setAnchor : You can't connect different type of edges"; + return 0; + } + + if ( ( anchor->startNodeId().isNull() && ( anchor->startItem() == 0 ) ) || + ( anchor->endNodeId().isNull() && ( anchor->endItem() == 0 ) ) ){ + qWarning() << "HbAnchorLayout::setAnchor : Both ids must be valid"; + return 0; + } + + if ( ( anchor->startNodeId() == anchor->endNodeId() ) && ( ( anchor->startItem() == anchor->endItem() ) ) && + ( anchor->startEdge() == anchor->endEdge() ) ) { + qWarning() << "HbAnchorLayout::setAnchor : You cannot set anchor between the same edge"; + return 0; + } + + const int count = mAllAnchors.size(); + for (int i = 0; i < count; ++i) { + HbAnchor *item = mAllAnchors.at(i); + + if( ( idConditionStartStart( item, anchor ) || itemConditionStartStart( item, anchor ) ) && + ( idConditionEndEnd( item, anchor ) || itemConditionEndEnd( item, anchor ) ) && + ( edgeConditionStartStart( item, anchor ) ) && + ( edgeConditionEndEnd( item, anchor ) ) ){ + item->setSizePolicy( anchor->sizePolicy() ); + item->setMinimumLength( anchor->minimumLength() ); + item->setPreferredLength( anchor->preferredLength() ); + item->setMaximumLength( anchor->maximumLength() ); + item->setDirection( anchor->direction() ); + delete anchor; + return item; + } else if( ( idConditionStartEnd( item, anchor ) || itemConditionStartEnd( item, anchor ) ) && + ( idConditionEndStart( item, anchor ) || itemConditionEndStart( item, anchor ) ) && + ( edgeConditionStartEnd( item, anchor ) ) && + ( edgeConditionEndStart( item, anchor ) ) ){ + item->setSizePolicy( anchor->sizePolicy() ); + item->setMinimumLength( anchor->minimumLength() ); + item->setPreferredLength( anchor->preferredLength() ); + item->setMaximumLength( anchor->maximumLength() ); + item->setDirection( ( anchor->direction() == HbAnchor::Positive )?( HbAnchor::Negative ):( HbAnchor::Positive ) ); + delete anchor; + return item; + } + } + + if( anchor->startItem() != 0 ){ + anchor->d_ptr->mStartId = mItemToNodeIdMap.value( anchor->startItem() ); + } else if( ! anchor->startNodeId().isNull() ) { + anchor->d_ptr->mStartItem = mItemToNodeIdMap.key( anchor->startNodeId() ); + } + + if( anchor->endItem() != 0 ){ + anchor->d_ptr->mEndId = mItemToNodeIdMap.value( anchor->endItem() ); + } else if( ! anchor->endNodeId().isNull() ) { + anchor->d_ptr->mEndItem = mItemToNodeIdMap.key( anchor->endNodeId() ); + } + + addItemIfNeeded( anchor->startItem() ); + addItemIfNeeded( anchor->endItem() ); + + anchor->d_ptr->mParent = q; + + mAllAnchors.append(anchor); + + return anchor; } +void HbAnchorLayoutPrivate::removeItemIfNeeded( QGraphicsLayoutItem *item ) +{ + Q_Q( HbAnchorLayout ); + + if( ( item == 0 ) || ( item == q ) ) { + return; + } + + for ( int i = 0; i < mAllAnchors.size(); i++ ) { + HbAnchor *anchor = mAllAnchors.at(i); + if ( ( anchor->startItem() == item ) || ( anchor->endItem() == item ) ) { + return; + } + } + + item->setParentLayoutItem( 0 ); + mItems.removeAt(q->indexOf( item )); +} + + + /*! Constructor. */ @@ -1045,6 +1474,7 @@ delete d_ptr; } + /*! Creates an anchor, or updates an existing one, between the edges described by (\a startItem, \a startEdge) and (\a endItem, \a endEdge). @@ -1054,9 +1484,9 @@ That is, it is not allowed to connect e.g. top edge of an item to the left edge of another one. Also there are horizontal and vertical center edges. - The distance between the two edges is defined by \a value. - If \a value is positive the end edge is to the right or below the start edge. - If \a value is negative the end edge is to the left or above the start edge. + The distance between the two edges is defined by \a length. + If \a length is positive the end edge is to the right or below the start edge. + If \a length is negative the end edge is to the left or above the start edge. Anchors can be created between the parent layout and a child layout item, or between two child layout items, or even between two edges of the same @@ -1075,48 +1505,110 @@ \param startEdge source edge. \param endItem target item. \param endEdge target edge. - \param value spacing (in pixels). - \return true if anchor was successfully added, false otherwise + \param length spacing (in pixels). + \return created anchor if it was successfully added, or zero otherwise */ -bool HbAnchorLayout::setAnchor( QGraphicsLayoutItem *startItem, - Hb::Edge startEdge, - QGraphicsLayoutItem *endItem, - Hb::Edge endEdge, - qreal value ) +HbAnchor *HbAnchorLayout::setAnchor( QGraphicsLayoutItem *startItem, Edge startEdge, QGraphicsLayoutItem *endItem, Edge endEdge, qreal length ) { Q_D( HbAnchorLayout ); - if ( d->edgeType(startEdge) != d->edgeType(endEdge) ) { - qWarning() << "HbAnchorLayout::setAnchor : You can't connect different type of edges"; - return false; + + + HbAnchor *anchor = new HbAnchor( startItem, startEdge, endItem, endEdge, length ); + + HbAnchor *result = d->setAnchor( anchor ); + + if( result ) { + invalidate(); + return result; } - if ( !startItem || !endItem ) { - qWarning() << "HbAnchorLayout::setAnchor : One of the items is NULL"; - return false; + delete anchor; + + return 0; +} + +/*! + Same as previous, but here it operates with node ids, instead of items itself. + + \param startId start id. + \param startEdge start edge. + \param endId end id. + \param endEdge end edge. + \param length spacing value for all edges starting from (\a startId, \a startEdge). + \return created anchor if it was successfully added, or zero otherwise +*/ +HbAnchor *HbAnchorLayout::setAnchor( const QString& startId, Edge startEdge, const QString& endId, Edge endEdge, qreal length ) +{ + Q_D( HbAnchorLayout ); + + HbAnchor *anchor = new HbAnchor( startId, startEdge, endId, endEdge, length ); + + HbAnchor *result = d->setAnchor( anchor ); + + if( result ) { + invalidate(); + return result; } - if ( ( startItem == endItem ) && ( startEdge == endEdge ) ) { - qWarning() << "HbAnchorLayout::setAnchor : You cannot set anchor between the same edge"; - return false; + delete anchor; + + return 0; +} + + +/*! + Set previously created anchor. Ownership is passed to layout. + + \param anchor anchor, created somewhere outside + \return reference to updated/created anchor (not necessary the same as in input parameter), or zero if something was wrong. +*/ +HbAnchor *HbAnchorLayout::setAnchor( HbAnchor *anchor ) +{ + Q_D( HbAnchorLayout ); + + HbAnchor *result = d->setAnchor( anchor ); + + if( result ) { + invalidate(); + return result; } - d->addItemIfNeeded(startItem); - d->addItemIfNeeded(endItem); + return 0; +} - HbAnchor* anchor = d->getAnchor(startItem, startEdge, endItem, endEdge); - HbAnchor* anchor2 = d->getAnchor(endItem, endEdge, startItem, startEdge); + +/*! + Removes anchor (\a startId, \a startEdge, \a endNodeId, \a endEdge). - if ( anchor ) { - anchor->mValue = value; - } else if ( anchor2 ) { - anchor2->mValue = -value; - } else { - anchor = new HbAnchor(startItem, startEdge, endItem, endEdge, value); - d->mAnchors.append(anchor); + \param startId start id. + \param startEdge start edge. + \param endId end id. + \param endEdge end edge. + \return true if success, false otherwise. +*/ +bool HbAnchorLayout::removeAnchor( const QString& startNodeId, Edge startEdge, const QString& endNodeId, Edge endEdge ) +{ + Q_D( HbAnchorLayout ); + bool modified = false; + + for (int i = d->mAllAnchors.size() - 1; i >= 0; --i) { + HbAnchor* anchor = d->mAllAnchors[i]; + if( ( anchor->startNodeId() == startNodeId && anchor->startEdge() == startEdge && + anchor->endNodeId() == endNodeId && anchor->endEdge() == endEdge ) || + ( anchor->startNodeId() == endNodeId && anchor->startEdge() == endEdge && + anchor->endNodeId() == startNodeId && anchor->endEdge() == startEdge ) ){ + delete d->mAllAnchors.takeAt(i); + modified = true; + } } - invalidate(); - return true; + if (modified) { + d->removeItemIfNeeded( d->mItemToNodeIdMap.key( startNodeId ) ); + d->removeItemIfNeeded( d->mItemToNodeIdMap.key( endNodeId ) ); + invalidate(); + return true; + } + return false; } /*! @@ -1133,95 +1625,338 @@ \param edge2 second edge. \return true if anchor was successfully removed, false otherwise */ -bool HbAnchorLayout::removeAnchor( QGraphicsLayoutItem *item1, - Hb::Edge edge1, - QGraphicsLayoutItem *item2, - Hb::Edge edge2 ) +bool HbAnchorLayout::removeAnchor( QGraphicsLayoutItem *startItem, Edge startEdge, QGraphicsLayoutItem *endItem, Edge endEdge ) { Q_D( HbAnchorLayout ); - HbAnchor *anchor = d->getAnchor( item1, edge1, item2, edge2 ); - if( !anchor ) { - anchor = d->getAnchor( item2, edge2, item1, edge1 ); + bool modified = false; + + for (int i = d->mAllAnchors.size() - 1; i >= 0; --i) { + HbAnchor* anchor = d->mAllAnchors[i]; + if( ( anchor->startItem() == startItem && anchor->startEdge() == startEdge && + anchor->endItem() == endItem && anchor->endEdge() == endEdge ) || + ( anchor->startItem() == endItem && anchor->startEdge() == endEdge && + anchor->endItem() == startItem && anchor->endEdge() == startEdge ) ){ + delete d->mAllAnchors.takeAt(i); + modified = true; + } } - if ( anchor ) { - d->mAnchors.removeAll( anchor ); + + if (modified) { + d->removeItemIfNeeded( startItem ); + d->removeItemIfNeeded( endItem ); + invalidate(); + return true; + } + return false; +} + - // Remove non-anchored items - bool startFound = false; - bool endFound = false; - for ( int i = d->mAnchors.count() - 1; i >= 0; i-- ) { - if ( d->mAnchors.at(i)->mStartItem == item1 || - d->mAnchors.at(i)->mEndItem == item1 ) { - startFound = true; - } - if ( d->mAnchors.at(i)->mStartItem == item2 || - d->mAnchors.at(i)->mEndItem == item2 ) { - endFound = true; - } - } - if ( !startFound && item1 != this ) { - item1->setParentLayoutItem( 0 ); - d->mItems.removeAt(indexOf(item1)); - } - if ( !endFound && item2 != this) { - item2->setParentLayoutItem( 0 ); - d->mItems.removeAt(indexOf(item2)); - } +/*! + + Removes and deletes an anchor (\a anchor) from layout. + + If layout contains exactly the same anchor, with the same reference, then only this + one is removed and deleted. Otherwise all anchors with the same start and end points + are removed and deleted ( \a anchor is not deleted in this case because this instance + is not in layout ). + + Notice: The item will be removed from the layout if this is the last + anchor connecting the item. + + \param anchor anchor to be removed. + \return true if anchor was successfully removed, false otherwise +*/ +bool HbAnchorLayout::removeAnchor( HbAnchor *anchor ) +{ + Q_D( HbAnchorLayout ); + + if( d->mAllAnchors.removeOne( anchor ) ) { + d->removeItemIfNeeded( anchor->startItem() ); + d->removeItemIfNeeded( anchor->endItem() ); delete anchor; invalidate(); return true; - } else { - return false; + } + + bool modified = true; + + for (int i = d->mAllAnchors.size() - 1; i >= 0; --i) { + HbAnchor* item = d->mAllAnchors[i]; + if( ( ( idConditionStartStart( item, anchor ) || itemConditionStartStart( item, anchor ) ) && + ( idConditionEndEnd( item, anchor ) || itemConditionEndEnd( item, anchor ) ) && + ( edgeConditionStartStart( item, anchor ) ) && + ( edgeConditionEndEnd( item, anchor ) ) ) // condition for same direction anchor + + || + + ( ( idConditionStartEnd( item, anchor ) || itemConditionStartEnd( item, anchor ) ) && + ( idConditionEndStart( item, anchor ) || itemConditionEndStart( item, anchor ) ) && + ( edgeConditionStartEnd( item, anchor ) ) && + ( edgeConditionEndStart( item, anchor ) ) ) ){ // condition for opposite direction anchor + delete d->mAllAnchors.takeAt(i); + modified = true; + break; + } + } + + if( modified ) { + d->removeItemIfNeeded( anchor->startItem() ); + d->removeItemIfNeeded( anchor->endItem() ); + invalidate(); + return true; + } + + + return modified; +} + +/*! + Removes all anchors starting or ending to \a nodeId. + Same is done with associated item + + \param id id to be removed. + \return true if success, false otherwise. +*/ +bool HbAnchorLayout::removeNodeId( const QString& nodeId ) +{ + Q_D( HbAnchorLayout ); + bool modified = false; + + // if association, do removal + + for (int i = d->mAllAnchors.size() - 1; i >= 0; --i) { + HbAnchor *anchor = d->mAllAnchors.at(i); + if (anchor->startNodeId() == nodeId || anchor->endNodeId() == nodeId) { + QGraphicsLayoutItem *startItem = anchor->startItem(); + QGraphicsLayoutItem *endItem = anchor->endItem(); + + delete d->mAllAnchors.takeAt(i); + d->removeItemIfNeeded( startItem ); + d->removeItemIfNeeded( endItem ); + + modified = true; + } + } + + removeMapping( nodeId ); + + if (modified) { + invalidate(); + return true; + } + return false; +} + +/*! + Clears all anchors. + Note that this does not affect on mappings. +*/ +void HbAnchorLayout::removeAnchors() +{ + Q_D( HbAnchorLayout ); + + if( d->mAllAnchors.size() ) { + qDeleteAll( d->mResolvedDynamicAnchors ); + qDeleteAll( d->mAllAnchors ); + d->mResolvedDynamicAnchors.clear(); + d->mResolvedStaticAnchors.clear(); + d->mResolvedAnchors.clear(); + d->mAllAnchors.clear(); + invalidate(); } } /*! - From QGraphicsLayoutItem. - Sets the geometry of all the child items of this layout. - - In case the layout is not valid geometry will not be set - to any of the child items. - - \param rect rectangle for this layout. - \sa isValid + Sets identifier for \a item. + \param item layout item. + \param nodeId new id corresponding to \a item. + \return true if success, false otherwise. */ -void HbAnchorLayout::setGeometry(const QRectF &rect) +bool HbAnchorLayout::setMapping( QGraphicsLayoutItem *item, const QString& nodeId ) { Q_D( HbAnchorLayout ); - QGraphicsLayout::setGeometry(rect); - d->setItemGeometries(); - d->mInvalidateCalled = false; + bool modified = false; + + if ( !nodeId.isNull() && ( item != 0 ) ) { + + for( int i = 0; i < d->mAllAnchors.size(); i++ ) { + HbAnchor *anchor = d->mAllAnchors.at(i); + if( anchor->startItem() == item ) { + anchor->d_ptr->mStartId = nodeId; + modified = true; + } else if( anchor->startNodeId() == nodeId ) { + anchor->d_ptr->mStartItem = item; + modified = true; + } + + if( anchor->endItem() == item ) { + anchor->d_ptr->mEndId = nodeId; + modified = true; + } else if( anchor->endNodeId() == nodeId ) { + anchor->d_ptr->mEndItem = item; + modified = true; + } + + } + + // Remove previous item -> id. + ItemToNodeIdMapIterator it = d->mItemToNodeIdMap.begin(); + while ( it != d->mItemToNodeIdMap.end() ) { + if ( it.value() == nodeId ) { + it = d->mItemToNodeIdMap.erase( it ); + } else { + ++it; + } + } + d->addItemIfNeeded( item ); + d->mItemToNodeIdMap.insert( item, nodeId ); + } else { + return false; + } + + if( modified ){ + invalidate(); + } + return true; } /*! - From QGraphicsLayoutItem. - Removes the item at index, \a index, without destroying it. + Resets mapping for \a item. All anchors are updated after that. + + item <=> "someId" ----> item <=> null + + \param item layout item. + \return true if success, false otherwise. +*/ +bool HbAnchorLayout::removeMapping( QGraphicsLayoutItem *item ) +{ + Q_D( HbAnchorLayout ); + + bool modified = false; + + if( ! item ) { + return false; + } + + for( int i = 0; i < d->mAllAnchors.size(); i++ ) { + HbAnchor *anchor = d->mAllAnchors.at(i); + + if( anchor->startItem() == item ) { + anchor->d_ptr->mStartId = QString(); + modified = true; + } - Removes all the anchors connected to the removed item. + if( anchor->endItem() == item ) { + anchor->d_ptr->mEndId = QString(); + modified = true; + } + } + + + d->mItemToNodeIdMap.remove(item); - \param index index of item to be removed. + if( modified ){ + invalidate(); + } + return true; +} + +/*! + Resets mapping for \a nodeId. All anchors are updated after that. + + item <=> "nodeId" ----> 0 <=> "nodeId" + + \param nodeId node id + \return true if success, false otherwise. */ -void HbAnchorLayout::removeAt(int index) +bool HbAnchorLayout::removeMapping( const QString& nodeId ) { Q_D( HbAnchorLayout ); - if ( index < 0 || index > d->mItems.count()-1 ) { + + bool modified = false; + + if( nodeId.isNull() ) { + return false; + } + + for( int i = 0; i < d->mAllAnchors.size(); i++ ) { + HbAnchor *anchor = d->mAllAnchors.at(i); + + if( anchor->startNodeId() == nodeId ) { + anchor->d_ptr->mStartItem = 0; + modified = true; + } + + if( anchor->endNodeId() == nodeId ) { + anchor->d_ptr->mEndItem = 0; + modified = true; + } + } + + + ItemToNodeIdMapIterator it = d->mItemToNodeIdMap.begin(); + while ( it != d->mItemToNodeIdMap.end() ) { + if ( it.value() == nodeId ) { + it = d->mItemToNodeIdMap.erase( it ); + } else { + ++it; + } + } + + if( modified ){ + invalidate(); + } + return true; +} + + +/*! + Clears all item id mappings. +*/ +void HbAnchorLayout::removeMappings() +{ + Q_D( HbAnchorLayout ); + d->mItemToNodeIdMap.clear(); + + for( int i = 0; i < d->mAllAnchors.size(); i++ ) { + HbAnchor *anchor = d->mAllAnchors.at(i); + + if( !anchor->startNodeId().isNull() ) { + anchor->d_ptr->mStartItem = 0; + } + + if( !anchor->endNodeId().isNull() ) { + anchor->d_ptr->mEndItem = 0; + } + + } +} + +/*! + Adds \a item. + + \param item item to be added. + \param id id of this item. +*/ +void HbAnchorLayoutPrivate::addItemIfNeeded(QGraphicsLayoutItem *item) +{ + Q_Q(HbAnchorLayout); + + if (!item) { return; } - QGraphicsLayoutItem *item = itemAt( index ); - if ( item ) { - for ( int i = d->mAnchors.count() - 1; i >= 0; i-- ) { - if ( d->mAnchors.at(i)->mStartItem == item || - d->mAnchors.at(i)->mEndItem == item ) { - d->mAnchors.removeAt(i); - } - } - item->setParentLayoutItem( 0 ); - d->mItems.removeAt(index); + if (item == q) { + return; } - invalidate(); + if (mItems.contains(item)) { + return; + } + + HbLayoutUtils::addChildItem(q, item); + mItems.append(item); } /*! @@ -1230,35 +1965,12 @@ \param item item to be removed. */ -void HbAnchorLayout::removeItem(QGraphicsLayoutItem* item) +void HbAnchorLayout::removeItem(QGraphicsLayoutItem *item) { removeAt(indexOf(item)); } /*! - From QGraphicsLayoutItem. - Returns the count of the child items in anchor layout. - \return amount of items in this layout. -*/ -int HbAnchorLayout::count() const -{ - Q_D( const HbAnchorLayout ); - return d->mItems.count(); -} - -/*! - From QGraphicsLayoutItem. - Returns a pointer to the item at an index \a index. - \param index position of desired item. - \return item at specified index. -*/ -QGraphicsLayoutItem *HbAnchorLayout::itemAt(int index) const -{ - Q_D( const HbAnchorLayout ); - return d->mItems.value(index); -} - -/*! Returns the index of given layout \a item, or -1 if not found. \param item item to look for. \return index of item or -1 if not found. @@ -1266,8 +1978,8 @@ int HbAnchorLayout::indexOf(const QGraphicsLayoutItem* item) const { Q_D( const HbAnchorLayout ); - for ( int i=0; i< d->mItems.count(); i++) { - if ( d->mItems.at(i) == item ) { + for (int i=0; i < d->mItems.count(); i++) { + if (d->mItems.at(i) == item) { return i; } } @@ -1286,14 +1998,117 @@ return ( d->mValid && ( ! d->mWrongAnchors ) ); } + /*! - From QGraphicsLayoutItem. + Returns node id for given item, or default constructed string if no mapping exist. + \param item item to check. + \return node id for given item. +*/ +QString HbAnchorLayout::nodeId( QGraphicsLayoutItem *item ) const +{ + Q_D( const HbAnchorLayout ); + if( d->mItemToNodeIdMap.contains( item ) ) { + return d->mItemToNodeIdMap.value( item ); + } + return QString(); +} + +/*! + Returns list of node ids that are mentioned in anchors list. + \return list of node ids. +*/ +QStringList HbAnchorLayout::nodeIds() const +{ + Q_D( const HbAnchorLayout ); + QStringList list; + int c = d->mAllAnchors.count(); + while (c--) { + QString id = d->mAllAnchors.at(c)->startNodeId(); + if (!list.contains(id) && !id.isNull()) { + list.append(id); + } + id = d->mAllAnchors.at(c)->endNodeId(); + if (!list.contains(id) && !id.isNull()) { + list.append(id); + } + } + return list; +} + +/*! + Returns item reference for given node id, or zero if no mapping exist. + \param nodeId node id to check. + \return item reference for given item. +*/ +QGraphicsLayoutItem *HbAnchorLayout::itemByNodeId( const QString& nodeId ) const +{ + Q_D( const HbAnchorLayout ); + return d->mItemToNodeIdMap.key( nodeId ); +} + + +/*! + \reimp +*/ +void HbAnchorLayout::removeAt(int index) +{ + Q_D( HbAnchorLayout ); + if ( index < 0 || index > d->mItems.count()-1 ) { + return; + } + QGraphicsLayoutItem *item = itemAt( index ); + if ( item ) { + for ( int i = d->mAllAnchors.count() - 1; i >= 0; i-- ) { + if ( ( ( d->mAllAnchors.at(i)->startItem() == item ) && ( d->mAllAnchors.at(i)->startNodeId().isNull() ) ) || + ( ( d->mAllAnchors.at(i)->endItem() == item ) && ( d->mAllAnchors.at(i)->endNodeId().isNull() ) ) ) { + delete d->mAllAnchors.takeAt(i); + } + } + + removeMapping( d->mItemToNodeIdMap.value(item) ); + item->setParentLayoutItem( 0 ); + d->mItems.removeAt( index ); + } + + invalidate(); +} + +/*! + \reimp +*/ +void HbAnchorLayout::setGeometry(const QRectF &rect) +{ + Q_D( HbAnchorLayout ); + QGraphicsLayout::setGeometry(rect); + d->setItemGeometries(); +} + +/*! + \reimp +*/ +int HbAnchorLayout::count() const +{ + Q_D( const HbAnchorLayout ); + return d->mItems.count(); +} + +/*! + \reimp +*/ +QGraphicsLayoutItem *HbAnchorLayout::itemAt(int index) const +{ + Q_D( const HbAnchorLayout ); + return d->mItems.value(index); +} + +/*! + \reimp */ void HbAnchorLayout::invalidate() { Q_D( HbAnchorLayout ); + d->mInvalidateCalled = true; d->mWrongAnchors = false; - d->mInvalidateCalled = true; d->mEquationsDirty = true; QGraphicsLayout::invalidate(); } @@ -1305,9 +2120,9 @@ { QGraphicsLayout::widgetEvent(e); } - /*! - From QGraphicsLayoutItem. If size hint for certain set of items cannot be defined, then it returns default size hint (0/100/1000) + From QGraphicsLayoutItem. If size hint for certain set of items cannot be defined, + then it returns default size hint (0/100/1000) \param which desired size hint. \param constraint optional constraint. \return calculated size hint. @@ -1320,15 +2135,15 @@ return const_cast(d)->sizeHint( which ); } -QSizeF HbAnchorLayoutPrivate::sizeHint( Qt::SizeHint which ) +QSizeF HbAnchorLayoutPrivate::sizeHint(Qt::SizeHint which) { if ( mEquationsDirty ) { - mEquationsDirty = false; + updateAnchorsAndItems(); createEquations( Horizontal ); createEquations( Vertical ); + mEquationsDirty = false; } - if( mLayoutVarH && mLayoutVarV ) { QSizeF res; @@ -1368,4 +2183,3 @@ } } } - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbanchorlayout.h --- a/src/hbcore/layouts/hbanchorlayout.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/layouts/hbanchorlayout.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,47 +37,58 @@ class HB_CORE_EXPORT HbAnchorLayout : public QGraphicsLayout { public: - typedef Hb::Edge Edge; - explicit HbAnchorLayout(QGraphicsLayoutItem *parent = 0); + typedef Hb::Edge Edge; // need to remove later... + + explicit HbAnchorLayout( QGraphicsLayoutItem *parent = 0 ); virtual ~HbAnchorLayout(); - bool setAnchor( - QGraphicsLayoutItem *startItem, - Hb::Edge startEdge, - QGraphicsLayoutItem *endItem, - Hb::Edge endEdge, - qreal value); + HbAnchor *setAnchor( const QString &startNodeId, Edge startEdge, const QString &endNodeId, Edge endEdge, qreal length = 0 ); + HbAnchor *setAnchor( QGraphicsLayoutItem *startItem, Edge startEdge, QGraphicsLayoutItem *endItem, Edge endEdge, qreal length = 0 ); + HbAnchor *setAnchor( HbAnchor *anchor ); + + bool removeAnchor( const QString &startNodeId, Edge startEdge, const QString &endNodeId, Edge endEdge ); + bool removeAnchor( QGraphicsLayoutItem *startItem, Edge startEdge, QGraphicsLayoutItem *endItem, Edge endEdge ); + bool removeAnchor( HbAnchor *anchor ); + + void removeAnchors(); + + QList anchors() const; + QList effectiveAnchors(); - bool removeAnchor( - QGraphicsLayoutItem *startItem, - Hb::Edge startEdge, - QGraphicsLayoutItem *endItem, - Hb::Edge endEdge); + bool setMapping( QGraphicsLayoutItem *item, const QString& nodeId ); + bool removeMapping( QGraphicsLayoutItem *item ); + bool removeMapping( const QString &nodeId ); + void removeMappings(); - void removeAt(int index); - void removeItem(QGraphicsLayoutItem* item); - void setGeometry(const QRectF &rect); - int count() const; - QGraphicsLayoutItem *itemAt(int index) const; - int indexOf(const QGraphicsLayoutItem* item) const; + QString nodeId( QGraphicsLayoutItem *item ) const; + QGraphicsLayoutItem *itemByNodeId( const QString &nodeId ) const; + QStringList nodeIds() const; + + void removeItem( QGraphicsLayoutItem *item ); + bool removeNodeId( const QString &nodeId ); + + int indexOf(const QGraphicsLayoutItem *item) const; + bool isValid() const; - void invalidate(); - virtual void widgetEvent(QEvent *e); - -protected: - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; + virtual void removeAt( int index ); + virtual void setGeometry( const QRectF &rect ); + virtual int count() const; + virtual QGraphicsLayoutItem *itemAt( int index ) const; + virtual void invalidate(); + virtual void widgetEvent( QEvent *e ); protected: - HbAnchorLayoutPrivate * const d_ptr; + virtual QSizeF sizeHint( Qt::SizeHint which, const QSizeF &constraint = QSizeF() ) const; + +protected: + HbAnchorLayoutPrivate *const d_ptr; private: - Q_DISABLE_COPY(HbAnchorLayout) - Q_DECLARE_PRIVATE_D(d_ptr, HbAnchorLayout) - - friend class HbAnchorLayoutDebug; + Q_DISABLE_COPY( HbAnchorLayout ) + Q_DECLARE_PRIVATE_D( d_ptr, HbAnchorLayout ) }; #endif // HBANCHORLAYOUT_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbanchorlayoutdebug_p.h --- a/src/hbcore/layouts/hbanchorlayoutdebug_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBANCHORLAYOUTDEBUGPRIVATE_H -#define HBANCHORLAYOUTDEBUGPRIVATE_H - -class HbAnchorLayout; -class HbAnchor; - -class HB_CORE_PRIVATE_EXPORT HbAnchorLayoutDebug -{ -public: - static QList getAnchors( HbAnchorLayout* layout ); -}; - -#endif - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbanchorlayoutengine_p.cpp --- a/src/hbcore/layouts/hbanchorlayoutengine_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/layouts/hbanchorlayoutengine_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -34,17 +34,17 @@ #include #endif -#define EPSILON 0.01f -#define MAX_SIZE 0xffffff +static const qreal EPSILON = 0.01f; +static const qreal MAX_SIZE = 0xffffff; -static inline bool myFuzzyCompare(double p1, double p2) +static inline bool myFuzzyCompare(double p1, double p2) //krazy:exclude=typedefs { return (qAbs(p1 - p2) <= 0.0001); } -static inline bool myFuzzyCompare(float p1, float p2) +static inline bool myFuzzyCompare(float p1, float p2) //krazy:exclude=typedefs { - return (qAbs(p1 - p2) <= EPSILON); + return (qAbs(p1 - p2) <= (float)EPSILON); //krazy:exclude=typedefs } @@ -60,7 +60,8 @@ static inline bool differentSignOrZero( qreal val1, qreal val2 ) { - return ( ( val1 < EPSILON ) && ( val2 > -EPSILON ) ) || ( ( val1 > -EPSILON ) && ( val2 < EPSILON ) ); + return ( ( val1 < EPSILON ) && ( val2 > -EPSILON ) ) || + ( ( val1 > -EPSILON ) && ( val2 < EPSILON ) ); } @@ -78,7 +79,11 @@ return &theAnchorLayoutSimplyfier; } -bool AnchorLayoutEngine::processItems( QList *edges, QList *vertices, VariableSet *vs, QList *el ) +bool AnchorLayoutEngine::processItems( + QList *edges, + QList *vertices, + VariableSet *vs, + QList *el ) { bool result = true; @@ -122,7 +127,8 @@ break; } - if( ( oldEdgesNumber == edges->size() ) && ( oldVerticesNumber == vertices->size() ) ) { + if( ( oldEdgesNumber == edges->size() ) && + ( oldVerticesNumber == vertices->size() ) ) { state = SPLIT_1; break; } @@ -157,7 +163,8 @@ return result; } -GraphVertex *AnchorLayoutEngine::nextVertex( GraphVertex *currentVertex, GraphEdge *currentEdge, int *sign ) +GraphVertex *AnchorLayoutEngine::nextVertex( + GraphVertex *currentVertex, GraphEdge *currentEdge, int *sign ) { if( currentEdge->startVertex == currentVertex ) { *sign = 1; @@ -175,7 +182,8 @@ return currentVertex->edges.at(0); } -bool AnchorLayoutEngine::findSerialChains( QList *edges, QList *vertices, QList *el ) +bool AnchorLayoutEngine::findSerialChains( + QList *edges, QList *vertices, QList *el ) { bool result = true; @@ -245,7 +253,8 @@ qDebug() << "Adding one more left edge"; #endif //HBANCHORLAYOUT_DEBUG - } while( ( currentVertex != initialVertex ) && ( currentVertex->edges.size() == 2 ) && ( ! currentVertex->special ) ); + } while( ( currentVertex != initialVertex ) && + ( currentVertex->edges.size() == 2 ) && ( ! currentVertex->special ) ); if( currentVertex == initialVertex ) { el->append( expr ); @@ -331,6 +340,7 @@ i--; } + delete initialVertex; continue; } @@ -373,7 +383,11 @@ } -bool AnchorLayoutEngine::findParallelChains( QList *edges, QList *vertices, VariableSet *vs, QList *el ) +bool AnchorLayoutEngine::findParallelChains( + QList *edges, + QList *vertices, + VariableSet *vs, + QList *el ) { Q_UNUSED( vertices ); bool result = true; @@ -407,10 +421,12 @@ compared = edges->at(j); found = false; - if( ( current->startVertex == compared->startVertex ) && ( current->endVertex == compared->endVertex ) ) { + if( ( current->startVertex == compared->startVertex ) && + ( current->endVertex == compared->endVertex ) ) { found = true; sign = 1; - } else if( ( current->startVertex == compared->endVertex ) && ( current->endVertex == compared->startVertex ) ) { + } else if( ( current->startVertex == compared->endVertex ) && + ( current->endVertex == compared->startVertex ) ) { found = true; sign = -1; } @@ -468,12 +484,17 @@ newEdgeSizeProp->pref = sign * compared->expr->prefValue(); newEdgeSizeProp->flags |= SizeProperty::FlagFixed; } else { - if( sign * compared->expr->minValue() < sign * compared->expr->maxValue() ) { - newEdgeSizeProp->min = qMax( newEdgeSizeProp->min, sign * compared->expr->minValue() ); - newEdgeSizeProp->max = qMin( newEdgeSizeProp->max, sign * compared->expr->maxValue() ); + if( sign * compared->expr->minValue() < + sign * compared->expr->maxValue() ) { + newEdgeSizeProp->min = + qMax( newEdgeSizeProp->min, sign * compared->expr->minValue() ); + newEdgeSizeProp->max = + qMin( newEdgeSizeProp->max, sign * compared->expr->maxValue() ); } else { - newEdgeSizeProp->min = qMax( newEdgeSizeProp->min, sign * compared->expr->maxValue() ); - newEdgeSizeProp->max = qMin( newEdgeSizeProp->max, sign * compared->expr->minValue() ); + newEdgeSizeProp->min = + qMax( newEdgeSizeProp->min, sign * compared->expr->maxValue() ); + newEdgeSizeProp->max = + qMin( newEdgeSizeProp->max, sign * compared->expr->minValue() ); } if( comparedEdgeFlags & SizeProperty::FlagExpanding ) { expandingPrefValues.append( sign * compared->expr->prefValue() ); @@ -499,7 +520,8 @@ delete compared; } else { if( comparedEdgeFlags & SizeProperty::FlagFixed ) { - if( ! myFuzzyCompare( newEdgeSizeProp->pref, sign * compared->expr->prefValue() ) ) { + if( ! myFuzzyCompare( newEdgeSizeProp->pref, + sign * compared->expr->prefValue() ) ) { #ifdef HBANCHORLAYOUT_DEBUG qDebug()<< "!!! two different parallel fixed items"; #endif //HBANCHORLAYOUT_DEBUG @@ -543,19 +565,23 @@ if( ~newEdgeSizeProp->flags & SizeProperty::FlagFixed ) { int expectedPref = 0; if( expandingPrefValues.size() < numberOfParallelEdges ) { - expectedPref = static_cast(newEdgeSizeProp->pref / ( numberOfParallelEdges - expandingPrefValues.size() )); + expectedPref = static_cast(newEdgeSizeProp->pref / + ( numberOfParallelEdges - expandingPrefValues.size() )); } qSort( expandingPrefValues ); - if( ( !expandingPrefValues.isEmpty() ) && ( qAbs( expandingPrefValues.last() ) < qAbs( expandingPrefValues.first() ) ) ) { - qSort( expandingPrefValues.begin(), expandingPrefValues.end(), qGreater() ); + if( ( !expandingPrefValues.isEmpty() ) && + ( qAbs( expandingPrefValues.last() ) < qAbs( expandingPrefValues.first() ) ) ) { + qSort( expandingPrefValues.begin(), + expandingPrefValues.end(), qGreater() ); } while( expandingPrefValues.size() > 0 ) { if( qAbs( expandingPrefValues.last() ) > qAbs( expectedPref ) ) { newEdgeSizeProp->pref += expandingPrefValues.last(); expandingPrefValues.removeLast(); - expectedPref = static_cast(newEdgeSizeProp->pref / ( numberOfParallelEdges - expandingPrefValues.size() )); + expectedPref = static_cast(newEdgeSizeProp->pref / + ( numberOfParallelEdges - expandingPrefValues.size() )); } else { break; } @@ -607,6 +633,7 @@ currentVertex = nextVertex( initialVertex, currentEdge, &sign ); vertices->removeOne( initialVertex ); + delete initialVertex; edges->removeOne( currentEdge ); while( ( currentVertex->edges.size() == 2 ) && ( ! currentVertex->special ) ) { @@ -642,7 +669,8 @@ return result; } -void AnchorLayoutEngine::attachToLayout( GraphVertex *start, GraphVertex *middle, GraphVertex *end, Variable *layoutVar, +void AnchorLayoutEngine::attachToLayout( + GraphVertex *start, GraphVertex *middle, GraphVertex *end, Variable *layoutVar, QList *el ) { GraphEdge *current; @@ -689,11 +717,15 @@ // else some compare and indicate error } else if( ~layoutVar->sizeProp.flags & SizeProperty::FlagFixed ) { if( current->expr->minValue() / se.mCoef < current->expr->maxValue() / se.mCoef ) { - layoutVar->sizeProp.min = qMax( layoutVar->sizeProp.min, current->expr->minValue() / se.mCoef ); - layoutVar->sizeProp.max = qMin( layoutVar->sizeProp.max, current->expr->maxValue() / se.mCoef ); + layoutVar->sizeProp.min = + qMax( layoutVar->sizeProp.min, current->expr->minValue() / se.mCoef ); + layoutVar->sizeProp.max = + qMin( layoutVar->sizeProp.max, current->expr->maxValue() / se.mCoef ); } else { - layoutVar->sizeProp.min = qMax( layoutVar->sizeProp.min, current->expr->maxValue() / se.mCoef ); - layoutVar->sizeProp.max = qMin( layoutVar->sizeProp.max, current->expr->minValue() / se.mCoef ); + layoutVar->sizeProp.min = + qMax( layoutVar->sizeProp.min, current->expr->maxValue() / se.mCoef ); + layoutVar->sizeProp.max = + qMin( layoutVar->sizeProp.max, current->expr->minValue() / se.mCoef ); } layoutVar->sizeProp.pref += qAbs( current->expr->prefValue() / se.mCoef ); } @@ -732,12 +764,17 @@ } // else some compare and indicate error } else if( ~layoutVar->sizeProp.flags & SizeProperty::FlagFixed ) { - if( current->expr->minValue() / se.mCoef < current->expr->maxValue() / se.mCoef ) { - layoutVar->sizeProp.min = qMax( layoutVar->sizeProp.min, current->expr->minValue() / se.mCoef ); - layoutVar->sizeProp.max = qMin( layoutVar->sizeProp.max, current->expr->maxValue() / se.mCoef ); + if( current->expr->minValue() / + se.mCoef < current->expr->maxValue() / se.mCoef ) { + layoutVar->sizeProp.min = + qMax( layoutVar->sizeProp.min, current->expr->minValue() / se.mCoef ); + layoutVar->sizeProp.max = + qMin( layoutVar->sizeProp.max, current->expr->maxValue() / se.mCoef ); } else { - layoutVar->sizeProp.min = qMax( layoutVar->sizeProp.min, current->expr->maxValue() / se.mCoef ); - layoutVar->sizeProp.max = qMin( layoutVar->sizeProp.max, current->expr->minValue() / se.mCoef ); + layoutVar->sizeProp.min = + qMax( layoutVar->sizeProp.min, current->expr->maxValue() / se.mCoef ); + layoutVar->sizeProp.max = + qMin( layoutVar->sizeProp.max, current->expr->minValue() / se.mCoef ); } layoutVar->sizeProp.pref += qAbs( current->expr->prefValue() / se.mCoef ); } @@ -758,7 +795,13 @@ } } -void AnchorLayoutEngine::cleanUp( GraphVertex *start, GraphVertex *middle, GraphVertex *end, QList *edges, QList *vertices, QList *el ) +void AnchorLayoutEngine::cleanUp( + GraphVertex *start, + GraphVertex *middle, + GraphVertex *end, + QList *edges, + QList *vertices, + QList *el ) { if( start ) { vertices->removeOne( start ); @@ -778,14 +821,17 @@ vertices->clear(); for( int i = 0; i < el->size(); i++ ) { if( el->at(i)->isTrivial() ) { - el->removeAt(i); + delete el->takeAt(i); i--; } } } -bool AnchorLayoutEngine::splitVertices( QList *edges, QList *vertices, int level ) +bool AnchorLayoutEngine::splitVertices( + QList *edges, + QList *vertices, + int level ) { bool result = false; GraphEdge *newEdge, *current, *edgeToModify; @@ -879,7 +925,10 @@ } -bool AnchorLayoutEngine::solveEquation( QList *elOriginal, VariableSet *vs, Solution *solution ) +bool AnchorLayoutEngine::solveEquation( + QList *elOriginal, + VariableSet *vs, + Solution *solution ) { enum State { CheckEquationsNum, @@ -984,7 +1033,8 @@ } solution->insert( se.mVar, se.mVar->sizeProp.pref ); } - } else if( ( ( pref < EPSILON ) && ( maxExp > pref ) ) || ( ( pref > -EPSILON ) && ( maxExp < pref ) ) ) { + } else if( ( ( pref < EPSILON ) && ( maxExp > pref ) ) || + ( ( pref > -EPSILON ) && ( maxExp < pref ) ) ) { for ( int i = 0; i < currentEquation->mExpression.size(); i++ ) { SimpleExpression se = currentEquation->mExpression.at(i); @@ -1033,7 +1083,8 @@ SimpleExpression se = currentEquation->mExpression.at(i); qreal value; - if ( ( se.mVar->sizeProp.flags & SizeProperty::FlagFixed ) || solution->contains( ( se.mVar ) ) ) { + if ( ( se.mVar->sizeProp.flags & SizeProperty::FlagFixed ) || + solution->contains( ( se.mVar ) ) ) { continue; } @@ -1150,7 +1201,8 @@ qreal value = - exp.value( solution ) / se.mCoef; - if ( ( value - se.mVar->sizeProp.min < -EPSILON ) || ( value - se.mVar->sizeProp.max > EPSILON ) ) { + if ( ( value - se.mVar->sizeProp.min < -EPSILON ) || + ( value - se.mVar->sizeProp.max > EPSILON ) ) { #ifdef HBANCHORLAYOUT_DEBUG qDebug( "cannot solve: min=%lf, max=%lf, value=%lf", se.mVar->sizeProp.min, se.mVar->sizeProp.max, value ); #endif @@ -1268,7 +1320,8 @@ for ( int i = 0; i < mExpression.size(); i++ ) { isFixed = isFixed && ( mExpression.at(i).mVar->sizeProp.flags & SizeProperty::FlagFixed ); - isExpanding = ( isExpanding ) || ( mExpression.at(i).mVar->sizeProp.flags & SizeProperty::FlagExpanding ); + isExpanding = ( isExpanding ) || + ( mExpression.at(i).mVar->sizeProp.flags & SizeProperty::FlagExpanding ); } if( isFixed ) { @@ -1392,7 +1445,9 @@ if ( currentExpression.mVar->sizeProp.flags & SizeProperty::FlagFixed ) { result += currentExpression.mVar->sizeProp.pref * currentExpression.mCoef; } else { - result += qMin( currentExpression.mVar->sizeProp.max * currentExpression.mCoef, currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); + result += qMin( currentExpression.mVar->sizeProp.max * + currentExpression.mCoef, + currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); } } @@ -1426,7 +1481,9 @@ if ( currentExpression.mVar->sizeProp.flags & SizeProperty::FlagFixed ) { result += currentExpression.mVar->sizeProp.pref * currentExpression.mCoef; } else { - result += qMax( currentExpression.mVar->sizeProp.max * currentExpression.mCoef, currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); + result += qMax( currentExpression.mVar->sizeProp.max * + currentExpression.mCoef, + currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); } } @@ -1447,7 +1504,9 @@ } else if ( solution->contains( ( currentExpression.mVar ) ) ) { result += solution->value( ( currentExpression.mVar ) ) * currentExpression.mCoef; } else { - result += qMin( currentExpression.mVar->sizeProp.max * currentExpression.mCoef, currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); + result += qMin( currentExpression.mVar->sizeProp.max * + currentExpression.mCoef, + currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); } } @@ -1487,7 +1546,9 @@ } else if ( solution->contains( ( currentExpression.mVar ) ) ) { result += solution->value( ( currentExpression.mVar ) ) * currentExpression.mCoef; } else { - result += qMax( currentExpression.mVar->sizeProp.max * currentExpression.mCoef, currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); + result += qMax( currentExpression.mVar->sizeProp.max * + currentExpression.mCoef, + currentExpression.mVar->sizeProp.min * currentExpression.mCoef ); } } @@ -1530,13 +1591,15 @@ res += " + "; } if( mExpression.at(i).mVar->sizeProp.flags & SizeProperty::FlagFixed ) { - res += '(' + QString::number( mExpression.at(i).mCoef ) + ')' + "var[" + QString::number( mExpression.at(i).mVar->mId ) + ']' + "(" + + res += '(' + QString::number( mExpression.at(i).mCoef ) + + ')' + "var[" + QString::number( mExpression.at(i).mVar->mId ) + ']' + '(' + QString::number( mExpression.at(i).mVar->sizeProp.pref ) + "|f)"; } else { - res += '(' + QString::number( mExpression.at(i).mCoef ) + ')' + "var[" + QString::number( mExpression.at(i).mVar->mId ) + ']' + "(" + - QString::number( mExpression.at(i).mVar->sizeProp.min ) + "," + - QString::number( mExpression.at(i).mVar->sizeProp.pref ) + "," + - QString::number( mExpression.at(i).mVar->sizeProp.max ) + ")"; + res += '(' + QString::number( mExpression.at(i).mCoef ) + + ')' + "var[" + QString::number( mExpression.at(i).mVar->mId ) + ']' + '(' + + QString::number( mExpression.at(i).mVar->sizeProp.min ) + ',' + + QString::number( mExpression.at(i).mVar->sizeProp.pref ) + ',' + + QString::number( mExpression.at(i).mVar->sizeProp.max ) + ')'; } } return res; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbmeshlayout_p.cpp --- a/src/hbcore/layouts/hbmeshlayout_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1900 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include -#include -#include - - -#include "hbmeshlayout_p.h" -#include "hbmeshlayoutdebug_p.h" - -#include "hbanchorlayoutengine_p.h" -#include "hblayoututils_p.h" -#include "hbanchor_p.h" - -//Uncomment next define in order to get more debug prints. -//Similar define exists also in the engine side. -//#define HBMESHLAYOUT_DEBUG - -/*! - \class HbMeshLayout - \brief HbMeshLayout manages geometries of its child items with anchors - that connect the layout items with each other. This is different from - \c HbAnchorLayout in such way that this allows layout items to be missing - and can fix anchor attachments. - - Currently, the HbMeshLayout is an internal class which can be only utilized via the - WidgetML within a widget. - - The mesh layout is a bit more fragile than the anchor layout. The anchor definitions - need to support the missing items. Here are some simple rules how the mesh can be - created (the example is only for horizontal direction - the same needs to be done - for portrait as well). - - First, we need to find the child item (=node), which is always present i.e. cannot be missing. - - \image html hbmeshlayout1.png - - From the image above, we have decided that the green node is always present. This - means that all the other nodes in the horizontal graph can be optional. - - \image html hbmeshlayout2.png - - Then, we create the anchors starting from the non-optional node and point towards - the edges of the layout. The mesh layout definition in the WidgetML would look like: - - \code - - - - - - - - \endcode - - As mentioned, the green node needs be present always. In practice, this means that the - parent widget, which owns this mesh layout, needs to have a child widget with item - name "green_item". \c HbStyle::setItemName for more details. - - If an optional node is missing, the anchors pointing to the node are - changed to point to the node after (=towards the parent layout) the missing one - this - is called "fixing the mesh". The fixing only works if the end result can be determined - i.e. two anchor starting from a missing node is prohibited. - - \image html hbmeshlayout3.png - - In the picture above, the blue and yellow items are missing. The mesh is fixed by removing - the anchor definitions starting from the missing nodes. - - \proto - \internal -*/ - -/*! - \enum HbMeshLayout::Edge - - This enum defines the edges of a layout item. -*/ - -/* - \enum EdgeType - \internal -*/ -enum EdgeType { - Horizontal = 0, - Vertical -}; - -/* - Single anchor. If mHasSpacing equals to false, then anchor is sort of defined, - but not really connected. - \internal -*/ -struct HbMeshAnchor -{ - QString mStartId; - HbMeshLayout::Edge mStartEdge; - QString mEndId; - HbMeshLayout::Edge mEndEdge; - bool mHasSpacing; - qreal mSpacing; -}; - -/* - Key for spacing overrides. -*/ -struct HbMeshKey -{ - QString mId; - HbMeshLayout::Edge mEdge; -}; - -/* - Returns true if \a first is less than \a second. Needed for QMap use. - \internal -*/ -inline bool operator<(const HbMeshKey &first, const HbMeshKey &second) -{ - if( first.mId == second.mId ) { - return int(first.mEdge) < int(second.mEdge); - } else { - return first.mId < second.mId; - } -} - -/* - Type for mapping from layout item to node identifier. - \internal -*/ -typedef QMap HbMeshItemMap; -typedef HbMeshItemMap::iterator HbMeshItemMapIterator; -typedef HbMeshItemMap::const_iterator HbMeshItemMapConstIterator; - -/* - Type for inverse mapping of \c HbMeshItemMap. - \internal -*/ -typedef QMap HbMeshItemMapInverse; - -/* - Result of findEndItem. -*/ -struct HbMeshEndItemResult -{ - QGraphicsLayoutItem *mItem; - HbMeshLayout::Edge mEdge; - qreal mSpacing; -}; - -class HbMeshLayoutPrivate -{ -public: - Q_DECLARE_PUBLIC( HbMeshLayout ) - - HbMeshLayoutPrivate(); - ~HbMeshLayoutPrivate(); - - void addItemIfNeeded(QGraphicsLayoutItem *item); - - static EdgeType edgeType( HbMeshLayout::Edge edge ); - void setItemGeometries(); - void updateAnchorsAndItems(); - - void createEquations( EdgeType type ); - - int getEdgeIndex(QGraphicsLayoutItem *item, Hb::Edge edge); - - bool hasAnchorSpacing(const HbMeshAnchor &anchor, qreal *spacing = 0) const; - bool findEndItem( - HbMeshEndItemResult &result, - const HbMeshAnchor &anchor, - const HbMeshItemMapInverse &inverse, - QStringList &ids) const; - void resolveAnchors( QList *anchors ); - - bool setAnchor(const HbMeshAnchor &anchor); - int actualItemsIndexOf(QGraphicsLayoutItem *item) const; - - void setSizeProp( SizeProperty *v, QGraphicsLayoutItem *item, EdgeType type ); - GraphVertex *createCenterEdge( EdgeType type, QGraphicsLayoutItem *item, Hb::Edge edge ); - void defineNextGeometry( const int itemIndexStart, const int itemIndexEnd, const int anchorIndex, const int definedItemIndex ); - - - QSizeF sizeHint(Qt::SizeHint which); - -public: - HbMeshLayout * q_ptr; - - bool mEquationsDirty; // if true, we needed to re-create the equations (e.g. when new anchor is set) - bool mValid; // result of the calculations. false, if the equations cannot be solved. - bool mInvalidateCalled; // set true in ::invalidate() and cleared after geometry is set in ::setGeometry - bool mWrongAnchors; - - QList mAnchors; - - // mesh layout data - QList mItems; // for addItem - QList mActualItems; // layouted items - HbMeshItemMap mMeshMap; - QList mMeshAnchors; - QMap mMeshSpacings; - - QRectF mUsedRect; - - // new items - - QList mEdgesVertical; - QList mEdgesHorizontal; - QList mVerticesVertical; - QList mVerticesHorizontal; - - QList mEquationsHorizontal; - QList mEquationsVertical; - VariableSet mVariablesHorizontal; - VariableSet mVariablesVertical; - - Variable *mLayoutVarH; - Variable *mLayoutVarV; - - QVector mAnchorsVisited; - QVector< bool > mGeometryDefinedH; - QVector< bool > mGeometryDefinedV; - typedef struct { - qreal x1, y1, x2, y2; - } ItemGeometry; - - QVector< ItemGeometry > mItemsGeometry; - - Solution mSolutionHorizontal; - Solution mSolutionVertical; - -}; -/*! - \internal -*/ -QList HbMeshLayoutDebug::getAnchors( HbMeshLayout* layout ) -{ - QList anchors; - layout->d_ptr->resolveAnchors( &anchors ); - return anchors; -} - -/* - \class HbMeshLayoutPrivate - \internal -*/ -HbMeshLayoutPrivate::HbMeshLayoutPrivate() : mEquationsDirty(false), mValid(true), mInvalidateCalled( false ), mWrongAnchors( false ), - mUsedRect( 0, 0, 0, 0 ), mLayoutVarH( 0 ), mLayoutVarV( 0 ) - -{ -} - -/* - \internal -*/ -HbMeshLayoutPrivate::~HbMeshLayoutPrivate() -{ - - qDeleteAll( mEdgesVertical ); - qDeleteAll( mEdgesHorizontal ); - qDeleteAll( mVerticesVertical ); - qDeleteAll( mVerticesHorizontal ); - - qDeleteAll( mEquationsHorizontal ); - qDeleteAll( mEquationsVertical ); - - qDeleteAll( mAnchors ); -} - -/* - \internal -*/ -EdgeType HbMeshLayoutPrivate::edgeType( HbMeshLayout::Edge edge ) -{ - EdgeType type( Horizontal ); - if( edge == Hb::TopEdge || edge == Hb::BottomEdge || edge == Hb::CenterVEdge ) { - type = Vertical; - } - return type; -} - -#ifdef HBMESHLAYOUT_DEBUG -/* - Returns string representation of value in \c Edge enumeration. - \internal -*/ -static QString edgeAsText(HbMeshLayout::Edge edge) -{ - QString result; - switch (edge) { - case Hb::LeftEdge: - result = "LEFT"; - break; - - case Hb::RightEdge: - result = "RIGHT"; - break; - - case Hb::CenterHEdge: - result = "CENTERH"; - break; - - case Hb::TopEdge: - result = "TOP"; - break; - - case Hb::BottomEdge: - result = "BOTTOM"; - break; - - case Hb::CenterVEdge: - result = "CENTERV"; - break; - - default: - result = ""; - break; - } - - return result; -} - -#endif // HBMESHLAYOUT_DEBUG - -/* - \internal -*/ -void HbMeshLayoutPrivate::updateAnchorsAndItems() -{ - Q_Q(HbMeshLayout); - resolveAnchors( &mAnchors ); - -#ifdef HBMESHLAYOUT_DEBUG - QGraphicsWidget* w = HbLayoutUtils::parentWidget( q ); - if ( w ) { - qDebug() << "MeshLayout: Mesh anchors for" << w->metaObject()->className(); - } - const QString parentId = - mMeshMap.contains(q) ? mMeshMap.value(q) : QString(); - qDebug() << "-- count: " << mAnchors.size() << ", parent: " << parentId; - foreach (const HbAnchor *item, mAnchors) { - const QString itemTemplate("-- (%1, %2) - (%3, %4) = %5"); - qDebug() << - itemTemplate - .arg(mMeshMap.value(item->mStartItem)) - .arg(edgeAsText(item->mStartEdge)) - .arg(mMeshMap.value(item->mEndItem)) - .arg(edgeAsText(item->mEndEdge)) - .arg(item->mValue).toAscii().data(); - } - qDebug() << "-- "; -#endif // HBMESHLAYOUT_DEBUG - - // HbMeshLayout will only touch items that have anchors defined. - mActualItems.clear(); - for (QList::const_iterator it = mAnchors.constBegin(); - it != mAnchors.constEnd(); - ++it) { - - const HbAnchor* item = *it; - - if (item->mStartItem != q && !mActualItems.contains(item->mStartItem)) { - mActualItems.append(item->mStartItem); - } - if (item->mEndItem != q && !mActualItems.contains(item->mEndItem)) { - mActualItems.append(item->mEndItem); - } - } - -} - - -void HbMeshLayoutPrivate::setSizeProp( SizeProperty *v, QGraphicsLayoutItem *item, EdgeType type ) -{ - if( type == Vertical ) { - const QSizePolicy::Policy verticalPolicy = item->sizePolicy().verticalPolicy(); - - if ( verticalPolicy & QSizePolicy::ShrinkFlag ) { - v->min = item->minimumHeight(); - } else { - v->min = item->preferredHeight(); - } - - if ( verticalPolicy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag) ) { - v->max = item->maximumHeight(); - } else { - v->max = item->preferredHeight(); - } - - v->pref = qBound( v->min, item->preferredHeight(), v->max ); - - v->flags |= (v->min == v->max) ? SizeProperty::FlagFixed : 0; - v->flags |= (verticalPolicy & QSizePolicy::ExpandFlag) ? SizeProperty::FlagExpanding : 0; - - if( verticalPolicy & QSizePolicy::IgnoreFlag ) { - v->pref = v->min; - v->flags |= SizeProperty::FlagExpanding; - } - } else { - const QSizePolicy::Policy horizontalPolicy = item->sizePolicy().horizontalPolicy(); - - if ( horizontalPolicy & QSizePolicy::ShrinkFlag ) { - v->min = item->minimumWidth(); - } else { - v->min = item->preferredWidth(); - } - - if ( horizontalPolicy & (QSizePolicy::GrowFlag | QSizePolicy::ExpandFlag) ) { - v->max = item->maximumWidth(); - } else { - v->max = item->preferredWidth(); - } - - v->pref = qBound( v->min, item->preferredWidth(), v->max ); - - v->flags |= (v->min == v->max) ? SizeProperty::FlagFixed : 0; - v->flags |= (horizontalPolicy & QSizePolicy::ExpandFlag) ? SizeProperty::FlagExpanding : 0; - - if( horizontalPolicy & QSizePolicy::IgnoreFlag ) { - v->pref = v->min; - v->flags |= SizeProperty::FlagExpanding; - } - } -} - - -GraphVertex *HbMeshLayoutPrivate::createCenterEdge( EdgeType type, QGraphicsLayoutItem *item, Hb::Edge edge ) -{ - GraphVertex *middle; - GraphVertex *start = 0; - GraphVertex *end = 0; - - QList *edges = &mEdgesHorizontal; - QList *vertices = &mVerticesHorizontal; - - if( type == Vertical ) { - if( edge != Hb::CenterVEdge ) { -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBMESHLAYOUT_DEBUG - return 0; - } - - edges = &mEdgesVertical; - vertices = &mVerticesVertical; - - for( int j = 0; j < vertices->size(); j++ ) { - GraphVertex *current = vertices->at(j); - if( current->itemRef == item ) { - if( current->itemSide == Hb::TopEdge ) { - start = current; - } else if( current->itemSide == Hb::BottomEdge ) { - end = current; - } - } - } - } else { - if( edge != Hb::CenterHEdge ) { -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBMESHLAYOUT_DEBUG - return 0; - } - - for( int j = 0; j < vertices->size(); j++ ) { - GraphVertex *current = vertices->at(j); - if( current->itemRef == item ) { - if( current->itemSide == Hb::LeftEdge ) { - start = current; - } else if( current->itemSide == Hb::RightEdge ) { - end = current; - } - } - } - } - - if( !( start && end ) ) { -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBMESHLAYOUT_DEBUG - return 0; - } - - GraphEdge *oldEdge = 0; - - for( int i = 0; i < edges->size(); i++ ) { - oldEdge = edges->at(i); - if( oldEdge->ref == item ) { - if( ( oldEdge->startVertex == start ) && ( oldEdge->endVertex == end ) ){ -/* edges->removeOne( oldEdge ); - start->edges.removeOne( oldEdge ); - end->edges.removeOne( oldEdge );*/ - break; - } - } - } - - if( !oldEdge ) { -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "something wrong " << __LINE__; -#endif //HBMESHLAYOUT_DEBUG - return 0; - } - - middle = new GraphVertex(); - middle->itemRef = ( void* )item; - middle->itemSide = edge; - middle->special = false; - - GraphEdge *newEdge1 = new GraphEdge(); - GraphEdge *newEdge2 = new GraphEdge(); - - newEdge1->startVertex = start; - newEdge1->endVertex = middle; - newEdge1->ref = ( void* )item; - - newEdge1->expr->plusExpression( oldEdge->expr ); - newEdge1->expr->multiply( 0.5 ); - - - newEdge2->startVertex = middle; - newEdge2->endVertex = end; - newEdge2->ref = ( void* )item; - newEdge2->expr->plusExpression( oldEdge->expr ); - newEdge2->expr->multiply( 0.5 ); - - - middle->edges.append( newEdge1 ); - start->edges.append( newEdge1 ); - middle->edges.append( newEdge2 ); - end->edges.append( newEdge2 ); - - edges->append( newEdge1 ); - edges->append( newEdge2 ); - vertices->append( middle ); - - - return middle; -} - -void HbMeshLayoutPrivate::defineNextGeometry( const int itemIndexStart, const int itemIndexEnd, const int anchorIndex, const int definedItemIndex ) -{ - ItemGeometry *knownItemGeom, *unKnownItemGeom; - Hb::Edge knownEdge, unKnownEdge; - int sign; - qreal itemSize; - bool isHorizontal; - HbAnchor *anchor = mAnchors.at( anchorIndex ); - qreal leftPoint(0), rightPoint(0), sourcePoint(0), dstPointLeft(0); - - mAnchorsVisited[ anchorIndex ] = true; - - if( edgeType( anchor->mStartEdge ) == Horizontal ) { - isHorizontal = true; - } else { - isHorizontal = false; - } - - if( itemIndexEnd != definedItemIndex ) { - knownEdge = anchor->mStartEdge; - unKnownEdge = anchor->mEndEdge; - - knownItemGeom = &mItemsGeometry[itemIndexStart]; - unKnownItemGeom = &mItemsGeometry[itemIndexEnd]; - - if( isHorizontal ) { - mGeometryDefinedH[itemIndexEnd] = true; - itemSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( mActualItems.at(itemIndexEnd) ) ); - } else { - mGeometryDefinedV[itemIndexEnd] = true; - itemSize = mSolutionVertical.value( mVariablesVertical.findVariable( mActualItems.at(itemIndexEnd) ) ); - } - - sign = 1; - } else { - knownEdge = anchor->mEndEdge; - unKnownEdge = anchor->mStartEdge; - - knownItemGeom = &mItemsGeometry[itemIndexEnd]; - unKnownItemGeom = &mItemsGeometry[itemIndexStart]; - - if( isHorizontal ) { - mGeometryDefinedH[itemIndexStart] = true; - itemSize = mSolutionHorizontal.value( mVariablesHorizontal.findVariable( mActualItems.at(itemIndexStart) ) ); - } else { - mGeometryDefinedV[itemIndexStart] = true; - itemSize = mSolutionVertical.value( mVariablesVertical.findVariable( mActualItems.at(itemIndexStart) ) ); - } - - sign = -1; - } - - if( isHorizontal ) { - leftPoint = knownItemGeom->x1; - rightPoint = knownItemGeom->x2; - } else { - leftPoint = knownItemGeom->y1; - rightPoint = knownItemGeom->y2; - } - - switch( knownEdge ) { - case Hb::LeftEdge: - case Hb::TopEdge: - { - sourcePoint = leftPoint; - break; - } - case Hb::CenterHEdge: - case Hb::CenterVEdge: - { - sourcePoint = ( leftPoint + rightPoint ) / 2; - break; - } - case Hb::RightEdge: - case Hb::BottomEdge: - { - sourcePoint = rightPoint; - break; - } - } - - switch( unKnownEdge ) { - case Hb::LeftEdge: - case Hb::TopEdge: - { - dstPointLeft = sourcePoint + sign * anchor->mValue; - break; - } - case Hb::CenterHEdge: - case Hb::CenterVEdge: - { - dstPointLeft = sourcePoint + sign * anchor->mValue - itemSize / 2; - break; - } - case Hb::RightEdge: - case Hb::BottomEdge: - { - dstPointLeft = sourcePoint + sign * anchor->mValue - itemSize; - break; - } - } - - - - if( isHorizontal ) { - unKnownItemGeom->x1 = dstPointLeft; - unKnownItemGeom->x2 = dstPointLeft + itemSize; - } else { - unKnownItemGeom->y1 = dstPointLeft; - unKnownItemGeom->y2 = dstPointLeft + itemSize; - } - -} - - -/* - \internal -*/ -void HbMeshLayoutPrivate::setItemGeometries() -{ - Q_Q(HbMeshLayout); - const QRectF newRect = q->geometry(); - - if( mWrongAnchors || ( mActualItems.isEmpty() ) ) { - return; - } - - - if( (newRect != mUsedRect) || mInvalidateCalled ) { - - mInvalidateCalled = false; - mUsedRect = newRect; - - if ( mEquationsDirty ) { - updateAnchorsAndItems(); - createEquations( Horizontal ); - createEquations( Vertical ); - mEquationsDirty = false; - } - - - mValid = true; - - { - - QList *el = &mEquationsHorizontal; - VariableSet *vs = &mVariablesHorizontal; - Solution *solution = &mSolutionHorizontal; - solution->clear(); - - - solution->insert( mLayoutVarH, newRect.width() ); -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "LayoutH Id = " << mLayoutVarH->mId; -#endif // HBMESHLAYOUT_DEBUG - mValid = AnchorLayoutEngine::instance()->solveEquation( el, vs, solution ); - if( !mValid ) { - return; - } - -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "solution->size() = " << solution->size(); - - if( solution->size() > 0 ) { - QHashIterator i(*solution); - while (i.hasNext()) { - i.next(); - qDebug() << ( ( Variable* )( i.key() ) )->mId << ": " << i.value(); - } - } -#endif //HBMESHLAYOUT_DEBUG - } - - { - QList *el = &mEquationsVertical; - VariableSet *vs = &mVariablesVertical; - Solution *solution = &mSolutionVertical; - solution->clear(); - - - - solution->insert( mLayoutVarV, newRect.height() ); -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "LayoutV Id = " << mLayoutVarV->mId; -#endif //HBMESHLAYOUT_DEBUG - - mValid = AnchorLayoutEngine::instance()->solveEquation( el, vs, solution ); - if( !mValid ) { - return; - } -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "solution->size() = " << solution->size(); - - - if( solution->size() > 0 ) { - QHashIterator i(*solution); - while (i.hasNext()) { - i.next(); - qDebug() << ( ( Variable* )( i.key() ) )->mId << ": " << i.value(); - } - } -#endif //HBMESHLAYOUT_DEBUG - } - - { - for( int i = 0; i < mAnchorsVisited.size(); i++ ) { - mAnchorsVisited[i] = false; - } - - for( int i = 0; i < mGeometryDefinedH.size(); i++ ) { - mGeometryDefinedH[i] = false; - mGeometryDefinedV[i] = false; - } - - int layoutIndex = mActualItems.size(); - - mItemsGeometry[ layoutIndex ].x1 = 0;//newRect.left(); - mItemsGeometry[ layoutIndex ].x2 = newRect.width();//newRect.right(); - mItemsGeometry[ layoutIndex ].y1 = 0;//newRect.top(); - mItemsGeometry[ layoutIndex ].y2 = newRect.height();//newRect.bottom(); - mGeometryDefinedH[ layoutIndex ] = true; - mGeometryDefinedV[ layoutIndex ] = true; - - - for( int i = 0; i < mAnchorsVisited.size(); i++ ) { - - HbAnchor *anchor = mAnchors.at(i); - - - if( ( anchor->mStartItem != q ) && ( anchor->mEndItem != q ) ) { - continue; - } - - int startIndex = mActualItems.indexOf( anchor->mStartItem ); // returns -1 if not found => this is layout - int endIndex = mActualItems.indexOf( anchor->mEndItem ); - - mAnchorsVisited[i] = true; // Temporary overkill, if both anchors connected to layout. Must be restricted on setAnchor() level - - if( edgeType( anchor->mStartEdge ) == Horizontal ) { - if( startIndex > -1 ) { - if( ! mGeometryDefinedH.at( startIndex ) ) { - defineNextGeometry( startIndex, layoutIndex, i, layoutIndex ); - } - } else if( endIndex > -1 ) { - if( ! mGeometryDefinedH.at( endIndex ) ) { - defineNextGeometry( layoutIndex, endIndex, i, layoutIndex ); - } - } - } else { - if( startIndex > -1 ) { - if( ! mGeometryDefinedV.at( startIndex ) ) { - defineNextGeometry( startIndex, layoutIndex, i, layoutIndex ); - } - } else if( endIndex > -1 ) { - if( ! mGeometryDefinedV.at( endIndex ) ) { - defineNextGeometry( layoutIndex, endIndex, i, layoutIndex ); - } - } - } - } - - - - bool somethingHappens = true; - bool startDefined, endDefined; - int startIndex, endIndex; - while( somethingHappens ) { - somethingHappens = false; - for( int i = 0; i < mAnchorsVisited.size(); i++ ) { - - if( mAnchorsVisited.at(i) ) { - continue; - } - HbAnchor *anchor = mAnchors.at(i); - - startIndex = mActualItems.indexOf( anchor->mStartItem ); - endIndex = mActualItems.indexOf( anchor->mEndItem ); -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "startIndex:" << startIndex << " endIndex" << endIndex; -#endif //HBMESHLAYOUT_DEBUG - if( edgeType( anchor->mStartEdge ) == Horizontal ) { - startDefined = mGeometryDefinedH.at( startIndex ); - endDefined = mGeometryDefinedH.at( endIndex ); - } else { - startDefined = mGeometryDefinedV.at( startIndex ); - endDefined = mGeometryDefinedV.at( endIndex ); - } - - if( startDefined && ( !endDefined ) ) { - defineNextGeometry( startIndex, endIndex, i, startIndex ); - somethingHappens = true; - } else if( ( !startDefined ) && endDefined ) { - defineNextGeometry( startIndex, endIndex, i, endIndex ); - somethingHappens = true; - } - } - } - -#ifdef HBMESHLAYOUT_DEBUG - QGraphicsWidget* w = HbLayoutUtils::parentWidget( q ); - if ( w ) { - qDebug() << "Items of " << w->metaObject()->className(); - } -#endif - - - Qt::LayoutDirection layoutDir = HbLayoutUtils::visualDirection(q); - for( int i = 0; i < mActualItems.size(); i++ ) { - QRectF geom; - ItemGeometry calcGeom = mItemsGeometry.at(i); - if( mGeometryDefinedH.at(i) ) { - geom.setLeft( mUsedRect.left() + calcGeom.x1 ); - geom.setRight( mUsedRect.left() + calcGeom.x2 ); - } else { - geom.setLeft( mUsedRect.left() ); - geom.setRight( mUsedRect.left() + mActualItems.at(i)->preferredWidth() ); - } - if( mGeometryDefinedV.at(i) ) { - geom.setTop( mUsedRect.top() + calcGeom.y1 ); - geom.setBottom( mUsedRect.top() + calcGeom.y2 ); - } else { - geom.setTop( mUsedRect.top() ); - geom.setBottom( mUsedRect.top() + mActualItems.at(i)->preferredHeight() ); - } - - HbLayoutUtils::visualRect( layoutDir, geom, newRect ); - -#ifdef HBMESHLAYOUT_DEBUG - qDebug( "Item %d: (%lf, %lf) : (%lf %lf)", i, calcGeom.x1, calcGeom.y1, calcGeom.x2, calcGeom.y2 ); - // qDebug() << "Item " << i << "(" << ((QGraphicsWidget*)mActualItems.at(i))->metaObject()->className() << ")" << " geom " << geom; -#endif // HBMESHLAYOUT_DEBUG - mActualItems.at(i)->setGeometry( geom ); - } - } - } -} - -/*! - \internal -*/ -void HbMeshLayoutPrivate::createEquations( EdgeType type ) -{ - Q_Q(HbMeshLayout); - - { - - VariableSet *vs = &mVariablesHorizontal; - QList *el = &mEquationsHorizontal; - - QList *edges = &mEdgesHorizontal; - QList *vertices = &mVerticesHorizontal; - - Variable *layoutVar; - - if( type == Vertical ) { - edges = &mEdgesVertical; - vertices = &mVerticesVertical; - vs = &mVariablesVertical; - el = &mEquationsVertical; - } - - qDeleteAll( *el ); - - vs->clear(); - el->clear(); - - - GraphVertex *layoutStart = new GraphVertex(); - GraphVertex *layoutMiddle = new GraphVertex(); - GraphVertex *layoutEnd = new GraphVertex(); - - GraphVertex *itemStart; - GraphVertex *itemEnd; - - GraphEdge *newEdge; - - SimpleExpression se; - - vertices->append( layoutStart ); - vertices->append( layoutMiddle ); - vertices->append( layoutEnd ); - - layoutStart->itemRef = ( void* )q; - layoutMiddle->itemRef = ( void* )q; - layoutEnd->itemRef = ( void* )q; - - layoutStart->special = true; - layoutMiddle->special = true; - layoutEnd->special = true; - - if( type == Vertical ) { - layoutStart->itemSide = Hb::TopEdge; - layoutMiddle->itemSide = Hb::CenterVEdge; - layoutEnd->itemSide = Hb::BottomEdge; - } else { - layoutStart->itemSide = Hb::LeftEdge; - layoutMiddle->itemSide = Hb::CenterHEdge; - layoutEnd->itemSide = Hb::RightEdge; - } - - - for ( int i = 0; i < mActualItems.count(); i++ ) { - QGraphicsLayoutItem *item = mActualItems.at( i ); - itemStart = new GraphVertex(); - itemEnd = new GraphVertex(); - newEdge = new GraphEdge(); - - se.mVar = vs->createVariable(item); - se.mCoef = 1; - - newEdge->expr->plusSimpleExpression( se ); - - edges->append( newEdge ); - vertices->append( itemStart ); - vertices->append( itemEnd ); - - newEdge->startVertex = itemStart; - newEdge->endVertex = itemEnd; - newEdge->ref = ( void* )item; - - setSizeProp( &(se.mVar->sizeProp), item, type ); - - itemStart->itemRef = ( void* )item; - itemEnd->itemRef = ( void* )item; - - itemStart->edges.append( newEdge ); - itemEnd->edges.append( newEdge ); - - itemStart->special = false; - itemEnd->special = false; - - if( type == Vertical ) { - itemStart->itemSide = Hb::TopEdge; - itemEnd->itemSide = Hb::BottomEdge; - } else { - itemStart->itemSide = Hb::LeftEdge; - itemEnd->itemSide = Hb::RightEdge; - } - } - - - // pseudo variable - Variable *v1 = vs->createVariable(0); - v1->sizeProp.pref = 1; - v1->sizeProp.flags = SizeProperty::FlagFixed; - - - for( int i = 0; i < mAnchors.count(); i++) { - HbAnchor* anchor = mAnchors.at(i); - if ( edgeType( anchor->mStartEdge ) == type ) { - itemStart = 0; - itemEnd = 0; - for( int j = 0; j < vertices->size(); j++ ) { - if( ( vertices->at(j)->itemRef == anchor->mStartItem ) && ( vertices->at(j)->itemSide == anchor->mStartEdge ) ) { - itemStart = vertices->at(j); - } else if( ( vertices->at(j)->itemRef == anchor->mEndItem ) && ( vertices->at(j)->itemSide == anchor->mEndEdge ) ) { - itemEnd = vertices->at(j); - } - } - - if( !itemStart ) { - itemStart = createCenterEdge( type, anchor->mStartItem, anchor->mStartEdge ); - } - if( !itemEnd ) { - itemEnd = createCenterEdge( type, anchor->mEndItem, anchor->mEndEdge ); - } - - newEdge = new GraphEdge(); - itemStart->edges.append( newEdge ); - itemEnd->edges.append( newEdge ); - - newEdge->startVertex = itemStart; - newEdge->endVertex = itemEnd; - se.mVar = v1; - se.mCoef = anchor->mValue; - newEdge->expr->plusSimpleExpression( se ); - edges->append( newEdge ); - } - } - - if( layoutStart->edges.isEmpty() ) { - vertices->removeOne( layoutStart ); - delete layoutStart; - layoutStart = 0; - } - if( layoutMiddle->edges.isEmpty() ) { - vertices->removeOne( layoutMiddle ); - delete layoutMiddle; - layoutMiddle = 0; - } - if( layoutEnd->edges.isEmpty() ) { - vertices->removeOne( layoutEnd ); - delete layoutEnd; - layoutEnd = 0; - } - -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "Before"; - qDebug() << "Vertices:"; - for( int i = 0; i < vertices->size(); i++ ) { - qDebug() << i << ": " << vertices->at(i) << " itemRef: " << vertices->at(i)->itemRef << " special: " << vertices->at(i)->special; - for( int j = 0; j < vertices->at(i)->edges.size(); j++ ) { - qDebug() << " " << j << "- start: " << vertices->at(i)->edges.at(j)->startVertex << - " end: " << vertices->at(i)->edges.at(j)->endVertex << " expr: " << vertices->at(i)->edges.at(j)->expr->print(); - } - } - - - qDebug() << ""; - qDebug() << "Edges:"; - for( int j = 0; j < edges->size(); j++ ) { - qDebug() << " " << j << "- start: " << edges->at(j)->startVertex << - " end: " << edges->at(j)->endVertex << " expr: " << edges->at(j)->expr->print(); - - } -#endif // HBMESHLAYOUT_DEBUG - - if( ! AnchorLayoutEngine::instance()->processItems( edges, vertices, vs, el ) ) { - mWrongAnchors = true; - AnchorLayoutEngine::instance()->cleanUp( layoutStart, layoutMiddle, layoutEnd, edges, vertices, el ); -#ifdef HBMESHLAYOUT_DEBUG - qDebug() << "FAIL! " << __LINE__; -#endif //HBMESHLAYOUT_DEBUG - return; - } - -#ifdef HBMESHLAYOUT_DEBUG - - qDebug() << "After"; - qDebug() << "Vertices:"; - for( int i = 0; i < vertices->size(); i++ ) { - qDebug() << i << ": " << vertices->at(i) << " itemRef: " << vertices->at(i)->itemRef << " special: " << vertices->at(i)->special; - for( int j = 0; j < vertices->at(i)->edges.size(); j++ ) { - qDebug() << " " << j << "- start: " << vertices->at(i)->edges.at(j)->startVertex << - " end: " << vertices->at(i)->edges.at(j)->endVertex << " var: " << vertices->at(i)->edges.at(j)->expr->print(); - } - } - - - qDebug() << ""; - qDebug() << "Edges:"; - for( int j = 0; j < edges->size(); j++ ) { - qDebug() << " " << j << "- start: " << edges->at(j)->startVertex << - " end: " << edges->at(j)->endVertex << " var: " << edges->at(j)->expr->print(); - } -#endif //HBMESHLAYOUT_DEBUG - - layoutVar = vs->createVariable( q ); - layoutVar->sizeProp.min = 0; - layoutVar->sizeProp.max = 1000; - layoutVar->sizeProp.pref = 100; - layoutVar->sizeProp.flags = 0; - - AnchorLayoutEngine::instance()->attachToLayout( layoutStart, layoutMiddle, layoutEnd, layoutVar, el ); - AnchorLayoutEngine::instance()->cleanUp( layoutStart, layoutMiddle, layoutEnd, edges, vertices, el ); - - - mAnchorsVisited.resize( mAnchors.size() * sizeof( bool ) ); - mGeometryDefinedH.resize( ( mActualItems.size() + 1 ) * sizeof( bool ) ); - mGeometryDefinedV.resize( ( mActualItems.size() + 1 ) * sizeof( bool ) ); - mItemsGeometry.resize( ( mActualItems.size() + 1 ) * sizeof( ItemGeometry ) ); - - if( type == Vertical ) { - mLayoutVarV = layoutVar; - } else { - mLayoutVarH = layoutVar; - } - } -} - -/* - Creates inverse mapping, i.e. from id -> layout item. -*/ -static HbMeshItemMapInverse createInverse( - const HbMeshItemMap &map) -{ - HbMeshItemMapInverse result; - - HbMeshItemMapConstIterator end = map.constEnd(); - for (HbMeshItemMapConstIterator it = map.constBegin(); it != end; ++it) { - result.insert(it.value(), it.key()); - } - - return result; -} - -/* - Checks if anchor has spacing value defined. It will be returned in \a spacing - if it's not NULL. -*/ -bool HbMeshLayoutPrivate::hasAnchorSpacing( - const HbMeshAnchor &anchor, - qreal *spacing) const -{ - if (spacing) { - - HbMeshKey key; - key.mId = anchor.mStartId; - key.mEdge = anchor.mStartEdge; - - QMap::const_iterator spacingIt = - mMeshSpacings.constFind(key); - - bool hasSpacing = true; - if (spacingIt != mMeshSpacings.constEnd()) { - *spacing = spacingIt.value(); - } else if (anchor.mHasSpacing) { - *spacing = anchor.mSpacing; - } else { - hasSpacing = false; - } - return hasSpacing; - - } else { - if (anchor.mHasSpacing) { - return true; - } - - HbMeshKey key; - key.mId = anchor.mStartId; - key.mEdge = anchor.mStartEdge; - return mMeshSpacings.contains(key); - } -} - -/* - Finds new end item for problematic anchor. - - Follows the anchor that have the same start edge - as the problematic anchor. - - Invariant: - \a ids must be the exactly same in return. It is the array - which nodes have already been visited - so in order to avoid - infinite recursion, don't visit already visited. -*/ -bool HbMeshLayoutPrivate::findEndItem( - HbMeshEndItemResult &result, - const HbMeshAnchor &problem, - const HbMeshItemMapInverse &inverse, - QStringList &ids) const -{ - - for (QList::const_iterator it = mMeshAnchors.constBegin(); - it != mMeshAnchors.constEnd(); - ++it) { - - const HbMeshAnchor ¤tItem = *it; - - if (currentItem.mStartId == problem.mEndId && - currentItem.mStartEdge == problem.mStartEdge && - !ids.contains(currentItem.mStartId)) { - - qreal currentSpacing(0.0); - - if (hasAnchorSpacing(currentItem, ¤tSpacing)) { - QGraphicsLayoutItem *item = inverse.value(currentItem.mEndId); - bool found = false; - - if (item) { - found = true; - result.mEdge = currentItem.mEndEdge; - result.mItem = item; - result.mSpacing = currentSpacing; - } else { - ids.append(currentItem.mStartId); - found = findEndItem(result, currentItem, inverse, ids); - ids.takeLast(); - } - if (found) { - // We have found an end item. There can be multiple end items, - // but (for now) the first one is selected. - return true; - } - } - } - } - - return false; -} - -/* - Resolves anchors to be used in anchor layout calculations. - - For each anchor x with start id, start edge, end id, end edge: - - If anchor x does not have spacing defined, anchor is ignored. - Note that you can define spacing either in anchor or spacing overrides. - - If there is layout items corresponding to both start id and end id, - anchor is used automatically. - If there is layout item corresponding to start id, then we try to - "fix" anchor by looking for a path of anchors (same direction, with spacing defined) - from anchor x's end id as starting point to such end id that has layout item. - If found, anchor is fixed by replacing end id with found end id. - - So direction of anchors affect this resolution process, but not in the - anchor layout calculations. - - \sa findEndItem -*/ -void HbMeshLayoutPrivate::resolveAnchors( QList *anchors ) -{ - HbMeshItemMapInverse map = createInverse(mMeshMap); - - int count = 0; - HbAnchor *item; - - bool isAnchorNew = false; - - for (QList::const_iterator it = mMeshAnchors.constBegin(); - it != mMeshAnchors.constEnd(); - ++it) { - - const HbMeshAnchor &anchor = *it; - - QGraphicsLayoutItem *startItem = map.value(anchor.mStartId); - - if (startItem) { - qreal value; - - if (hasAnchorSpacing(anchor, &value)) { - // anchor really exists - - if( count > anchors->size() - 1 ) { - isAnchorNew = true; - } - - if( isAnchorNew ) { - item = new HbAnchor(startItem, anchor.mStartEdge, 0 /*end item*/, anchor.mEndEdge, value); - } else { - item = anchors->at( count ); - item->mStartItem = startItem; - item->mStartEdge = anchor.mStartEdge; - item->mEndItem = 0; - item->mEndEdge = anchor.mEndEdge; - item->mValue = value; - } - - QGraphicsLayoutItem *endItem = map.value(anchor.mEndId); - if (endItem) { - // this is already valid anchor - - item->mEndItem = endItem; - if( isAnchorNew ) { - anchors->append(item); - } - count++; - } else { - // try to "fix" anchor - - HbMeshEndItemResult result; - result.mItem = 0; - result.mEdge = Hb::LeftEdge; - result.mSpacing = 0; - - QStringList ids; - ids.append(anchor.mStartId); - - if (findEndItem(result, anchor, map, ids)) { - item->mEndEdge = result.mEdge; - item->mEndItem = result.mItem; - item->mValue = result.mSpacing; - if( isAnchorNew ) { - anchors->append(item); - } - count++; - } - } - } - - } else { - // Nothing needed. - } - } - - while( count < anchors->size() ) { - delete anchors->last(); - anchors->removeLast(); - } -} - -bool HbMeshLayoutPrivate::setAnchor(const HbMeshAnchor& anchor) -{ - // This method is called from HbMeshLayout::setAnchor. - - if (HbMeshLayoutPrivate::edgeType(anchor.mStartEdge) != - HbMeshLayoutPrivate::edgeType(anchor.mEndEdge)) { - qWarning() << "HbMeshLayout::setAnchor : You can't connect different type of edges"; - return false; - } - - if (anchor.mStartId.isNull() || - anchor.mEndId.isNull()) { - qWarning() << "HbMeshLayout::setAnchor : Both ids must be valid"; - return false; - } - - if ((anchor.mStartId == anchor.mEndId) && - (anchor.mStartEdge == anchor.mEndEdge)) { - qWarning() << "HbMeshLayout::setAnchor : You cannot set anchor between the same edge"; - return false; - } - - bool modified = false; - - const int count = mMeshAnchors.size(); - for (int i = 0; i < count; ++i) { - HbMeshAnchor& item = mMeshAnchors[i]; - if (item.mStartId == anchor.mStartId && - item.mStartEdge == anchor.mStartEdge) { -#ifdef HBMESHLAYOUT_DEBUG - if (item.mEndId != anchor.mEndId || - item.mEndEdge != anchor.mEndEdge) { - qDebug() << "MeshLayout: Replacing existing anchor!" - << "Check your layout definition whether this is really intentional." - << "There can be only one anchor starting from one edge."; - } -#endif - modified = true; - - // Only one anchor starting from single (startId, startEdge). - item = anchor; - break; - } - } - - if (!modified) { - mMeshAnchors.append(anchor); - } - - return true; -} - -int HbMeshLayoutPrivate::actualItemsIndexOf(QGraphicsLayoutItem *item) const -{ - for (int i=0; i < mActualItems.count(); i++) { - if (mActualItems.at(i) == item) { - return i; - } - } - return -1; -} - -/*! - Constructor. -*/ -HbMeshLayout::HbMeshLayout(QGraphicsLayoutItem *parent) -: QGraphicsLayout( parent), d_ptr( new HbMeshLayoutPrivate ) -{ - Q_D( HbMeshLayout ); - d->q_ptr = this; -} - -/*! - Destructor. -*/ -HbMeshLayout::~HbMeshLayout() -{ - if (d_ptr) { - for (int i = count() - 1; i >= 0; --i) { - QGraphicsLayoutItem *item = itemAt(i); - // The following lines can be removed, but this removes the item - // from the layout more efficiently than the implementation of - // ~QGraphicsLayoutItem. - removeAt(i); - if (item) { - item->setParentLayoutItem(0); - if (item->ownedByLayout()) { - delete item; - } - } - } - } - - delete d_ptr; -} - -/*! - Sets anchor between (startId, startEdge) to (endId, endEdge). Optionally, you can provide - spacing in \a defaultSpacing parameter. Note that you cannot have more than one anchor from - (id, edge) pair. So, \c startId shouldn't represent this layout item. - - Note that previously define spacing override is still used as defined for - (\a startId, \a startEdge). - - \param startId start id. - \param startEdge start edge. - \param endId end id. - \param endEdge end edge. - \param spacing spacing value for all edges starting from (\a startId, \a startEdge). - \return true if success, false otherwise. -*/ -bool HbMeshLayout::setAnchor(const QString& startId, Edge startEdge, const QString& endId, Edge endEdge, qreal spacing) -{ - Q_D( HbMeshLayout ); - - HbMeshAnchor anchor; - anchor.mStartId = startId; - anchor.mStartEdge = startEdge; - anchor.mEndId = endId; - anchor.mEndEdge = endEdge; - anchor.mHasSpacing = true; - anchor.mSpacing = spacing; - - if (d->setAnchor(anchor)) { - invalidate(); - return true; - } - return false; -} - -bool HbMeshLayout::setAnchor(const QString& startId, Edge startEdge, const QString& endId, Edge endEdge) -{ - Q_D( HbMeshLayout ); - - HbMeshAnchor anchor; - anchor.mStartId = startId; - anchor.mStartEdge = startEdge; - anchor.mEndId = endId; - anchor.mEndEdge = endEdge; - anchor.mHasSpacing = false; - anchor.mSpacing = 0; - - if (d->setAnchor(anchor)) { - invalidate(); - return true; - } - return false; -} - -/*! - Removes anchor starting from (\a startId, \a startEdge). As you cannot have more - than one anchor starting from a (id, edge) pair, provided (\a startId, \a startEdge) - pair uniquely defines anchor to be removed. - - Note that this does not affect on spacing override. - - \param startId id. - \param startEdge edge. - \param spacing spacing value for all edges starting from (\a startId, \a startEdge). - \return true if success, false otherwise. -*/ -bool HbMeshLayout::removeAnchor(const QString& startId, Edge startEdge) -{ - Q_D( HbMeshLayout ); - bool modified = false; - - for (int i = d->mMeshAnchors.size() - 1; i >= 0; --i) { - const HbMeshAnchor& anchor = d->mMeshAnchors[i]; - if (anchor.mStartId == startId && anchor.mStartEdge == startEdge) { - d->mMeshAnchors.removeAt(i); - modified = true; - break; - } - } - - if (modified) { - invalidate(); - return true; - } - return false; -} - -/*! - Removes all anchors starting or ending to \a id. - Note that this does not affect on spacing override. - - \param id id to be removed. - \return true if success, false otherwise. -*/ -bool HbMeshLayout::removeAnchors(const QString& id) -{ - Q_D( HbMeshLayout ); - bool modified = false; - - for (int i = d->mMeshAnchors.size() - 1; i >= 0; --i) { - const HbMeshAnchor& anchor = d->mMeshAnchors[i]; - if (anchor.mStartId == id || anchor.mEndId == id) { - d->mMeshAnchors.removeAt(i); - modified = true; - } - } - - if (modified) { - invalidate(); - return true; - } - return false; -} - -/*! - Clears all anchors. - Note that this does not affect on spacing override. -*/ -void HbMeshLayout::clearAnchors() -{ - Q_D( HbMeshLayout ); - if (d->mMeshAnchors.size()) { - d->mMeshAnchors.clear(); - invalidate(); - } -} - -/*! - Overrides spacing for anchor starting from (\a startId, \a startEdge). - \param startId id. - \param startEdge edge. - \param spacing spacing value for anchor starting from (\a startId, \a startEdge). -*/ -void HbMeshLayout::overrideSpacing(const QString& startId, Edge startEdge, qreal spacing) -{ - Q_D( HbMeshLayout ); - - HbMeshKey key; - key.mId = startId; - key.mEdge = startEdge; - - d->mMeshSpacings.insert(key, spacing); // will replace spacing if key already exists - - invalidate(); -} - -/*! - Resets spacing override for anchor starting from (\a startId, \a startEdge). - \param startId id. - \param startEdge edge. -*/ -void HbMeshLayout::resetSpacingOverride(const QString& startId, Edge startEdge) -{ - Q_D( HbMeshLayout ); - HbMeshKey key; - key.mId = startId; - key.mEdge = startEdge; - - if(d->mMeshSpacings.remove(key)) { - invalidate(); - } -} - -/*! - Clears all spacing overrides. -*/ -void HbMeshLayout::clearSpacingOverrides() -{ - Q_D( HbMeshLayout ); - if (d->mMeshSpacings.size()) { - d->mMeshSpacings.clear(); - invalidate(); - } -} - -/*! - Sets identifier for \a item. You can reset this mapping by - passing \c UndefineId as \a id. - \param item layout item. - \param id new id corresponding to \a item. -*/ -void HbMeshLayout::setItemId(QGraphicsLayoutItem *item, const QString& id) -{ - Q_D( HbMeshLayout ); - - bool modified = false; - - if (!id.isNull()) { - - // Remove previous item -> id. - HbMeshItemMapIterator it = d->mMeshMap.begin(); - while (it != d->mMeshMap.end()) { - if (it.value() == id) { - it = d->mMeshMap.erase(it); - } else { - ++it; - } - } - d->addItemIfNeeded(item); - d->mMeshMap.insert(item, id); - modified = true; - } else { - modified = (d->mMeshMap.remove(item) != 0); - } - - if (modified) { - invalidate(); - } -} - -/*! - Clears all item id mappings. -*/ -void HbMeshLayout::clearItemIds() -{ - Q_D( HbMeshLayout ); - d->mMeshMap.clear(); -} - -/*! - Adds \a item. - - \param item item to be added. - \param id id of this item. -*/ -void HbMeshLayoutPrivate::addItemIfNeeded(QGraphicsLayoutItem *item) -{ - Q_Q(HbMeshLayout); - - if (!item) { - //qWarning() << "HbMeshLayout::addItemIfNeeded : item is NULL"; - return; - } - - if (item == q) { - //qWarning() << "HbMeshLayout::addItemIfNeeded : layout cannot be added"; - return; - } - - if (mItems.contains(item)) { - //qWarning() << "HbMeshLayout::addItemIfNeeded : item is already in layout"; - return; - } - - HbLayoutUtils::addChildItem(q, item); - mItems.append(item); -} - -/*! - Removes given \a item. - This is a convenience function. It's equivalent to calling removeAt(indexOf(item)). - - \param item item to be removed. -*/ -void HbMeshLayout::removeItem(QGraphicsLayoutItem *item) -{ - removeAt(indexOf(item)); -} - -/*! - Returns the index of given layout \a item, or -1 if not found. - \param item item to look for. - \return index of item or -1 if not found. -*/ -int HbMeshLayout::indexOf(const QGraphicsLayoutItem* item) const -{ - Q_D( const HbMeshLayout ); - for (int i=0; i < d->mItems.count(); i++) { - if (d->mItems.at(i) == item) { - return i; - } - } - return -1; -} - -/*! - Returns true if anchor layout could be "solved" in the - last setGeometry call. That is, the anchors of the layout do - not create any contradictions in the geometry calculation. - \return true if valid layout, false otherwise. -*/ -bool HbMeshLayout::isValid() const -{ - Q_D( const HbMeshLayout ); - return ( d->mValid && ( ! d->mWrongAnchors ) ); -} - - -QString HbMeshLayout::nodeId( QGraphicsLayoutItem *item ) const -{ - Q_D( const HbMeshLayout ); - if( d->mMeshMap.contains( item ) ) { - return d->mMeshMap.value( item ); - } - return QString(); -} - -QStringList HbMeshLayout::nodeIds() const -{ - Q_D( const HbMeshLayout ); - QStringList list; - int c = d->mMeshAnchors.count(); - while (c--) { - QString id = d->mMeshAnchors.at(c).mStartId; - if (!list.contains(id)) { - list.append(id); - } - id = d->mMeshAnchors.at(c).mEndId; - if (!list.contains(id)) { - list.append(id); - } - } - return list; -} - -QGraphicsLayoutItem *HbMeshLayout::itemById( const QString& id ) const -{ - Q_D( const HbMeshLayout ); - return d->mMeshMap.key( id ); -} - -qreal HbMeshLayout::spacing( const QString& startId, Edge startEdge ) const -{ - Q_D( const HbMeshLayout ); - HbMeshKey key; - key.mId = startId; - key.mEdge = startEdge; - - return d->mMeshSpacings.value( key ); -} - - - -/*! - \reimp -*/ -void HbMeshLayout::removeAt(int index) -{ - Q_D( HbMeshLayout ); - if ( index < 0 || index > d->mItems.count()-1 ) { - return; - } - QGraphicsLayoutItem *item = itemAt( index ); - if ( item ) { - setItemId(item, QString()); - - item->setParentLayoutItem( 0 ); - d->mItems.removeAt(index); - } - - invalidate(); -} - -/*! - \reimp -*/ -void HbMeshLayout::setGeometry(const QRectF &rect) -{ - Q_D( HbMeshLayout ); - QGraphicsLayout::setGeometry(rect); - d->setItemGeometries(); -} - -/*! - \reimp -*/ -int HbMeshLayout::count() const -{ - Q_D( const HbMeshLayout ); - return d->mItems.count(); -} - -/*! - \reimp -*/ -QGraphicsLayoutItem *HbMeshLayout::itemAt(int index) const -{ - Q_D( const HbMeshLayout ); - return d->mItems.value(index); -} - -/*! - \reimp -*/ -void HbMeshLayout::invalidate() -{ - Q_D( HbMeshLayout ); - d->mInvalidateCalled = true; - d->mWrongAnchors = false; - d->mEquationsDirty = true; - QGraphicsLayout::invalidate(); -} - -/*! - \reimp -*/ -void HbMeshLayout::widgetEvent(QEvent *e) -{ - QGraphicsLayout::widgetEvent(e); -} -/*! - \reimp -*/ -QSizeF HbMeshLayout::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const -{ - Q_D( const HbMeshLayout ); - Q_UNUSED( constraint ); - - return const_cast(d)->sizeHint( which ); -} - -QSizeF HbMeshLayoutPrivate::sizeHint(Qt::SizeHint which) -{ - if ( mEquationsDirty ) { - updateAnchorsAndItems(); - createEquations( Horizontal ); - createEquations( Vertical ); - mEquationsDirty = false; - } - - if( mLayoutVarH && mLayoutVarV ) { - - QSizeF res; - - if( mLayoutVarH->sizeProp.flags & SizeProperty::FlagFixed ) { - res.setWidth( mLayoutVarH->sizeProp.pref ); - } else { - if (which == Qt::MinimumSize) { - res.setWidth( mLayoutVarH->sizeProp.min ); - } else if (which == Qt::PreferredSize ) { - res.setWidth( mLayoutVarH->sizeProp.pref ); - } else { - res.setWidth( mLayoutVarH->sizeProp.max ); - } - } - - if( mLayoutVarV->sizeProp.flags & SizeProperty::FlagFixed ) { - res.setHeight( mLayoutVarV->sizeProp.pref ); - } else { - if (which == Qt::MinimumSize) { - res.setHeight( mLayoutVarV->sizeProp.min ); - } else if (which == Qt::PreferredSize ) { - res.setHeight( mLayoutVarV->sizeProp.pref ); - } else { - res.setHeight( mLayoutVarV->sizeProp.max ); - } - } - - return res; - } else { - if (which == Qt::MinimumSize) { - return QSizeF( 0, 0 ); - } else if (which == Qt::PreferredSize ) { - return QSizeF( 100, 100 ); - } else { - return QSizeF( 1000, 1000 ); - } - } -} - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbmeshlayout_p.h --- a/src/hbcore/layouts/hbmeshlayout_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBMESHLAYOUT_H -#define HBMESHLAYOUT_H - -#include - -#include -#include - -class HbMeshLayoutPrivate; -class HbMeshLayoutDebug; - -class HB_AUTOTEST_EXPORT HbMeshLayout : public QGraphicsLayout -{ - friend class HbMeshLayoutDebug; - -public: - typedef Hb::Edge Edge; - -public: - explicit HbMeshLayout(QGraphicsLayoutItem *parent = 0); - virtual ~HbMeshLayout(); - - bool setAnchor(const QString& startId, Edge startEdge, const QString& endId, Edge endEdge, qreal spacing); - bool setAnchor(const QString& startId, Edge startEdge, const QString& endId, Edge endEdge); - bool removeAnchor(const QString& startId, Edge startEdge); - bool removeAnchors(const QString& id); - void clearAnchors(); - - void overrideSpacing(const QString& startId, Edge startEdge, qreal spacing); - void resetSpacingOverride(const QString& startId, Edge startEdge); - void clearSpacingOverrides(); - - void setItemId(QGraphicsLayoutItem *item, const QString& id); - void clearItemIds(); - - QString nodeId( QGraphicsLayoutItem *item ) const; - QStringList nodeIds() const; - QGraphicsLayoutItem *itemById( const QString& id ) const; - - qreal spacing( const QString& startId, Edge startEdge ) const; - - void removeItem(QGraphicsLayoutItem *item); - int indexOf(const QGraphicsLayoutItem *item) const; - - bool isValid() const; - - virtual void removeAt(int index); - virtual void setGeometry(const QRectF &rect); - virtual int count() const; - virtual QGraphicsLayoutItem *itemAt(int index) const; - virtual void invalidate(); - virtual void widgetEvent(QEvent *e); - -protected: - virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; - -protected: - HbMeshLayoutPrivate *const d_ptr; - -private: - Q_DISABLE_COPY(HbMeshLayout) - Q_DECLARE_PRIVATE_D(d_ptr, HbMeshLayout) -}; - -#endif // HBMESHLAYOUT_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbmeshlayoutdebug_p.h --- a/src/hbcore/layouts/hbmeshlayoutdebug_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBMESHLAYOUTDEBUGPRIVATE_H -#define HBMESHLAYOUTDEBUGPRIVATE_H - -#include - -class HbMeshLayout; -class HbAnchor; - -class HB_AUTOTEST_EXPORT HbMeshLayoutDebug -{ -public: - static QList getAnchors( HbMeshLayout* layout ); -}; - -#endif - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbmeshlayoutdoc.cpp --- a/src/hbcore/layouts/hbmeshlayoutdoc.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -/*! - \class HbMeshLayout - \brief HbMeshLayout manages geometries of its child items with anchors that - that connect the layout items with each other. This is different from - \c HbAnchorLayout in such way that this allows layout items to be missing - and can fix anchor attachments. - - Currently, the HbMeshLayout is an internal class which can be only utilized via the - WidgetML within a widget. - - The mesh layout is a bit more fragile than the anchor layout. The anchor definitions - need to support the missing items. Here are some simple rules how the mesh can be - created (the example is only for horizontal direction - the same needs to be done - for portrait as well). - - First, we need to find the child item (=node), which is always present i.e. cannot be missing. - - \image html hbmeshlayout1.png - - From the image above, we have decided that the green node is always present. This - means that all the other nodes in the horizontal graph can be optional. - - \image html hbmeshlayout2.png - - Then, we create the anchors starting from the non-optional node and point towards - the edges of the layout. The mesh layout definition in the WidgetML would look like: - - \code - - - - - - - - \endcode - - As mentioned, the green node needs be present always. In practice, this means that the - parent widget, which owns this mesh layout, needs to have a child widget with item - name "green_item". \c HbStyle::setItemName for more details. - - If an optional node is missing, the anchors pointing to the node are - changed to point to the node after (=towards the parent layout) the missing one - this - is called "fixing the mesh". The fixing only works if the end result can be determined - i.e. two anchor starting from a missing node is prohibited. - - \image html hbmeshlayout3.png - - In the picture above, the blue and yellow items are missing. The mesh is fixed by removing - the anchor definitions starting from the missing nodes. - - \proto - \internal -*/ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbspaceritem_p.cpp --- a/src/hbcore/layouts/hbspaceritem_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbspaceritem_p.h" -#include // QWIDGETSIZE_MAX - -class HbSpacerItemPrivate -{ -}; - -/*! - @proto - @hbcore - \class HbSpacerItem - - \brief HbSpacerItem class is used in layouts to fill the void. - - The spacer itself is invisble and therefore it can be used to fill empty areas in layouts. - - Modifying the size hint and the policy, the spacer and occupy different areas. -*/ - - -/*! - Constructs a spacer. By default, the preferred size is (0,0) and the size policy is (preferred,preferred). -*/ -HbSpacerItem::HbSpacerItem(QGraphicsLayoutItem *parent ) : QGraphicsLayoutItem( parent ), d_ptr(0) -{ -} - -/*! - Destructor -*/ -HbSpacerItem::~HbSpacerItem() -{ - delete d_ptr; -} - -/*! - \reimp - */ -QSizeF HbSpacerItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const -{ - Q_UNUSED( constraint ); - if ( which == Qt::MaximumSize ) { - return QSizeF( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX ); - } - return QSizeF( 0,0 ); -} - -/*! - \reimp - */ -void HbSpacerItem::updateGeometry() -{ - QGraphicsLayoutItem::updateGeometry(); - QGraphicsLayoutItem *parentItem = parentLayoutItem(); - - if (parentItem && parentItem->isLayout()) { - parentItem->updateGeometry(); - } -} - -//end of file - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbspaceritem_p.h --- a/src/hbcore/layouts/hbspaceritem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBSPACERITEM_H -#define HBSPACERITEM_H - -#include -#include - -class HbSpacerItemPrivate; - -class HB_AUTOTEST_EXPORT HbSpacerItem : public QGraphicsLayoutItem -{ -public: - HbSpacerItem(QGraphicsLayoutItem *parent = 0); - ~HbSpacerItem(); - - void updateGeometry(); -protected: - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; -private: - HbSpacerItemPrivate *d_ptr; -}; - -#endif // HBSPACERITEM_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbstackedlayout.cpp --- a/src/hbcore/layouts/hbstackedlayout.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/layouts/hbstackedlayout.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -66,7 +66,7 @@ Constructor. \param parent parent layout item. */ -HbStackedLayout::HbStackedLayout(QGraphicsLayoutItem * parent) +HbStackedLayout::HbStackedLayout(QGraphicsLayoutItem *parent) : QGraphicsLayout(parent), d(new HbStackedLayoutPrivate()) { } @@ -83,7 +83,7 @@ for (int i = count() - 1; i >= 0; --i) { QGraphicsLayoutItem *item = itemAt(i); // The following lines can be removed, but this removes the item - // from the layout more efficiently than the implementation of + // from the layout more efficiently than the implementation of // ~QGraphicsLayoutItem. removeAt(i); if (item) { @@ -94,7 +94,7 @@ } } } - + delete d; } @@ -128,7 +128,7 @@ */ int HbStackedLayout::insertItem(int index, QGraphicsLayoutItem *item) { - if( !item ) { + if (!item) { qWarning("HbStackedLayout::insertItem: item is NULL"); return -1; } @@ -160,7 +160,7 @@ */ void HbStackedLayout::removeItem(QGraphicsLayoutItem *item) { - removeAt( indexOf( item ) ); + removeAt(indexOf(item)); } /*! @@ -170,8 +170,8 @@ int HbStackedLayout::indexOf(QGraphicsLayoutItem *item) const { int c = d->mList.count(); - for ( int i = 0; i < c; i++ ) { - if ( d->mList.at(i) == item ) { + for (int i = 0; i < c; i++) { + if (d->mList.at(i) == item) { return i; } } @@ -200,7 +200,7 @@ */ void HbStackedLayout::removeAt(int index) { - if (index <0 || index >= d->mList.size()) { + if (index < 0 || index >= d->mList.size()) { return; } itemAt(index)->setParentLayoutItem(0); @@ -232,12 +232,12 @@ { if (which == Qt::MaximumSize) { // Sub items do not affect the maximum size hint. - return QSizeF( QWIDGETSIZE_MAX, QWIDGETSIZE_MAX ); + return QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); } QSizeF sizeHint(0, 0); int c = d->mList.count(); - for ( int i=0; i < c; ++i ) { - QGraphicsLayoutItem* item = d->mList.at(i); + for (int i = 0; i < c; ++i) { + QGraphicsLayoutItem *item = d->mList.at(i); QSizeF itemSize(item->effectiveSizeHint(which, constraint)); if (item->sizePolicy().horizontalPolicy() == QSizePolicy::Ignored) { itemSize.setWidth(0); @@ -245,7 +245,7 @@ if (item->sizePolicy().verticalPolicy() == QSizePolicy::Ignored) { itemSize.setHeight(0); } - if ( itemSize.isValid() ) { + if (itemSize.isValid()) { sizeHint = sizeHint.expandedTo(itemSize); } } @@ -265,24 +265,24 @@ QGraphicsLayout::setGeometry(rect); int c = d->mList.count(); - for ( int i=0; i < c; ++i ) { - QGraphicsLayoutItem* item = d->mList.at(i); + for (int i = 0; i < c; ++i) { + QGraphicsLayoutItem *item = d->mList.at(i); QSizeF itemMax = item->effectiveSizeHint(Qt::MaximumSize); QSizeF itemMin = item->effectiveSizeHint(Qt::MinimumSize); QRectF itemRect(rect); // Have to check min and max "manually" in order // to make mirroring work. - if ( itemMax.width() < itemRect.width() ) { - itemRect.setWidth( itemMax.width() ); + if (itemMax.width() < itemRect.width()) { + itemRect.setWidth(itemMax.width()); } - if ( itemMax.height() < itemRect.height() ) { - itemRect.setHeight( itemMax.height() ); + if (itemMax.height() < itemRect.height()) { + itemRect.setHeight(itemMax.height()); } - if ( itemMin.width() > itemRect.width() ) { - itemRect.setWidth( itemMin.width() ); + if (itemMin.width() > itemRect.width()) { + itemRect.setWidth(itemMin.width()); } - if ( itemMin.height() > itemRect.height() ) { - itemRect.setHeight( itemMin.height() ); + if (itemMin.height() > itemRect.height()) { + itemRect.setHeight(itemMin.height()); } alignRect(itemRect, rect); item->setGeometry(itemRect); @@ -292,9 +292,9 @@ /*! \internal */ -void HbStackedLayout::alignRect( QRectF &rect, const QRectF &boundingRect ) +void HbStackedLayout::alignRect(QRectF &rect, const QRectF &boundingRect) { if (HbApplication::layoutDirection() == Qt::RightToLeft) { - rect.moveLeft( 2 * boundingRect.x() + boundingRect.width() - rect.x() - rect.width() ); + rect.moveLeft(2 * boundingRect.x() + boundingRect.width() - rect.x() - rect.width()); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/hbstackedlayout.h --- a/src/hbcore/layouts/hbstackedlayout.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/layouts/hbstackedlayout.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,7 +54,7 @@ virtual QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; private: - void alignRect( QRectF &rect, const QRectF &boundingRect ); + void alignRect(QRectF &rect, const QRectF &boundingRect); private: // Disable copy constructor and assignment operator diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/layouts/layouts.pri --- a/src/hbcore/layouts/layouts.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/layouts/layouts.pri Thu Jul 22 16:36:53 2010 +0100 @@ -28,20 +28,17 @@ INCLUDEPATH += $$PWD DEPENDPATH += $$PWD +PUBLIC_HEADERS += $$PWD/hbanchor.h PUBLIC_HEADERS += $$PWD/hbanchorlayout.h PUBLIC_HEADERS += $$PWD/hbstackedlayout.h PRIVATE_HEADERS += $$PWD/hbanchor_p.h -PRIVATE_HEADERS += $$PWD/hbanchorlayoutdebug_p.h PRIVATE_HEADERS += $$PWD/hbanchorlayoutengine_p.h PRIVATE_HEADERS += $$PWD/hblayoututils_p.h -PRIVATE_HEADERS += $$PWD/hbmeshlayout_p.h -PRIVATE_HEADERS += $$PWD/hbspaceritem_p.h +SOURCES += $$PWD/hbanchor.cpp SOURCES += $$PWD/hbanchorlayout.cpp SOURCES += $$PWD/hbanchorlayoutengine_p.cpp SOURCES += $$PWD/hblayoututils_p.cpp -SOURCES += $$PWD/hbmeshlayout_p.cpp -SOURCES += $$PWD/hbspaceritem_p.cpp SOURCES += $$PWD/hbstackedlayout.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgbceffect.cpp --- a/src/hbcore/ovgeffects/hbvgbceffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgbceffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -63,8 +63,9 @@ void HbVgBcEffect::setBrightness(qreal brightness) { Q_D(HbVgBcEffect); - if (d->brightness == brightness) + if (d->brightness == brightness) { return; + } d->brightness = brightness; updateEffect(); emit brightnessChanged(brightness); @@ -79,8 +80,9 @@ void HbVgBcEffect::setContrast(qreal contrast) { Q_D(HbVgBcEffect); - if (d->contrast == contrast) + if (d->contrast == contrast) { return; + } d->contrast = contrast; updateEffect(); emit contrastChanged(contrast); @@ -92,9 +94,9 @@ } void HbVgBcEffect::performEffect(QPainter *painter, - const QPointF &offset, - const QVariant &vgImage, - const QSize &vgImageSize) + const QPointF &offset, + const QVariant &vgImage, + const QSize &vgImageSize) { #ifdef HB_EFFECTS_OPENVG QPixmap cachedPm = cached(vgImageSize); @@ -112,11 +114,11 @@ // brightness [-1, 1] const VGfloat offset_br = clamp(d->brightness, -1.0f, 1.0f); const VGfloat scale_br = 1.0f - 0.5f * ((offset_br < 0.0f) ? -offset_br : offset_br); - + // contrast [0, N] const VGfloat scale_con = clamp(d->contrast, 0.0f, 100.0f); const VGfloat offset_con = -0.5f * scale_con + 0.5f ; - + // combine the effects of brightness and contrast const VGfloat off = offset_br + offset_con; const VGfloat sc = scale_br * scale_con; @@ -125,7 +127,7 @@ const VGfloat o = (VGfloat) opacity; const VGfloat oOff = off * o; const VGfloat oSc = (sc * o) + (1.0f - o); - + d->colorMatrix[0] = oSc; d->colorMatrix[1] = 0.0f; d->colorMatrix[2] = 0.0f; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgblureffect.cpp --- a/src/hbcore/ovgeffects/hbvgblureffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgblureffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -63,8 +63,9 @@ void HbVgBlurEffect::setRadius(const QPointF &radius) { Q_D(HbVgBlurEffect); - if (d->radius == radius) + if (d->radius == radius) { return; + } d->radius = radius; updateEffectBoundingRect(); emit radiusChanged(radius); @@ -73,9 +74,9 @@ QRectF HbVgBlurEffect::boundingRectFor(const QRectF &rect) const { Q_D(const HbVgBlurEffect); - QSizeF mappedRadius = d->mapSize(QSizeF(d->radius.x(), d->radius.y())); - qreal deltaX = mappedRadius.width(); - qreal deltaY = mappedRadius.height(); + QSizeF mappedRadius = d->mapSize(QSizeF(d->radius.x(), d->radius.y())); + qreal deltaX = mappedRadius.width(); + qreal deltaY = mappedRadius.height(); return rect.adjusted(-deltaX, -deltaY, deltaX, deltaY); } @@ -105,8 +106,9 @@ { #ifdef HB_EFFECTS_OPENVG QPixmap cachedPm = cached(vgImageSize); - if (!cachedPm.isNull()) + if (!cachedPm.isNull()) { return cachedPm; + } Q_D(HbVgBlurEffect); VGImage srcImage = vgImage.value(); @@ -119,14 +121,15 @@ VGImage tmpImage = d->ensurePixmap(&d->tmpPixmap, vgImageSize); vgGaussianBlur(tmpImage, srcImage, blurX, blurY, VG_TILE_PAD); if (d->paramsChanged) { - for (int i = 0; i < 256; ++i) - d->alphaLUT[i] = (VGubyte) (i * opacity); + for (int i = 0; i < 256; ++i) { + d->alphaLUT[i] = (VGubyte)(i * opacity); + } } vgLookup(dstImage, tmpImage, identityLUT, identityLUT, identityLUT, d->alphaLUT, VG_TRUE, VG_FALSE); } else { - vgGaussianBlur(dstImage, srcImage, blurX, blurY, VG_TILE_PAD); + vgGaussianBlur(dstImage, srcImage, blurX, blurY, VG_TILE_PAD); } tryCache(d->dstPixmap); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgblureffect_p.h --- a/src/hbcore/ovgeffects/hbvgblureffect_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgblureffect_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,9 @@ public slots: void setRadius(const QPointF &radius); - inline void setRadius(qreal x, qreal y) { setRadius(QPointF(x, y)); } + inline void setRadius(qreal x, qreal y) { + setRadius(QPointF(x, y)); + } signals: void radiusChanged(const QPointF &radius); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgchainedeffect.cpp --- a/src/hbcore/ovgeffects/hbvgchainedeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgchainedeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -144,23 +144,28 @@ QRectF HbVgChainedEffect::boundingRectFor(const QRectF &rect) const { Q_D(const HbVgChainedEffect); - if (d->effects.empty()) + if (d->effects.empty()) { return rect; + } // find out the bounding rect that covers all the effects QRectF result; - foreach (HbVgEffect *effect, d->effects) { + foreach(HbVgEffect * effect, d->effects) { QRectF br = effect->boundingRectFor(rect); if (result.isNull()) { result = br; } else { - if (br.left() < result.left()) + if (br.left() < result.left()) { result.setLeft(br.left()); - if (br.top() < result.top()) + } + if (br.top() < result.top()) { result.setTop(br.top()); - if (br.right() > result.right()) + } + if (br.right() > result.right()) { result.setRight(br.right()); - if (br.bottom() > result.bottom()) + } + if (br.bottom() > result.bottom()) { result.setBottom(br.bottom()); + } } } return result; @@ -176,7 +181,7 @@ { #ifdef HB_EFFECTS_OPENVG Q_D(HbVgChainedEffect); - foreach (HbVgEffect *effect, d->effects) { + foreach(HbVgEffect * effect, d->effects) { // Set up srcPixmap and others for the individual effects // because the base class does it only for us, not for the // contained ones. @@ -189,8 +194,9 @@ effD->paramsChanged = effD->cacheInvalidated = false; } // If there are no effects in the chain then just draw the source. - if (d->effects.isEmpty()) + if (d->effects.isEmpty()) { painter->drawPixmap(offset, d->srcPixmap); + } #else Q_UNUSED(painter); @@ -201,13 +207,29 @@ } /*! + * \reimp + */ +void HbVgChainedEffect::performEffectSw(QPainter *painter) +{ + Q_D(HbVgChainedEffect); + foreach(HbVgEffect * effect, d->effects) { + effect->performEffectSw(painter); + HbVgEffectPrivate *effD = HbVgEffectPrivate::d_ptr(effect); + effD->paramsChanged = effD->cacheInvalidated = false; + } + if (d->effects.isEmpty()) { + drawSource(painter); + } +} + +/*! \reimp */ void HbVgChainedEffectPrivate::notifyCacheInvalidated() { // Distribute the new value of cacheInvalidated to all the // contained effects. - foreach (HbVgEffect *effect, effects) { + foreach(HbVgEffect * effect, effects) { HbVgEffectPrivate *effD = HbVgEffectPrivate::d_ptr(effect); effD->cacheInvalidated = true; effD->notifyCacheInvalidated(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgchainedeffect_p.h --- a/src/hbcore/ovgeffects/hbvgchainedeffect_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgchainedeffect_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -58,6 +58,7 @@ HbVgChainedEffect(HbVgChainedEffectPrivate &dd, QObject *parent = 0); void performEffect(QPainter *painter, const QPointF &offset, const QVariant &vgImage, const QSize &vgImageSize); + void performEffectSw(QPainter *painter); private: Q_DECLARE_PRIVATE(HbVgChainedEffect) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgcolorizeeffect.cpp --- a/src/hbcore/ovgeffects/hbvgcolorizeeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgcolorizeeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -63,8 +63,9 @@ void HbVgColorizeEffect::setColor(const QColor &color) { Q_D(HbVgColorizeEffect); - if (d->color == color) + if (d->color == color) { return; + } d->color = color; updateEffect(); emit colorChanged(color); @@ -82,25 +83,25 @@ const VGfloat Bw = 0.0820f; void HbVgColorizeEffectPrivate::getColorMatrix(VGfloat *colorMatrix, - const QColor &color, - qreal opacity) + const QColor &color, + qreal opacity) { const VGfloat o = (VGfloat) opacity; const VGfloat ao = 1 - o; const VGfloat R = (o / 255.0f) * (VGfloat) color.red(); const VGfloat G = (o / 255.0f) * (VGfloat) color.green(); const VGfloat B = (o / 255.0f) * (VGfloat) color.blue(); - colorMatrix[0] = R*Rw + ao; - colorMatrix[1] = G*Rw; - colorMatrix[2] = B*Rw; + colorMatrix[0] = R * Rw + ao; + colorMatrix[1] = G * Rw; + colorMatrix[2] = B * Rw; colorMatrix[3] = 0.0f; - colorMatrix[4] = R*Gw; - colorMatrix[5] = G*Gw + ao; - colorMatrix[6] = B*Gw; + colorMatrix[4] = R * Gw; + colorMatrix[5] = G * Gw + ao; + colorMatrix[6] = B * Gw; colorMatrix[7] = 0.0f; - colorMatrix[8] = R*Bw; - colorMatrix[9] = G*Bw; - colorMatrix[10] = B*Bw + ao; + colorMatrix[8] = R * Bw; + colorMatrix[9] = G * Bw; + colorMatrix[10] = B * Bw + ao; colorMatrix[11] = 0.0f; colorMatrix[12] = 0.0f; colorMatrix[13] = 0.0f; @@ -109,15 +110,15 @@ colorMatrix[16] = 0.0f; colorMatrix[17] = 0.0f; colorMatrix[18] = 0.0f; - colorMatrix[19] = 0.0f; + colorMatrix[19] = 0.0f; } #endif void HbVgColorizeEffect::performEffect(QPainter *painter, - const QPointF &offset, - const QVariant &vgImage, - const QSize &vgImageSize) + const QPointF &offset, + const QVariant &vgImage, + const QSize &vgImageSize) { #ifdef HB_EFFECTS_OPENVG QPixmap cachedPm = cached(vgImageSize); @@ -131,8 +132,9 @@ VGImage dstImage = d->ensurePixmap(&d->dstPixmap, vgImageSize); qreal opacity = clamp(d->opacity, 0.0f, 1.0f); if (opacity > HBVG_EPSILON) { - if (d->paramsChanged) + if (d->paramsChanged) { HbVgColorizeEffectPrivate::getColorMatrix(d->colorMatrix, d->color, opacity); + } vgColorMatrix(dstImage, srcImage, d->colorMatrix); painter->drawPixmap(offset, d->dstPixmap); tryCache(d->dstPixmap); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgeffect.cpp --- a/src/hbcore/ovgeffects/hbvgeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -40,7 +40,7 @@ * \brief Abstract base class for OpenVG effects. * * \internal - * + * * Brief guide for creating new effects: *
    * @@ -103,7 +103,8 @@ sourceGraphicsItem(0), mainWindow(0), lastUsedRotation(0), - lastRotationTransformAngle(0) + lastRotationTransformAngle(0), + forceSwMode(false) { } @@ -122,10 +123,11 @@ * * \internal */ -VGImage HbVgEffectPrivate::ensurePixmap(QPixmap *pixmap, const QSize& size) +VGImage HbVgEffectPrivate::ensurePixmap(QPixmap *pixmap, const QSize &size) { - if (pixmap->size() != size) + if (pixmap->size() != size) { *pixmap = QPixmap(size); + } return qPixmapToVGImage(*pixmap); } #endif @@ -165,10 +167,11 @@ QGraphicsScene *scene = srcItem->scene(); if (scene) { QList views = scene->views(); - foreach (QGraphicsView *view, views) { + foreach(QGraphicsView * view, views) { mainWindow = qobject_cast(view); - if (mainWindow) + if (mainWindow) { break; + } } } } @@ -190,7 +193,7 @@ } return lastRotationTransform; } - + /*! * Maps the given translation offset to an offset that is based on the current * rotation of the graphics view. Effects are drawing directly, in device @@ -349,14 +352,59 @@ void HbVgEffect::setOpacity(qreal opacity) { Q_D(HbVgEffect); - if (d->opacity == opacity) + if (d->opacity == opacity) { return; + } d->opacity = opacity; updateEffect(); emit opacityChanged(opacity); } /*! + * Returns the current setting for sw mode forcing. By default this is + * disabled (false). + */ +bool HbVgEffect::forceSwMode() const +{ + Q_D(const HbVgEffect); + return d->forceSwMode; +} + +/*! + * When enabled the sw implementation is used always. + * + * Many effects have no software implementation so enabling this will + * lead to the same result as trying to paint the hw accelerated + * effects on a non-hw paint engine: Only the source is painted, + * without any effects. + */ +void HbVgEffect::setForceSwMode(bool b) +{ + Q_D(HbVgEffect); + if (d->forceSwMode == b) { + return; + } + d->forceSwMode = b; + updateEffect(); + emit forceSwModeChanged(b); +} + +/*! + * Called when using a non-OpenVG paint engine. The default + * implementation simply calls drawSource(), i.e. paints the source + * item without any effect. + * + * Note that the source pixmap is not requested and the painter's + * world transform is not reset before calling this, in contrast to + * performEffect(). (this means that neither d->srcPixmap nor + * d->worldTransform is available). + */ +void HbVgEffect::performEffectSw(QPainter *painter) +{ + drawSource(painter); +} + +/*! * \reimp * * Implementation of QGraphicsEffect's draw(). After setting up the environment @@ -365,15 +413,27 @@ */ void HbVgEffect::draw(QPainter *painter) { + Q_D(HbVgEffect); + + // Invalidate the cache if the rotation of the graphics view has changed. + qreal rotation = d->mainWindowRotation(); + if (rotation != d->lastUsedRotation) { + d->lastUsedRotation = rotation; + d->ensureCacheInvalidated(); + } + // Just draw the source without effects if the painter's paint engine // is not using OpenVG. - if (painter->paintEngine()->type() != QPaintEngine::OpenVG) { - drawSource(painter); + QPaintEngine *paintEngine = painter->paintEngine(); + if (d->forceSwMode || !paintEngine || paintEngine->type() != QPaintEngine::OpenVG) { + // No sourcePixmap() and world transform change here because + // in most cases we will just call drawSource(). + performEffectSw(painter); + d->paramsChanged = d->cacheInvalidated = false; return; } #ifdef HB_EFFECTS_OPENVG - Q_D(HbVgEffect); // Render the source into a pixmap. Note that the effect's modified bounding // rectangle is already taken into account in the size of the pixmap created // here, so there is no need to waste time with boundingRectFor() calls @@ -395,13 +455,6 @@ d->worldTransform = painter->worldTransform(); painter->setWorldTransform(QTransform()); - // Invalidate the cache if the rotation of the graphics view has changed. - qreal rotation = d->mainWindowRotation(); - if (rotation != d->lastUsedRotation) { - d->lastUsedRotation = rotation; - d->ensureCacheInvalidated(); - } - // Enter raw VG mode. painter->beginNativePainting(); // Draw something. @@ -462,8 +515,9 @@ void HbVgEffect::setCaching(bool caching) { Q_D(HbVgEffect); - if (d->caching == caching) + if (d->caching == caching) { return; + } d->caching = caching; emit cachingChanged(caching); } @@ -492,8 +546,7 @@ // causes a clipping to the device viewport, therefore the cached // pixmap for an item that was/is clipped should not be used. if (QPixmapCache::find(key, &cachedPm) - && (size.isNull() || cachedPm.size() == size)) - { + && (size.isNull() || cachedPm.size() == size)) { #ifdef HBVG_TRACES qDebug("HbVgEffect [%x]: cache hit", (int) this); #endif @@ -534,7 +587,7 @@ void HbVgEffect::releaseCachedResources() { QSet *keys = cacheKeys(); - foreach (const QString &key, *keys) { + foreach(const QString & key, *keys) { QPixmapCache::remove(key); } keys->clear(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgeffect_p.h --- a/src/hbcore/ovgeffects/hbvgeffect_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgeffect_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,6 +40,7 @@ Q_OBJECT Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity NOTIFY opacityChanged) Q_PROPERTY(bool caching READ caching WRITE setCaching NOTIFY cachingChanged) + Q_PROPERTY(bool forceSwMode READ forceSwMode WRITE setForceSwMode NOTIFY forceSwModeChanged) public: HbVgEffect(QObject *parent = 0); @@ -47,27 +48,31 @@ void install(QGraphicsItem *item); - qreal opacity() const; - virtual void performEffect(QPainter *painter, const QPointF &offset, const QVariant &vgImage, const QSize &vgImageSize) = 0; + virtual void performEffectSw(QPainter *painter); + void setChainRoot(HbVgEffect *effect); HbVgEffect *chainRoot() const; + qreal opacity() const; bool caching() const; + bool forceSwMode() const; static void releaseCachedResources(); public slots: void setOpacity(qreal opacity); void setCaching(bool caching); + void setForceSwMode(bool b); signals: void opacityChanged(qreal opacity); void cachingChanged(bool caching); + void forceSwModeChanged(bool b); protected: HbVgEffect(HbVgEffectPrivate &dd, QObject *parent = 0); @@ -84,7 +89,7 @@ void draw(QPainter *painter); void sourceChanged(ChangeFlags flags); - HbVgEffectPrivate * const d_ptr; + HbVgEffectPrivate *const d_ptr; Q_DECLARE_PRIVATE_D(d_ptr, HbVgEffect) Q_DISABLE_COPY(HbVgEffect) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgeffect_p_p.h --- a/src/hbcore/ovgeffects/hbvgeffect_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgeffect_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -74,7 +74,9 @@ QPointF mapOffset(const QPointF &point) const; QSizeF mapSize(const QSizeF &size) const; - static HbVgEffectPrivate *d_ptr(HbVgEffect *effect) { return effect->d_func(); } + static HbVgEffectPrivate *d_ptr(HbVgEffect *effect) { + return effect->d_func(); + } void ensureCacheInvalidated(); @@ -113,7 +115,7 @@ QPixmap dstPixmap; QPixmap tmpPixmap; - + // Root of the chain, null by default. If non-null then updates are // delegated to this effect. Note that the sourceXxxx() functions in // QGraphicsEffect are not valid for chained effects so call those functions @@ -132,6 +134,8 @@ mutable qreal lastUsedRotation; mutable QTransform lastRotationTransform; mutable qreal lastRotationTransformAngle; + + bool forceSwMode; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgframeeffect.cpp --- a/src/hbcore/ovgeffects/hbvgframeeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgframeeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -80,26 +80,30 @@ * \internal */ QRectF HbVgFrameEffectPrivate::deviceRectForSource(DeviceRectType type, - QPaintDevice *pdev) + QPaintDevice *pdev) { Q_Q(HbVgFrameEffect); QRectF br = type == IncludeChildren - ? q->sourceBoundingRectForRoot() - : q->sourceItemForRoot()->boundingRect(); + ? q->sourceBoundingRectForRoot() + : q->sourceItemForRoot()->boundingRect(); QRect result = worldTransform.mapRect(br).toAlignedRect(); if (pdev) { int left, top, right, bottom; result.getCoords(&left, &top, &right, &bottom); - if (left < 0) + if (left < 0) { result.setX(0); - if (top < 0) + } + if (top < 0) { result.setY(0); + } int deviceWidth = pdev->width(); int deviceHeight = pdev->height(); - if (right > deviceWidth - 1) + if (right > deviceWidth - 1) { result.setRight(deviceWidth - 1); - if (bottom > deviceHeight - 1) + } + if (bottom > deviceHeight - 1) { result.setBottom(deviceHeight - 1); + } } return result; } @@ -127,8 +131,9 @@ void HbVgFrameEffect::setColor(const QColor &color) { Q_D(HbVgFrameEffect); - if (d->color == color) + if (d->color == color) { return; + } d->color = color; updateEffect(); emit colorChanged(color); @@ -159,8 +164,9 @@ Q_UNUSED(vgImageSize); Q_D(HbVgFrameEffect); - if (d->hints & DrawSourceHint) + if (d->hints & DrawSourceHint) { painter->drawPixmap(offset, d->srcPixmap); + } painter->setOpacity(d->opacity); painter->setPen(d->color); painter->drawRect(d->deviceRectForSource( diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvghsleffect.cpp --- a/src/hbcore/ovgeffects/hbvghsleffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvghsleffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -64,8 +64,9 @@ void HbVgHslEffect::setHue(qreal hue) { Q_D(HbVgHslEffect); - if (d->hue == hue) + if (d->hue == hue) { return; + } d->hue = hue; updateEffect(); emit hueChanged(hue); @@ -80,8 +81,9 @@ void HbVgHslEffect::setSaturation(qreal saturation) { Q_D(HbVgHslEffect); - if (d->saturation == saturation) + if (d->saturation == saturation) { return; + } d->saturation = saturation; updateEffect(); emit saturationChanged(saturation); @@ -96,8 +98,9 @@ void HbVgHslEffect::setLightness(qreal lightness) { Q_D(HbVgHslEffect); - if (d->lightness == lightness) + if (d->lightness == lightness) { return; + } d->lightness = lightness; updateEffect(); emit lightnessChanged(lightness); @@ -118,28 +121,28 @@ #ifdef HB_EFFECTS_OPENVG inline void getSaturationRotationMatrix(VGfloat *effectMatrix, VGfloat opacity, - VGfloat saturation, VGfloat angle) + VGfloat saturation, VGfloat angle) { - const VGfloat sa = saturation; + const VGfloat sa = saturation; const VGfloat as = 1.0f - saturation; - + const VGfloat o = opacity; const VGfloat ao = 1.0f - o; - + const VGfloat c = qCos(angle); const VGfloat s = qSin(angle); - - effectMatrix[0] = o * ((-0.02473f*as+0.66667f*sa)*c+ (0.30450f*as*s+(0.33333f*as+0.33333f*sa))) + ao; - effectMatrix[1] = o * ((-0.02473f*as-0.33333f*sa)*c+((0.30450f*as+0.57736f*sa)*s+(0.33333f*as+0.33333f*sa))); - effectMatrix[2] = o * ((-0.02473f*as-0.33333f*sa)*c+((0.30450f*as-0.57736f*sa)*s+(0.33333f*as+0.33333f*sa))); + + effectMatrix[0] = o * ((-0.02473f * as + 0.66667f * sa) * c + (0.30450f * as * s + (0.33333f * as + 0.33333f * sa))) + ao; + effectMatrix[1] = o * ((-0.02473f * as - 0.33333f * sa) * c + ((0.30450f * as + 0.57736f * sa) * s + (0.33333f * as + 0.33333f * sa))); + effectMatrix[2] = o * ((-0.02473f * as - 0.33333f * sa) * c + ((0.30450f * as - 0.57736f * sa) * s + (0.33333f * as + 0.33333f * sa))); effectMatrix[3] = 0.0f; - effectMatrix[4] = o * ((0.27607f*as-0.33333f*sa)*c+((-0.13083f*as-0.57736f*sa)*s+(0.33333f*as+0.33333f*sa))); - effectMatrix[5] = o * ((0.27607f*as+0.66667f*sa)*c+ (-0.13083f*as*s+(0.33333f*as+0.33333f*sa))) + ao; - effectMatrix[6] = o * ((0.27607f*as-0.33333f*sa)*c+((-0.13083f*as+0.57736f*sa)*s+(0.33333f*as+0.33333f*sa))); + effectMatrix[4] = o * ((0.27607f * as - 0.33333f * sa) * c + ((-0.13083f * as - 0.57736f * sa) * s + (0.33333f * as + 0.33333f * sa))); + effectMatrix[5] = o * ((0.27607f * as + 0.66667f * sa) * c + (-0.13083f * as * s + (0.33333f * as + 0.33333f * sa))) + ao; + effectMatrix[6] = o * ((0.27607f * as - 0.33333f * sa) * c + ((-0.13083f * as + 0.57736f * sa) * s + (0.33333f * as + 0.33333f * sa))); effectMatrix[7] = 0.0f; - effectMatrix[8] = o * ((-0.25134f*as-0.33333f*sa)*c+((-0.17367f*as+0.57736f*sa)*s+(0.33333f*as+0.33333f*sa))); - effectMatrix[9] = o * ((-0.25134f*as-0.33333f*sa)*c+((-0.17367f*as-0.57736f*sa)*s+(0.33333f*as+0.33333f*sa))); - effectMatrix[10] = o * ((-0.25134f*as+0.66667f*sa)*c+ (-0.17367f*as*s+(0.33333f*as+0.33333f*sa))) + ao; + effectMatrix[8] = o * ((-0.25134f * as - 0.33333f * sa) * c + ((-0.17367f * as + 0.57736f * sa) * s + (0.33333f * as + 0.33333f * sa))); + effectMatrix[9] = o * ((-0.25134f * as - 0.33333f * sa) * c + ((-0.17367f * as - 0.57736f * sa) * s + (0.33333f * as + 0.33333f * sa))); + effectMatrix[10] = o * ((-0.25134f * as + 0.66667f * sa) * c + (-0.17367f * as * s + (0.33333f * as + 0.33333f * sa))) + ao; effectMatrix[11] = 0.0f; effectMatrix[12] = 0.0f; effectMatrix[13] = 0.0f; @@ -153,16 +156,16 @@ inline void getSaturationMatrix(VGfloat *effectMatrix, VGfloat opacity, VGfloat saturation) { - const VGfloat sa = saturation; + const VGfloat sa = saturation; const VGfloat as = 1.0f - saturation; - + const VGfloat o = opacity; const VGfloat ao = 1.0f - o; const VGfloat asRw = o * as * Rw; const VGfloat asGw = o * as * Gw; const VGfloat asBw = o * as * Bw; - + effectMatrix[0] = asRw + sa + ao; effectMatrix[1] = asRw; effectMatrix[2] = asRw; @@ -185,21 +188,21 @@ { const VGfloat o = opacity; const VGfloat ao = 1.0f - o; - + const VGfloat c = qCos(angle); const VGfloat s = qSin(angle); - - effectMatrix[0] = o * ( 0.66667f*c+0.33333f) + ao; - effectMatrix[1] = o * (-0.33333f*c+(0.57736f*s+0.33333f)); - effectMatrix[2] = o * (-0.33333f*c+(-0.57736f*s+0.33333f)); + + effectMatrix[0] = o * (0.66667f * c + 0.33333f) + ao; + effectMatrix[1] = o * (-0.33333f * c + (0.57736f * s + 0.33333f)); + effectMatrix[2] = o * (-0.33333f * c + (-0.57736f * s + 0.33333f)); effectMatrix[3] = 0.0f; - effectMatrix[4] = o * (-0.33333f*c+(-0.57736f*s+0.33333f)); - effectMatrix[5] = o * ( 0.66667f*c+0.33333f) + ao; - effectMatrix[6] = o * (-0.33333f*c+(0.57736f*s+0.33333f)); + effectMatrix[4] = o * (-0.33333f * c + (-0.57736f * s + 0.33333f)); + effectMatrix[5] = o * (0.66667f * c + 0.33333f) + ao; + effectMatrix[6] = o * (-0.33333f * c + (0.57736f * s + 0.33333f)); effectMatrix[7] = 0.0f; - effectMatrix[8] = o * (-0.33333f*c+(0.57736f*s+0.33333f)); - effectMatrix[9] = o * (-0.33333f*c+(-0.57736f*s+0.33333f)); - effectMatrix[10] = o * (0.66667f*c+0.33333f) + ao; + effectMatrix[8] = o * (-0.33333f * c + (0.57736f * s + 0.33333f)); + effectMatrix[9] = o * (-0.33333f * c + (-0.57736f * s + 0.33333f)); + effectMatrix[10] = o * (0.66667f * c + 0.33333f) + ao; effectMatrix[11] = 0.0f; effectMatrix[12] = 0.0f; effectMatrix[13] = 0.0f; @@ -230,9 +233,9 @@ #endif // HB_EFFECTS_OPENVG void HbVgHslEffect::performEffect(QPainter *painter, - const QPointF &offset, - const QVariant &vgImage, - const QSize &vgImageSize) + const QPointF &offset, + const QVariant &vgImage, + const QSize &vgImageSize) { #ifdef HB_EFFECTS_OPENVG QPixmap cachedPm = cached(vgImageSize); @@ -250,13 +253,13 @@ // a helpful constant const qreal radsPerDeg = 2.0f * (qreal) M_PI / 360.0f; - // make sure parametres are in range + // make sure parameters are in range const VGfloat o = (VGfloat) opacity; const VGfloat angle = (VGfloat) clamp(d->hue * radsPerDeg, 0.0f, 2.0f * (qreal) M_PI); // angle [0, 2*pi] const VGfloat saturation = (VGfloat) clamp(d->saturation, 0.0f, 100.0f); // saturation [0, N] const VGfloat lightness = (VGfloat) clamp(d->lightness, -1.0f, 1.0f); // lightness [-1, 1] - - // check parametres which precalculated matrix we have to use. + + // check parameters which precalculated matrix we have to use. // Note: lightness affects offset and not matrix so we don't bother optimising that. const bool enableSaturation = (saturation < 1.0f - HBVG_EPSILON || saturation > 1.0f + HBVG_EPSILON); const bool enableHueRotation = (HBVG_EPSILON < angle && angle < (2.0f * (qreal) M_PI - HBVG_EPSILON)); @@ -265,12 +268,12 @@ // contains SaturateT*PrerotationT*HuerotationT*PostrotationT*I*opacity+I*(1-opacity) matrices // --- ugly, but saves lot of operations in FPU. // note: there are plenty of redundancy in these calculations - // --- let compiler optimise them. + // --- let compiler optimize them. getSaturationRotationMatrix(&d->colorMatrix[0], o, saturation, angle); } else if (enableSaturation && !enableHueRotation) { // saturationT*I*opacity+I*(1 - opacity) matrix without hue rotation getSaturationMatrix(&d->colorMatrix[0], o, saturation); - } else if(!enableSaturation && enableHueRotation) { + } else if (!enableSaturation && enableHueRotation) { // PrerotationT*HuerotationT*PostrotationT*I*opacity+I*(1-opacity) matrices without saturation matrix getRotationMatrix(&d->colorMatrix[0], o, angle); } else { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgmaskeffect.cpp --- a/src/hbcore/ovgeffects/hbvgmaskeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgmaskeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -38,21 +38,32 @@ * defined by a pixmap's alpha channel transparent. The opacity effect * parameter is ignored. * + * With certain OpenVG implementations masking with vgMask() may be + * problematic. In such cases enable the pure QPainter implementation + * with setForceSwMode(). + * + * Currently the sw version only support masks set by setMask() or + * provided via the callback. Mask rectangles are not supported. + * * \internal */ HbVgMaskEffectPrivate::HbVgMaskEffectPrivate() - : maskRectIsInDeviceCoords(false), maskCallback(0) + : maskRectIsInDeviceCoords(false), + maskCallback(0), + maskCallbackParam(0), + lastMainWindowRotationAngle(-1), + includeSourceItemOnly(false) { } HbVgMaskEffect::HbVgMaskEffect(QObject *parent) - : HbVgEffect(*new HbVgMaskEffectPrivate, parent) + : HbVgFrameEffect(*new HbVgMaskEffectPrivate, parent) { } HbVgMaskEffect::HbVgMaskEffect(HbVgMaskEffectPrivate &dd, QObject *parent) - : HbVgEffect(dd, parent) + : HbVgFrameEffect(dd, parent) { } @@ -86,7 +97,8 @@ /*! * Returns the scaled version of the mask that was used during the previous * paint. Will return a null pixmap if no painting took place since the last - * setMask() call. + * setMask() call. Any other automatic transformation (e.g. rotation) of the + * mask is not included in the returned pixmap. */ QPixmap HbVgMaskEffect::scaledMask() const { @@ -99,7 +111,8 @@ * is 0 will be set transparent. The pixmap is subject to scaling and therefore * distortion may occur. If this is not acceptable then use the callback * version. Any previously set mask pixmap or rectangle will not be effective - * anymore. + * anymore. If the graphics view is rotated (due to a transformed screen + * orientation) then the mask will be rotated automatically too. */ void HbVgMaskEffect::setMask(const QPixmap &mask) { @@ -141,8 +154,9 @@ void HbVgMaskEffect::setMaskCallback(MaskCallback callback, void *param) { Q_D(HbVgMaskEffect); - if (d->maskCallback == callback) + if (d->maskCallback == callback) { return; + } clear(); d->maskCallback = callback; d->maskCallbackParam = param; @@ -176,8 +190,9 @@ void HbVgMaskEffect::setMaskRect(const QRectF &rect) { Q_D(HbVgMaskEffect); - if (rect == d->maskRect && !d->maskRectIsInDeviceCoords) + if (rect == d->maskRect && !d->maskRectIsInDeviceCoords) { return; + } clear(); d->maskRect = rect; d->maskRectIsInDeviceCoords = false; @@ -189,12 +204,17 @@ * Similar to setMask() but the rectangle is assumed to be in device coordinates * (i.e. relative to the entire screen instead of the source item), meaning that * the source item will be clipped where it intersects with \a rect. + * + * Even when the graphics view is transformed (e.g. when being in "landscape + * orientation") the rectangle passed here is treated as being in device + * coordinates, ignoring the rotation of the graphics view. */ void HbVgMaskEffect::setMaskDeviceRect(const QRectF &rect) { Q_D(HbVgMaskEffect); - if (rect == d->maskRect && d->maskRectIsInDeviceCoords) + if (rect == d->maskRect && d->maskRectIsInDeviceCoords) { return; + } clear(); d->maskRect = rect; d->maskRectIsInDeviceCoords = true; @@ -203,6 +223,33 @@ } /*! + * Returns the current setting for masking only the source graphics item. By + * default this is disabled. + */ +bool HbVgMaskEffect::includeSourceItemOnly() const +{ + Q_D(const HbVgMaskEffect); + return d->includeSourceItemOnly; +} + +/*! + * When enabled, only the source item (excluding its children) is masked. This + * is needed when shaping e.g. a pop-up or other widget that has a scroll area + * in it. The real size, together with all the children, is usually much bigger + * then the size of the widget itself (and it depends on the position in the + * scroll area etc.). To solve this issue, enable this setting when shaping + * such widgets. + */ +void HbVgMaskEffect::setIncludeSourceItemOnly(bool b) +{ + Q_D(HbVgMaskEffect); + clear(); + d->includeSourceItemOnly = b; + updateEffect(); + emit includeSourceItemOnlyChanged(b); +} + +/*! * \reimp */ QRectF HbVgMaskEffect::boundingRectFor(const QRectF &rect) const @@ -222,7 +269,35 @@ } /*! + * \internal + */ +QRectF HbVgMaskEffectPrivate::mapRect(const QRectF &rect, const QSize &srcSize) const +{ + qreal rotationAngle = mainWindowRotation(); + qreal x1 = 0; + qreal y1 = 0; + + QPointF mp = mapOffset(QPointF(rect.x(), rect.y())); + QSizeF sz = mapSize(rect.size()); + + if (rotationAngle == -90 || rotationAngle == 270) { + x1 = mp.x(); + y1 = mp.y() + srcSize.height() - sz.height(); + } else if (rotationAngle == 90 || rotationAngle == -270) { + x1 = mp.x() + srcSize.width() - sz.width(); + y1 = mp.y(); + } else { + x1 = mp.x(); + y1 = mp.y(); + } + + return QRectF(x1, y1, sz.width(), sz.height()); +} + +/*! * \reimp + * + * OpenVG-based implementation. Supports all masking options. */ void HbVgMaskEffect::performEffect(QPainter *painter, const QPointF &offset, @@ -233,19 +308,36 @@ Q_UNUSED(vgImage); Q_D(HbVgMaskEffect); + if (!painter->paintEngine()) { + return; + } + + // Find out the target size and position. + QPaintDevice *pdev = painter->paintEngine()->paintDevice(); + QRectF srcDevRect(d->deviceRectForSource(HbVgFrameEffectPrivate::ExcludeChildren, pdev)); + QSize targetSize = d->includeSourceItemOnly ? srcDevRect.size().toSize() : vgImageSize; + int posX = (int) offset.x(); + int posY = (int) offset.y(); + if (d->includeSourceItemOnly) { + posX = (int) srcDevRect.x(); + posY = (int) srcDevRect.y(); + } + // Initialize scaledMask if the mask has changed or the size of the source // is different than before. if (!d->mask.isNull()) { - if (d->scaledMask.isNull()) + if (d->scaledMask.isNull()) { d->scaledMask = d->mask; + } // Scale only when really needed, i.e. when the size is different than // before (or there is a new mask). - if (d->scaledMask.size() != vgImageSize) - d->scaledMask = d->mask.scaled(vgImageSize); + if (d->scaledMask.size() != targetSize) { + d->scaledMask = d->mask.scaled(targetSize); + d->rotatedPixmap = QPixmap(); + } } vgSeti(VG_MASKING, VG_TRUE); - QPaintDevice *pdev = painter->paintEngine()->paintDevice(); // Set the mask for the entire surface to 1 (i.e. nothing is transparent). vgMask(VG_INVALID_HANDLE, VG_FILL_MASK, 0, 0, pdev->width(), pdev->height()); @@ -254,17 +346,16 @@ // of these is set then try the callback, if that is not set either then // just draw the source normally. QPixmap *maskPtr = 0; - int ox = (int) offset.x(); - int oy = (int) offset.y(); if (d->scaledMask.isNull() && !d->maskRect.isNull()) { - int x1 = (int) d->maskRect.x(); - int y1 = (int) d->maskRect.y(); - int w = (int) d->maskRect.width(); - int h = (int) d->maskRect.height(); + QRectF mappedRect = d->maskRect; if (!d->maskRectIsInDeviceCoords) { - x1 += ox; - y1 += oy; + mappedRect = d->mapRect(d->maskRect, targetSize); + mappedRect.adjust(posX, posY, posX, posY); } + int x1 = (int) mappedRect.x(); + int y1 = (int) mappedRect.y(); + int w = (int) mappedRect.width(); + int h = (int) mappedRect.height(); // Make the area defined by the rectangle transparent. Passing // VG_CLEAR_MASK results in writing 0 to the mask which results in // transparent pixels at that position. @@ -276,18 +367,30 @@ } else if (d->maskCallback) { // Invoke the callback but only if it has just been set or the size of // the source is different than before. - if (d->callbackResult.isNull() || d->callbackResult.size() != vgImageSize) - d->callbackResult = d->maskCallback(vgImageSize, d->maskCallbackParam); + if (d->callbackResult.isNull() || d->callbackResult.size() != targetSize) { + d->callbackResult = d->maskCallback(targetSize, d->maskCallbackParam); + d->rotatedPixmap = QPixmap(); + } maskPtr = &d->callbackResult; } if (maskPtr) { - int w = vgImageSize.width(); - int h = vgImageSize.height(); + int w = targetSize.width(); + int h = targetSize.height(); + QPixmap pm; + qreal rotationAngle = d->mainWindowRotation(); + if (rotationAngle != 0) { + if (d->rotatedPixmap.isNull() || rotationAngle != d->lastMainWindowRotationAngle) { + d->rotatedPixmap = maskPtr->transformed(d->rotationTransform()).scaled(targetSize); + d->lastMainWindowRotationAngle = rotationAngle; + } + pm = d->rotatedPixmap; + } + QPixmap *finalMaskPtr = pm.isNull() ? maskPtr : ± // Will use the alpha channel from the image, alpha=0 => 0 in the mask // => transparent pixel, alpha=255 => 1 in the mask => opaque pixel. - vgMask(qPixmapToVGImage(*maskPtr), VG_SET_MASK, - ox, toVgYH(oy, h, pdev), + vgMask(qPixmapToVGImage(*finalMaskPtr), VG_SET_MASK, + posX, toVgYH(posY, h, pdev), w, h); } @@ -302,3 +405,87 @@ Q_UNUSED(vgImageSize); #endif } + +/*! + * \reimp + * + * QPainter-based implementation. Currently only supports masking via pixmaps. + * + * The behavior for partially visible items (clipped by the device rect) is + * somewhat wrong, the mask is never clipped, it is just scaled down to match + * the visible part of the item. + */ +void HbVgMaskEffect::performEffectSw(QPainter *painter) +{ + Q_D(HbVgMaskEffect); + + QPoint offset; + QPixmap srcPixmap = sourcePixmap(Qt::DeviceCoordinates, &offset); // needs the original world transform + if (srcPixmap.isNull()) { + return; + } + + QPaintDevice *pdev = painter->paintEngine()->paintDevice(); + d->worldTransform = painter->worldTransform(); // deviceRectForSource needs this + // The full source rect (without child items) would be + // d->worldTransform.mapRect(sourceItemForRoot()->boundingRect()).toRect() + // but we only care about the visible part here so clipping must be applied. + QRect srcDevRect(d->deviceRectForSource(HbVgFrameEffectPrivate::ExcludeChildren, pdev).toRect()); + QPoint pos = d->includeSourceItemOnly ? srcDevRect.topLeft() : offset; + QSize size = d->includeSourceItemOnly ? srcDevRect.size() : srcPixmap.size(); + if (size.width() <= 0 || size.height() <= 0) { + return; + } + + QPixmap maskPixmap; + if (d->maskCallback) { + if (d->callbackResult.isNull() || d->callbackResult.size() != size) { + d->callbackResult = d->maskCallback(size, d->maskCallbackParam); + d->rotatedPixmap = QPixmap(); + } + maskPixmap = d->callbackResult; + } else if (!d->mask.isNull()) { + if (d->scaledMask.isNull()) { + d->scaledMask = d->mask; + } + if (d->scaledMask.size() != size) { + d->scaledMask = d->mask.scaled(size); + d->rotatedPixmap = QPixmap(); + } + maskPixmap = d->scaledMask; + } else { + // Masking via rectangles is not supported here. + drawSource(painter); + return; + } + + qreal rotationAngle = d->mainWindowRotation(); + if (rotationAngle != 0) { + if (d->rotatedPixmap.isNull() || rotationAngle != d->lastMainWindowRotationAngle) { + d->rotatedPixmap = maskPixmap.transformed(d->rotationTransform()).scaled(size); + d->lastMainWindowRotationAngle = rotationAngle; + } + maskPixmap = d->rotatedPixmap; + } + + if (d->includeSourceItemOnly) { + // Take only the source item itself, excluding its children. + srcPixmap = srcPixmap.copy(srcDevRect.adjusted(-offset.x(), -offset.y(), -offset.x(), -offset.y())); + } + + painter->setWorldTransform(QTransform()); + + QImage image(size, QImage::Format_ARGB32_Premultiplied); + QPainter p(&image); + p.setCompositionMode(QPainter::CompositionMode_Source); + p.fillRect(image.rect(), Qt::transparent); + p.setCompositionMode(QPainter::CompositionMode_SourceOver); + p.drawPixmap(0, 0, srcPixmap); + p.setCompositionMode(QPainter::CompositionMode_DestinationIn); + p.drawPixmap(0, 0, maskPixmap); + p.end(); + + painter->drawImage(pos, image); + + painter->setWorldTransform(d->worldTransform); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgmaskeffect_p.h --- a/src/hbcore/ovgeffects/hbvgmaskeffect_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgmaskeffect_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,16 +26,17 @@ #ifndef HBVGMASKEFFECT_P_H #define HBVGMASKEFFECT_P_H -#include "hbvgeffect_p.h" +#include "hbvgframeeffect_p.h" class HbVgMaskEffectPrivate; -class HB_CORE_PRIVATE_EXPORT HbVgMaskEffect : public HbVgEffect +class HB_CORE_PRIVATE_EXPORT HbVgMaskEffect : public HbVgFrameEffect { Q_OBJECT Q_PROPERTY(QRectF maskRect READ maskRect WRITE setMaskRect NOTIFY maskRectChanged) Q_PROPERTY(QRectF maskDeviceRect READ maskDeviceRect WRITE setMaskDeviceRect NOTIFY maskRectChanged) Q_PROPERTY(QPixmap mask READ mask WRITE setMask NOTIFY maskChanged) + Q_PROPERTY(bool includeSourceItemOnly READ includeSourceItemOnly WRITE setIncludeSourceItemOnly NOTIFY includeSourceItemOnlyChanged) public: HbVgMaskEffect(QObject *parent = 0); @@ -43,35 +44,42 @@ QRectF boundingRectFor(const QRectF &rect) const; - typedef QPixmap (*MaskCallback)(const QSize &, void *); + typedef QPixmap(*MaskCallback)(const QSize &, void *); QPixmap mask() const; QPixmap scaledMask() const; - QRectF maskRect() const; QRectF maskDeviceRect() const; - MaskCallback maskCallback() const; void *maskCallbackParam() const; + bool includeSourceItemOnly() const; + public slots: void clear(); void setMask(const QPixmap &mask); void setMaskRect(const QRectF &rect); void setMaskDeviceRect(const QRectF &rect); - inline void setMaskRect(int x, int y, int w, int h) { setMaskRect(QRectF(x, y, w, h)); } - inline void setMaskDeviceRect(int x, int y, int w, int h) { setMaskDeviceRect(QRectF(x, y, w, h)); } + inline void setMaskRect(int x, int y, int w, int h) { + setMaskRect(QRectF(x, y, w, h)); + } + inline void setMaskDeviceRect(int x, int y, int w, int h) { + setMaskDeviceRect(QRectF(x, y, w, h)); + } void setMaskCallback(MaskCallback callback, void *param = 0); + void setIncludeSourceItemOnly(bool b); signals: void maskChanged(const QPixmap &mask); void maskRectChanged(const QRectF &rect); void maskCallbackChanged(MaskCallback callback); + void includeSourceItemOnlyChanged(bool b); protected: HbVgMaskEffect(HbVgMaskEffectPrivate &dd, QObject *parent = 0); void performEffect(QPainter *painter, const QPointF &offset, const QVariant &vgImage, const QSize &vgImageSize); + void performEffectSw(QPainter *painter); private: Q_DECLARE_PRIVATE(HbVgMaskEffect) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgmaskeffect_p_p.h --- a/src/hbcore/ovgeffects/hbvgmaskeffect_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgmaskeffect_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,15 +26,16 @@ #ifndef HBVGMASKEFFECT_P_P_H #define HBVGMASKEFFECT_P_P_H -#include "hbvgeffect_p_p.h" +#include "hbvgframeeffect_p_p.h" #include "hbvgmaskeffect_p.h" -class HbVgMaskEffectPrivate : public HbVgEffectPrivate +class HbVgMaskEffectPrivate : public HbVgFrameEffectPrivate { Q_DECLARE_PUBLIC(HbVgMaskEffect) public: HbVgMaskEffectPrivate(); + QRectF mapRect(const QRectF &rect, const QSize &srcSize) const; QPixmap mask; QPixmap scaledMask; @@ -43,6 +44,9 @@ HbVgMaskEffect::MaskCallback maskCallback; void *maskCallbackParam; QPixmap callbackResult; + QPixmap rotatedPixmap; + qreal lastMainWindowRotationAngle; + bool includeSourceItemOnly; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgoutlineeffect.cpp --- a/src/hbcore/ovgeffects/hbvgoutlineeffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgoutlineeffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -63,8 +63,9 @@ void HbVgOutlineEffect::setOutline(const QPointF &outline) { Q_D(HbVgOutlineEffect); - if (d->outline == outline) + if (d->outline == outline) { return; + } d->outline = outline; updateEffectBoundingRect(); emit outlineChanged(outline); @@ -79,8 +80,9 @@ void HbVgOutlineEffect::setColor(const QColor &color) { Q_D(HbVgOutlineEffect); - if (d->color == color) + if (d->color == color) { return; + } d->color = color; updateEffect(); emit colorChanged(color); @@ -95,8 +97,9 @@ void HbVgOutlineEffect::setSteepness(qreal steepness) { Q_D(HbVgOutlineEffect); - if (d->steepness == steepness) + if (d->steepness == steepness) { return; + } d->steepness = steepness; updateEffect(); emit steepnessChanged(steepness); @@ -111,8 +114,9 @@ void HbVgOutlineEffect::setOffset(const QPointF &offset) { Q_D(HbVgOutlineEffect); - if (d->offset == offset) + if (d->offset == offset) { return; + } d->offset = offset; updateEffectBoundingRect(); emit offsetChanged(offset); @@ -141,23 +145,24 @@ { #ifdef HB_EFFECTS_OPENVG QPixmap cachedPm = cached(vgImageSize); - if (!cachedPm.isNull()) + if (!cachedPm.isNull()) { return cachedPm; + } Q_D(HbVgOutlineEffect); VGImage srcImage = vgImage.value(); VGImage dstImage = d->ensurePixmap(&d->dstPixmap, vgImageSize); if (d->paramsChanged) { - VGubyte stpc = (VGubyte) clamp(d->steepness, 0.0f, 32.0f); - VGubyte unnormalisedOpacity = (VGubyte) (clamp(d->opacity, 0.0f, 1.0f) * 255.0f); + VGubyte stpc = (VGubyte) clamp(d->steepness, 0.0f, 255.0f); + VGubyte unnormalisedOpacity = (VGubyte)(clamp(d->opacity, 0.0f, 1.0f) * 255.0f); for (int i = 0; i < 256; ++i) { - VGubyte alpha = (i*stpc > unnormalisedOpacity) ? unnormalisedOpacity : i*stpc; + VGubyte alpha = (i * stpc > unnormalisedOpacity) ? unnormalisedOpacity : i * stpc; d->lut[i] = 0x00000000 - | (d->color.red() << 24) - | (d->color.green() << 16) - | (d->color.blue() << 8) - | alpha; + | (d->color.red() << 24) + | (d->color.green() << 16) + | (d->color.blue() << 8) + | alpha; } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgoutlineeffect_p.h --- a/src/hbcore/ovgeffects/hbvgoutlineeffect_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgoutlineeffect_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -52,11 +52,15 @@ public slots: void setOutline(const QPointF &outline); - inline void setOutline(qreal x, qreal y) { setOutline(QPointF(x, y)); } + inline void setOutline(qreal x, qreal y) { + setOutline(QPointF(x, y)); + } void setColor(const QColor &color); void setSteepness(qreal steepness); void setOffset(const QPointF &offset); - inline void setOffset(qreal x, qreal y) { setOffset(QPointF(x, y)); } + inline void setOffset(qreal x, qreal y) { + setOffset(QPointF(x, y)); + } signals: void outlineChanged(const QPointF &outline); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgreflectioneffect.cpp --- a/src/hbcore/ovgeffects/hbvgreflectioneffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgreflectioneffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,13 +35,13 @@ * \class HbVgReflectionEffect * * \brief OpenVG-based reflection effect. - * + * * \internal */ HbVgReflectionEffectPrivate::HbVgReflectionEffectPrivate() : fade(0), fadeInited(false) -{ +{ } HbVgReflectionEffectPrivate::~HbVgReflectionEffectPrivate() @@ -76,8 +76,9 @@ void HbVgReflectionEffect::setOffset(const QPointF &offset) { Q_D(HbVgReflectionEffect); - if (offset == d->offset) + if (offset == d->offset) { return; + } d->offset = offset; updateEffectBoundingRect(); emit offsetChanged(offset); @@ -100,56 +101,42 @@ void HbVgReflectionEffect::setFade(qreal fade) { Q_D(HbVgReflectionEffect); - if (fade == d->fade) + if (fade == d->fade) { return; + } d->fade = fade; updateEffect(); emit fadeChanged(fade); } -QColor HbVgReflectionEffect::color() const -{ - Q_D(const HbVgReflectionEffect); - return d->color; -} - -void HbVgReflectionEffect::setColor(const QColor &color) -{ - Q_D(HbVgReflectionEffect); - if (color == d->color) - return; - d->color = color; - updateEffect(); - emit colorChanged(color); -} - QRectF HbVgReflectionEffect::boundingRectFor(const QRectF &rect) const { // Double the height of the rectangle but take also the offset into account. Q_D(const HbVgReflectionEffect); QRectF r(rect); QPointF mappedOffset = d->mapOffset(d->offset); - qreal rotationAngle = d->mainWindowRotation(); - - if (rotationAngle == 0) + qreal rotationAngle = d->mainWindowRotation(); + + if (rotationAngle == 0) { r.adjust(0, 0, 0, r.height()); - else if (rotationAngle == 90 || rotationAngle == -270) + } else if (rotationAngle == 90 || rotationAngle == -270) { r.adjust(-r.width(), 0, 0, 0); - else if (rotationAngle == -90 || rotationAngle == 270) + } else if (rotationAngle == -90 || rotationAngle == 270) { r.adjust(0, 0, r.width(), 0); - + } + qreal x1 = qMin(r.left(), r.left() + mappedOffset.x()); qreal y1 = qMin(r.top(), r.top() + mappedOffset.y()); qreal x2 = qMax(r.right(), r.right() + mappedOffset.x()); qreal y2 = qMax(r.bottom(), r.bottom() + mappedOffset.y()); - + return QRectF(x1, y1, x2 - x1 + 1, y2 - y1 + 1); } void HbVgReflectionEffect::performEffect(QPainter *painter, - const QPointF &offset, - const QVariant &vgImage, - const QSize &vgImageSize) + const QPointF &offset, + const QVariant &vgImage, + const QSize &vgImageSize) { #ifdef HB_EFFECTS_OPENVG Q_D(HbVgReflectionEffect); @@ -162,11 +149,11 @@ QPaintDevice *pdev = painter->device(); QRectF rectWithChildren = d->deviceRectForSource( - HbVgFrameEffectPrivate::IncludeChildren, - pdev); + HbVgFrameEffectPrivate::IncludeChildren, + pdev); QRectF rectWithoutChildren = d->deviceRectForSource( - HbVgFrameEffectPrivate::ExcludeChildren, - pdev); + HbVgFrameEffectPrivate::ExcludeChildren, + pdev); VGImage srcImage = vgImage.value(); VGImage dstImage = d->ensurePixmap(&d->dstPixmap, vgImageSize); @@ -174,60 +161,63 @@ // IMAGE_USER_TO_SURFACE matrix. painter->drawPixmap(offset, d->srcPixmap); - // Prepare the mirrored image. + // Prepare the mirrored image. qreal rotationAngle = d->mainWindowRotation(); qreal absRotationAngle = qAbs(rotationAngle); - + VGfloat m[9]; vgGetMatrix(m); vgLoadIdentity(); - if (absRotationAngle == 0) + if (absRotationAngle == 0) { m[4] *= -1.0f; - else if (absRotationAngle == 90 || absRotationAngle == 270) + } else if (absRotationAngle == 90 || absRotationAngle == 270) { m[0] *= -1.0f; + } vgMultMatrix(m); - + // Must move the mirrored image to have it on top of the original and then down // again to have it below in portrait-mode. Rotation angles -90 or 270 causes image to be moved to right, // and in rotation angles -90 and 270, image is in correct place initially. // Try to take the exclude-children hint into account when performing the second move. - + VGfloat trans; - if (absRotationAngle == 0) { - if (d->hints & ExcludeChildrenHint) + if (absRotationAngle == 0) { + if (d->hints & ExcludeChildrenHint) { trans = -rectWithChildren.height() - rectWithoutChildren.height(); - else + } else { trans = -2.0f * rectWithChildren.height(); - + } + vgTranslate(0.0f, trans); - } - else if (absRotationAngle == 90 || absRotationAngle == 270) { - if (d->hints & ExcludeChildrenHint) + } else if (absRotationAngle == 90 || absRotationAngle == 270) { + if (d->hints & ExcludeChildrenHint) { trans = -rectWithChildren.width() - rectWithoutChildren.width(); - else + } else { trans = -2.0f * rectWithChildren.width(); - + } + vgTranslate(trans, 0.0f); } - + // Apply the additional offset. Note: down = minus, right = plus. - QPointF mappedOffset = d->mapOffset(d->offset); + QPointF mappedOffset = d->mapOffset(d->offset); VGfloat ox = (VGfloat) mappedOffset.x(); VGfloat oy = (VGfloat) mappedOffset.y(); - if (rotationAngle == 0) - vgTranslate(ox, -oy); - else if (rotationAngle == 90 || rotationAngle == -270) - vgTranslate(-ox, oy); - else if (rotationAngle == -90 || rotationAngle == 270) - vgTranslate(-ox, oy); - + if (rotationAngle == 0) { + vgTranslate(ox, -oy); + } else if (rotationAngle == 90 || rotationAngle == -270) { + vgTranslate(-ox, oy); + } else if (rotationAngle == -90 || rotationAngle == 270) { + vgTranslate(-ox, oy); + } + // Apply the opacity and the color. When no color was set and the opacity is 1, the // source image will be used as it is. This is the only place where we can try to use // the pixmap cache. VGImage imgToDraw = srcImage; QPixmap cachedPm = cached(vgImageSize); - if (cachedPm.isNull()) { + if (cachedPm.isNull()) { VGImage tmpImage = VG_INVALID_HANDLE; if (d->color.isValid()) { // Perform a colorize effect (ignore the opacity here because it must be set for @@ -242,8 +232,9 @@ if (d->opacity < 1.0f - HBVG_EPSILON) { // Apply the opacity, i.e. modify the alpha channel. if (d->paramsChanged) { - for (int i = 0; i < 256; ++i) - d->alphaLUT[i] = (VGubyte) (i * opacity); + for (int i = 0; i < 256; ++i) { + d->alphaLUT[i] = (VGubyte)(i * opacity); + } } vgLookup(dstImage, imgToDraw, identityLUT, identityLUT, identityLUT, d->alphaLUT, @@ -251,10 +242,11 @@ imgToDraw = dstImage; } // If colorize and/or opacity was used then try to cache the result. - if (imgToDraw == tmpImage) + if (imgToDraw == tmpImage) { tryCache(d->tmpPixmap); - else if (imgToDraw == dstImage) + } else if (imgToDraw == dstImage) { tryCache(d->dstPixmap); + } } else { imgToDraw = qPixmapToVGImage(cachedPm); } @@ -289,22 +281,18 @@ // Set up the linear gradient based on the (transformed) size of the source. VGfloat sw = (VGfloat) rectWithChildren.width(); VGfloat sh = (VGfloat) rectWithChildren.height(); - // must be bottom-up to get the proper effect - if (rotationAngle == 0) { + // must be bottom-up to get the proper effect + if (absRotationAngle == 0) { VGfloat grad[] = { sw / 2.0f, sh, - sw / 2.0f, 0.0f }; + sw / 2.0f, 0.0f + }; + vgSetParameterfv(d->fadePaint, VG_PAINT_LINEAR_GRADIENT, 4, grad); + } else if (absRotationAngle == 90 || absRotationAngle == 270) { + VGfloat grad[] = { sw, sh / 2.0f, + 0.0f, sh / 2.0f + }; vgSetParameterfv(d->fadePaint, VG_PAINT_LINEAR_GRADIENT, 4, grad); } - else if (rotationAngle == -90 || rotationAngle == 270){ - VGfloat grad[] = { sw, sh / 2.0f, - 0.0f, sh / 2.0f }; - vgSetParameterfv(d->fadePaint, VG_PAINT_LINEAR_GRADIENT, 4, grad); - } - else if (rotationAngle == 90 || rotationAngle == -270){ - VGfloat grad[] = { 0.0f, sh / 2.0f, - sw, sh / 2.0f }; - vgSetParameterfv(d->fadePaint, VG_PAINT_LINEAR_GRADIENT, 4, grad); - } // Draw the mirrored image by using the paint to get a gradual fade-out effect. vgSeti(VG_MATRIX_MODE, VG_MATRIX_FILL_PAINT_TO_USER); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgreflectioneffect_p.h --- a/src/hbcore/ovgeffects/hbvgreflectioneffect_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgreflectioneffect_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -35,7 +35,6 @@ Q_OBJECT Q_PROPERTY(QPointF offset READ offset WRITE setOffset NOTIFY offsetChanged) Q_PROPERTY(qreal fade READ fade WRITE setFade NOTIFY fadeChanged) - Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged) public: HbVgReflectionEffect(QObject *parent = 0); @@ -45,18 +44,17 @@ QPointF offset() const; qreal fade() const; - QColor color() const; public slots: void setOffset(const QPointF &offset); - void setOffset(qreal x, qreal y) { setOffset(QPointF(x, y)); } + void setOffset(qreal x, qreal y) { + setOffset(QPointF(x, y)); + } void setFade(qreal fade); - void setColor(const QColor &color); signals: void offsetChanged(const QPointF &offset); void fadeChanged(qreal fade); - void colorChanged(const QColor &color); protected: HbVgReflectionEffect(HbVgReflectionEffectPrivate &dd, QObject *parent = 0); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/ovgeffects/hbvgshadoweffect.cpp --- a/src/hbcore/ovgeffects/hbvgshadoweffect.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/ovgeffects/hbvgshadoweffect.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -50,9 +50,9 @@ } void HbVgShadowEffect::performEffect(QPainter *painter, - const QPointF &offset, - const QVariant &vgImage, - const QSize &vgImageSize) + const QPointF &offset, + const QVariant &vgImage, + const QSize &vgImageSize) { #ifdef HB_EFFECTS_OPENVG Q_D(HbVgOutlineEffect); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbframeitem.cpp --- a/src/hbcore/primitives/hbframeitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbframeitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,11 +30,11 @@ #include /*! - @stable + @stable @hbcore \class HbFrameItem \brief A graphics item that draws a frame using the given HbFrameDrawer instance. - + This class is not intended to be derived from. Example of how to create a graphics frame item and use it. @@ -79,7 +79,7 @@ } HbFrameItemPrivate::HbFrameItemPrivate(HbFrameItem *q, HbFrameDrawer *drawer) - : item(q), + : item(q), frameDrawer(drawer) { init(); @@ -101,9 +101,9 @@ void HbFrameItemPrivate::init() { - item->setSizePolicy( QSizePolicy::Ignored, QSizePolicy::Ignored ); + item->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); - if ( QGraphicsWidget *parent = item->parentWidget() ) { + if (QGraphicsWidget *parent = item->parentWidget()) { frameDrawer->setLayoutDirection(parent->layoutDirection()); } @@ -202,16 +202,16 @@ d->frameDrawer->paint(painter, boundingRect()); } - /*! - \reimp - */ +/*! + \reimp +*/ void HbFrameItem::changeEvent(QEvent *event) { - if ( event->type() == QEvent::LayoutDirectionChange ) { - if ( QGraphicsWidget *parent = parentWidget() ) { - d->frameDrawer->setLayoutDirection( parent->layoutDirection() ); + if (event->type() == QEvent::LayoutDirectionChange) { + if (QGraphicsWidget *parent = parentWidget()) { + d->frameDrawer->setLayoutDirection(parent->layoutDirection()); } - } else if ( event->type() == HbEvent::ThemeChanged ) { + } else if (event->type() == HbEvent::ThemeChanged) { d->frameDrawer->themeChanged(); } @@ -223,7 +223,7 @@ break; case QEvent::StyleChange: // flow through default: - HbWidgetBase::changeEvent( event ); + HbWidgetBase::changeEvent(event); break; } } @@ -232,11 +232,11 @@ QSizeF HbFrameItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const { if (which == Qt::MinimumSize) { - return QSizeF( 0, 0 ); - } else if (which == Qt::PreferredSize ) { - return QSizeF( 0, 0 ); + return QSizeF(0, 0); + } else if (which == Qt::PreferredSize) { + return QSizeF(0, 0); } else { - return HbWidgetBase::sizeHint( which, constraint ); + return HbWidgetBase::sizeHint(which, constraint); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbframeitem.h --- a/src/hbcore/primitives/hbframeitem.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbframeitem.h Thu Jul 22 16:36:53 2010 +0100 @@ -59,7 +59,9 @@ void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); enum { Type = Hb::ItemType_FrameItem }; - int type() const { return Type; } + int type() const { + return Type; + } protected: void changeEvent(QEvent *event); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbiconitem.cpp --- a/src/hbcore/primitives/hbiconitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbiconitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ @stable @hbcore \class HbIconItem - \brief HbIconItem displays an HbIcon instance. + \brief HbIconItem displays an icon provided in form of an HbIcon HbIconItem derives from HbWidgetBase and so can be added to a layout. @@ -61,7 +61,7 @@ icon->setPos(10,150); icon->setSize(icon->defaultSize()); \endcode - + Example of how to add HbIconItem to a layout. \code HbButton *button = new HbButton("Button 1"); @@ -102,28 +102,41 @@ const QIcon::Mode HbIconItem::defaultMode = QIcon::Normal; const QIcon::State HbIconItem::defaultState = QIcon::Off; const Qt::AspectRatioMode HbIconItem::defaultAspectRatioMode = Qt::KeepAspectRatio; -const Qt::Alignment HbIconItem::defaultAlignment = Qt::AlignCenter; + +// Note: No center aligning by default to prevent interesting rounding issues +// in certain cases (e.g. 50.25x50.25 sized icon item would lead to having an +// icon sized 50x50 drawn at (0.12499, 0.12499) which may or may not fit visually +// the other primitives of the same widget). +const Qt::Alignment HbIconItem::defaultAlignment = 0; bool HbIconItemPrivate::outlinesEnabled = false; HbIconItemPrivate::HbIconItemPrivate(const HbIcon &icon) : - mIcon(icon), - mAnimator(), - mAlignment(HbIconItem::defaultAlignment), - mAspectRatioMode(HbIconItem::defaultAspectRatioMode), - mState(HbIconItem::defaultState), - mMode(HbIconItem::defaultMode) + mIcon(icon), + mAnimator(), + mAlignment(HbIconItem::defaultAlignment), + mAspectRatioMode(HbIconItem::defaultAspectRatioMode), + mState(HbIconItem::defaultState), + mMode(HbIconItem::defaultMode), + mClearCachedRect(true) { q_ptr = 0; } -HbIconItemPrivate::~HbIconItemPrivate () +HbIconItemPrivate::~HbIconItemPrivate() { } void HbIconItemPrivate::updateIconItem() { - Q_Q( HbIconItem ); + Q_Q(HbIconItem); + if (!mIcon.isNull()) { + // This must be done before the setIcon() call below due to the + // possibility of detaching. Doing it afterwards would lead to + // colorization errors as the themed color might potentially be set for + // a different icon engine, not for the one that is used in painting. + HbIconPrivate::d_ptr_detached(&mIcon)->setThemedColor(mThemedColor); + } const QRectF boundingRect = q->rect(); if (!boundingRect.size().isEmpty()) { mIconRect = boundingRect; @@ -133,6 +146,35 @@ } } +void HbIconItemPrivate::updateIconParams() +{ + Q_Q(HbIconItem); + if (mIconRect.isValid()) { + if (!mIcon.isNull()) { + HbIconPrivate::d_ptr_detached(&mIcon)->setThemedColor(mThemedColor); + } + mAnimator.setIcon(mIcon); + } + q->update(); +} + +void HbIconItemPrivate::recalculateBoundingRect() const +{ + Q_Q(const HbIconItem); + mBoundingRect = q->HbWidgetBase::boundingRect(); + //workaround for qt bug http://bugreports.qt.nokia.com/browse/QTBUG-8820 + mAdjustedRect.setWidth(qMax(qreal(0),mBoundingRect.width() - qreal(2.0))); + mAdjustedRect.setHeight(qMax(qreal(0),mBoundingRect.height() - qreal(2.0))); + //workaround ends + mClearCachedRect = false; +} + +void HbIconItemPrivate::setThemedColor(const QColor &color) +{ + mThemedColor = color; + updateIconItem(); +} + /*! Constructs a new HbIconItem with \a iconName and \a parent. \param iconName the name of the icon. @@ -142,7 +184,7 @@ HbIconItem::HbIconItem(const QString &iconName, QGraphicsItem *parent) : HbWidgetBase(*new HbIconItemPrivate(iconName), parent) { - Q_D( HbIconItem ); + Q_D(HbIconItem); d->q_ptr = this; // Set this graphics item to be updated on icon animations d->mAnimator.setGraphicsItem(this); @@ -157,7 +199,7 @@ HbIconItem::HbIconItem(const HbIcon &icon, QGraphicsItem *parent) : HbWidgetBase(*new HbIconItemPrivate(icon), parent) { - Q_D( HbIconItem ); + Q_D(HbIconItem); d->q_ptr = this; // Set this graphics item to be updated on icon animations d->mAnimator.setGraphicsItem(this); @@ -171,7 +213,7 @@ HbIconItem::HbIconItem(QGraphicsItem *parent) : HbWidgetBase(*new HbIconItemPrivate(QString()), parent) { - Q_D( HbIconItem ); + Q_D(HbIconItem); d->q_ptr = this; // Set this graphics item to be updated on icon animations d->mAnimator.setGraphicsItem(this); @@ -182,7 +224,7 @@ /*! \internal */ -HbIconItem::HbIconItem(HbIconItemPrivate &dd, QGraphicsItem * parent) : +HbIconItem::HbIconItem(HbIconItemPrivate &dd, QGraphicsItem *parent) : HbWidgetBase(dd, parent) { // Set this graphics item to be updated on icon animations @@ -195,7 +237,10 @@ */ HbIconItem::~HbIconItem() { - HbOogmWatcher::instance()->unregisterIconItem(this); + HbOogmWatcher *w = HbOogmWatcher::instance(); + if (w) { + w->unregisterIconItem(this); + } } /*! @@ -205,39 +250,31 @@ */ HbIcon HbIconItem::icon() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mIcon; } /*! Sets the HbIcon instance associated with this HbIconItem. + Calling any function on \a icon after this one may not have any effect on the + icon displayed by the HbIconItem. Use the setters in HbIconItem instead. Of course + the settings set on \a icon before calling setIcon() will all be taken into account. + + The icon-specific parameters (flags, color, mirroring mode) set via the HbIconItem + setters before are lost as this function causes the entire underlying icon to be + replaced with a new one. + \param icon the HbIcon instance that this HbIconItem displays. - When \a takeIconSettings is false, the following settings are not - taken (ignored) from \a icon: flags, color, mirroring mode. Instead, - the previous values set via HbIconItem's setters are used. - - \sa icon + \sa icon() */ -void HbIconItem::setIcon(const HbIcon &icon, bool takeIconSettings) +void HbIconItem::setIcon(const HbIcon &icon, bool reserved) { - Q_D(HbIconItem ); + Q_UNUSED(reserved); + Q_D(HbIconItem); if (d->mIcon != icon) { - if (takeIconSettings) { - d->mIcon = icon; - } else { - // Must preserve settings like flags, colors, etc. In this case the - // settings made previously through HbIconItem take precedence over the - // newly set HbIcon's own settings. - HbIcon::Flags prevFlags = d->mIcon.flags(); - QColor prevColor = d->mIcon.color(); - HbIcon::MirroringMode prevMirroringMode = d->mIcon.mirroringMode(); - d->mIcon = icon; - d->mIcon.setFlags(prevFlags); - d->mIcon.setColor(prevColor); - d->mIcon.setMirroringMode(prevMirroringMode); - } + d->mIcon = icon; d->updateIconItem(); } } @@ -269,7 +306,8 @@ */ void HbIconItem::setAlignment(Qt::Alignment alignment) { - Q_D(HbIconItem ); + Q_D(HbIconItem); + d->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconAlign, true); if (d->mAlignment != alignment) { d->mAlignment = alignment; update(); @@ -287,7 +325,7 @@ */ void HbIconItem::setAspectRatioMode(Qt::AspectRatioMode aspectRatioMode) { - Q_D(HbIconItem ); + Q_D(HbIconItem); d->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconAspectRatioMode, true); if (d->mAspectRatioMode != aspectRatioMode) { d->mAspectRatioMode = aspectRatioMode; @@ -300,13 +338,13 @@ If this method is not called, the icon uses the default mode which is QIcon::Normal. \param mode the new icon mode. - \warning Currently this method makes use of pixmap() routine in case of NVG icons. + \warning Currently this method makes use of pixmap() routine in case of NVG icons. pixmap() slows down the hardware accelerated rendering. \sa mode */ void HbIconItem::setMode(QIcon::Mode mode) { - Q_D(HbIconItem ); + Q_D(HbIconItem); if (d->mMode != mode) { d->mMode = mode; update(); @@ -323,7 +361,7 @@ */ void HbIconItem::setState(QIcon::State state) { - Q_D(HbIconItem ); + Q_D(HbIconItem); if (d->mState != state) { d->mState = state; update(); @@ -340,7 +378,7 @@ */ void HbIconItem::setIconName(const QString &iconName) { - Q_D(HbIconItem ); + Q_D(HbIconItem); if (d->mIcon.iconName() != iconName) { d->mIcon.setIconName(iconName); d->updateIconItem(); @@ -359,9 +397,7 @@ Q_D(HbIconItem); if (d->mIcon.flags() != flags) { d->mIcon.setFlags(flags); - if (d->mIconRect.isValid()) - d->mAnimator.setIcon(d->mIcon); - update(); + d->updateIconParams(); } } @@ -378,9 +414,7 @@ Q_D(HbIconItem); if (d->mIcon.mirroringMode() != mode) { d->mIcon.setMirroringMode(mode); - if (d->mIconRect.isValid()) - d->mAnimator.setIcon(d->mIcon); - update(); + d->updateIconParams(); } } @@ -413,27 +447,28 @@ */ void HbIconItem::setIconName(const QString &iconName, QIcon::Mode mode, QIcon::State state) { - Q_D( HbIconItem ); + Q_D(HbIconItem); d->mIcon.setIconName(iconName, mode, state); d->updateIconItem(); } /*! - Sets the new icon color for the HbIconItem. Note that the color is just - stored but not actually used if the HbIcon::Colorized flag is not set and the - icon is not a mono icon from the theme. + Sets the new icon color for the HbIconItem. Note that the color + is just stored but not actually used if the HbIcon::Colorized flag + is not set and the icon is not a mono icon from the theme. - \param color to be set. - \sa HbIconItem::color(), HbIcon::setColor() + See HbIcon::setColor() for more information on colorization of mono + icons in widgets. + + \param color to be set. + \sa HbIconItem::color(), HbIcon::setColor() */ void HbIconItem::setColor(const QColor &color) { - Q_D( HbIconItem ); + Q_D(HbIconItem); if (d->mIcon.color() != color) { d->mIcon.setColor(color); - if (d->mIconRect.isValid()) - d->mAnimator.setIcon(d->mIcon); - update(); + d->updateIconParams(); } } @@ -443,20 +478,20 @@ */ QColor HbIconItem::color() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mIcon.color(); } /*! Returns the default size of the icon. - + For raster images this is the original size of the image. \sa HbIcon::defaultSize() */ QSizeF HbIconItem::defaultSize() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mIcon.defaultSize(); } @@ -477,7 +512,7 @@ */ Qt::AspectRatioMode HbIconItem::aspectRatioMode() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mAspectRatioMode; } @@ -488,7 +523,7 @@ */ Qt::Alignment HbIconItem::alignment() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mAlignment; } @@ -499,7 +534,7 @@ */ QIcon::Mode HbIconItem::mode() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mMode; } @@ -510,7 +545,7 @@ */ QIcon::State HbIconItem::state() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mState; } @@ -522,7 +557,7 @@ */ QString HbIconItem::iconName() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mIcon.iconName(); } @@ -536,7 +571,7 @@ */ QString HbIconItem::iconName(QIcon::Mode mode, QIcon::State state) const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mIcon.iconName(mode, state); } @@ -580,7 +615,7 @@ */ bool HbIconItem::isNull() const { - Q_D(const HbIconItem ); + Q_D(const HbIconItem); return d->mIcon.isNull(); } @@ -594,25 +629,55 @@ Q_UNUSED(widget) Q_UNUSED(option) Q_D(HbIconItem); - const QRectF rect(boundingRect()); - if(!rect.isEmpty()){ - if (d->mIconRect != rect) { - d->mIconRect = rect; + if (d->mClearCachedRect){ + d->recalculateBoundingRect(); + } + if (!d->mBoundingRect.isEmpty()){ + if (d->mIconRect != d->mBoundingRect) { + d->mIconRect = d->mBoundingRect; + if (!d->mIcon.isNull()) { + HbIconPrivate::d_ptr_detached(&d->mIcon)->setThemedColor(d->mThemedColor); + } d->mIcon.setSize(d->mIconRect.size()); d->mAnimator.setIcon(d->mIcon); } - painter->fillRect(rect, d->mBrush); - d->mAnimator.paint(painter, rect, + if (d->mBrush != Qt::NoBrush) { + painter->fillRect(d->mBoundingRect, d->mBrush); + } + d->mAnimator.paint(painter, d->mBoundingRect, d->mAspectRatioMode, d->mAlignment, d->mMode, d->mState); } if (HbIconItemPrivate::outlinesEnabled) { painter->setBrush(QBrush(QColor(0, 255, 0, 50))); - painter->drawRect(contentsRect()); + painter->drawRect(contentsRect()); } } /*! + \reimp + */ +QRectF HbIconItem::boundingRect() const + +{ + Q_D(const HbIconItem); + if (d->mClearCachedRect) { + d->recalculateBoundingRect(); + } + return d->mAdjustedRect; +} + +/*! + \reimp + */ +void HbIconItem::setGeometry(const QRectF& rect) +{ + Q_D(HbIconItem); + d->mClearCachedRect = true; + HbWidgetBase::setGeometry(rect); +} + +/*! \reimp */ void HbIconItem::changeEvent(QEvent *event) @@ -630,13 +695,13 @@ } } - /*! - \reimp - */ +/*! + \reimp +*/ QVariant HbIconItem::itemChange(GraphicsItemChange change, const QVariant &value) { Q_D(HbIconItem); - if (QGraphicsItem::ItemEnabledHasChanged==change) { + if (QGraphicsItem::ItemEnabledHasChanged == change) { d->mMode = value.toBool() ? QIcon::Normal : QIcon::Disabled; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbiconitem.h --- a/src/hbcore/primitives/hbiconitem.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbiconitem.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,17 +34,17 @@ class HbIconItemPrivate; class HbIconAnimator; -class HB_CORE_EXPORT HbIconItem: public HbWidgetBase +class HB_CORE_EXPORT HbIconItem: public HbWidgetBase { Q_OBJECT public: - explicit HbIconItem(const QString& iconName, QGraphicsItem *parent = 0); + explicit HbIconItem(const QString &iconName, QGraphicsItem *parent = 0); explicit HbIconItem(const HbIcon &icon, QGraphicsItem *parent = 0); explicit HbIconItem(QGraphicsItem *parent = 0); virtual ~HbIconItem(); - void setIcon(const HbIcon &icon, bool takeIconSettings = false); + void setIcon(const HbIcon &icon, bool reserved = false); void setSize(const QSizeF &size); void setAspectRatioMode(Qt::AspectRatioMode mode); void setAlignment(Qt::Alignment alignment); @@ -56,8 +56,8 @@ void setMirroringMode(HbIcon::MirroringMode mode); void setBrush(const QBrush &brush); - void setColor(const QColor &color); - QColor color() const; + void setColor(const QColor &color); + QColor color() const; HbIcon icon() const; QSizeF defaultSize() const; QSizeF iconItemSize() const; @@ -79,11 +79,14 @@ static const Qt::Alignment defaultAlignment; void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0); - + QRectF boundingRect() const; + void setGeometry(const QRectF& rect); HbIconAnimator &animator(); enum { Type = Hb::ItemType_IconItem }; - int type() const { return Type; } + int type() const { + return Type; + } protected: HbIconItem(HbIconItemPrivate &dd, QGraphicsItem *parent); @@ -93,7 +96,7 @@ private: Q_DECLARE_PRIVATE_D(d_ptr, HbIconItem) Q_DISABLE_COPY(HbIconItem) - + friend class HbStylePrivate; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbiconitem_p.h --- a/src/hbcore/primitives/hbiconitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbiconitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,16 +26,6 @@ #ifndef HBICONITEM_P_H #define HBICONITEM_P_H -// -// W A R N I N G -// ------------- -// -// This file is not part of the Hb API. It exists purely as an -// implementation detail. This file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// #include "hbwidgetbase_p.h" #include "hbicon.h" #include "hbiconanimator.h" @@ -46,22 +36,31 @@ class HbIconItemPrivate : public HbWidgetBasePrivate { - Q_DECLARE_PUBLIC( HbIconItem) + Q_DECLARE_PUBLIC(HbIconItem) public: HbIconItemPrivate(const HbIcon &icon); ~HbIconItemPrivate(); void clearStoredIconContent(); void updateIconItem(); - static HbIconItemPrivate *d_ptr(HbIconItem *item) { return item->d_func(); } + void updateIconParams(); + void recalculateBoundingRect() const; + void setThemedColor(const QColor &color); + static HbIconItemPrivate *d_ptr(HbIconItem *item) { + return item->d_func(); + } HbIcon mIcon; HbIconAnimator mAnimator; Qt::Alignment mAlignment; Qt::AspectRatioMode mAspectRatioMode; QIcon::State mState; QIcon::Mode mMode; + QColor mThemedColor; QBrush mBrush; QRectF mIconRect; + mutable QRectF mBoundingRect; + mutable QRectF mAdjustedRect; + mutable bool mClearCachedRect; static bool outlinesEnabled; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbmarqueeitem.cpp --- a/src/hbcore/primitives/hbmarqueeitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbmarqueeitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #ifdef HB_TEXT_MEASUREMENT_UTILITY #include "hbtextmeasurementutility_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #endif //HB_TEXT_MEASUREMENT_UTILITY #include "hbdeviceprofile.h" @@ -549,6 +549,26 @@ } /*! + \reimp +*/ +bool HbMarqueeItem::event(QEvent *e) +{ + Q_D(HbMarqueeItem); + if (e->type() == HbEvent::SleepModeEnter) { + bool oldAnimationPending = d->mAnimationPending; + stopAnimation(); + d->mAnimationPending = oldAnimationPending; + } else if (e->type() == HbEvent::SleepModeExit) { + if (d->mAnimationPending) { + startAnimation(); + } + } + return HbWidgetBase::event(e); +} + + + +/*! Sets the text color into \a color. If invalid color is used color from theme will be used. @@ -584,6 +604,5 @@ return d->mDefaultColor; } - #include "moc_hbmarqueeitem.cpp" // end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbmarqueeitem.h --- a/src/hbcore/primitives/hbmarqueeitem.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbmarqueeitem.h Thu Jul 22 16:36:53 2010 +0100 @@ -64,6 +64,7 @@ void changeEvent(QEvent *event); void resizeEvent ( QGraphicsSceneResizeEvent * event ); QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); + bool event(QEvent *e); HbMarqueeItem(HbMarqueeItemPrivate &dd, QGraphicsItem *parent ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbprogresstrackitem.cpp --- a/src/hbcore/primitives/hbprogresstrackitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbprogresstrackitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -45,14 +45,17 @@ maximum = 0; value = 0; maskWidth = 0; + mDiff = maximum - minimum; } void HbProgressTrackItem::setMinimum(int min) { minimum = min; + mDiff = maximum - minimum; } void HbProgressTrackItem::setMaximum(int max ) { maximum = max; + mDiff = maximum - minimum; } void HbProgressTrackItem::setValue(int val ) { @@ -79,30 +82,30 @@ if(boundingRect()!= parentItem()->boundingRect()){ setGeometry(parentItem()->boundingRect()); } - QSize size = parentItem()->boundingRect().size().toSize(); + /* QSize size = parentItem()->boundingRect().size().toSize(); if(size.width() == 0 || size.height() == 0){ size.setWidth((int)boundingRect().width()); size.setHeight((int)boundingRect().height()); - } + }*/ QRectF maskRect; if(maximum != minimum) { if(maskWidth == 0) { if(mOrientation == Qt::Horizontal){ qreal left = (qreal)boundingRect().topLeft().x(); if(inverted) { - left = (qreal)boundingRect().width()* ((maximum - value)/(qreal) (maximum - minimum)); + left = (qreal)boundingRect().width()* ((maximum - value)/(qreal) (mDiff)); } maskRect = QRectF( left, (qreal)boundingRect().topLeft().y(), - (qreal)boundingRect().width()* ((value - minimum)/(qreal) (maximum - minimum)), + (qreal)boundingRect().width()* ((value - minimum)/(qreal) (mDiff)), (qreal)boundingRect().height() ); } else{ - qreal start = boundingRect().bottom() -(qreal)boundingRect().height()*((value - minimum)/(qreal) (maximum - minimum)); + qreal start = boundingRect().bottom() -(qreal)boundingRect().height()*((value - minimum)/(qreal) (mDiff)); maskRect = QRectF( (qreal)boundingRect().topLeft().x(), start, @@ -113,9 +116,18 @@ } } - QPainterPath path; - path.addRect(maskRect); - frameDrawer().setClipPath(path); +// QPainterPath path; +// path.addRect(maskRect); +// frameDrawer().setClipPath(path); + QPixmap pixmap(boundingRect().size().toSize()); + pixmap.fill(Qt::white); + QPainter painter1; + painter1.begin(&pixmap); + painter1.setBrush(QBrush(Qt::black)); + painter1.drawRect(maskRect); + painter1.end(); + frameDrawer().setMask(pixmap); + HbFrameItem::paint(painter,option,widget); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbprogresstrackitem_p.h --- a/src/hbcore/primitives/hbprogresstrackitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbprogresstrackitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -46,6 +46,7 @@ bool inverted; qreal maskWidth; Qt::Orientation mOrientation; + int mDiff; }; #endif // HBPROGRESSTRACKITEM_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbslidertrackitem.cpp --- a/src/hbcore/primitives/hbslidertrackitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbslidertrackitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -147,10 +147,19 @@ } } } - QPainterPath rectPath; - rectPath.addRect(maskRect); - frameDrawer().setClipPath(rectPath); - setMask = false; +// QPainterPath rectPath; +// rectPath.addRect(maskRect); +// frameDrawer().setClipPath(rectPath); +// setMask = false; + QPixmap pixmap(boundingRect().size().toSize()); + pixmap.fill(Qt::white); + QPainter painter1; + painter1.begin(&pixmap); + painter1.setBrush(QBrush(Qt::black)); + painter1.drawRect(maskRect); + painter1.end(); + frameDrawer().setMask(pixmap); + } HbFrameItem::paint(painter, option, widget); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbtextitem.cpp --- a/src/hbcore/primitives/hbtextitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbtextitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -38,33 +38,39 @@ #ifdef HB_TEXT_MEASUREMENT_UTILITY #include "hbtextmeasurementutility_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #endif +// #define HB_TEXT_ITEM_LOGS #define EPSILON 0.01 +#ifdef HB_TEXT_ITEM_LOGS +# include +const int KMaxLogedTextLength = 30; +#endif // HB_TEXT_ITEM_LOGS + bool HbTextItemPrivate::outlinesEnabled = false; static const QString KDefaultColorThemeName = "qtc_view_normal"; -const int MinimumWidth = 5; // minimum width if there is some text. +const qreal MinimumWidth = 5.0; // minimum width if there is some text. const int KLayoutCacheLimit = 64; const qreal KFadeTolerance = 1.0; HbTextItemPrivate::HbTextItemPrivate () : mAlignment(Qt::AlignLeft | Qt::AlignVCenter), mElideMode(Qt::ElideNone), - mDontPrint(false), - mDontClip(false), mInvalidateShownText(true), mOffsetPos(0,0), mPaintFaded(false), mFadeLengthX(30), mFadeLengthY(15), - mPrefHeight(0), - mMinLines(0), + mMinLines(1), mMaxLines(0), - mNeedToAdjustSizeHint(false), - mUpdateColor(true) + mMinWidthForAdjust(-1), + mMaxWidthForAdjust(-1), + mDefaultHeight(-1), + mUpdateColor(true), + mEventPosted(false) { } @@ -73,7 +79,7 @@ Q_Q(HbTextItem); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - q->setFlag(QGraphicsItem::ItemClipsToShape, !mDontClip); + q->setFlag(QGraphicsItem::ItemClipsToShape, false); q->setFlag(QGraphicsItem::ItemIsSelectable, false); q->setFlag(QGraphicsItem::ItemIsFocusable, false); @@ -81,6 +87,7 @@ textOption.setWrapMode(QTextOption::WordWrap); mTextLayout.setTextOption(textOption); mTextLayout.setCacheEnabled(true); + mTextLayout.setFont(q->font()); } void HbTextItemPrivate::clear() @@ -88,57 +95,36 @@ // no implementation needed } -bool HbTextItemPrivate::doLayout(const QString& text, const qreal lineWidth, qreal leading) +bool HbTextItemPrivate::doLayout(const QString& text, const qreal lineWidth, qreal lineSpacing) { bool textTruncated = false; - mInvalidateShownText = false; mTextLayout.setText(text); - mTextLayout.setFont( q_func()->font() ); - qreal height = 0; + qreal yLinePos = 0; mTextLayout.beginLayout(); while (1) { QTextLine line = mTextLayout.createLine(); if (!line.isValid()) break; - if( ( mMaxLines > 0 ) && ( mTextLayout.lineCount() > mMaxLines ) ) { - textTruncated = true; + + line.setLineWidth(lineWidth); + line.setPosition(QPointF(0, yLinePos)); + + if( ( mMaxLines > 0 ) && ( mTextLayout.lineCount() >= mMaxLines ) ) { + textTruncated = (line.textStart()+line.textLength() < text.length()); break; } - - line.setLineWidth(lineWidth); - height += leading; - line.setPosition(QPointF(0, height)); - height += line.height(); + yLinePos += lineSpacing; } mTextLayout.endLayout(); - if( textTruncated ) { - mTextLayout.setText(text); - mTextLayout.setFont( q_func()->font() ); - - qreal height = 0; - mTextLayout.beginLayout(); - while ( mTextLayout.lineCount() < mMaxLines ) { - QTextLine line = mTextLayout.createLine(); - line.setLineWidth(lineWidth); - height += leading; - line.setPosition(QPointF(0, height)); - height += line.height(); - } - mTextLayout.endLayout(); - } - return textTruncated; } -void HbTextItemPrivate::setSize(const QSizeF &newSize) +void HbTextItemPrivate::rebuildTextLayout(const QSizeF &newSize) { - Q_Q(HbTextItem); - - QFont usedFont = q->font(); - QFontMetricsF fontMetrics(usedFont); + QFontMetricsF fontMetrics(mTextLayout.font()); const qreal lineWidth = qRound( newSize.width() + 0.5 ); // round up to integer @@ -150,11 +136,10 @@ tempText.replace('\n', QChar::LineSeparator); } - // function does the layout only when needed - mTextLayout.setFont(usedFont); // Need to call elidedText explicitly to enable multiple length translations. tempText = fontMetrics.elidedText(tempText, Qt::ElideNone, lineWidth); - bool textTruncated = doLayout(tempText, lineWidth, fontMetrics.leading()); + bool textTruncated = doLayout(tempText, lineWidth, fontMetrics.lineSpacing()); + if(mElideMode!=Qt::ElideNone && !tempText.isEmpty()) { if( ( mTextLayout.boundingRect().height() - newSize.height() > EPSILON ) || ( mTextLayout.boundingRect().width() - lineWidth > EPSILON ) || @@ -162,12 +147,15 @@ // TODO: Multiple length translations with multiline text doLayout(elideLayoutedText(newSize, fontMetrics), lineWidth, - fontMetrics.leading()); + fontMetrics.lineSpacing()); } } + calculateVerticalOffset(); calculateFadeRects(); - q->update(); + + // build of text layout is completed + mInvalidateShownText = false; } /* @@ -196,6 +184,25 @@ return i; } +qreal HbTextItemPrivate::respectHeightLimits(qreal height) const +{ + QFontMetricsF metrics(mTextLayout.font()); + + Q_ASSERT(mMinLines>0); + qreal minHeight = metrics.lineSpacing()*mMinLines - metrics.leading(); + if (height0) { + qreal maxHeight = metrics.lineSpacing()*mMaxLines - metrics.leading(); + if (height>maxHeight) { + height=maxHeight; + } + } + return height; +} + QString HbTextItemPrivate::elideLayoutedText(const QSizeF& size, const QFontMetricsF& metrics) const { int lastVisibleLine =findIndexOfLastLineBeforeY(size.height()); @@ -272,44 +279,163 @@ break; } - if(mDontClip) flags |= Qt::TextDontClip; - if(mDontPrint) flags |= Qt::TextDontPrint; + if(q_ptr->flags().testFlag(QGraphicsItem::ItemClipsToShape)) { + flags |= Qt::TextDontClip; + } + if(!q_ptr->isVisible()) { // or ItemHasNoContents? + flags |= Qt::TextDontPrint; + } return flags; } -bool HbTextItemPrivate::adjustSizeHint() +/* + This method check spatial case of calculating sizeHint. + By default preferredSize (sizeHint(Qt::PreferredSize)) returns size of text + which has lots of free space and it is not wrapped. + After size of HbTextItem is set (width is know) there can be situation + that text has less available width then required. + In such cases when text wrapping is available preferred height of HbTextItem + should be recalculated to take wrapped text into account. + */ +bool HbTextItemPrivate::isAdjustHightNeeded(qreal newWidth, + qreal prefHeight, + qreal minHeight, + qreal maxHeight) { - Q_Q( HbTextItem ); +#ifdef HB_TEXT_ITEM_LOGS + qDebug() << "isAdjustHightNeeded for: " << q_ptr->objectName() + << " text=" << mText.left(KMaxLogedTextLength) + << " adjusted=" << mAdjustedSize + << " prefHeight=" << prefHeight + << " minHeight=" << minHeight + << " lastConstraint=" << mLastConstraint + << " " << mTextLayout.font(); +#endif // HB_TEXT_ITEM_LOGS - mNeedToAdjustSizeHint = false; - - if ( !(q->sizePolicy().verticalPolicy()&QSizePolicy::IgnoreFlag) ) { - // only calculated if the vertical sizeHint is taken into account - - const QFontMetricsF metrics(q->font()); + // first check if wrapping of text is not active + QTextOption::WrapMode wrapMode = mTextLayout.textOption().wrapMode(); + if (wrapMode==QTextOption::NoWrap + || wrapMode==QTextOption::ManualWrap) { + return false; + } - if ( mMinLines > 0 && (mMinLines == mMaxLines) ) { - // if the number of lines if fixed: optimize - const qreal newPrefHeight = ( metrics.height() + metrics.leading() ) * mMinLines - metrics.leading(); - if( qAbs( mPrefHeight - newPrefHeight ) > EPSILON ) { - mPrefHeight = newPrefHeight; - return true; - } - return false; - } + // preferred height was set from outside of this class so there is mo reson to adjust it + if (mLastConstraint.height()>0) { + return false; + } + + // check if line count is fixed + if (mMaxLines == mMinLines) { + return false; + } + + // check if adjusted size has been already calculated + // new width is bigger then last estimated range of same height + if ((mMaxWidthForAdjust>=newWidth + // new width is smaller then last estimated range of same height + && newWidth>=mMinWidthForAdjust)) { + return false; + } - QSizeF currSize = q->size(); - // do the heavy calculation - QRectF desiredRect = metrics.boundingRect( QRectF( 0, 0 , currSize.width(), QWIDGETSIZE_MAX ), textFlagsFromTextOption(), mText ); + if (!mAdjustedSize.isValid()) { + // this means that preferred size is set outside of class by setPreferredSize + // so sizeHint(Qt::Preferredsize) was not called and size adjustment is useless + return false; + } + + // if preconditions are met test if current hight is enough + const QFontMetricsF metrics(mTextLayout.font()); - if( qAbs( desiredRect.height() - mPrefHeight ) > EPSILON ) { - mPrefHeight = desiredRect.height(); - return true; - } + // heavy calculation: check if text fits in current size and cache result + QSizeF newAdjust = metrics.boundingRect(QRectF(0, 0, newWidth, QWIDGETSIZE_MAX), + textFlagsFromTextOption(), + mText).size(); + + if (qFuzzyCompare(newAdjust.height(), mAdjustedSize.height())) { + // height is same as last time update range of same height + mMaxWidthForAdjust = qMax(mMaxWidthForAdjust, newWidth); + mMinWidthForAdjust = qMin(mMinWidthForAdjust, newWidth); + + // and don't update geometry + return false; } - return false; + // new height was calculated create new range for which + // current mAdjustedSize.height is valid + mMaxWidthForAdjust = newWidth; + mMinWidthForAdjust = newAdjust.width(); + + // store new hieght, don't change width + mAdjustedSize.setHeight(newAdjust.height()); + + Q_ASSERT_X(mLastConstraint.width()>0 || mAdjustedSize.width()>=newAdjust.width(), + "HbTextItemPrivate::isAdjustHightNeeded", + QString("Fail for string: \"%1\"").arg(mText).toAscii().data()); + + if (qFuzzyCompare(qBound(minHeight, + respectHeightLimits(mAdjustedSize.height()), + maxHeight), + prefHeight)) { + // updateGeometry has no effect + return false; + } + + // all conditions for calling updateGeometry are meet + return true; +} + +void HbTextItemPrivate::clearAdjustedSizeCache() +{ + // clear cache of size + mMinWidthForAdjust = -1; + mMaxWidthForAdjust = -1; + mAdjustedSize.setHeight(-1); +} + +QSizeF HbTextItemPrivate::calculatePrefferedSize(const QSizeF& constraint) const +{ + const QFontMetricsF metrics(mTextLayout.font()); + + if (mAdjustedSize.isValid() && constraint == mLastConstraint) { + // return cached value, see more in: + // - HbTextItemPrivate::isAdjustHightNeeded + // - HbTextItem::resizeEvent + +#ifdef HB_TEXT_ITEM_LOGS + qDebug() << "HbTextItemPrivate::calculatePrefferedSize: returning cached value: " << mAdjustedSize + << " font:" << mTextLayout.font() + << " text:" << mText.left(KMaxLogedTextLength); +#endif + return mAdjustedSize; + } + mLastConstraint = constraint; + + QSizeF maxSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + if(constraint.width()>0) { + maxSize.setWidth(constraint.width()); + } + if(constraint.height()>0) { + maxSize.setHeight(constraint.height()); + } + + QSizeF size = metrics.boundingRect(QRectF(QPointF(),maxSize), + textFlagsFromTextOption(), + mText).size(); + + mAdjustedSize = size; + mDefaultHeight = size.height(); + mMinWidthForAdjust = size.width(); + mMaxWidthForAdjust = maxSize.width(); + +#ifdef HB_TEXT_ITEM_LOGS + qDebug() << "HbTextItemPrivate::calculatePrefferedSize:" + << " text: " << mText.left(KMaxLogedTextLength) + << " returnSize: " << mAdjustedSize + << " constraint: " << constraint + << " font: " << mTextLayout.font(); +#endif + return size; } bool HbTextItemPrivate::fadeNeeded(const QRectF& contentRect) const @@ -418,96 +544,102 @@ } /* - This method paint each line in tree pieces. - In each piece uses different pen. - When fade effect is not needed on some end centerPen is used. + This method paints single piece of text layout. + If line contains criticalX value then fadePen is used for painting in other + case normalPen is used. */ -int HbTextItemPrivate::paintFaded(QPainter *painter, +void HbTextItemPrivate::paintArea(QPainter *painter, int firstItemToPaint, - const QPen& leftPen, - const QPen& centerPen, - const QPen& rightPen, - const QRectF& area ) const + int lastItemToPaint, + const QPen& normalPen, + const QPen& fadePen, + qreal criticalX) const { - Q_Q(const HbTextItem); - - const int n = mTextLayout.lineCount(); - const qreal leftBorder = q->contentsRect().left()-KFadeTolerance; - const qreal rightBorder = q->contentsRect().right()+KFadeTolerance; - - QRectF leftRect(area); - leftRect.setRight(mFadeFromRect.left()); - QRectF centerRect(area); - centerRect.moveLeft(leftRect.right()); - centerRect.setRight(mFadeFromRect.right()); - QRectF rightRect(area); - rightRect.setLeft(centerRect.right()); - - qreal maxY = area.bottom(); - - for(int i=firstItemToPaint; icriticalX) { + setPainterPen(painter, fadePen, gradientOffset); + } else { + setPainterPen(painter, normalPen, gradientOffset); + } +#else + if (lineRect.left()criticalX) { + painter->setPen(fadePen); + } else { + painter->setPen(normalPen); + } #endif // HB_FADE_EFFECT_WORKAROUND_ON_PHONE - QRectF currentCenter(centerRect); - - if(lineRect.top()>maxY) { - // stop painting line by line - return i; // current line won't be painted at all - } + line.draw(painter, mOffsetPos); + } // for i +} - if(lineRect.left()setPen(leftPen); -#endif - painter->setClipRect(leftRect); - line.draw(painter, mOffsetPos); - } else { - // no fade on this end so extend currentCenter - currentCenter.setLeft(leftRect.left()); - } +/* + This method is used to draw center part of lines. + It is also used to calculate range of lines needed for painting in this range. + */ +int HbTextItemPrivate::paintArea(QPainter *painter, + int firstItemToPaint, + const QPen& normalPen, + qreal lastValidY) const +{ + int i; + const int n = mTextLayout.lineCount(); - if(lineRect.right()>rightBorder) { -#ifdef HB_FADE_EFFECT_WORKAROUND_ON_PHONE - setPainterPen(painter, rightPen, gradientOffset); -#else - painter->setPen(rightPen); +#ifndef HB_FADE_EFFECT_WORKAROUND_ON_PHONE + painter->setPen(normalPen); #endif - painter->setClipRect(rightRect); - line.draw(painter, mOffsetPos); - } else { - // no fade on this end so extend currentCenter - currentCenter.setRight(rightRect.right()); + + for(i=firstItemToPaint; ilastValidY) { + return i; } - - if(currentCenter.width()>0) { #ifdef HB_FADE_EFFECT_WORKAROUND_ON_PHONE - setPainterPen(painter, centerPen, gradientOffset); -#else - painter->setPen(centerPen); -#endif - painter->setClipRect(currentCenter); - line.draw(painter, mOffsetPos); + const QPointF gradientOffset(lineRect.left(), + lineRect.top()+line.ascent()); + + setPainterPen(painter, normalPen, gradientOffset); +#endif // HB_FADE_EFFECT_WORKAROUND_ON_PHONE + + line.draw(painter, mOffsetPos); + + if (lineRect.bottom()>lastValidY) { + return i; } + } // for i + return n-1; +} - if(lineRect.bottom()>maxY) { - // stop painting line by line - return i; // current line has been painted partially +bool HbTextItemPrivate::setClipPath(QPainter *painter, + const QRectF& rect, + const QPainterPath& initialCliping) const +{ + if (initialCliping.isEmpty()) { + painter->setClipRect(rect); + } else { + QPainterPath newPath(rect.topLeft()); + newPath.addRect(rect); + + if (!initialCliping.intersects(newPath)) { + return false; // dont paint } - } // for loop + newPath = initialCliping.intersected(newPath); - return n; -} // paintFaded() + painter->setClipPath(newPath); + } + return true; +} void HbTextItemPrivate::paintWithFadeEffect(QPainter *painter) const { @@ -515,6 +647,7 @@ QLinearGradient gradient; setupGradient(&gradient, q->textColor()); + const QPainterPath initialClipPath = painter->clipPath(); const QRectF contentRect = q->contentsRect(); int i=0; @@ -523,7 +656,6 @@ // #define SEE_FADE_RECTANGLES #ifdef SEE_FADE_RECTANGLES - painter->setClipRect(mFadeToRect); painter->setBrush(QBrush(QColor(215, 0, 0, 30))); painter->drawRect(mFadeToRect); painter->setBrush(QBrush(QColor(0, 0, 200, 30))); @@ -534,19 +666,32 @@ if(mTextLayout.lineAt(0).y()+mOffsetPos.y()contentRect.bottom()) { // bottom fade is needed here centerRect.setBottom(mFadeFromRect.bottom()); + paintBottom = true; } // paint center part { + int startFrom = i; + QPen centerPen(q->textColor()); + if (setClipPath(painter, + QRectF(QPointF(mFadeFromRect.left(), centerRect.top()), + QPointF(mFadeFromRect.right(), centerRect.bottom())), + initialClipPath)) { + // center with no gradient: + i = paintArea(painter, i, centerPen, centerRect.bottom()); + } + // left gradient | || gradient.setStart(mFadeToRect.left(), mFadeFromRect.top()); gradient.setFinalStop(mFadeFromRect.topLeft()); QBrush leftBrush(gradient); QPen leftPen; leftPen.setBrush(leftBrush); + if (setClipPath(painter, + QRectF(centerRect.topLeft(), + QPointF(mFadeFromRect.left(), + centerRect.bottom())), + initialClipPath)) { + paintArea(painter, startFrom, i, centerPen, leftPen, contentRect.left()-KFadeTolerance); + } - // center with no gradient: - QPen centerPen(q->textColor()); - - // top right gradient || | + // right gradient || | gradient.setStart(mFadeToRect.right(), mFadeFromRect.top()); gradient.setFinalStop(mFadeFromRect.topRight()); QBrush rightBrush(gradient); QPen rightPen; rightPen.setBrush(rightBrush); - i = paintFaded(painter, i, leftPen, centerPen, rightPen, centerRect); + + if (setClipPath(painter, + QRectF(QPointF(mFadeFromRect.right(), centerRect.top()), + centerRect.bottomRight()), + initialClipPath)) { + paintArea(painter, startFrom, i, centerPen, rightPen, contentRect.right()+KFadeTolerance); + } } // need to draw bottom as faded? is some lines remained? - if(isetClipPath(initialClipPath); } void HbTextItemPrivate::setFadeLengths(qreal xLength, qreal yLength) @@ -654,15 +848,13 @@ QRectF HbTextItemPrivate::boundingRect (const QRectF& contentsRect) const { QRectF result(layoutBoundingRect()); - if(!mDontClip) { - // clip - QRectF clippedTo = contentsRect; - qreal dx = qMin(mFadeLengthX, (qreal)0.0); - qreal dy = qMin(mFadeLengthY, (qreal)0.0); - clippedTo.adjust(dx, dy, -dx, -dy); + if (mPaintFaded) { + result = result.intersected(mFadeToRect); + } - result = result.intersected(clippedTo); + if(q_ptr->flags().testFlag(QGraphicsItem::ItemClipsToShape)) { + result = result.intersected(contentsRect); } if (HbTextItemPrivate::outlinesEnabled) { @@ -672,6 +864,11 @@ return result; } +void HbTextItemPrivate::scheduleTextBuild() +{ + mInvalidateShownText = true; +} + /*! @alpha @hbcore @@ -686,7 +883,6 @@ /*! Constructor for the class with no content. */ - HbTextItem::HbTextItem (QGraphicsItem *parent) : HbWidgetBase(*new HbTextItemPrivate, parent) { @@ -801,21 +997,34 @@ #endif //HB_TEXT_MEASUREMENT_UTILITY if (d->mText != txt) { - d->mInvalidateShownText = true; + d->scheduleTextBuild(); prepareGeometryChange(); d->mText = txt; d->mTextLayout.setCacheEnabled(KLayoutCacheLimit >= d->mText.length()); - bool onlyHorizontalSizeHintChanged = false; - if ( d->mMinLines > 0 && (d->mMinLines == d->mMaxLines) ) { - onlyHorizontalSizeHintChanged = true; + d->clearAdjustedSizeCache(); + update(); + + // check if call of updateGeometry can be ignored + // don't call it when minimum and maximum lines are equal (height is fixed) or ... + if ((d->mMinLines == d->mMaxLines) + // or when preferred height is ignored + || (sizePolicy().verticalPolicy()&QSizePolicy::IgnoreFlag) + // or was preferred height set from outside of this class? + || d->mLastConstraint.height()>0) { + + // and when preferred width is ignored + if (sizePolicy().horizontalPolicy()&QSizePolicy::IgnoreFlag + // or was preferred width set from outside of this class? + || d->mLastConstraint.width()>0) { +#ifdef HB_TEXT_ITEM_LOGS + qDebug() << "HbTextItem::setText: skiping updateGeometry for: " + << objectName() << " text:" << d->mText.left(KMaxLogedTextLength); +#endif + // in those cases skip updateGeometry + return; + } } - if ( (sizePolicy().horizontalPolicy()&QSizePolicy::IgnoreFlag) && onlyHorizontalSizeHintChanged ) { - // suppress updateGeometry() and use the same geometry - d->setSize( size() ); - } else { - updateGeometry(); - } - update(); + updateGeometry(); } } @@ -881,8 +1090,9 @@ { Q_D(HbTextItem); if (elideMode != d->mElideMode) { - d->mInvalidateShownText = true; d->mElideMode = elideMode; + d->scheduleTextBuild(); + prepareGeometryChange(); update(); } } @@ -910,20 +1120,31 @@ painter->drawRect(rect); } - if(!d->mDontPrint) { - painter->setPen(textColor()); + if (d->mInvalidateShownText) { + d->rebuildTextLayout(size()); + } + + + painter->setPen(textColor()); - Q_ASSERT(d->mPaintFaded == d->fadeNeeded(contentsRect())); - if(!d->mDontClip && d->mPaintFaded ) { - d->paintWithFadeEffect(painter); - } else { - d->mTextLayout.draw(painter, - d->mOffsetPos, - QVector(), - d->mDontClip?QRectF():contentsRect()); - } + Q_ASSERT(d->mPaintFaded == d->fadeNeeded(contentsRect())); + if(d->mPaintFaded ) { + // there is issue with restoring state of painter when + // setClipPath is used. It is impossible to restore + // original clipPath without save and restore whole painter + painter->save(); // see comment above + + d->paintWithFadeEffect(painter); + + painter->restore(); // see comment above + } else { + d->mTextLayout.draw(painter, + d->mOffsetPos, + QVector(), + flags().testFlag(ItemClipsToShape)?contentsRect():QRectF()); } + // Restore painter's state painter->setPen(oldPen); } @@ -935,15 +1156,22 @@ */ void HbTextItem::setGeometry(const QRectF & rect) { - Q_D(HbTextItem); - HbWidgetBase::setGeometry(rect); - // needed when there was no size change and some things - // need to relayout text - if(d->mInvalidateShownText) { - prepareGeometryChange(); - d->setSize(rect.size()); + if (parentLayoutItem() && parentLayoutItem()->isLayout()) { + // rect.size can't be used here since size can be limited inside of + // called method HbWidgetBase::setGeometry(rect) so size is used which + // holds current size + Q_D(HbTextItem); + if (d->isAdjustHightNeeded(size().width(), + preferredHeight(), + minimumHeight(), + maximumHeight())) { + updateGeometry(); +#ifdef HB_TEXT_ITEM_LOGS + qDebug() << "isAdjustHightNeeded returned true - updateGeometry was called"; +#endif // HB_TEXT_ITEM_LOGS + } } } @@ -956,6 +1184,9 @@ { Q_D(const HbTextItem); + if (d->mInvalidateShownText) { + const_cast(d)->rebuildTextLayout(size()); + } return d->boundingRect(contentsRect()); } // boundingRect() @@ -968,6 +1199,21 @@ QSizeF size(0,0); + // TODO: Temporary work-around - font change event are not always received + // so updating font here (this is needed because of sizeHint adjustments). + if (d->mTextLayout.font()!=font()) { +#ifdef HB_TEXT_ITEM_LOGS + qWarning() << "Font change was not recieved on time: work-around is active" + << objectName() + << " test: " << d->mText.left(KMaxLogedTextLength) + << " oldFont:" << d->mTextLayout.font() + << " newFont:" << font(); +#endif // HB_TEXT_ITEM_LOGS + + const_cast(d)->mTextLayout.setFont(font()); + const_cast(d)->clearAdjustedSizeCache(); + } + Qt::Orientations effectiveOrientations(0); if ( !(sizePolicy().horizontalPolicy()&QSizePolicy::IgnoreFlag) ) { effectiveOrientations |= Qt::Horizontal; @@ -982,71 +1228,32 @@ return HbWidgetBase::sizeHint( which, constraint ); } - const QFontMetricsF metrics(font()); - QSizeF maxSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); - - if(constraint.width()>0) { - maxSize.setWidth(constraint.width()); - } - if(constraint.height()>0) { - maxSize.setHeight(constraint.height()); - } - switch(which) { case Qt::MinimumSize: { if ( !d->mText.isEmpty() ) { - size.setWidth( MinimumWidth ); // just to show something -- should not matter in read use-case - - if( d->mMinLines > 1 ) { - size.setHeight( ( metrics.height() + metrics.leading() ) * d->mMinLines - metrics.leading() ); - } else { - size.setHeight( metrics.height() ); - } + size.setWidth(MinimumWidth); // just to show something -- should not matter in read use-case + size.setHeight(d->respectHeightLimits(size.height())); } - break; } case Qt::PreferredSize: { - if ( !(effectiveOrientations&Qt::Horizontal) && d->mMinLines > 0 && (d->mMinLines == d->mMaxLines) ) { + if ( !effectiveOrientations.testFlag(Qt::Horizontal) + && (d->mMinLines == d->mMaxLines) ) { //optimize single line if the horizontal sizeHint is ignored - size.setHeight( ( metrics.height() + metrics.leading() ) * d->mMinLines - metrics.leading() ); + size.setHeight(d->respectHeightLimits(size.height())); break; } - // do the heavy calculation - size = metrics.boundingRect(QRectF(QPointF(),maxSize), - d->textFlagsFromTextOption(), - d->mText).size(); - - - if( ( constraint.width() < 0 ) && ( constraint.height() < 0 ) ) { - - if( ( d->mNeedToAdjustSizeHint ) || ( d->oldSize != size ) ) { - const_cast(d)->adjustSizeHint(); - } - - qreal pref = d->mPrefHeight; - - if( d->mMaxLines > 0 ) { - qreal maxLimit = ( metrics.height() + metrics.leading() ) * d->mMaxLines - metrics.leading(); - if( maxLimit < pref ) { - pref = maxLimit; - } - - } - - const_cast(d)->oldSize = size; - size.setHeight( pref ); - } - + size = d->calculatePrefferedSize(constraint); + size.setHeight(d->respectHeightLimits(size.height())); break; } default: - size = HbWidgetBase::sizeHint( which, constraint ); + size = HbWidgetBase::sizeHint(which, constraint); } return size; @@ -1064,16 +1271,30 @@ switch(event->type()) { case QEvent::LayoutDirectionChange: { Q_D(HbTextItem); - d->mInvalidateShownText = true; - updateGeometry(); + d->scheduleTextBuild(); } break; case QEvent::FontChange: { Q_D(HbTextItem); - d->mInvalidateShownText = true; - prepareGeometryChange(); - updateGeometry(); + + if (!d->mTextLayout.font().isCopyOf(font())) { + +#ifdef HB_TEXT_ITEM_LOGS + qDebug() << "fontChangeEvent: " << objectName() + << " text: " << text().left(KMaxLogedTextLength) + << " font: " << font(); +#endif // HB_TEXT_ITEM_LOGS + + d->mTextLayout.setFont(font()); + d->clearAdjustedSizeCache(); + d->scheduleTextBuild(); + prepareGeometryChange(); + updateGeometry(); + } else { + // ignoring event since it has no effect + return; + } } break; @@ -1094,20 +1315,13 @@ /*! \reimp */ -void HbTextItem::resizeEvent ( QGraphicsSceneResizeEvent * event ) +void HbTextItem::resizeEvent (QGraphicsSceneResizeEvent *event) { Q_D(HbTextItem); HbWidgetBase::resizeEvent(event); - d->setSize(event->newSize()); - - if( ( qAbs(event->oldSize().width() - event->newSize().width()) > EPSILON ) && - ( ( event->oldSize().width() < preferredWidth() ) || ( event->newSize().width() < preferredWidth() ) ) ){ - if( d->adjustSizeHint() ) { - updateGeometry(); - } - } + d->scheduleTextBuild(); } /*! @@ -1129,9 +1343,23 @@ textOption.setWrapMode(textWrapMode); d->mTextLayout.setTextOption(textOption); if(!d->mText.isEmpty()) { - d->mInvalidateShownText = true; - d->mNeedToAdjustSizeHint = true; - updateGeometry(); + d->scheduleTextBuild(); + prepareGeometryChange(); + update(); + } + + // is size hint adjustable? + if (parentLayoutItem() && parentLayoutItem()->isLayout()) { + if (d->mAdjustedSize.isValid() && + d->mAdjustedSize.width() > size().width()) { + // restore default size hint + d->mAdjustedSize.setHeight( + d->respectHeightLimits(d->mDefaultHeight)); + d->mMinWidthForAdjust = d->mAdjustedSize.width(); + d->mMaxWidthForAdjust = QWIDGETSIZE_MAX; + + updateGeometry(); + } } } } @@ -1153,53 +1381,47 @@ Shows (default) or hides text. Size hint remains unchanged (same as when text is visible). - \sa HbTextItem::isVisible() + Equvalent of QGraphicsItem::setVisible(bool) */ void HbTextItem::setTextVisible(bool isVisible) { - Q_D(HbTextItem); - if( d->mDontPrint == isVisible ) { - d->mDontPrint = !isVisible; - update(); - } + setVisible(isVisible); } /*! Returns if text is visible. \sa HbTextItem::setTextVisible(bool) + + Equvalent of QGraphicsItem::isVisible() */ bool HbTextItem::isTextVisible() const { - Q_D(const HbTextItem); - return !d->mDontPrint; + return isVisible(); } /*! - enables (default) or disables text clipping when item geometry is too small. + enables (default) od disables text cliping when item geometry is to small. \sa HbTextItem::isTextClip() + + Equvalent of QGraphicsItem::setFlag(QGraphicsItem::ItemClipsToShape, clipping) */ void HbTextItem::setTextClip(bool clipping) { - Q_D(HbTextItem); - if( d->mDontClip == clipping ) { - prepareGeometryChange(); - d->mDontClip = !clipping; - setFlag(QGraphicsItem::ItemClipsToShape, clipping); - update(); - } + setFlag(QGraphicsItem::ItemClipsToShape, clipping); } /*! Returns true if text is clipped when item geometry is too small. \sa HbTextItem::setTextClip(bool) + + Equvalent of QGraphicsItem::flags().testFlag(QGraphicsItem::ItemClipsToShape) */ bool HbTextItem::isTextClip() const { - Q_D(const HbTextItem); - return !d->mDontClip; + return flags().testFlag(ItemClipsToShape); } /*! @@ -1218,14 +1440,17 @@ void HbTextItem::setMinimumLines( int minLines ) { Q_D( HbTextItem ); + minLines = qMax(minLines, 1); // zero or nagative values are meanless and are restoring 1 + d->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, true); if( minLines != d->mMinLines ) { if( ( d->mMaxLines > 0 ) && ( minLines > d->mMaxLines ) ) { d->mMaxLines = minLines; } + d->mMinLines = minLines; - d->mMinLines = minLines; + // not needed?: d->clearAdjustedSizeCache(); // some condition? updateGeometry(); } } @@ -1248,12 +1473,18 @@ Q_D( HbTextItem ); d->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, true); + maxLines = qMax(maxLines, 0); + if( maxLines != d->mMaxLines ) { - if( ( d->mMinLines > 0 ) && ( maxLines > 0 ) && ( maxLines < d->mMinLines ) ){ + if ((maxLines > 0) && (maxLines < d->mMinLines)){ d->mMinLines = maxLines; } + d->mMaxLines = maxLines; - d->mMaxLines = maxLines; + d->scheduleTextBuild(); + prepareGeometryChange(); + update(); + updateGeometry(); #ifdef HB_TEXT_MEASUREMENT_UTILITY if ( HbFeatureManager::instance()->featureStatus( HbFeatureManager::TextMeasurement ) ) { @@ -1267,7 +1498,7 @@ \sa HbTextItem::setMinimumLines() \sa HbTextItem::setMaximumLines() \sa HbTextItem::maximumLines() - \return "minimum lines" parameter + \return "minimum lines" parameter (zero value means unset) */ int HbTextItem::minimumLines() const { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbtextitem_p.h --- a/src/hbcore/primitives/hbtextitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbtextitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,8 +54,8 @@ void init(QGraphicsItem *parent); void clear(); - bool doLayout(const QString& text, const qreal lineWidth, qreal leading); - void setSize(const QSizeF &newSize); + bool doLayout(const QString& text, const qreal lineWidth, qreal lineSpacing); + void rebuildTextLayout(const QSizeF &newSize); void updateTextOption(); void calculateVerticalOffset(); void updateLayoutDirection(); @@ -65,7 +65,16 @@ int findIndexOfLastLineBeforeY(qreal y) const; QString elideLayoutedText(const QSizeF& size, const QFontMetricsF& metrics) const; - bool adjustSizeHint(); + bool isAdjustHightNeeded(qreal newWidth, + qreal prefHeight, + qreal minHeight, + qreal maxHeight); + + void clearAdjustedSizeCache(); + + qreal respectHeightLimits(qreal height) const; + + inline QSizeF calculatePrefferedSize(const QSizeF& constraint) const; bool fadeNeeded(const QRectF& contentRect) const; static inline void setupGradient(QLinearGradient *gradient, QColor color); @@ -76,12 +85,34 @@ const QPen& pen, const QPointF& lineBegin); + void paintArea(QPainter *painter, + int firstItemToPaint, + int lastItemToPaint, + const QPen& normalPen, + const QPen& fadePen, + qreal criticalX) const; + + int paintArea(QPainter *painter, + int firstItemToPaint, + const QPen& normalPen, + qreal lastValidY) const; + + int paintHorizontalSection(QPainter *painter, + int firstItemToPaint, + QLinearGradient& gradient, + qreal startY, + qreal stopY) const; + int paintFaded(QPainter *painter, int firstItemToPaint, const QPen& leftPen, const QPen& centerPen, const QPen& rightPen, - const QRectF& area ) const; + const QPainterPath& area ) const; + + bool setClipPath(QPainter *painter, + const QRectF& rect, + const QPainterPath& initialCliping) const; void paintWithFadeEffect(QPainter *painter) const; @@ -90,11 +121,11 @@ QRectF layoutBoundingRect() const; QRectF boundingRect(const QRectF& contentsRect) const; + inline void scheduleTextBuild(); + QString mText; Qt::Alignment mAlignment; Qt::TextElideMode mElideMode; - bool mDontPrint; // needed to fake text flags - bool mDontClip; // needed to fake text flags bool mInvalidateShownText; QRectF mOldContentsRect; @@ -112,13 +143,18 @@ QRectF mFadeToRect; QRectF mFadeFromRect; - qreal mPrefHeight; int mMinLines; int mMaxLines; - bool mNeedToAdjustSizeHint; - QSizeF oldSize; + mutable QSizeF mAdjustedSize; + mutable qreal mMinWidthForAdjust; + mutable qreal mMaxWidthForAdjust; + mutable qreal mDefaultHeight; + mutable QSizeF mLastConstraint; mutable bool mUpdateColor; + + bool mEventPosted; + static bool outlinesEnabled; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbtoucharea.cpp --- a/src/hbcore/primitives/hbtoucharea.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbtoucharea.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,9 +30,9 @@ #include #include #include +#include #include #include -#include bool HbTouchAreaPrivate::outlinesEnabled = false; @@ -62,7 +62,7 @@ // Because this method is static we need to toggle QGraphicsItem::ItemHasNoContents flag // value hard way. This is RnD feature anyway. foreach (HbMainWindow *window, hbInstance->allMainWindows()) { - QGraphicsScene *scene = static_cast(window->scene()); + QGraphicsScene *scene = static_cast(window->scene()); //krazy:exclude=qclasses foreach( QGraphicsItem *item, scene->items() ) { if (HbTouchArea *widget = qgraphicsitem_cast(item)) { widget->setFlag(QGraphicsItem::ItemHasNoContents, !enabled); @@ -132,7 +132,7 @@ // The paint method is called only if HbTouchAreaPrivate::outlinesEnabled is true (RnD feature) // because flag QGraphicsItem::ItemHasNoContents is set otherwise. if (HbTouchAreaPrivate::outlinesEnabled) { - painter->setPen(Qt::red); + painter->setPen(Qt::red); //krazy:exclude=qenums painter->drawLine(contentsRect().topLeft(), contentsRect().bottomRight()); painter->drawLine(contentsRect().topRight(), contentsRect().bottomLeft()); painter->setBrush(QBrush(QColor(255, 0, 0, 50))); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/primitives/hbtoucharea.h --- a/src/hbcore/primitives/hbtoucharea.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/primitives/hbtoucharea.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,6 +32,7 @@ class HbTouchAreaPrivate; class HB_CORE_EXPORT HbTouchArea: public HbWidgetBase { + //Q_OBJECT public: explicit HbTouchArea (QGraphicsItem *parent = 0); virtual ~HbTouchArea (); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/centralrepository/2002C304.txt Binary file src/hbcore/resources/centralrepository/2002C304.txt has changed diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/displaydefinition.xml --- a/src/hbcore/resources/displaydefinition.xml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/displaydefinition.xml Thu Jul 22 16:36:53 2010 +0100 @@ -15,7 +15,7 @@ resolutionWidth="360" resolutionHeight="640" ppiValue="229" - orientationAngle="270" + orientationAngle="0" unitValue="6.7" /> :> -qtg_small_smiley_verycool B-) B) +qtg_small_smiley_very_cool B-) B) qtg_small_smiley_eyebrows %-) %) qtg_small_smiley_angry :-@ :@ qtg_small_smiley_sarcastic_mad ;-> ;> diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/animations/hbdefault/qtg_anim_battery_charging.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/animations/hbdefault/qtg_anim_battery_charging.axml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + +qtg_anim_battery_charging_01 +qtg_anim_battery_charging_02 +qtg_anim_battery_charging_03 +qtg_anim_battery_charging_04 +qtg_anim_battery_charging_05 +qtg_anim_battery_charging_06 +qtg_anim_battery_charging_07 +qtg_anim_battery_charging_08 +qtg_anim_battery_charging_09 +qtg_anim_battery_charging_10 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/animations/hbdefault/qtg_anim_battery_full.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/animations/hbdefault/qtg_anim_battery_full.axml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + +qtg_anim_battery_full_01 +qtg_anim_battery_full_02 +qtg_anim_battery_full_03 +qtg_anim_battery_full_04 +qtg_anim_battery_full_05 +qtg_anim_battery_full_06 +qtg_anim_battery_full_07 +qtg_anim_battery_full_08 +qtg_anim_battery_full_09 +qtg_anim_battery_full_10 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/animations/hbdefault/qtg_anim_loading.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/animations/hbdefault/qtg_anim_loading.axml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + +qtg_anim_loading_1 +qtg_anim_loading_2 +qtg_anim_loading_3 +qtg_anim_loading_4 +qtg_anim_loading_5 +qtg_anim_loading_6 +qtg_anim_loading_7 +qtg_anim_loading_8 +qtg_anim_loading_9 +qtg_anim_loading_10 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/animations/hbdefault/qtg_anim_longtap.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/animations/hbdefault/qtg_anim_longtap.axml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + +qtg_anim_longtap_1 +qtg_anim_longtap_2 +qtg_anim_longtap_3 +qtg_anim_longtap_4 +qtg_anim_longtap_5 +qtg_anim_longtap_6 +qtg_anim_longtap_7 +qtg_anim_longtap_8 +qtg_anim_longtap_9 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/animations/hbdefault/qtg_anim_mono_loading.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/animations/hbdefault/qtg_anim_mono_loading.axml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + +qtg_anim_mono_loading_1 +qtg_anim_mono_loading_2 +qtg_anim_mono_loading_3 +qtg_anim_mono_loading_4 +qtg_anim_mono_loading_5 +qtg_anim_mono_loading_6 +qtg_anim_mono_loading_7 +qtg_anim_mono_loading_8 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/animations/hbdefault/qtg_anim_small_loading.axml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/animations/hbdefault/qtg_anim_small_loading.axml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + +qtg_anim_small_loading_1 +qtg_anim_small_loading_2 +qtg_anim_small_loading_3 +qtg_anim_small_loading_4 +qtg_anim_small_loading_5 +qtg_anim_small_loading_6 +qtg_anim_small_loading_7 +qtg_anim_small_loading_8 +qtg_anim_small_loading_9 +qtg_anim_small_loading_10 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,28 @@ + + + + 0.3 + + 0 + 1 + 0.5 + 1.0 + + + 0.3 + + 0 + 1 + 0.5 + 1.0 + + + + 0.3 + 0.0 + 1.0 + + 0.5 + 0.5 + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_bl.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_bl.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,27 @@ + + + Created using carbide.fx 1.5.0; FxML revision 0.84; Platform 10.1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0.0 + 1.0 + + 1.0 + 0.0 + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_br.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_br.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,28 @@ + + + Created using carbide.fx 1.5.0; FxML revision 0.84; Platform 10.1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0.0 + 1.0 + + 0.0 + 0.0 + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_tl.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_tl.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,27 @@ + + + Created using carbide.fx 1.5.0; FxML revision 0.84; Platform 10.1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0.0 + 1.0 + + 1.0 + 1.0 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_tr.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/HS_friend_expand_tr.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,28 @@ + + + Created using carbide.fx 1.5.0; FxML revision 0.84; Platform 10.1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0 + 1 + + + 0.3 + + 0.0 + 1.0 + + 0.0 + 1.0 + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/HS_friend_minimize.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/HS_friend_minimize.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ + + + + + 0.3 + 1.0 + 0.0 + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/camera_standby_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/camera_standby_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + 0.3 + 0.0 + 1.0 + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/camera_standby_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/camera_standby_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + 0.3 + 1.0 + 0.0 + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/camera_toolbarextension_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/camera_toolbarextension_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,22 @@ + + + + 0.3 + + 0.0 + 1.0 + -0.5 + 1 + + + + + + 0.3 + 0.0 + 1.0 + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/camera_toolbarextension_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/camera_toolbarextension_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,21 @@ + + + + 0.3 + + 0.0 + 1.0 + 1 + -0.5 + + + + + + 0.3 + 1.0 + 0.0 + + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/camera_zoom_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/camera_zoom_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + 0.3 + + 0.0 + 1.0 + 1.0 + 1 + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/camera_zoom_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/camera_zoom_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + 0.4 + + 0.0 + 1.0 + 1.0 + 1 + + + + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/chatincoming_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/chatincoming_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + 0.5 + -1.0 + 0.0 + + 1.0 + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/chatoutgoing_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/chatoutgoing_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + 0.5 + 0.0 + 1.0 + + 1.0 + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/dialog_rotate.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/dialog_rotate.fxml Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - 0.3 - - 1.0 - 0.0 - 0.0 - 1.0 - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/gridviewitem_disappear.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/gridviewitem_disappear.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/gridviewitem_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -8,7 +8,7 @@ 0.3 - + 1.0 0.8 diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/gridviewitem_press.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/gridviewitem_press.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/gridviewitem_press.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - 0.3 - - 1.0 - 0.9 - - - - 0.3 - 1.0 - 0.9 - - - 0.5 - 0.5 + + + 0.3 + 1.0 + 0.5 + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/gridviewitem_release.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/gridviewitem_release.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/gridviewitem_release.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - 0.3 - - 0.9 - 1.0 - - - - 0.3 - 0.9 - 1.0 - - - 0.5 - 0.5 + + + 0.3 + 0.5 + 1.0 + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/listviewitem_press.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/listviewitem_press.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/listviewitem_press.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - 0.3 - - 1.0 - 0.9 - - - - 0.3 - 1.0 - 0.9 - - - 0.5 - 0.5 + + + 0.3 + 1.0 + 0.5 + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/listviewitem_release.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/listviewitem_release.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/listviewitem_release.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - 0.3 - - 0.9 - 1.0 - - - - 0.3 - 0.9 - 1.0 - - - 0.5 - 0.5 + + + 0.3 + 0.5 + 1.0 + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/mail_delete.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/mail_delete.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,25 @@ + + + + 0.3 + + 1.0 + 0.5 + + + 0.3 + + 1.0 + 0.5 + + + + 0.3 + 1.0 + 0.0 + + + 0.5 + 0.5 + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/mail_send.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/mail_send.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,49 @@ + + + + 0.5 + 1.0 + 0.0 + + + + + 0.5 + 0.0 + 60.0 + + 0.5 + 0.5 + 1 + + + 0.5 + 1.0 + 0.5 + + 0.5 + 0.5 + + + 0.5 + 1.0 + 0.5 + + + 0.5 + + 0.0 + -1.0 + 1.0 + 1.0 + + + 0.5 + + 0.0 + 1.0 + 1.0 + 1.0 + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/mail_widget_collapse.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/mail_widget_collapse.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + 0.3 + + 0.0 + 1.0 + 1.0 + 1 + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/mail_widget_expand.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/mail_widget_expand.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + 0.3 + + 0.0 + 1.0 + 1 + 1 + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/popup_appear.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/popup_appear.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/popup_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -5,7 +5,7 @@ 0 1 - 0.5 + 0.8 1.0 @@ -13,7 +13,7 @@ 0 1 - 0.5 + 0.8 1.0 @@ -25,22 +25,7 @@ 0.5 0.5 - - 0.0 - 5.0 - - - 0.3 - 0.0 - 0.0 - 1.0 - - 8.0 - 1.0 - 1.0 - #000000 - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/popup_disappear.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/popup_disappear.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/popup_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,12 @@ - 0.3 0 1 1.0 - 0.5 + 0.8 0.3 @@ -15,7 +14,7 @@ 0 1 1.0 - 0.5 + 0.8 0.5 0.5 @@ -26,18 +25,4 @@ 0.0 - - 0.0 - 5.0 - - - 0.3 - 1.0 - 0.0 - - 8.0 - 1.0 - 1.0 - #000000 - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/popup_orient_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/popup_orient_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ + + + + 0.3 + + 0.0 + 1.0 + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/popup_orient_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/popup_orient_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ + + + + 0.4 + + 1.0 + 0.0 + + + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/radiobuttonlistitem_press.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/radiobuttonlistitem_press.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/radiobuttonlistitem_press.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - 0.3 - - 1.0 - 0.8 - - - - 0.2 - 1.0 - 0.8 - - - 0.5 - 0.5 + + + 0.3 + 1.0 + 0.5 + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/radiobuttonlistitem_release.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/radiobuttonlistitem_release.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/radiobuttonlistitem_release.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - 0.3 - - 0.8 - 1.0 - - - - 0.2 - 0.8 - 1.0 - - - 0.5 - 0.5 + + + 0.3 + 0.5 + 1.0 + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/taskswapper_appear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/taskswapper_appear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,33 @@ + + + + 0.3 + + 0 + 1 + 0.5 + 1.0 + + + 0.3 + + 0 + 1 + 0.5 + 1.0 + + + + 0.3 + 0.0 + 1.0 + + 0.5 + 0.5 + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/taskswapper_disappear.fxml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/effects/hbdefault/taskswapper_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,30 @@ + + + + + 0.3 + + 0 + 1 + 1.0 + 0.5 + + + 0.3 + + 0 + 1 + 1.0 + 0.5 + + 0.5 + 0.5 + + + 0.3 + 1.0 + 0.0 + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/effects/hbdefault/viewitem_disappear.fxml --- a/src/hbcore/resources/themes/effects/hbdefault/viewitem_disappear.fxml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/effects/hbdefault/viewitem_disappear.fxml Thu Jul 22 16:36:53 2010 +0100 @@ -8,7 +8,7 @@ 0.3 - + 1.0 0.8 diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/hbdefault.themeindex Binary file src/hbcore/resources/themes/hbdefault.themeindex has changed diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading.axml --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading.axml Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - -qtg_anim_loading_1 -qtg_anim_loading_2 -qtg_anim_loading_3 -qtg_anim_loading_4 -qtg_anim_loading_5 -qtg_anim_loading_6 -qtg_anim_loading_7 -qtg_anim_loading_8 -qtg_anim_loading_9 -qtg_anim_loading_10 - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_1.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_1.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_1.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_10.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_10.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_10.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_2.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_2.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_2.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_3.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_3.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_3.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_4.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_4.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_4.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_5.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_5.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_5.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_6.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_6.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_6.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_7.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_7.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_7.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_8.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_8.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_8.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_9.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_9.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_loading_9.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap.axml --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap.axml Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_1.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_1.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_1.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_2.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_2.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_2.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_3.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_3.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_3.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_4.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_4.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_4.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_5.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_5.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_5.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_6.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_6.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_6.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_7.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_7.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_7.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_8.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_8.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_8.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_9.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_9.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_longtap_9.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_1.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_1.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_2.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_2.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_3.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_3.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_4.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_4.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_5.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_5.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_6.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_6.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_7.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_7.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_8.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_mono_loading_8.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_1.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_1.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_1.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_10.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_10.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_10.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_11.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_11.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_11.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_12.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_12.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_12.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_13.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_13.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_13.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_14.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_14.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_14.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_15.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_15.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_15.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_16.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_16.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_16.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_2.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_2.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_2.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_3.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_3.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_3.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_4.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_4.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_4.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_5.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_5.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_5.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_6.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_6.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_6.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_7.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_7.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_7.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_8.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_8.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_8.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_9.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_9.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_screenlock_swipe_9.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading.axml --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading.axml Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_1.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_1.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_1.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_10.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_10.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_10.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_2.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_2.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_2.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_3.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_3.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_3.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_4.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_4.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_4.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_5.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_5.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_5.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_6.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_6.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_6.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_7.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_7.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_7.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_8.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_8.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_8.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_9.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_9.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_anim_small_loading_9.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_disabled_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_green_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_btn_red_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_focused_day_ind_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_bg_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_title_bg_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_title_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_title_bg_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_title_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_title_bg_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_monthgrid_title_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_bg_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_title_bg_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_title_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_title_bg_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_title_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_title_bg_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_cal_preview_title_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_character_preview_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_edit_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_combobox_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_received_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_convlist_sent_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_icon_bg_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_coverflow_list_bg_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_form_heading_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_fullscreen_heading_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_fullscreen_heading_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_fullscreen_heading_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_fullscreen_heading_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_fullscreen_heading_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_fullscreen_heading_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_organize_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_grid_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_groupbox_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_cl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_cr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_cl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_cr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_cl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_cr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_cl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_cr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsbutton_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems2_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsitems_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hsshortcut_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_hswidget_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_disabled_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_function_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_accented_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_disabled_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_btn_keypad_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,6 @@ - + - + - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,11 @@ - + - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_h_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,6 @@ - + - + - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,6 @@ - + - - - - - - - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,6 @@ - + - - - - - - - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_input_v_bg_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,11 @@ - + - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_overlay_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lcd_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_disabled_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_lineedit_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_new_item_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_parent_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_list_separator_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_messaging_char_count_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_messaging_char_count_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_messaging_char_count_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_messaging_char_count_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_messaging_char_count_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_messaging_char_count_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_multimedia_trans_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_grid_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_heading_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_latched_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_parent_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_list_pressed_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_preview_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_secondary_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_sk_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_grid_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_list_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_popup_trans_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_filled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_frame_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_h_mask_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_filled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_frame_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progbar_v_mask_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_frame_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_disabled_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_disabled_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_disabled_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_loaded_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_disabled_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_disabled_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_disabled_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_progslider_played_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_rocker_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_frame_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_active_handle_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_frame_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_h_handle_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_frame_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_active_handle_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_frame_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_scroll_v_handle_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_shortcut_badge_bg_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_shortcut_badge_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_shortcut_badge_bg_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_shortcut_badge_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_shortcut_badge_bg_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_shortcut_badge_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_filled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_disabled_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_disabled_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_disabled_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_h_frame_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_filled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_disabled_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_disabled_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_disabled_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,12 @@ - + - + - - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,13 @@ - + - + - - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,15 @@ - + - + + + - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_slider_v_frame_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,7 +1,6 @@ - + - + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,7 +1,6 @@ - + - + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,7 +1,6 @@ - + - + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_statusbar_trans_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,7 +1,6 @@ - + - + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_active_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_active_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_active_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_active_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_active_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_active_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_mask_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_mask_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_mask_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_mask_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_mask_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_mask_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tab_passive_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_h_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_h_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,15 @@ - + - + - + - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,20 @@ - + - + - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,15 @@ - + - + - + - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,15 @@ - + - + - + - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,15 @@ - + - + - + - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + - - + + - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + + - - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + + - - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,12 @@ - + - + + - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_trans_v_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,13 @@ - + - + - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,12 +1,12 @@ - + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + - - - - + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_latched_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,17 @@ - + - + - + + + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + + + - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + + + - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + + + - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,17 @@ - + - + - + + + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + - - + + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_cb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_cb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_cb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_ct.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_ct.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_ct.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tb_v_pressed_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_bl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_br.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_tl.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_tr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_disabled_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_highlight_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_textedit_normal_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,18 @@ - + - + - - - - - + + + + + + + + + + + - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,16 @@ - + - + - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,16 @@ - + - + - - - - - + + + + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,16 @@ - + - + - - - - - + + + + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,17 @@ - + - + - - - - - + + + + + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,17 @@ - + - + - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,34 +1,17 @@ - + - + - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,34 +1,17 @@ - + - + - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,38 +1,18 @@ - + - + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,38 +1,18 @@ - + - + - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,16 @@ - + - + - - - - - + + + + + + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,17 @@ - + - + - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,17 @@ - + - + - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,17 @@ - + - + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,17 @@ - + - + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,15 @@ - + - + - - - - + + + + + + + + - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,15 @@ - + - + - - - - - - + + + + + + + + - - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,15 @@ - + - + - - - - + + + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,16 @@ - + - + - - - - + + + + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,16 @@ - + - + - - - - + + + + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,20 @@ - + - + - + - - - - - + + + + - - - - - + + + + - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,15 @@ - + - + - + - - - - - + + + + - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,15 @@ - + - + - + - - - - - + + + + - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,15 @@ - + - + - + - - - - - + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_highlight_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,15 @@ - + - + - + - - - - - + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,14 @@ - + - + - - - + + + - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,13 @@ - + - + - - - + + + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,13 @@ - + - + - - - + + + + + + - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,13 @@ - + - + - - - + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_latched_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,14 @@ - + - + - - - + + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,14 @@ - + - + - - + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,13 @@ - + - + - - + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,13 @@ - + - + - - + + + + + - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,13 @@ - + - + - - + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_normal_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,14 @@ - + - + - - + + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ - + - + - - - + + + - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_cl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_cl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_cl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,13 @@ - + - + - - + + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_cr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_cr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_cr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,13 @@ - + - + - - + + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,13 @@ - + - + - - + + + + + - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_titlebar_trans_pressed_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,14 @@ - + - + - - + + + + + + - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_bg_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_pri_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_highlight_sec_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_b.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_b.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_bl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_bl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_bl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_br.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_br.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_br.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_c.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_c.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_l.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_l.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_r.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_r.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_t.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_t.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_tl.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_tl.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_tl.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_tr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_tr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tumbler_overlay_tr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tuner_c.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tuner_c.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tuner_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tuner_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tuner_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_fr_tuner_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_bg.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_bg.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_bg.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,14 @@ - + - + + + + - - - - - + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_full.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_full.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_full.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,14 @@ - + - + + + + - - - - - + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_low.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_low.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_low.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,14 @@ - + - + + + + - - - - - + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_medium.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_medium.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_battery_medium.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,14 @@ - + - + + + + - - - - - + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_cal_event_ind.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_cal_event_ind.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_bg.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_hour.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_hour.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_min.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_min.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_sec.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_day_sec.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_bg.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_hour.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_hour.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_min.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_min.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_sec.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_clock_night_sec.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_empty.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_empty.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_empty.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_filled.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_filled.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_filled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_mask.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_mask.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_colorpicker_mask.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_disabled.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_disabled.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_highlight.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_highlight.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_highlight.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_latched.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_latched.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_latched.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_normal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_normal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_pressed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_pressed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_combobox_button_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_dimming_image.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_dimming_image.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_dimming_image.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,5 +1,5 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_divider_h_thin.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_divider_h_thin.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_divider_v_thin.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_divider_v_thin.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_capital.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_capital.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_capital.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_numeric.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_numeric.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_numeric.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_small.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_small.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_small.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_text.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_text.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_case_text.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_handle_begin.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_handle_begin.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_handle_begin.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_handle_end.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_handle_end.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_editor_handle_end.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_delete_highlight.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_delete_highlight.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_delete_normal.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_delete_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_dialer_normal.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_dialer_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_dialer_pressed.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hs_dialer_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hspage_highlight.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hspage_highlight.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hspage_normal.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hspage_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hsradio_bg.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hsradio_bg.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hsscreen_bg_lsc.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hsscreen_bg_lsc.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hsscreen_bg_prt.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_hsscreen_bg_prt.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_input_h_swipe.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_input_h_swipe.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_input_h_swipe.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,118 +1,118 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_input_v_swipe.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_input_v_swipe.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_input_v_swipe.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progbar_h_wait.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progbar_h_wait.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progbar_h_wait.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progbar_v_wait.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progbar_v_wait.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progbar_v_wait.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,15 @@ - + - + - + - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_disabled.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_disabled.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,8 +1,8 @@ - + - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_normal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_normal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,12 @@ - + - + - - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_pressed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_pressed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_progslider_handle_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,12 @@ - + - + - - - - + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated_disabled.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated_disabled.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated_pressed.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_rated_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated_disabled.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated_disabled.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated_pressed.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_ratingslider_unrated_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_screen_bg_lsc.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_screen_bg_lsc.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_screen_bg_lsc.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_screen_bg_prt.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_screen_bg_prt.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_screen_bg_prt.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_b.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_b.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_l.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_l.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_r.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_r.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_t.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_scrollarea_mask_t.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_bg.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_bg.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_bg.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,10 @@ - + - - - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_full.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_full.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_full.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,16 @@ - + - - - - - - + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_low.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_low.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_low.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,16 @@ - + - - - - - - + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_medium.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_medium.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_signal_medium.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,10 +1,16 @@ - + - - - - - - + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_disabled.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_normal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_normal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,20 @@ - + - + - - + + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_pressed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_pressed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_handle_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,20 @@ - + - + - - + + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_tick_major.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_tick_major.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_tick_major.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,5 +1,5 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_tick_minor.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_tick_minor.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_h_tick_minor.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,5 +1,5 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_disabled.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_normal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_normal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,20 @@ - + - + - - + + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_pressed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_pressed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_handle_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,20 @@ - + - + - - + + - + - - + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_tick_major.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_tick_major.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_tick_major.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,5 +1,5 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_tick_minor.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_tick_minor.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_slider_v_tick_minor.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,5 +1,5 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_taskswitcher_camcorder.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_taskswitcher_camcorder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_taskswitcher_camera.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_taskswitcher_camera.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_lsc.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_lsc.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,479 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_prt.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_prt.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,553 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_thumbnail.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_theme_preview_thumbnail.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_handle_normal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_handle_normal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_handle_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,21 @@ - + - + + + + + + + + + + + - - - - - - - - - + + + + - - - - - - - - - - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_handle_pressed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_handle_pressed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_handle_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,9 @@ - + - + - - + + @@ -11,9 +11,9 @@ - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_minimize.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_minimize.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_titlebar_minimize.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,19 @@ - + - + - - + + - - + + - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_activated.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_activated.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_activated.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_normal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_normal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_normal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_pressed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_pressed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_trackpoint_pressed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_tumbler_divider.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_tumbler_divider.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_tumbler_divider.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_tuner_selected.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_tuner_selected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_tuner_unselected.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_graf_tuner_unselected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_about.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_about.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_about.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,137 +1,137 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - - - + + + - - - + + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_accessibility.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_accessibility.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_accessibility.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,37 @@ - - - - - - - - - - - + + + + + + + + + - - - - - + + + + + + - - - - - - - - - + + + + + + + + + - - - - - + + + + + - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_account_setup.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_account_setup.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_active_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_active_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_active_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,33 +1,33 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_active_mode.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_active_mode.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_active_mode.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,140 +1,145 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - - + + - - + + + - - - + + + + - - + + + + - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_add_contact_picture.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_add_contact_picture.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_add_contact_picture.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,105 +1,111 @@ - - - + + + + - - - - - + + + + - - - - - + + + + + - - + + - - - + - - - + + + - - + + - - - - - - + + + + + + + + + - - + + - - + + - + - - - + + + + - - + + - - - - + + + + - - - - + + + + + + - - - + + + + + - - + + - - + + - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_add_group_picture.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_add_group_picture.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_album_art.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_album_art.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_als.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_als.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_als.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,266 +1,270 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - + + - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - + + - - - + + + - - + + - - + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_application.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_application.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_application.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,67 +1,61 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_download.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_download.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_download.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,58 +1,55 @@ - - - + + + - - - - - + + + - + - - - + + + - - - - - + + + + + + - + - - + + - + - - - + - - - + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_games.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_games.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_games.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,267 +1,269 @@ - - - + + + - - - - - + + + - + - - - + + + - - - - - + + + + + + - + - - + + - + - - - + - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + + - - - - + + + + + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + + - - - - + + + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + - + - - - - + + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - + + + - - - - + + + + - + - - - - + + + + - - - + + + - - - - + + + + - + - - - - + + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_office.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_office.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_office.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,354 +1,226 @@ - - - + + + - - - - - + + + - + - - - + + + - - - - - + + + + + + - + - - + + - + - - - - - - - - - - + + - - - - - + + - - - - - - - - - - - + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - - - + + - - - + - - - - + - - - - - - - - - - - + + + + + - - - + - - - - + - - - - - - - - - - - + + + + + - - - + - - - - + - - - - - - - - - - - + + + + + - - - + - - - - + - - - - - - - - - - - + + + + + - - - + - - - - + - - - - - - - - - - - + + + + + - - - + - - - - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_user.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_user.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_applications_user.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,91 +1,90 @@ - - - + + + - - - - - + + + - + - - - + + + - - - - - + + + + + + - + - - + + - + - - - + - - + + - - - + + + + + - - + + - - - + + + - - - - + + + + - + - - - + + + - + - - + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_avatar.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_avatar.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_avatar.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,18 @@ - - + + - + - - - - - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_avatar_mycard.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_avatar_mycard.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bell.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bell.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bell.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,65 +1,63 @@ - - - + + + - - - - - - + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - + + - - + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,28 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_active_connection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_active_connection.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_active_connection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,59 +1,61 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + - - - - + + - - + + + - - - + + + + - - + + + + - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_hide.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_hide.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_hide.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,26 @@ - + - - - + + + - - - + + + - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_hide_connection.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_hide_connection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_multiple_connection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_multiple_connection.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_bluetooth_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,39 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + - - - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_browser.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_browser.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_browser.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,61 +1,63 @@ - - - + + + - - - - + + - - - + + + - - - + + + - + - - + + - + - - + + - + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calculator.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calculator.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calculator.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,71 +1,75 @@ - - - + + + - - - - - + + + - - - + + + + - - - - + + + + + - + - - - + + + - - - - + + + + + - + - - - + + + + - - + + - + - - + + - - - - + + + + + - - - - + + + + + @@ -75,189 +79,198 @@ - - - - + + + + - - + + - - - - + + + + - - - - + + + + - - + + - - - - + + + + + - - - - + + + + - - + + - - - - + + + + + - - - - + + + + - + - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - - + + - - - - + + + + - + - - - - + + + + + - + - - - - + + + + - + - - - - + + + + + - + - - - - + + + + - + - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - + + + + + - + - - - - + + + + - + - - - - + + + + + - - - - + + + + - - + + - - - - + + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,102 +1,104 @@ - - - + + + - - - - - - - + + + + + + - - - - - + + + + + + - - - - + + + + - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - - - - + + + + + + + - - - - - - - + + + + + - - - - - + + + + + + + + + + + + - - - - + + + + - - - - - - + + + + + + + - - - - + + + + + + + + - - - - - - - - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar_alarm.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar_alarm.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar_alarm.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,164 +1,164 @@ - - - + + + - - - - - - - + + + + + + - - - - - + + + + + + - - - - + + + + - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - - - - + + + + + + + - - - - - - - + + + + + - - - - - + + + + - - - - + + + + + + + - - - - - - + + + + - - - - + + + + + + + - - - - - - + + + + + + + + - - - + + + - - - + - - - - + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - + + - - + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar_dynamic.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar_dynamic.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_calendar_dynamic.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,92 +1,94 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - - - + + + + - - - - + + + + + + - - - - - - - - - + + + + - - - - + + + + - - - - + + + + + + + - - - - - - - - + + + + + - - - - - + + + + - - - - + + + + + + + - - - - - - + + + + - - - - + + + + + + + - - - - - - + + + + + + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_assistant.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_assistant.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_assistant.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,153 +1,152 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - - - + + + + - - - + + + + - - + + - - - + + + - - - + + + - - - - - + + + + + - - + + - - - + + + - - - + + + - - - - - + + + + + - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_car.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_car.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_car.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,149 +1,107 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - - - - - - + + - - - - - - - - + + - - - - - + + - - - - + - - - - - + + - - - - + - - - - - - - + + + - - - - - + + - - - - - + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_duration.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_duration.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_duration.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,79 +1,78 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - + + - - - + + + - + - - - - + + + + - - + + - - + + + - + @@ -86,23 +85,23 @@ - + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,291 +1,296 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - + - - - + + + - - + + - - + + + - - + + - - - - - - - - - + + + + + + + + + - - + + + - + - - - - - + + + + + - - - + + + - - + + - - - - + + + + + - - + + - + - - + + - - - - + + + + + - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - + + + - - + + - + - - + + - - - - - - - + + + + + + + - - + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,308 +1,313 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - + + + + + - - - - - - + + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + + - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - + + + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - - + + + + - - - + + + - - - - - + + + + + - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_fax_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,307 +1,312 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - + + + + + - - - - - + + + + + + - - - + + + - - - - - - - - - + + + + + + + + + - - + + + - - - - - - - + + + + + + + - - - - + + + + - - - - - - - + + + + + + + + - - - + + + - - - - + + + + - - - - + + + + + - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - - + + + + - - - + + + - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + + - + - - - - - + + + + - - - - - - - - - + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_group.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_group.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_group.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,323 +1,213 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - - + + + + - - - - - - - - - + + + + - + - - - - - + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - - - - - - - - - + + + + - - - - - - - - - + + + + - + - - - - - + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - - - - - - + + + + + + - - - - - - - - - + + + + - - - - - + + - - - - - + + - - + + - - - - - - - + + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,253 +1,255 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - + + - + - - - - - + + + + + + - - - - + + + + + - - - - + + + + - + - - - - - + + + + + - - - - + + + + - + - - - - - + + + + + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - + - - - - + + + + - + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - + + - + - - + + - - - - + + + + + - - - - + + + + + - - + + - - - + + + - - + + - - + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,266 +1,268 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - - - + + + + + + + + - - - - - + + + + + + - + - - - - + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + - - - - - - + + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - + + - - - - + + + + - + - - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - + - - + + - - - - + + + + - + - - - - + + + + + - + - - - - + + + + + - - - - - - - + + + + + + + - + - - + + - + - - + + - - - - - + + + + + - + - - + + - + - - - - - + + + + + - - - - - - - - + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_landline_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,265 +1,267 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - - - + + + + + + + + - - - - - + + + + + + - + - - - - + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + - - - - - - + + + + + + + - - - - - - - + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - + + - - - - + + + + - + - - - - - + + + + + - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - + + + + + + - - - - - - - - + + + + + + + + - + - - + + - - - - - - - - - - - + + + + - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - + + + + + + + - - - - + + + + + + + + + - - - - - + + + + + - - - - + + + + - + - - - - - + + + + - - - - - - - - - + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,129 +1,131 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - + - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - - + + + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,146 +1,148 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + + - - - - + + + + - - - - - - - - - - + + + + + + - - - + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + + - + - - + + - - - - + + + + - - - - - + + + + + - + - - + + - - - - + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_mobile_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,145 +1,147 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - + + + + - - - - + + + + - - - - - - - - - - + + + + + + - - - + + + - - - - + + + + - - - - - - + + + + + + - - - - - - - + + + + + + + + - + - - + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - + - - - - - + + + + - - - - - - - - - - + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_muted.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_muted.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_muted.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,40 @@ - - - + + + - - - + - - - - + + + + - - + + - - - - + + + + - - - + + + - - - - + + + + - - - - - + + + + + @@ -59,187 +57,207 @@ - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - + + + + + + + - - - - + + + + - + - - - - + + + + + - - + + - - + + - - - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_pager.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_pager.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_pager.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,111 +1,113 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - + - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - - + + + + + - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - - - - + + + + - - + + - - - - - + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_service.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_service.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_service.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,75 +1,73 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,105 +1,112 @@ - - - + + + - - - - + + - - - + + + - - - + + + - + - - + + - + - - + + - + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - + + - - - - + + + + + - - - + + + - - - - + + + + + - - + + - - - - + + + + + - + - - - - + + + + + - + - - - - + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,148 +1,153 @@ - - - + + + - - - - + + - - - + + + - - - + + + - + - - + + - + - - + + - + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - + + - - - - + + + + + - - - + + + - - - - + + + + + - - + + - - - - + + + + + - + - - - - + + + + + - + - - - - + + + + + - - - + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_call_voip_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,104 +1,111 @@ - - - + + + - - - - + + - - - + + + - - - + + + - + - - + + - + - - + + - + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - + + - - - - + + + + + - - - + + + - - - - + + + + + - - + + - - - - + + + + + - + - - - - + + + + + - + - - - - + + + + + @@ -106,165 +113,105 @@ - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - + - - - - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_camera.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_camera.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_camera.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,121 +1,116 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_car.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_car.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_car.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,155 +1,81 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - + + + + - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - + - - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_cellinfo.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_cellinfo.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_cellinfo.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,99 +1,97 @@ - - - + + + - - - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,40 +1,39 @@ - - - + + + - - - - + + - - - + + + - + - - - - + + + + - - + + - - + + + - + @@ -47,27 +46,27 @@ - + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,40 +1,39 @@ - - - + + + - - - - + + - - - + + + - + - - - - + + + + - - + + - - + + + - + @@ -47,70 +46,68 @@ - + - - + + - - + + - - + + - - + + - - - + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_night.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_night.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_night_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_night_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_clock_night_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,30 +1,29 @@ - - - + + + - - - + - - - + + + - + - - + + - - + + + - + @@ -37,70 +36,68 @@ - + - - + + - - + + - - + + - - + + - - - + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_computer.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_computer.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_computer.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,71 +1,69 @@ - - - + + + - - - - - - + + + + - + - - + + - + - - + + - - + + - - + + - + - - + + - - - + + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_corrupted.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_corrupted.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_corrupted.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,126 +1,57 @@ - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - + + + + + - - - - - + + + + - - - - - - - - - - + + + + - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - + + + + + + + - - - - + + + + - - - - + + + + - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_custom.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_custom.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_custom.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,71 +1,39 @@ - - + + - + - - - - - - + + - - - - - - - - - + + + - - - - - - - + + - - - - - - - + + - - - - - - - - - + + + - - - - - - - + + - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_data_import.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_data_import.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_data_import.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,393 +1,200 @@ - - + + - + - - - - - - - - - - - - - - + + + + + + - - - - - - - - - + + + - - - - - - - + + - - - - - - - - - - - - - - - - + + + + - - - - - - - + + - - - - + - - - - + - - - - - - - + + - - - - - - - + + - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - + + + - - - - - - - + + - - - - - - - + + - - - - - - - - - + + + - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + - - - - - - - + + - - - - - - - - - - - - - - - - + + + + - - - - - - - + + - - - - + - - - + - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - + + + + + + - - - - - - - + + - - - - - - - + + - - - - - - - - - + + + - - - - - - - - - - - + + + - - - - - - - - - - - - + + + - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_default_server.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_default_server.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_default_server.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,180 +1,176 @@ - - - + + + - - - - - - + + + + - - - - + + + + - - + + - + - - + + - - + + - - + + - + - - + + - + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - - - + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_device_lock.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_device_lock.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_device_lock.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,108 +1,110 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + @@ -110,42 +112,42 @@ - + - + - - - + + + - - - + + + - - - + + + - - - - - + + + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_device_update.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_device_update.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_device_update.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,132 +1,132 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dialer.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dialer.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dialer.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,89 +1,48 @@ - - + + - + - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - - + + - - - - - - - - - + + - - - - - - - - + + - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dialled_voice_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dialled_voice_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dialled_voice_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,62 +1,62 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + + - - + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dictionary.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_dictionary.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,27 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_group.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_group.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_group.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,25 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + @@ -28,291 +27,181 @@ - - - - - - - - - + + + + - - - - - - - - - + + + + - + - - - - - + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - - - - - - - - - + + + + - - - - - - - - - + + + + - + - - - - - + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - - - - - - + + + + + + - - - - - - - - - + + + + - - - - - + + - - - - - + + - - + + - - - - - - - + + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,71 +1,68 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + - - - + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_setup.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_setup.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_setup.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,52 +1,50 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + - - - + - - - + + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_email_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,25 @@ - - - + + + - - - - - - + + + + - - - + + + + - - + + @@ -29,165 +28,105 @@ - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - + - - - - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_end_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_end_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_end_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,43 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_fail.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_fail.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_fail.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,25 @@ - - - + + + - - - - + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_favourites.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_favourites.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_favourites.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,33 +1,35 @@ - - - + + + - - - - - - - - - - - + + + + + - - + + - - + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_filemgr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_filemgr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_filemgr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,100 +1,92 @@ - - - + + + - - - - - + + + - - - + + + - - - - - + + - - - - - - - - - + + - - + + - - - - + + + + - - - - + + + + - - - - - - + - - - - - - - - + + + - - + + - - + + - + - - - + + + - - - + + + - - - - + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_flash.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_flash.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_folder.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_folder.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_folder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,36 +1,35 @@ - - - + + + - - - - - + + + - + - - - + + + - - - - - + + + + + + - + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_friend.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_friend.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_friend.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,75 +1,76 @@ - - - + + + - - - - + + - + - - + + + + - - - + + + + - + - - + + - - + + - - + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_friends.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_friends.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_friends.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,197 +1,204 @@ - - - + + + - - - - + + + + - - - + + + + - + - - + + - - + + - - + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - + + + + - - - + + + + - + - - + + - - + + - - + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - - - - - + + + + + + - - + + + + - - + + - - + + - - + + - - + + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ftu.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ftu.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ftu.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,108 +1,110 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + @@ -110,72 +112,46 @@ - - - - - + + - - - - - - - + + + - - - - - + + - - - - - + + - + - - - + - - + - - - - - + + - - - - - - - + + + - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_games.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_games.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_games.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,160 +1,159 @@ - - - + + + - - - - + + - + - - + + - + - - - + + + - + - - + + - - - + + + - + - - - + + + - - - + + + - - - + + + - - - + + + + - - - - - - + + + + + + - - - - - + + + + + - + - - + + - - - + + + - - + + - - - - - - - - - - + + + + + + + + + + - - - + + + - + - - + + - - - + + + - + - - - + + + - - - + + + - - - + + + - - - - - - + + + + + + - - - - - + + + + + - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_generic_audio.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_generic_audio.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_generic_audio.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,126 +1,128 @@ - - - + + + - - - - + + + + - + - - - - + + + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - + - - - - + + + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - + - - - + + + + - + - - - + + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_generic_bluetooth.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_generic_bluetooth.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_generic_bluetooth.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,31 @@ - - - + + + - - - - + + + + - + - - - - + + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_group_feeds.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_group_feeds.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_group_feeds.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,220 +1,225 @@ - - - + + + - - - - + + + + - - - + + + + - + - - + + - - + + - - + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - + + + + - - - + + + + - + - - + + - - + + - - + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - - - - - + + + + + + - - + + + + - - + + - - + + - - + + - - + + + - - - - + + + + - - + + - - - + + + - - - + + + - - - + + + - - + + - - - - + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_help.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_help.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_help.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,30 +1,28 @@ - - - + + + - - - - - - + + + + - - - + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_hold_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_hold_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_hold_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,41 +1,41 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_homezone.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_homezone.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_homezone.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,61 +1,59 @@ - - - + + + - - - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_im.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_im.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_im.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,49 +1,48 @@ - - - + + + - - - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + + - + - + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_imageprint.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_imageprint.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_imageprint.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,150 +1,151 @@ - - - + + + - - - - + + - - - + + + - - - - - + + + + + - - - + + + - - + + - - - + + + - + - - + + + - - + + - - + + + - - + + - - - + + + - - - + + + - - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - - - - - - - - + + + + + + + + - - - + + + - + - - + + - - - + + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_info.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_info.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_info.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,35 @@ - - - + + + - - - - - - + + + + - - - + + + - - - - + + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_input_device.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_input_device.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_input_device.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,92 +1,86 @@ - - - + + + - - - + + + - + - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_internet_radio.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_internet_radio.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_internet_radio.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,340 +1,339 @@ - - - + + + - - - - - + + + - - - - + + + + - - + + - - + + - - + + - - + + - - - + + + + - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - - + + + - - - + + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_java.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_java.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_java.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,75 +1,79 @@ - - - + + + - - - - - - - + + + + + + - - - - - - - - + + + + + + + + - - + + - - - + + + - - - + + + + - - + + + - - + + + - + - - - - + + + + + - - + + + - - - + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_just_audio.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_just_audio.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_just_audio.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,83 +1,77 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - + - - + + - - + + - - + + - - + + - - - + + + - - - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_key_screen.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_key_screen.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_key_screen.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,215 +1,215 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_keyboard.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_keyboard.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_keyboard.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,358 +1,381 @@ - - - + + + - - - - - + + + - + - - - + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - - + + + - - - + + + + - + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_language.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_language.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_language.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,87 +1,85 @@ - - - + + + - - - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_location_new.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_location_new.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_location_new.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,87 +1,88 @@ - - - + + + - - - - + + - - + + - + - - + + - - + + - - + + - + - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - + + + + + - + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_map_placeholder.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_map_placeholder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_maps.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_maps.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_maps.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,61 +1,60 @@ - - - + + + - - - - + + - - + + - + - - + + - - + + - - + + - + - - + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mass_storage.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mass_storage.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mass_storage.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,130 +1,131 @@ - - - + + + - - - - + + - - - + + + - - - + + + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + - - + + - - - + + + - - + + - - + + - - + + - + - - + + - - + + + - - + + - - + + + - + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_media_transfer.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_media_transfer.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,94 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_meeting.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_meeting.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_meeting.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,84 +1,85 @@ - - - + + + - - - - + + - - - - + + + + + - - - + + + - - + + - - - - + + + + + - + - - + + - - - - + + + + + - - - - + + + + - - + + - - + + - - + + - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,44 +1,42 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_group.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_group.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_group.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,40 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + @@ -44,291 +42,181 @@ - - - - - - - - - + + + + - - - - - - - - - + + + + - + - - - - - + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - - - - - - - - - + + + + - - - - - - - - - + + + + - + - - - - - + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - - - - - - + + + + + + - - - - - - - - - + + + + - - - - - + + - - - - - + + - - + + - - - - - - - + + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - - - + + + - - - - - - - + + + - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,87 +1,83 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - - + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_message_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,40 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + @@ -45,165 +43,105 @@ - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - + - - - - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_video_call_unseen.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_video_call_unseen.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_video_call_unseen.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,234 +1,174 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -236,4 +176,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voice_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voice_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voice_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,64 +1,62 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voice_call_unseen.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voice_call_unseen.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voice_call_unseen.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,88 +1,86 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voip_call_unseen.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voip_call_unseen.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_missed_voip_call_unseen.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,121 +1,117 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - + + - - + + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mmc.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mmc.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mmc.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,161 +1,84 @@ - - + + - + - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - + + + + + + + + + + + + - + + + + + + + - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - + + + + - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mmc_removed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mmc_removed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mmc_removed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -2,85 +2,129 @@ - - - - - + + + + + + - - - - + + + + + + + - - - - - - + + + + + + + + + + + - - - - - + + + + + + + + - - - - + + + + + + + - - - - - - + + + + + + + + + + + - - - - - + + + + + + + + - - - - - - + + + + + + + + + + + - - - - - + + + + + + + + - - - - - - + + + + + + + + + + + - - - - - + + + + + + + + - - - - - - + + + + + + + + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mobile.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mobile.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mobile.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,110 +1,112 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mobile_tv.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mobile_tv.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mobile_tv.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,40 +1,39 @@ - - - + + + - - - - + + - - - + + + + - + - - + + - + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mono.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mono.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mono.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,54 +1,52 @@ - - - + + + - - - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mouse.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mouse.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mouse.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,96 +1,98 @@ - - - + + + - - - - - + + + + - - - - + + + + + - - - - + + + + + - - + + - + - - - - + + + + + - - + + - + - - + + - - - + + + - - - + + + - - - + + + - - + + - - + + - - - - - + + + + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,52 +1,50 @@ - - - + + + - - - - + + - + - - - + + + - - - + + + - + - - + + - - - + + + - - + + - - - + + + - + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_album.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_album.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_album.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,72 +1,68 @@ - - - + + + - - - - - + + + - - + + - - - + + + - + - - - + + + - - + + - + - - - + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_empty.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_empty.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_empty.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,108 +1,113 @@ - - - + + + - - - - + + - - + + - + - - + + - + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + + - - + + + - - + + + - - + + + - - + + + + - - + + + - - - - - - - - - + + + + + + + + + @@ -113,4 +118,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_player.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_player.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_shop.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_shop.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_music_shop.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,132 +1,130 @@ - - - + + + - - - - - + + + - - - + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - - - + + + + + + - - + + - + - - - + + + - - - + + + - - + + - - - - - + + + + + + - - - - - + + + + + - - - + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mycard.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mycard.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_mycard.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,44 +1,42 @@ - - - + + + - - - - + + - - - + + + - - + + - + - - + + - - + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,46 @@ - - - + + + - - - - - - - + + + + + - - + + - - - + + + - - - - + + + + - - + + - - + + - - - - - + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,61 +1,57 @@ - - - + + + - - - - - - - + + + + + - - + + - - - + + + - - - - + + + + - - + + - - + + - - - - - + + + + + - - - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network_settings.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network_settings.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_network_settings.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,72 +1,69 @@ - - - + + + - - - - - - - + + + + + - - + + - - - + + + - - - - + + + + - - + + - - + + - - - - - + + + + + - - - + - - - + + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_new_message.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_new_message.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_new_message.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,75 +1,70 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - - - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_new_voice_message.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_new_voice_message.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_new_voice_message.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,74 +1,57 @@ - - - + + + - - - - - - - + - - - - - - - - - - + + - - - - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_non_default.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_non_default.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_non_default.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,161 +1,159 @@ - - - + + + - - - - - - + + + + - - - - + + + + - - + + - + - - + + - - + + - - + + - + - - + + - + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_notes.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_notes.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_notes.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,103 +1,100 @@ - - - + + + - - - - + + + - - - - + + + + - - - - + + + + - - - + + + - - - - - - - - - + + + + + + + + + - - - + - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - - + + + - - - - + + + + - - - - + + + + - + - - - - + + + + - - - + + + - - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ok.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ok.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ok.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,20 @@ - - - + + + - - - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_online.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_online.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_online.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,76 +1,78 @@ - - - + + + - - - - + + - - - + + + - - - + + + - + - - + + - + - - + + - + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + - - - + + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_outbox.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_outbox.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ovi_suite.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ovi_suite.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,12 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ovistore.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ovistore.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_personalization.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_personalization.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_personalization.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,185 +1,117 @@ - - - + + + - - - - - - - - - + + + + - - - - - + + - - - - - - - + + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - + + - - - - - - - + + + - - - - - + + - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - + + + + + - - - - - + + - - - - - + + - - - - - + + - - - - - - - + - - - - - - - - - - + @@ -187,54 +119,46 @@ - - - + - - - - - - - + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_phone_as_modem.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_phone_as_modem.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_phone_as_modem.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,253 +1,255 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - - + + - - + + - - + + - - - + + + + - - - - + + + + - - - + + + + - - - - + + + + - - + + - - + + - + - - + + - - - + + + - - + + - - - + + + - - + + - - + + - - - - - - + + + + + + - - - + + + - - - + + + - - + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_phonebook.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_phonebook.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_phonebook.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,65 +1,66 @@ - - - + + + - - - - + + - - - + + + + - + - - - + + + + - + - - - + + + - - + + - - - + + + - - + + + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_photos.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_photos.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_photos.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,111 +1,114 @@ - - - + + + - - - - - - - + + + + + + - - - - - + + + + + + - - + + - + - - - - - + + + + + + - - - - - + + + + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + + - - - + + + - - - - - + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_pin_code.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_pin_code.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_pin_code.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,40 +1,38 @@ - - - + + + - - - - - + + + - - + + - - + + - - + + - + - + - + - + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_play.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_play.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_play.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,24 @@ - - - + + + - - - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_playlist.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_playlist.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_playlist.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,32 +1,32 @@ - - - + + + - - - - + + + - - + + - - - + + + - - - + + + + - + @@ -38,36 +38,34 @@ - - - + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_positioning.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_positioning.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_positioning_info.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_positioning_info.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_power_management.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_power_management.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_power_management.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,41 @@ - - - + + + - - - + - - - - - + + + + + - - - + + + - - - - + + + + - - - - + + + + @@ -48,9 +46,9 @@ - - - + + + @@ -58,50 +56,48 @@ - - - + - - + + - - - - + + + + - - - - + + + + - - + + - - - - + + + + - - - - + + + + @@ -116,4 +112,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_presentation_player.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_presentation_player.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_presentation_player.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,135 +1,127 @@ - - - + + + - - - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - - - + - - + + - + - - + + - - - - + + + + + + + + + + + + + - - - - - + + + + + - - - - - - + - - - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_profiles.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_profiles.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_profiles.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,103 +1,99 @@ - - - + + + - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_psm.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_psm.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_query.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_query.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_query.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,32 +1,31 @@ - - - + + + - - - - - + + + - - + + - - - + + + - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_radio.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_radio.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_radio.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,307 +1,308 @@ - - - + + + - - - - - + + + - - - - + + + + - - + + - - + + - - + + - - + + - - - + + + + - - + + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - - + + + - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_realplayer.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_realplayer.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_received_voice_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_received_voice_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_received_voice_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,64 +1,62 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_reset.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_reset.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_reset.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,207 +1,151 @@ - - + + - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - + + + + + + + - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ring_tone.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ring_tone.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_ring_tone.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,143 +1,143 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sat.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sat.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sat.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,116 +1,112 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - + + + - - - + + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_search.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_search.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_search.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,60 +1,60 @@ - - - + + + - - - - - - + + + + - - - - + + + + - - - - - + + + + + - + - - - + + + - + - - - - + + + + + - - - - + + + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_security.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_security.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_security.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,46 +1,44 @@ - - - + + + - - - - - + + + - - - + + + - - - + + + - - - - - + + + + + - - - - - - + + + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_server_locked.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_server_locked.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_server_locked.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,202 +1,200 @@ - - - + + + - - - - - - + + + + - - - - + + + + - - + + - + - - + + - - + + - - + + - + - - + + - + - - + + - - + + - - - - - + + + + + - - - - - + + + + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + - + - - - - - + + + + + - + - + - + - - - + + + - - - + + + - - - + + + - - - - - + + + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_settings.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_settings.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_settings.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,140 +1,146 @@ - - - + + + - - - - - - + + + + - - - - - + + + + + - - + + - - - - + + + + - - - + + + - - + + - - + + - - - - - - + + + + + + + + + - - - - - + + + + + + - - + + - - - - + + + + - - - + + + - - + + - - + + - - - - - - + + + + + + + + + - - - - - + + + + + + - - + + - - + + - - + + - - - - - - + + + + + + @@ -142,12 +148,12 @@ - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sim.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sim.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sim.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,89 +1,87 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - + + - + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sisx.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sisx.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sisx.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,15 @@ - - - + + + - - - - - - - + + + + + + @@ -19,47 +18,47 @@ - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_social_media.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_social_media.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_social_media.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,523 +1,265 @@ - - + + - + - - - - - - + + - - - - - - - - - + + + - - - - - - - - - + + + - - - - - + - - - - - - + - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + - - - - - - + + - - - - - + - - - - - - - - - - - - + + + + - - - - - - - - - - - + + + + - - - - - - - - - - - - - + + - - - - - - - + + - - - - - - - - - - - - + + + + - - - - - - - + + - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - + + - - - - - - - - + + - - - - - + - - - - - - - - - - - - + + + + - - - - - - - + + - - - - - - - + + - - - - - - + + - - - - - - - + + + - - - - - - - - - - - + + + + - - - - - - - + + - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - + + - - - - - - - - - - - - - - + + + + - - - - - - - - + + - - - - - - - - - - + + + + - - - - - - - + + - - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_speaker.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_speaker.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_speaker.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,99 +1,97 @@ - - - + + + - - - - + + - - - + + + - - - + + + - - + + - - - - + + + + - - - - + + + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_stereo.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_stereo.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_stereo.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,95 +1,93 @@ - - - + + + - - - - - + + + - - - - + + + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - - + + + + + - - + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - - + + - - - - - + + + + + - - + + - - - - - + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sync.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sync.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_sync.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,61 +1,60 @@ - - - + + + - - - - + + - + - - + + - + - - + + - + - - + + - + - - - + + + - - + + - - - + + + - - + + - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_text.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_text.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_text.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,32 +1,32 @@ - - - + + + - - - - + + + - - + + - - - + + + - - - + + + + - + @@ -37,4 +37,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tip.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tip.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tip.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,41 +1,40 @@ - - - + + + - - - - - - + + + + + - + - - - - - - - + + + + + + + - - - - + + + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_todo_alarm.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_todo_alarm.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_todo_alarm.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,151 +1,148 @@ - - - + + + - - - - + + - - + + - - + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + + - - + + - - - + + + - - - - - + + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + - - - - + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - + + - - + + - - - - - - - + + + + + + + - - - - - - - - + + + + + + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tone.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tone.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tone.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,61 +1,34 @@ - - + + - + - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - - - + + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tone_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tone_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tone_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,63 +1,45 @@ - - - + + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - - - + + + - - - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tv_out.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tv_out.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_tv_out.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,184 +1,184 @@ - - - + + + - - - - - - - + + + + + + - - - - + + + + + - - + + - + - - + + - - - + + + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - + - - - - - + + + + + + - - + + - + - - + + - + - - - + + + - - + + - + - - + + - + - - - + + + - - - - - + + + - + - - - - + + + + - + - - - - - - + + + + + + - + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - + + + - - - + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_unknown.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_unknown.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_unknown.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,32 +1,31 @@ - - - + + + - - - - - + + + - - + + - - - + + + - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,81 +1,86 @@ - - - + + + - - - - - - - - - - - + + + - - - - - - - + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,124 +1,127 @@ - - - + + + - - - - - - - - - - - + + + - - - - - - - + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + + - - - - - + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - + + + + + + + + + + + + + - - - + - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_url_address_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,246 +1,191 @@ - - - + + + - - - - - - - - - - - + + + - - - - - - - + + + + - - - - - + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - - - - - + + + + + + - - - - - + + + + + + + + + + + + + - - - - - + + + + + + - - - - - - - - + + + + + + + + + + + + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - - + + + - + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - + + - + - - - - - - - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_usb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_usb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_usb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,29 @@ - - - + + + - - - - - - + + + + - - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_usb_memory.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_usb_memory.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_usb_memory.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,64 +1,63 @@ - - - + + + - - - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - + + - + - - + + - - + + - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,35 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,188 +1,130 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -190,4 +132,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_active.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,179 +1,121 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -181,4 +123,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_end.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_end.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_end.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,189 +1,131 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - - + + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -191,4 +133,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_call_waiting.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,187 +1,129 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -189,4 +131,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_capture.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_capture.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_capture.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,138 +1,149 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - + - - - + + + - - - - - - + + + + + + + + + - + - - - + + + + - - + + - - - - + + + + - - - - + + + + + + - - + + + + - - - + + + + + - - + + + - - + + - + - - - + + + - - - - - - + + + + + + + + + - - + + - - + + - - - + + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_collection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_collection.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_collection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,207 +1,68 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - + + + + + - - - - - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_dialled_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_dialled_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_dialled_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,208 +1,150 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + + - - + + + - + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -210,4 +152,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_download.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_download.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_download.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,59 +1,55 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - + - - - + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_missed_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_missed_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_missed_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,210 +1,150 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - + + - - + + - - + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -212,4 +152,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_player.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_player.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_player.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,60 +1,56 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_podcast.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_podcast.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_podcast.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,60 +1,56 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - - + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_received_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_received_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_received_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,210 +1,150 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - - - + + + - - + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + - - + + - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - + - - - - - + - - - - - - - - - - + + + + @@ -212,4 +152,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_recent.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_recent.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_recent.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,74 +1,71 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - + - - + + - - - + + + - + - - - - + + + + - - + + - - + + + - + @@ -81,23 +78,23 @@ - + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_service.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_service.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_service.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,70 +1,66 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_tv.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_tv.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_video_tv.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,74 +1,71 @@ - - - + + + - - - - - - + + + + - - + + - - - + + + - - + + - + - - + + - + - - - + - - + + - - - + + + + - + - - + + - + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voice_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voice_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voice_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,42 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voice_recorder.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voice_recorder.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voice_recorder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,40 @@ - - - + + + - - - + - - - - + + + + - - + + - - - - + + + + - - - + + + - - - - + + + + - - - - - + + + + + @@ -59,174 +57,196 @@ - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - + + + + - - - - + + + + - - - - + + + + - - - - - - - + + + + + + + - - - - + + + + - + - - - - + + + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,75 +1,73 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_active.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,66 +1,64 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - - + + + - + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_end.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_end.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_end.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,76 +1,74 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_hold.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_hold.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_hold.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,74 +1,72 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - - + + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_call_waiting.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,74 +1,72 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_dialled_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_dialled_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_dialled_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,95 +1,93 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - - - + - - - + + + + - - + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_missed_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_missed_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_missed_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,97 +1,93 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - - - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_received_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_received_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_voip_received_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,97 +1,93 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - - - + - - - + + + - + - - - + + + - + - - - - + + + + - - - - + + + + - - - + - - - + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_waiting_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_waiting_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_waiting_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,41 +1,41 @@ - - - + + + - - - - - + + + + + - - + + - - + + - - + + - + - - + + - + - - - + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_warning.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_warning.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_warning.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,34 +1,33 @@ - - - + + + - - - - + + - - - + + + + - - - - + + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_web_feeds.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_web_feeds.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_web_feeds.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,23 @@ - - - + + + - - - + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_widget.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_widget.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_widget.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,88 +1,96 @@ - - - + + + - - - - - + + + + - - - - + + + + + - - + + - - + + - - - - + + + + + - - - - + + + + + - - - - + + + + + - - + + + + - - - - + + + + - - + + + - - - + + + - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wire_connect.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wire_connect.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wire_connect.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,80 +1,50 @@ - - - + + + - - - - - - - - - - - - - + - - - - - + + - - - + - - - - - + + - - - - - - - - - - @@ -86,4 +56,4 @@ - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wlan.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wlan.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wlan.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,74 +1,73 @@ - - - + + + - - - - - + + + + - - - + + + - - + + - + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wlan_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wlan_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_wlan_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,87 +1,84 @@ - - - + + + - - - - - + + + + - - - + + + - - + + - + - - - + + + - - - + + + - - + + - - + + - - - + + + - - - + + + - - + + - - + + - + - - - + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_zipmgr.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_zipmgr.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_large_zipmgr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,147 +1,145 @@ - - - + + + - - - - - - + + + + - - - - + + + + - - + + - - - - + + + + - - + + - - - - + + + + - - + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - - + + + + - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - + + + - - - - + + + + - - - + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_0_3mp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_0_3mp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_0_3mp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,9 @@ - - - - - - - - + + + + + - - - - - - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_12mp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_12mp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_12mp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,8 @@ - - - - - - - - + + + + + - - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_1_3mp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_1_3mp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_1_3mp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,8 @@ - - + + - - - - - - - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_3mp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_3mp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_3mp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,8 @@ - - - - - - - - + + + + + - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_9mp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_9mp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_9mp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,9 @@ - - - - - - - - + + + + + - - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_accented_characters.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_accented_characters.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_accented_characters.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,12 @@ - - - - + + + + - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_activitystream.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_activitystream.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_activitystream.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,11 @@ - - - - + + + + - - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_account.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_account.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +0,0 @@ - - - -]> - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_contact.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_contact.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_contact.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,9 @@ - - - -]> - - - - - + + + + + - - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_field.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_field.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - -]> - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_calendar.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_calendar.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_calendar.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,10 @@ - - - -]> - - - - - + + + + + - - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_contact.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_contact.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_contact.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,24 +1,8 @@ - - - -]> - - - - - - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_favourites.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_favourites.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_favourites.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,9 @@ - - - -]> - - - - - + + + + + - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_groups.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_groups.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +0,0 @@ - - - -]> - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_homescreen.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_homescreen.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_homescreen.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,10 @@ - - - -]> - - - - - + + + + + - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_phonebook.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_phonebook.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_video_collection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_video_collection.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_add_to_video_collection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,17 @@ - - + + - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_addcity.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_addcity.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_addcity.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,10 @@ - - - -]> - - - - - - - - - - - + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_inactive.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_inactive.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_inactive.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,9 @@ - - - -]> - - - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_new.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_new.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_new.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,9 @@ - - - -]> - - - - - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_snooze.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_snooze.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alarm_snooze.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alpha_mode.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alpha_mode.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_alpha_mode.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,11 @@ - - - - + + + + - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_app_exit.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_app_exit.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_app_exit.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,8 @@ - - - - + + + + - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_applications_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_applications_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_applications_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,8 @@ - - - -]> - - - - - - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_applications_collections.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_applications_collections.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_applications_collections.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,9 @@ - - - -]> - - - - - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_down.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_down.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_down.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_left.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_left.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_right.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_right.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_up.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_up.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_arrow_up.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_artists.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_artists.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_artists.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,9 @@ - - - -]> - - - - - + + + + + - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_natural.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_natural.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_natural.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - + - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_stretched.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_stretched.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_stretched.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,13 @@ - - + + - - - + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_zoom.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_zoom.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_aspect_ratio_zoom.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,14 @@ - - + + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_attach.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_attach.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_attach.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_audio.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_audio.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_audio.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - + - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_autoflash.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_autoflash.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_autoflash.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - - - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_automatic.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_automatic.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_automatic.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - - - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_back.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_back.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_back.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_backspace1.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_backspace1.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_backspace1.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,5 @@ - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_backspace2.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_backspace2.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_backspace2.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,8 @@ - - - - + + + + - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,8 @@ - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth_headset.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth_headset.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth_headset.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,11 @@ - - - -]> - - - - - + + + + + - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bluetooth_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bold.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bold.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bold.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,6 @@ - - - - + + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_add_new.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_add_new.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_add_new.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,9 @@ - - - -]> - - - - - + + + + + - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_pair.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_pair.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_pair.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - - - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_show_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_show_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_show_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,24 +1,12 @@ - - - -]> - - - - - + + + + + - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_show_pair.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_show_pair.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_show_pair.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,10 @@ - - - -]> - - - - - + + + + + - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_unpair.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_unpair.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bt_unpair.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,24 +1,11 @@ - - - -]> - - - - - + + + + + - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bullet.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bullet.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_bullet.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,17 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_call_diverted.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camcoder_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camcoder_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - -]> - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camcorder.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camcorder.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camcorder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,9 @@ - - - -]> - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camcorder_off.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camcorder_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camera.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camera.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_camera.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,10 @@ - - + + - + - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_capture.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_capture.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_capture.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,11 @@ - - + + - + - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_car_itut.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_car_itut.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_car_qwerty.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_car_qwerty.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_change_cam_mode.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_change_cam_mode.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_change_cam_mode.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,11 @@ - - + + - + - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_ciphering_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,10 @@ - - - -]> - - - - - + + + + + - - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_close_up.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_close_up.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_close_up.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,10 @@ - - + + - + - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_collapse.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_collapse.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_collapse.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,5 @@ - - - - - - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_communication.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_communication.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_communication.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,9 @@ - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_conference.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_conference.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contact_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contact_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contact_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,10 @@ - - - -]> - - - - - + + + + + - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contacts.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contacts.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contacts.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,10 @@ - - - -]> - - - - - + + + + + - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_continuous_capture.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_continuous_capture.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_continuous_capture.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - - - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contrast.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contrast.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_contrast.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_corrupted.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_corrupted.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_corrupted.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,9 @@ - - - -]> - - - - - + + + + + - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_countdown_timer.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_countdown_timer.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - -]> - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_email.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_email.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_email.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,8 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_event.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_event.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_event.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - - -]> - - - - - + + + + + - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_group.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_group.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ - - - -]> - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_message.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_message.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_create_message.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,13 @@ - - - -]> - - - - - + + + + + - - + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_day_light_saving_time.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_day_light_saving_time.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_day_light_saving_time.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,10 @@ - - + + - + - - - - - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_delete.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_delete.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_delete.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,10 @@ - - - -]> - - - - - + + + + + - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_details.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_details.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_details.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,12 @@ - - - -]> - - - - - + + + + + - - - - - - - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_dialer.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_dialer.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_dialer.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,24 +1,17 @@ - - - -]> - - - - - + + + + + - - - - - - - - - - + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_disconnect.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_disconnect.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_disconnect.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,12 @@ - - - -]> - - - - - + + + + + - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_drm_rights_expired.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_drm_rights_expired.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_drm_rights_expired.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,10 @@ - - - -]> - - - - - + + + + + - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_drop_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_drop_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_drop_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,12 @@ - - + + - - - + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_edit.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_edit.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_edit.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,10 @@ - - - -]> - - - - - + + + + + - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,6 @@ - - + + - - - + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_attach.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_attach.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_attach.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,14 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_context.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_context.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_context.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_multipdp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_multipdp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_multipdp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_suspended.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_suspended.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_egprs_suspended.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,11 @@ - - + + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_end_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_end_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_end_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_enter.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_enter.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_enter.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_exit.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_exit.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_exit.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_expand.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_expand.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_expand.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,5 @@ - - - - - - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_exposure.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_exposure.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_exposure.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,9 @@ - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_face_tracking.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_face_tracking.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_face_tracking.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,9 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_face_tracking_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_face_tracking_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_face_tracking_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_failed.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_failed.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_failed.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,5 @@ - - - -]> - - - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_favourites.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_favourites.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_favourites.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,5 @@ - - - -]> - - - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_favourites_remove.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_favourites_remove.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_favourites_remove.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,7 @@ - - - -]> - - - - - - - - - + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_filter.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_filter.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_filter.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,8 @@ - - - -]> - - - - - + + + + + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - + + - - - + - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash_charging.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash_charging.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash_charging.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,10 @@ - - + + - + - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_flash_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,12 @@ - - + + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_folder.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_folder.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_folder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,9 @@ - - + + - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - - - + - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward_email.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward_email.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward_email.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - - - + - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward_msg.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward_msg.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_forward_msg.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,12 @@ - - + + - - - + - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_genres.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_genres.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_genres.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,6 @@ - - + + - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_geotag.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_geotag.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_geotag.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - + - - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_geotag_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_geotag_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_geotag_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,11 @@ - - + + - + - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_go.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_go.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_go.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - + - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_gps.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_gps.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_gps.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - - - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_gps_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_gps_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_gps_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,14 @@ - - - -]> - - - - - + + + + + - - - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_group.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_group.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_group.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,10 @@ - - - -]> - - - - - + + + + + - - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hard_disk.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hard_disk.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hd.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hd.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hd.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,9 @@ - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_help_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_help_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_help_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,10 @@ - - - -]> - - - - - + + + + + - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_history.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_history.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_history.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,9 @@ - - - -]> - - - - - + + + + + - - - - - - - - - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hold_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hold_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hold_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,9 @@ - - + + - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_attach.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_attach.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_attach.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,17 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_context.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_context.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_context.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,11 @@ - - + + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_multipdp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_multipdp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_multipdp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,11 @@ - - + + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_suspended.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_suspended.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_hsdpa_suspended.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,14 @@ - - + + - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_img_quality.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_img_quality.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_img_quality.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,12 @@ - - + + - + - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_import.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_import.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_info.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_info.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_info.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,5 @@ - - - - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_iso.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_iso.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_iso.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - - - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_italic.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_italic.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_italic.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_join_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_join_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_join_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,11 @@ - - - - + + + + - - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_landscape.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_landscape.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_landscape.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,7 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lap.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lap.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - -]> - - - - - - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_last_result.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_last_result.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_last_result.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,10 @@ - - - -]> - - - - - + + + + + - - - + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_light.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_light.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_light.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,14 @@ - - + + - + - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_light_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_light_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_light_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,11 @@ - - - - - - + + + + - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_location.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_location.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_location.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,9 @@ - - + + - + - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_location_collection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_location_collection.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_location_collection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - + - - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_log.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_log.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_low_light.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_low_light.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_low_light.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,12 @@ - - + + - + - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lsk_horizontal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lsk_horizontal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lsk_horizontal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lsk_vertical.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lsk_vertical.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_lsk_vertical.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_memory_in_use.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_memory_in_use.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_memory_in_use.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,8 @@ - - + + - - - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_merge.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_merge.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - -]> - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mic_mute.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mic_mute.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mic_mute.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - - - + + + - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mic_unmute.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mic_unmute.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mic_unmute.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_minus.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_minus.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_minus.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - - -]> - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_missed_call_unseen.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_missed_call_unseen.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_missed_call_unseen.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,7 @@ - - - -]> - - - - - - - - - + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mobile.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mobile.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mobile.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,9 @@ - - - -]> - - - - - + + + + + - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mono_recognize_song.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_mono_recognize_song.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - - - -]> - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_more.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_more.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_more.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,7 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_music_albums.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_music_albums.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_music_albums.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,9 @@ - - - -]> - - - - - + + + + + - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_new_event.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_new_event.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_new_event.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,7 @@ - - + + - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_next.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_next.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_next.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,9 @@ - - - -]> - - - - - + + + + + - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_night.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_night.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_night.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,5 @@ - - - - - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_night_portrait.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_night_portrait.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_night_portrait.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,6 @@ - - - -]> - - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_notes_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_notes_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_notes_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,9 @@ - - - -]> - - - - - + + + + + - - - - - - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_notes_collections.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_notes_collections.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_notes_collections.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,9 @@ - - - -]> - - - - - + + + + + - - - - - - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,7 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_one.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_one.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_one.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,8 @@ - - - -]> - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_online_support.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_online_support.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_online_support.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,6 @@ - - - -]> - - - - - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_options_menu.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_options_menu.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_options_menu.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - + + - - - + - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_organize.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_organize.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_organize.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,11 @@ - - + + - - - - - - - - - - - + - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_outbox.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_outbox.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_outbox.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,9 @@ - - - -]> - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_ovistore.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_ovistore.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ - - - -]> - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pause.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pause.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pause.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,7 @@ - - + + - - - + + - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_attach.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_attach.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_attach.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_context.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_context.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_context.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,10 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_multipdp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_multipdp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_multipdp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,10 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_suspended.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_suspended.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_pd_suspended.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_person_activitystream.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_person_activitystream.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_person_activitystream.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,9 @@ - - - -]> - - - - - + + + + + - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_person_history.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_person_history.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - - - -]> - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_photo_albums.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_photo_albums.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_photo_albums.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,9 @@ - - - -]> - - - - - + + + + + + + - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_photos.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_photos.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_photos.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,9 @@ - - - -]> - - - - - + + + + + + + - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_play.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_play.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_play.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - + + - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_play_history.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_play_history.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_play_history.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,9 @@ - - + + - - - + - - - - - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_playlist.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_playlist.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_playlist.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,12 @@ - - - -]> - - - - - + + + + + - - - - - - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_plus.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_plus.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_plus.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,8 @@ - - - -]> - - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_podcast.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_podcast.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_podcast.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,12 @@ - - + + - - - - - - - + + + + + - - - + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_portrait.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_portrait.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_portrait.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,8 @@ - - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_power.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_power.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_predictive_text_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_predictive_text_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_predictive_text_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,10 @@ - - - -]> - - - - - + + + + + + + + - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_predictive_text_on.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_predictive_text_on.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_predictive_text_on.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,12 @@ - - - -]> - - - - - + + + + + + + + - - - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_presentation.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_presentation.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_presentation.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,10 @@ - - + + - + + + - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_previous.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_previous.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_previous.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,9 @@ - - - -]> - - - - - + + + + + + + - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_private_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_private_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_private_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,15 @@ - - + + - - - + - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_qcif.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_qcif.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_qcif.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,9 @@ - - - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_radio_collections.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_radio_collections.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_radio_collections.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,6 @@ - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_radio_stations.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_radio_stations.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_radio_stations.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,35 +1,10 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_recentlog.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_recentlog.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_recognize_song.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_recognize_song.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_redeye.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_redeye.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_redeye.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,9 @@ - - + + - + + + - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_refresh.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_refresh.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reject_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reject_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reject_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,10 @@ - - - - + + + + + + + - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_remove_from_collection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_remove_from_collection.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_remove_from_video_collection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_remove_from_video_collection.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_remove_from_video_collection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,19 @@ - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_repeat.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_repeat.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_repeat.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,8 @@ - - - -]> - - - - - + + + + + + - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_repeat_exception.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_repeat_exception.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_repeat_exception.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - - -]> - - - - - + + + + + + + + + - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_replace_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_replace_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_replace_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,9 @@ - - - - + + + + + + - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,12 @@ - - + + - - - + + + + + + - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,13 @@ - - + + - - - + + + + + + - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_all_email.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_all_email.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_all_email.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,11 @@ - - + + - - - + + - - - - - - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_email.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_email.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reply_email.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - - - + + + + - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reset.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_reset.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,18 +0,0 @@ - - - -]> - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_restore_settings.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_restore_settings.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_restore_settings.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,10 @@ - - - -]> - - - - - - - - - - + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rewind.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rewind.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rewind.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - + + - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rsk_horizontal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rsk_horizontal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rsk_horizontal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - + - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rsk_vertical.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rsk_vertical.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_rsk_vertical.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - + - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_search.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_search.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_search.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,10 @@ - - - - - - + + + + + + + - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_search_stop.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_search_stop.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_search_stop.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,12 @@ - - - - - - - - - - - - - - + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_seek_next.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_seek_next.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_seek_next.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - - -]> - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_seek_previous.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_seek_previous.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_seek_previous.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - - -]> - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_send.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_send.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_send.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,14 @@ - - - -]> - - - - - - - - + + + + + + + + + + + + - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_send_mycard.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_send_mycard.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_send_mycard.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,24 +1,11 @@ - - - -]> - - - - - - - - + + + + + + + + + - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_settings.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_settings.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_settings.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,9 @@ - - - - + + + + + + - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shake_warning.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shake_warning.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shake_warning.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,12 @@ - - - -]> - - - - - - - - - + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,12 @@ - - + + - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share_photo.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share_photo.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share_photo.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,10 @@ - - - -]> - - - - - + + + + + + + - - - - - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share_photo_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share_photo_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_share_photo_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,15 @@ - - - -]> - - - - - + + + + + + + + + - - - - - - - - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sharpness.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sharpness.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sharpness.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,11 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shift.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shift.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shift.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_show_view.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_show_view.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_show_view.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,10 @@ - - - -]> - - - - - + + + + + + + + - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shuffle.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shuffle.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shuffle.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,7 @@ - - + + - - - - - - - + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shuffle_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shuffle_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_shuffle_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,14 @@ - - + + - - - - - - - - - - - + + + + + + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_smiley.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_smiley.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_smiley.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,8 @@ - - - -]> - - - - - - - - - - + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_songs_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_songs_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_songs_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,8 @@ - - - -]> - - - - - + + + + + + - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sort.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sort.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sort.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,12 @@ - - - -]> - - - - - + + + + + + + + + + - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_space_itut.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_space_itut.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_space_itut.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_space_vkb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_space_vkb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_space_vkb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + - + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_speaker.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_speaker.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_speaker.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,11 @@ - - - -]> - - - - - + + + + + + + + + - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_speaker_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,11 @@ - - - -]> - - - - - - - - + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_special_characters_itut.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_special_characters_itut.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_special_characters_itut.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,14 @@ - - - - + + + + - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_special_characters_qwerty.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_special_characters_qwerty.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_special_characters_qwerty.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,17 @@ - - - - + + + + + + + - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_split.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_split.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sport.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sport.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sport.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,6 @@ - - - - - - - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stabilization.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stabilization.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stabilization.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,12 @@ - - - - - - - - - - - + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stabilization_off.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stabilization_off.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stabilization_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,15 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_start.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_start.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_station_scan.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_station_scan.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_station_scan.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,14 @@ - - + + - + + + + + + + - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stop.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stop.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stop.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,5 @@ - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stopwatch.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_stopwatch.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,17 +0,0 @@ - - - - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_store.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_store.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_store.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,10 @@ - - - - + + + + + + + - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_swap_call.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_swap_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,11 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sym_itut.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sym_itut.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sym_itut.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,10 @@ - - - - + + + + - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sym_qwerty.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sym_qwerty.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_sym_qwerty.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,13 @@ - - - - + + + + - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tab_active.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tab_active.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tab_active.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,5 @@ - - - -]> - - - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tab_passive.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tab_passive.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tab_passive.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,5 @@ - - - -]> - - - - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tag.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tag.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tag.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,8 @@ - - + + - + - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_center.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_center.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_center.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,13 @@ - - - - + + + + - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_justify.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_justify.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_justify.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,13 @@ - - - - + + + + - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_left.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_left.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_left.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,13 @@ - - - - + + + + - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_right.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_right.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_text_align_right.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,13 @@ - - - - + + + + - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tick.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tick.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tick.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,8 @@ - - - -]> - - - - - + + + + + + - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tip.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tip.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_tip.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,10 @@ - - - -]> - - - - - + + + + + + + + - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_two.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_two.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_two.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,7 @@ - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_attach.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_attach.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_attach.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_context.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_context.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_context.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,9 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_multipdp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_multipdp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_multipdp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,10 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_suspended.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_suspended.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_uma_suspended.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_unblock.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_unblock.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_unblock.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,6 @@ - - - -]> - - - - - - - - - - + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_underline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_underline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_underline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,9 @@ - - - - + + + + + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_unknown.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_unknown.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_unknown.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,9 @@ - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_update_existing.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_update_existing.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_update_existing.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,24 +1,11 @@ - - - -]> - - - - - + + + + + - - - - + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_usb.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_usb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_user_defined.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_user_defined.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_user_defined.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,8 @@ - - - - - - - - + + + + + + - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vga.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vga.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vga.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,9 @@ - - - - - - - - - + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vga_wide.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vga_wide.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vga_wide.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,10 @@ - - + + - + + + - - - + - - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - + - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,14 @@ - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_collection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_collection.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_collection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,18 @@ - - + + - + + + + + + + + + + + - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_services.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_services.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_video_services.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - + + + - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_virtual_input.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_virtual_input.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_virtual_input.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_voice_mailbox.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_voice_mailbox.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_voice_mailbox.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,8 @@ - - - - + + + + - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vol_down.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vol_down.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vol_down.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,11 @@ - - - -]> - - - - - + + + + + + + + + - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vol_up.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vol_up.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_vol_up.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,12 @@ - - - -]> - - - - - + + + + + + + + + + - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,7 @@ - - - - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_attach.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_attach.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_attach.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,15 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_context.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_context.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_context.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,9 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_multipdp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_multipdp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_multipdp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,9 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_suspended.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_suspended.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wcdma_suspended.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,12 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,10 @@ - - + + - - - - - - - - - - \ No newline at end of file + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_cloudy.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_cloudy.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_cloudy.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,29 +1,13 @@ - - - -]> - - - - - - - - - - + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_fluorescent.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_fluorescent.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_fluorescent.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - + + + - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_incandescent.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_incandescent.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_incandescent.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - + + + - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_sunny.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_sunny.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_white_balance_sunny.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,16 @@ - - - -]> - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,9 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_attach.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_attach.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_attach.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,33 +1,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_context.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_context.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_context.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,11 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_multipdp.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_multipdp.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_multipdp.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,11 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_suspended.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_suspended.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wimax_suspended.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wlan.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wlan.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wlan.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,13 @@ - - - - + + + + + + + + + + - - - - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wlan_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wlan_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_wlan_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,39 +1,15 @@ - - - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,9 @@ - - + + - + + - - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_world_clock.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_world_clock.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_world_clock.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,5 @@ - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,12 @@ - - - -]> - - - - - - - - + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom_in.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom_in.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom_in.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,11 @@ - - + + - + + + + - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom_out.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom_out.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_mono_zoom_out.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,11 @@ - - + + - + + + + - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_add.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_add.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_add.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,19 @@ - - - + + + - - - - - + + + + + + + + + - - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_allday.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_allday.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_anniversary.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_anniversary.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_anniversary.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,55 +1,58 @@ - - - + + + - - - - - - + + + + + + - - - + + + - - - + + + - - - + + + - + - - - + + + - - + + - - + + + - - + + + - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_assistant.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_assistant.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_assistant.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,73 +1,68 @@ - - - + + + - - - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - - - + + + + + - - - - + + + + - - - - - + + + + - - - - - + + + + + - - - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_attachment.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_attachment.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_attachment.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,16 @@ - - - + + + - - + + - - - + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_authorised.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_authorised.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_authorised.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,45 +1,43 @@ - - - - - + + + - - - - - - - + + + + + + + + - - - - - + + + + + + - - - - - + + + + + + + - - - - - - - + + + + + + - - - - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_blocked.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_blocked.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_blocked.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,20 @@ - - - + + + - - - - - - + + + + + - - - - - + + + + - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bluetooth_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bluetooth_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bluetooth_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,29 @@ - - - + + + - - - + - - - + + + - - - - + + + + - + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_low_battery.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_low_battery.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_low_battery.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,40 +1,39 @@ - - - + + + - - - + - - - - - - + + + + + + - - - - - + + + + + + - - - - - - + + + + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_high.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_high.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_high.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,41 @@ - - - + + + - - - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_low.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_low.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_low.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,49 +1,47 @@ - - - + + + - - - - - + + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_medium.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_medium.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_bt_signal_medium.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,46 +1,44 @@ - - - + + + - - - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_business_card.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_business_card.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_business_card.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,29 @@ - - - + + + - - - - + + - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_calendar.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_calendar.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_calendar.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,54 +1,51 @@ - - - + + + - - - - - - + + + - - + + - - + + - + - - + + - - + + - - + + - + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_car.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_car.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_car.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,81 +1,79 @@ - - - + + + - - - + - - - + + + - - - + + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_charger.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_charger.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_charger.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,65 +1,63 @@ - - - + + + - - - + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_collapse.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_collapse.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_collapse.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - - - + + + @@ -9,15 +9,10 @@ - - - - - - + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_company_details.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_company_details.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_company_details.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,90 +1,88 @@ - - - + + + - - - + - - + + - - + + - - + + - - + + - + - - + + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_connected.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_connected.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_connected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,19 @@ - - - + + + - - + + + + + - - + + - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_connection.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_connection.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_connection.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,34 +1,37 @@ - - - + + + - - - - + + - - + + + - - - + + + + - - + + + + - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_contacts.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_contacts.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_corrupted.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_corrupted.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_corrupted.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,59 +1,26 @@ - - - + + + - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - + + + + + - - - - + + + + - - - - - - - - - - - - - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_day.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_day.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_day.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,46 @@ - - - + + + - - - - - - + + + + - + - - + + - - + + - - + + - + - - + + - - + + - + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_dictionary.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_dictionary.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_disconnected.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_disconnected.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_disconnected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,30 +1,30 @@ - - - + + + - - - - - - - + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_draft.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_draft.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_draft.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,45 @@ - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_drm_rights_expired.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_drm_rights_expired.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,19 @@ - - - + + + - - - - - - - + - - - + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,33 +1,31 @@ - - - + + + - - - - - - + + + + - - - + + + - - - - - + + + + - - - - - - + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_email_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,36 +1,34 @@ - - - + + + - - - - - - + + + + - - - + + + - - + - + + + + + + + + + + + + - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_expand.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_expand.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_expand.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,18 @@ - - - + + + - + - - - - + + + + - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fail.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fail.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fail.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,20 @@ - - - + + + - - - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_family.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_family.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_family.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,40 +1,40 @@ - - - + + + - - - - - - + + + + - - - - - + + + + + + + - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_favorite.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_favorite.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_favorite.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,16 @@ - - - + + + - - - - - - - + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,175 +1,91 @@ - - + + - + - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,197 +1,104 @@ - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_fax_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,195 +1,105 @@ - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_flash.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_flash.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_flash.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,39 +1,39 @@ - - - + + + - - - + - - - - + + + + - - - - - - - - - + + + + - + - - - + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_folder.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_folder.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_folder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,20 @@ - - - + + + - - - - + + + + + + - - - + + + - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_follow_up.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_follow_up.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_follow_up.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,29 @@ - - - + + + - - - - - + + + - - + + - - - + + + - - - + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_forward.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_forward.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_forward.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,18 @@ - - - + + + - - + + + + + - - + + - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_gprs.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_gprs.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_gprs.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,21 @@ - - - + + + - - - - - + + + + + + + + + + + - - - - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_homescreen.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_homescreen.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_homescreen.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,67 +1,65 @@ - - - + + + - - - - + + - + - - + + - + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hs_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hs_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hs_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,80 +1,70 @@ - - - + + + - - - - - + + + - - - - - + + + + + - - - - - + + + - - - + + + - + - - + + - - + + - - - + + + - - + + - + - + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hs_widget.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hs_widget.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hs_widget.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,45 +1,46 @@ - - - + + + - - - - - - + + + + + - - - + + + - - - - + + + + + - - - - + + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_html.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_html.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_html.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,91 +1,25 @@ - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hwr.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_hwr.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_im.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_im.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_image.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_image.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_image.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,103 +1,55 @@ - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + + + + + + - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_internet.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_internet.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_internet.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,35 +1,37 @@ - - - + + + - - - - - + + + - - - - - - - + + - - - + + + + - - - + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_intranet.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_intranet.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_intranet.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,39 @@ - - - + + + - - - - - + + + - - - - - - - + + - - - + + + + - - - + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_itut.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_itut.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_java.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_java.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_java.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,30 +1,28 @@ - - - + + + - - - - - - + + + + - - - - - - - - - - - + + + + + + + + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_keyboard.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_keyboard.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,75 +1,73 @@ - - - + + + - - - + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,113 +1,86 @@ - - + + - + - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_landline_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,111 +1,87 @@ - - + + - + - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_link.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_link.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_link.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,25 @@ - - - + + + - - - - - - - + - - - - - + + + + + - - + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_location.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_location.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_location.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,30 +1,28 @@ - - - + + + - - + + - - - - + + - - - + + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_lock.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_lock.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_lock.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,45 +1,43 @@ - - - + + + - - - - - - - + + + + + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_meeting.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_meeting.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_meeting.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,51 +1,49 @@ - - - + + + - - - + - - + + - + - - - - - + + + + + - - + + - - - - - + + + + + - - + + - - - - + + + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_message.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_message.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_message.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,30 +1,30 @@ - - - + + + - - - - - - + + + + - + - - - + + + + + - + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_missed_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_missed_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_missed_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,18 @@ - - - + + + + + + + + + - - - - - + + - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mms.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mms.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mms.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,129 +1,72 @@ - - + + - + - - - - - - - - - - - - + + - - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - - - + + - - - - - + + + + + + + + + + - - - - - - - + + + - - - - - - - - - - - - - + - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,46 @@ - - - + + + - - - + - - + + - - - + + + - - + + - + - - + + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,107 +1,59 @@ - - + + - - - - - - - - - - - + + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_mobile_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,105 +1,60 @@ - - + + - - - - - - - - - - - + + + + + + - - - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_doc.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_doc.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_doc.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,12 @@ - - + + - + - - - - + - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_pdf.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_pdf.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_pdf.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,12 @@ - - + + - + - - - - + - - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_ppt.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_ppt.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_ppt.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,15 @@ - - + + - + - - - - + - - - - - - - - - - - \ No newline at end of file + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_rtf.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_rtf.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_rtf.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,14 @@ - - + + - + - - - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_xls.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_xls.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ms_xls.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,15 @@ - - + + - + - - - - + - - - - - + - - - - \ No newline at end of file + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_network.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_network.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_network_off.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_network_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_chat.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_chat.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_chat.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,49 +1,39 @@ - - - + + + - - - - - - + + + + - - + + - + - + - + - + - - - - - - - + + + - + - - - - - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_email_event.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_email_event.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_email_event.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,45 +1,35 @@ - - - + + + - - - - - - + + + + - - - + + + - + - - - - - - - + + + - + - - - - - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_event.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_event.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_event.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,24 +1,22 @@ - - - + + + - - - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_tip.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_tip.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_new_tip.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,74 +1,61 @@ - - - + + + - - - - - - - - + - - - + + + - - - - - - + - - - - - - - + + + + + + + - + - - - + + + - - - + + + + + + + + + + - + - - - - - - - + + + - + - - - - - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_nfc_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_nfc_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_nfc_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,44 +1,34 @@ - - - + + + + + + + + + + + + + - - - - - + + - - - - - - - - - - - - + - + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_no_signal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_no_signal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_no_signal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,35 @@ - - - + + + - - - - + + - + - - + + - - - + + + - - + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_note.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_note.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_note.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,19 @@ - - - + + + + + + + + + + - - - - - - + + + - - - - - - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,21 @@ - - - + + + - - - - + + + + + - - + + - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_online.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_online.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_online.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,23 @@ - - - + + + - - - - - + + + + + + + - - + + - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_operator.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_operator.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_operator.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,41 @@ - - - + + + - - - - + + - - + + - - + + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_outbox.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_outbox.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_outbox.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,32 +1,30 @@ - - - + + + - - - + - - + + - - - + + + - + - - + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ovi.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_ovi.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pager.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pager.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pager.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,42 @@ - - - + + + - - - + - - - + + + - + - - + + - - + + - - + + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pair.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pair.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pair.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,22 @@ - - - + + + - - - - - + + + + - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pd_wcdma.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pd_wcdma.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pd_wcdma_off.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_pd_wcdma_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_person.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_person.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_person.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,42 @@ - - - + + + - - - - + + + + - + - - + + - - + + - - - - + + + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_phone_disabled.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_phone_disabled.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_phone_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,66 +1,58 @@ - - - + + + - - - + - - + + - - - + + + - - + + - + - - + + - - + + - - + + - - + + - + - + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_phonebook.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_phonebook.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_phonebook.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,44 +1,42 @@ - - - + + + - - - + - - + + - + - - + + - - + + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_play.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_play.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_play.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,17 @@ - - + + - - - - - - - - - + + + + + - - - - - - - - + + + - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_playlist.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_playlist.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_playlist.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,40 +1,34 @@ - - - + + + + + + + + + + + + + - - - - - - - - - - - + - - - - + + + + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_presentation.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_presentation.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_presentation.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,55 +1,53 @@ - - - + + + - - - - + + - - + + - + - - - + + + - - + + - - + + - - + + - - + + - - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_priority_high.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_priority_high.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_priority_high.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,21 @@ - - - + + + - - - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_priority_low.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_priority_low.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_priority_low.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,18 @@ - - - + + + - - - - - + + + + + + + + - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,51 +1,29 @@ - - + + - + - - - - - - - + + - - - - - - - - - - - + + - - - - - - - - - - - + + + + - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected_disabled.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected_highlight.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected_highlight.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_selected_highlight.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,57 +1,32 @@ - - + + - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - - - - - - - + + + + + + - - - - - - - - - - - - - + + + + + + - - - + - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,17 @@ - - + + - + - - - - - - - - - + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected_disabled.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected_highlight.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected_highlight.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_radio_unselected_highlight.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,33 +1,20 @@ - - + + - - - - - - - - - + + + + + - - - - - - - - - + + + + - - - - - - - + + + - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reboot.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reboot.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reboot.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,29 @@ - - - + + + - - - + - - - + + + - - + + - - - + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_received.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_received.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_received.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,20 @@ - - - + + + - - - + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_record.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_record.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_record.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,17 @@ - - - + + + - - + + + + - - + + - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_refresh.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_refresh.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_refresh.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,26 +1,24 @@ - - - + + + - - - + - - + + - - + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reminder.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reminder.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reminder.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,41 @@ - - - + + + - - - - - - + + + + - + - - - - + + + + - + - - - - + + + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_repeat.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_repeat.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_repeat.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,20 +1,20 @@ - - - + + + - - + + + + + + + - - + + - - - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_repeat_exception.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_repeat_exception.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_repeat_exception.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,38 +1,30 @@ - - - + + + - - - - + + - - - - + + + + - + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reply.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reply.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reply.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,17 @@ - - - + + + - - + + + + - - + + - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reply_all.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reply_all.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_reply_all.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,22 @@ - - + + - + - - - - - - - - + + - - - - - - - + + - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_rgb.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_rgb.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_rgb.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,15 @@ - - - + + + - - - + - + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_secure.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_secure.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,39 +1,23 @@ - - + + - + - - - - + - - - - - - - - - - - - - + + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_disabled.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_highlight.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_highlight.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_highlight.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,47 +1,27 @@ - - + + - - - - - - - - - + + + + + - - - - - - - - + + + - - - - - - - - - - - - - - - - + + + + + + + - - - - - - \ No newline at end of file + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_partial.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_partial.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_selected_partial.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,49 +1,28 @@ - - + + - + - - - + - - - - - - - - - - - - - + + - - - - - - - - - - - + + + + - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sent.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sent.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sent.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,22 +1,19 @@ - - - + + + - - - - - - - + + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_shuffle.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_shuffle.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_shuffle_off.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_shuffle_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_good.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_good.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_good.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,31 +1,29 @@ - - - + + + - - - - + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_low.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_low.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_low.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,37 +1,35 @@ - - - + + + - - - - + + - - + + - - - + + + - - + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_medium.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_medium.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_signal_medium.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,34 +1,32 @@ - - - + + + - - - - + + - - + + - - + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sisx.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sisx.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sisx.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,30 +1,28 @@ - - - + + + - - - + - - + + - - - - - - - + + + + + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_angry.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_angry.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_angry.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,61 +1,59 @@ - - - + + + - - - + - + - - + + - + - - + + - + - - + + - - + + - + - - + + - - - - + + + + - - + + - - + + - - - - - - - + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_bigsmile.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_bigsmile.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_bigsmile.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,56 +1,54 @@ - - - + + + - - - + - + - + - - - + + + - + - - + + - + - - + + - + - - + + - - + + - - - + + + - + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_cry.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_cry.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_cry.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,46 @@ - - - + + + - - - + - + - - - + + + - - - - - - - - + + + + + + + + - - + + - + - - + + - - + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_evil.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_evil.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_evil.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,38 +1,38 @@ - - - + + + - - - + - + - - - + + + - - - - - - - + + + - - + + - - - - - + + + + + - - - + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_eyebrows.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_eyebrows.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_eyebrows.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,71 +1,69 @@ - - - + + + - - - + - + - - - + + + - - + + - - + + - - + + - - - - - + + + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_heart.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_heart.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_heart.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,18 +1,16 @@ - - - + + + - - - + - + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_irritated.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_irritated.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_irritated.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,28 +1,26 @@ - - - + + + - - - + - + - - - + + + - - - - - - - - - - + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_kissing.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_kissing.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_kissing.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,44 +1,42 @@ - - - + + + - - - + - + - - - + + + - + - - + + - - + + - + - - + + - - - - - - - - - + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_nerd.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_nerd.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_nerd.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,46 @@ - - - + + + - - - + - + - - - + + + - - + + - - - + + + - + - - - + + + - - - - - - - - + + + + + + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_neutral.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_neutral.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_neutral.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,58 +1,56 @@ - - - + + + - - - + - + - - - + + + - + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_sarcastic.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_sarcastic.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_sarcastic.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,66 +1,64 @@ - - - + + + - - - + - + - - - + + + - - - - - + + + + + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_sarcastic_mad.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_sarcastic_mad.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_sarcastic_mad.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,46 @@ - - - + + + - - - + - + - - - + + + - + - - + + - + - - + + - - + + - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_smile.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_smile.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_smile.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,38 +1,36 @@ - - - + + + - - - + - + - - - + + + - + - - + + - + - - + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_surprised.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_surprised.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_surprised.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,66 +1,64 @@ - - - + + + - - - + - + - - - + + + - + - - + + - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - + + - - + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_tongue.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_tongue.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_tongue.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,47 +1,45 @@ - - - + + + - - - + - + - - - + + + - - - - + + + + - - + + - + - - + + - - + + - + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_unhappy.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_unhappy.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_unhappy.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,46 @@ - - - + + + - - - + - + - - - + + + - + - - + + - + - - + + - - + + - + - - + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_very_cool.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_very_cool.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_very_cool.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,56 +1,54 @@ - - - + + + - - - + - + - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wink.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wink.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wink.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,43 +1,41 @@ - - - + + + - - - + - + - - - + + + - + - - + + - + - - + + - - + + - - - + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wink_grin.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wink_grin.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wink_grin.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,55 +1,53 @@ - - - + + + - - - + - + - - - + + + - + - - + + - - + + - - + + - - - - - - - + + + + + + + - - + + - + - - + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wondering.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wondering.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_smiley_wondering.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,44 +1,42 @@ - - - + + + - - - + - + - - - + + + - - - - - + + + + + - - + + - - - - - + + + + + - - + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sound.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sound.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sound.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,33 +1,17 @@ - - + + - - - - - - - - - - - - - - - - - + + + + + + - - - - - - - + + + - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_speaker.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_speaker.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_star_non_favourited.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_star_non_favourited.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_star_non_favourited.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,16 @@ - + - + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_star_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_star_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_swype.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_swype.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sync.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sync.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_sync.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,25 @@ - - - + + + - - - - - - + + + + - - - - - - + + + + + + - - - + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tag_inactive.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tag_inactive.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tag_inactive.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,21 +1,19 @@ - - - + - - - - + + + + - - - - - - + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_telephony_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_telephony_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_telephony_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,46 +1,38 @@ - - - + + + - - - + - - + + - - + + - + - - + + - + - + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_text.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_text.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_text.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,19 @@ - - - + + + + + + + + + - - - - + + + + - - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tick.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tick.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tick.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,16 +1,16 @@ - - - + + + - - - + + + + - - + + - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tip.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tip.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_tip.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,48 +1,43 @@ - - - + + + - - - - - - - - + - - - + + + - - - - - - + - - - - - - - + + + + + + + - + - - - + + + - - - + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_todo.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_todo.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_todo.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,24 @@ - - - + + + - - - - - - - + + + + - - - - - + + + + + - - + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_todo_done.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_todo_done.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_todo_done.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,24 @@ - - - + + + - - - - - - - + + + + - - - - - + + + + + - - + + - - + + @@ -29,15 +26,10 @@ - - - - - - + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unknown.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unknown.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unknown.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,23 @@ - - - + + + - - - - - + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,17 @@ - - + + - + - - - - - - - - - + - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected_disabled.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected_disabled.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected_highlight.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected_highlight.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_unselected_highlight.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,33 +1,20 @@ - - + + - - - - - - - - - + + + + + - - - - - - - - + + + - - - - - - - - - \ No newline at end of file + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_untrusted.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_untrusted.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_untrusted.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,36 +1,34 @@ - - - + + + - - - + - - - - + + + + - - - - - + + + + + - - - - + + + + - - - - + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,42 +1,42 @@ - - - + + + - - - - - - + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - + + + + + + - - - - - + + + + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,56 +1,56 @@ - - - + + + - - - - - - + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - + + + + + + - - - - - + + + + + + - + - - - - - + + + + - - - - - - + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_url_address_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,59 +1,59 @@ - - - + + + - - - - - - + + + + - - - - - - - + + + + + + + - - - - - + + + + + - - - - - + + + + + + - - - - - + + + + + + - + - - + - + + + + + + + + + + + + - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_video.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_video.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_video.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,34 +1,32 @@ - - - + + + - - - - + + - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,58 +1,60 @@ - - - + + + - - - + - - - + + + - + - - - + + + - + - - - + + + + - - - + + + + - + - - - + + + - - - - + + + + + - + - - - - + + + + + - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip_home.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip_home.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip_home.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,72 +1,74 @@ - - - + + + - - - + - - - + + + - + - - - + + + - + - - - + + + + - - - + + + + - + - - - + + + - - - - + + + + + - + - - - - + + + + + - + - - - - - + + + + - - - - - - + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip_work.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip_work.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_voip_work.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,75 +1,77 @@ - - - + + + - - - + - - - + + + - + - - - + + + - + - - - + + + + - - - + + + + - + - - - + + + - - - - + + + + + - + - - - - + + + + + - + - - + - + + + + + + + + + + + + - - - - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_vpn.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_vpn.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_vpn.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,63 +1,55 @@ - - - + + + - - - - - + + + - + - - - + + + - + - - - + + + + - - - + + + + - + - - - - + - - - - - - - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wcdma.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wcdma.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wcdma_off.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wcdma_off.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wifi.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wifi.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wifi.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,25 +1,25 @@ - - - + + + - - - - - - - - - - + + + - + + - + + + + + + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,27 +1,27 @@ - - - + + + - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan_offline.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan_offline.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,45 +1,37 @@ - - - + + + - - - - - + + + - - - - - - - + + + + + + + - + - + - + - - - - - - - - + + + - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan_secure.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan_secure.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_small_wlan_secure.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,55 +1,45 @@ - - - + + + - - - - - + + + - - - - - - - + + + + + + + - + - + - + - - - - + - - - - - - - - - + + + + - - + + - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_battery.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_battery.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_battery.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,6 @@ - - + + - - - - - - - \ No newline at end of file + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_bluetooth.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_bluetooth.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_bluetooth.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,6 @@ - - + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_egprs.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_egprs.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_egprs.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,6 @@ - - + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_gps.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_gps.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_gps.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_hsdpa.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_hsdpa.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_hsdpa.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,15 +1,9 @@ - - + + - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_missed_call.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_missed_call.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_missed_call.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,6 @@ - - + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_email.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_email.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_email.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,7 @@ - - + + - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_im.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_im.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_im.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,8 @@ - - + + - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_message.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_message.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_new_message.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,6 @@ - - + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_offline.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_offline.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_profile_silent.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_profile_silent.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,7 @@ + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress.axml --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress.axml Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ - - - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_1.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_1.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_2.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_2.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_3.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_3.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_4.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_4.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_5.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_progress_5.svg Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ - - - - - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_psm.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_psm.svg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_signal.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_signal.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_signal.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,6 @@ - - + + - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_wcdma.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_wcdma.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_wcdma.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,7 @@ - - + + - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_wlan.svg --- a/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_wlan.svg Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/icons/hbdefault/scalable/qtg_status_wlan.svg Thu Jul 22 16:36:53 2010 +0100 @@ -1,17 +1,10 @@ - - + + - - - - - - - - \ No newline at end of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcolorgridviewitem/hbcolorgridviewitem.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcolorgridviewitem/hbcolorgridviewitem.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcolorgridviewitem/hbcolorgridviewitem.css Thu Jul 22 16:36:53 2010 +0100 @@ -8,8 +8,8 @@ top: -var(hb-param-margin-gene-popup); bottom: var(hb-param-margin-gene-popup); right: var(hb-param-margin-gene-popup); -/* fixed-width: var(hb-param-graphic-size-primary-small); - fixed-height: var(hb-param-graphic-size-primary-small); */ + fixed-width: var(hb-param-graphic-size-primary-small); + fixed-height: var(hb-param-graphic-size-primary-small); } HbColorGridViewItem::cg-color-icon @@ -18,11 +18,12 @@ top: -var(hb-param-margin-gene-popup); bottom: var(hb-param-margin-gene-popup); right: var(hb-param-margin-gene-popup); -/* fixed-width: var(hb-param-graphic-size-primary-small); - fixed-height: var(hb-param-graphic-size-primary-small); */ + fixed-width: var(hb-param-graphic-size-primary-small); + fixed-height: var(hb-param-graphic-size-primary-small); } HbColorGridViewItem::cg-selection-icon { fixed-width: var(hb-param-graphic-size-secondary); + fixed-height: var(hb-param-graphic-size-secondary); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcolorgridviewitem/hbcolorgridviewitem.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcolorgridviewitem/hbcolorgridviewitem.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcolorgridviewitem/hbcolorgridviewitem.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -1,23 +1,19 @@ - - - - - - - - - - - - - + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcombobox/hbcombobox.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcombobox/hbcombobox.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcombobox/hbcombobox.css Thu Jul 22 16:36:53 2010 +0100 @@ -2,6 +2,7 @@ HbComboBox { layout:combobox_layout_noneditable; + size-policy-horizontal:expanding; } HbComboBox[editable] @@ -23,7 +24,6 @@ { fixed-width:var(hb-param-widget-combobox-height); fixed-height:var(hb-param-widget-combobox-height); - } HbComboBox::combobox_labelfield @@ -33,12 +33,13 @@ text-align:left center; font-variant:primary; text-height:var(hb-param-text-height-secondary); - } HbComboBox[!editable]::combobox_labelfield { text-line-count-max:1; + } + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcombobox/hbcombobox_color.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcombobox/hbcombobox_color.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbcombobox/hbcombobox_color.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,5 +1,5 @@ /* Colors for different comboBox states for text */ -HbComboBox[!editable][state = "normal"]::combobox_labelfield +HbComboBox[!editable]::combobox_labelfield { color:var(qtc_combobox_normal); } @@ -9,11 +9,21 @@ color:var(qtc_combobox_pressed); } -HbComboBox[!enabled]::combobox_labelfield +HbComboBox[!editable][!enabled]::combobox_labelfield { color:var(qtc_combobox_disabled); } +HbComboBox[!editable][state = "latched"]::combobox_labelfield +{ + color:var(qtc_combobox_latched); +} + +HbComboBox[!editable][state = "highlight"]::combobox_labelfield +{ + color:var(qtc_combobox_highlight); +} + HbComboBox[editable]::combobox_labelfield { color:var(qtc_combobox_edit); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdataformviewitem/hbdataformviewitem_color.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdataformviewitem/hbdataformviewitem_color.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdataformviewitem/hbdataformviewitem_color.css Thu Jul 22 16:36:53 2010 +0100 @@ -6,4 +6,19 @@ HbDataFormViewItem::dataItem_Description { color:var(qtc_list_item_content_normal); -} \ No newline at end of file +} + +HbDataFormViewItem[!enabled]::dataItem_Label +{ + color:var(qtc_list_item_disabled); +} + + +HbDataFormViewItem[!enabled]::dataItem_Description +{ + color:var(qtc_list_item_disabled); +} + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdatagroupheadingwidget/hbdatagroupheadingwidget_color.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdatagroupheadingwidget/hbdatagroupheadingwidget_color.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdatagroupheadingwidget/hbdatagroupheadingwidget_color.css Thu Jul 22 16:36:53 2010 +0100 @@ -6,4 +6,14 @@ HbDataGroupHeadingWidget::dataGroup_Description { color:var(qtc_list_item_content_normal); +} + +HbDataGroupHeadingWidget[!enabled]::dataGroup_HeadingLabel +{ + color:var(qtc_list_item_disabled); +} + +HbDataGroupHeadingWidget[!enabled]::dataGroup_Description +{ + color:var(qtc_list_item_disabled); } \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdatetimepicker/hbdatetimepicker.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdatetimepicker/hbdatetimepicker.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdatetimepicker/hbdatetimepicker.css Thu Jul 22 16:36:53 2010 +0100 @@ -13,5 +13,5 @@ } HbDateTimePicker::highlight{ - fixed-height: expr(var(hb-param-text-height-secondary)+2*var(hb-param-margin-gene-middle-vertical)); + fixed-height: expr(var(hb-param-text-height-primary) + var(hb-param-margin-gene-bottom) + var(hb-param-margin-gene-top)); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdialog/hbdialog.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdialog/hbdialog.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdialog/hbdialog.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,14 +1,37 @@ HbDialog { max-width:expr(var(hb-param-screen-width)-2*var(hb-param-margin-gene-screen)); max-height:expr(var(hb-param-screen-height)-2*var(hb-param-margin-gene-screen)); + layout:default; +} + +HbDialog[heading_layout] { + layout:content_header; +} + +HbDialog[controls_layout] { + layout:content_controls; +} + +HbDialog[heading_layout][controls_layout] { + layout:content_header_controls; } HbDialog::heading { + left:-var(hb-param-margin-gene-popup); + right:var(hb-param-margin-gene-popup); + top:-var(hb-param-margin-gene-popup); + bottom:var(hb-param-margin-gene-popup); + text-height:var(hb-param-text-height-primary); + text-align:left; + font-variant:primary; max-height:expr(var(hb-param-text-height-primary)+2*var(hb-param-margin-gene-popup)); + bottom:var(hb-param-margin-gene-popup); } -HbDialog::controls { +HbDialog::controls { + top:-var(hb-param-margin-gene-popup); min-width:expr(var(hb-param-screen-short-edge)-2*var(hb-param-margin-gene-screen)); + fixed-height:var(hb-param-widget-popup-softkey-height); } HbDialog::content { @@ -16,6 +39,7 @@ right:var(hb-param-margin-gene-popup); top:-var(hb-param-margin-gene-popup); bottom:var(hb-param-margin-gene-popup); + } HbDialog > HbListWidget { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdialog/hbdialog.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbdialog/hbdialog.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbgroupboxheadingwidget/hbgroupboxheadingwidget.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbgroupboxheadingwidget/hbgroupboxheadingwidget.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbgroupboxheadingwidget/hbgroupboxheadingwidget.css Thu Jul 22 16:36:53 2010 +0100 @@ -34,12 +34,9 @@ /* Collapsing container groupBox */ HbGroupBoxHeadingWidget[groupBoxType="3"]::icon { - top:-var(hb-param-margin-gene-top); - bottom:var(hb-param-margin-gene-bottom); right:var(hb-param-margin-gene-right); - - fixed-width:var(hb-param-graphic-size-primary-small); - fixed-height:var(hb-param-graphic-size-primary-small); + fixed-width:var(hb-param-graphic-size-secondary); + fixed-height:var(hb-param-graphic-size-secondary); } HbGroupBoxHeadingWidget[groupBoxType="3"]::text diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbgroupboxheadingwidget/hbgroupboxheadingwidget.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbgroupboxheadingwidget/hbgroupboxheadingwidget.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbgroupboxheadingwidget/hbgroupboxheadingwidget.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -34,9 +34,8 @@ background: [ TOP,LEFT,BOTTOM,RIGHT ]anchored w.r.t to layout --> - + - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,29 @@ -HbIndicatorButton +HbIndicatorButton[layout_type="1"] { - layout:indicatorbuttonlayout; + layout:indicatorbuttonlayout1; +} + +HbIndicatorButton[layout_type="2"] +{ + layout:indicatorbuttonlayout2; } HbIndicatorButton::handleindication { - fixed-width: expr(var(hb-param-widget-chrome-height)/6); + fixed-width: expr((1/6)*var(hb-param-widget-chrome-height)); + fixed-height: expr((2/3)*var(hb-param-widget-chrome-height)); } + +HbIndicatorButton::eventindication +{ + top: -expr(((2/3)*var(hb-param-widget-chrome-height) - var(hb-param-graphic-size-primary-small))*(1/2)); + left: -expr((var(hb-param-widget-chrome-height) - var(hb-param-graphic-size-primary-small)*2 - 0.5un)*(1/2)); + fixed-width:var(hb-param-graphic-size-primary-small); + fixed-height:var(hb-param-graphic-size-primary-small); +} + +HbIndicatorButton::toucharea +{ + top: expr((1/3)*var(hb-param-widget-chrome-height)); + fixed-height: var(hb-param-widget-chrome-height); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ - + @@ -12,6 +12,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton_color.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton_color.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorbutton/hbindicatorbutton_color.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,4 +1,4 @@ -HbIndicatoButton::icon { +HbIndicatorButton::eventindication { color: var(qtc_title_pane_normal); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorgroup/hbindicatorgroup.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorgroup/hbindicatorgroup.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbindicatorgroup/hbindicatorgroup.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,9 @@ -HbIndicatorGroup[layout="0"] +HbIndicatorGroup[alignment="0"] { layout:notificationlayout; } -HbIndicatorGroup[layout="1"] +HbIndicatorGroup[alignment="1"] { layout:settinglayout; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbinputdialog/hbinputdialog.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbinputdialog/hbinputdialog.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,9 @@ +HbInputDialog::content { + left:0 un; + right:0 un; + top:0 un; + bottom:0 un; +} +HbInputDialog::controls { + top:0 un; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbinputdialogcontentwidget/hbinputdialogcontentwidget.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbinputdialogcontentwidget/hbinputdialogcontentwidget.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbinputdialogcontentwidget/hbinputdialogcontentwidget.css Thu Jul 22 16:36:53 2010 +0100 @@ -19,7 +19,8 @@ HbInputDialogContentWidget::label-1:portrait { top:-var(hb-param-margin-gene-popup); - text-line-count-max: 1; + text-line-count-min:1; + text-line-count-max:2; font-variant:secondary; text-height:var(hb-param-text-height-secondary); text-align:left; @@ -38,7 +39,8 @@ HbInputDialogContentWidget::label-2:portrait { - text-line-count-max: 1; + text-line-count-min:1; + text-line-count-max:2; font-variant:secondary; text-height:var(hb-param-text-height-secondary); @@ -59,7 +61,8 @@ min-width: expr((((var(hb-param-screen-short-edge)-(2*var(hb-param-margin-gene-screen)))-(2*var(hb-param-margin-gene-popup)))/2)); size-policy-horizontal: preferred; - text-line-count-max: 1; + text-line-count-min:1; + text-line-count-max:2; font-variant:secondary; text-height:var(hb-param-text-height-secondary); @@ -81,7 +84,8 @@ HbInputDialogContentWidget::label-2:landscape { size-policy-horizontal: expanding; - text-line-count-max: 1; + text-line-count-min:1; + text-line-count-max:2; min-width: expr((((var(hb-param-screen-short-edge)-(2*var(hb-param-margin-gene-screen)))-(2*var(hb-param-margin-gene-popup)))/2)); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbinputsettinglist/hbinputsettinglist.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbinputsettinglist/hbinputsettinglist.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,4 @@ +HbInputSettingList { + max-width:200un; + max-height:200un; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblabel/hblabel.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblabel/hblabel.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblabel/hblabel.css Thu Jul 22 16:36:53 2010 +0100 @@ -16,14 +16,3 @@ top:-var(hb-param-margin-label); bottom:var(hb-param-margin-label); } - -HbDialog::heading > HbLabel::text { - left:-var(hb-param-margin-gene-popup); - right:var(hb-param-margin-gene-popup); - top:-var(hb-param-margin-gene-popup); - bottom:var(hb-param-margin-gene-popup); - text-height:var(hb-param-text-height-primary); - text-align:left; - text-line-count-max: 1; - font-variant:primary; -} \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblineedit/hblineedit.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblineedit/hblineedit.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblineedit/hblineedit.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -5,6 +5,17 @@ + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblistviewitem/hblistviewitem.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblistviewitem/hblistviewitem.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hblistviewitem/hblistviewitem.css Thu Jul 22 16:36:53 2010 +0100 @@ -170,6 +170,7 @@ text-line-count-min:1; text-line-count-max:1; text-wrap-mode:no-wrap; + size-policy-horizontal: ignored; } HbListViewItem::frame{ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmenu/hbmenu.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmenu/hbmenu.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmenu/hbmenu.css Thu Jul 22 16:36:53 2010 +0100 @@ -3,6 +3,7 @@ layout:default; submenu-right-offset: 2.25un; submenu-bottom-margin: var(hb-param-margin-gene-screen); + number-of-columns: 1; } HbMenu::content diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmenuitem/hbmenuitem.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmenuitem/hbmenuitem.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmenuitem/hbmenuitem.css Thu Jul 22 16:36:53 2010 +0100 @@ -20,7 +20,8 @@ bottom: var(hb-param-margin-gene-bottom); font-variant: primary; text-height: var(hb-param-text-height-primary); - text-line-count-max: 1; + text-line-count-min:1; + text-line-count-max:1; } HbMenuItem[separator_exists]::text diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmessagebox/hbmessagebox.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmessagebox/hbmessagebox.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ +HbMessageBox::content { + left:0 un; + right:0 un; + top:0 un; + bottom:0 un; +} + +HbMessageBox::controls { + top:0 un; +} \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmessageboxcontentwidget/hbmessageboxcontentwidget.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmessageboxcontentwidget/hbmessageboxcontentwidget.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmessageboxcontentwidget/hbmessageboxcontentwidget.css Thu Jul 22 16:36:53 2010 +0100 @@ -6,23 +6,34 @@ HbMessageBoxContentWidget[hasIcon="false"]{ layout: text_layout; } + + HbMessageBoxContentWidget::text { - top: -var(hb-param-margin-gene-popup); - bottom: var(hb-param-margin-gene-popup); - left: -var(hb-param-margin-gene-popup); - right: 0 un;/*var(hb-param-margin-gene-popup);*/ - font-variant:primary; - text-height:var(hb-param-text-height-primary); - text-line-count-max: 5; - text-line-count-min: 3; - text-align: left; + + top: -var(hb-param-margin-gene-popup); + bottom: var(hb-param-margin-gene-popup); + left: -var(hb-param-margin-gene-popup); + right: 0 un;/*var(hb-param-margin-gene-popup);*/ + font-variant:primary; + text-height:var(hb-param-text-height-primary); + text-line-count-max: 5; + text-line-count-min: 3; + text-align: left; } +HbMessageBoxContentWidget::text[hasIcon="true"] +{ + min-width: expr(var(hb-param-screen-short-edge)-2*var(hb-param-margin-gene-screen)-2*var(hb-param-margin-gene-popup)-var(hb-param-graphic-size-primary-large)); +} +HbMessageBoxContentWidget::text[hasIcon="false"] +{ + min-width: expr(var(hb-param-screen-short-edge)-*2var(hb-param-margin-gene-screen)-var(hb-param-margin-gene-popup)); +} HbMessageBoxContentWidget::icon { - top: -var(hb-param-margin-gene-popup); - left: -var(hb-param-margin-gene-popup); - fixed-width: var(hb-param-graphic-size-primary-large); - fixed-height: var(hb-param-graphic-size-primary-large); + top: -var(hb-param-margin-gene-popup); + left: -var(hb-param-margin-gene-popup); + fixed-width: var(hb-param-graphic-size-primary-large); + fixed-height: var(hb-param-graphic-size-primary-large); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmessageboxeditor/hbmessageboxeditor.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbmessageboxeditor/hbmessageboxeditor.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ +HbMessageBoxEditor::text{ + left: 0un; + right: 0un; + top: 0un; + bottom: 0un; +} \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbnavigationbutton/hbnavigationbutton.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbnavigationbutton/hbnavigationbutton.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ +HbNavigationButton +{ + layout:navigationbuttonlayout; +} + +HbNavigationButton::toucharea +{ + top: expr((1/3)*var(hb-param-widget-chrome-height)); + fixed-height: var(hb-param-widget-chrome-height); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbnavigationbutton/hbnavigationbutton.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbnavigationbutton/hbnavigationbutton.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbnotificationdialogcontent/hbnotificationdialogcontent.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbnotificationdialogcontent/hbnotificationdialogcontent.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbnotificationdialogcontent/hbnotificationdialogcontent.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,11 +1,11 @@ HbNotificationDialogContent[icon="true"][textFields="2"] { - layout:dialog_notification_window_title_text_icon; + layout:dialog_notification_window_title_text_icon; } HbNotificationDialogContent[icon="false"][textFields="2"] { - layout:dialog_notification_window_title_text + layout:dialog_notification_window_title_text } HbNotificationDialogContent[icon="false"][textFields="1"] @@ -15,7 +15,7 @@ HbNotificationDialogContent[icon="true"][textFields="1"] { - layout:dialog_notification_window_title_icon; + layout:dialog_notification_window_title_icon; } HbNotificationDialogContent[textFields="1"]::icon @@ -45,6 +45,8 @@ font-variant:primary; pref-height: var(hb-param-text-height-primary); text-align: left; + text-line-count-min: 1; + text-line-count-max: 1; } HbNotificationDialogContent[titleWrapping="false"][icon="true"][textFields="1"]::title @@ -54,6 +56,8 @@ font-variant:primary; pref-height: var(hb-param-text-height-primary); text-align: left; + text-line-count-min: 1; + text-line-count-max: 1; } HbNotificationDialogContent[titleWrapping="true"][icon="false"][textFields="1"]::title @@ -90,6 +94,8 @@ font-variant:primary; pref-height: var(hb-param-text-height-primary); text-align: left; + text-line-count-min: 1; + text-line-count-max: 1; } HbNotificationDialogContent[icon="true"][textFields="2"]::title @@ -100,6 +106,8 @@ font-variant:primary; pref-height: var(hb-param-text-height-primary); text-align: left; + text-line-count-min: 1; + text-line-count-max: 1; } HbNotificationDialogContent::text @@ -109,5 +117,7 @@ font-variant:secondary; pref-height: var(hb-param-text-height-secondary); text-align: left; + text-line-count-min: 1; + text-line-count-max: 1; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressbar/hbprogressbar.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressbar/hbprogressbar.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressbar/hbprogressbar.css Thu Jul 22 16:36:53 2010 +0100 @@ -40,6 +40,7 @@ pref-height: var(hb-param-widget-progress-bar-height); size-policy-vertical: fixed; size-policy-horizontal: preferred; + pref-width:var(hb-param-screen-short-edge); } @@ -48,6 +49,7 @@ pref-width: var(hb-param-widget-progress-bar-height); size-policy-vertical: preferred; size-policy-horizontal: fixed; + pref-height:var(hb-param-screen-short-edge); } HbProgressBar[orientation="Horizontal"]::toucharea diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressbar/hbprogressbar.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressbar/hbprogressbar.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressbar/hbprogressbar.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -251,7 +251,6 @@ - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressdialog/hbprogressdialog.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressdialog/hbprogressdialog.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,10 @@ +HbProgressDialog::content { + left:0 un; + right:0 un; + top:0 un; + bottom:0 un; +} + +HbProgressDialog::controls { + top:0 un; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressdialogcontentwidget/hbprogressdialogcontentwidget.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressdialogcontentwidget/hbprogressdialogcontentwidget.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbprogressdialogcontentwidget/hbprogressdialogcontentwidget.css Thu Jul 22 16:36:53 2010 +0100 @@ -47,6 +47,7 @@ { text-line-count-min:1; text-line-count-max:3; + min-width: expr(var(hb-param-screen-short-edge)-2*var(hb-param-margin-gene-screen)-3*var(hb-param-margin-gene-popup)-var(hb-param-graphic-size-primary-large)); } /* Text line count for only text Layout use cases */ @@ -54,5 +55,6 @@ { text-line-count-min:1; text-line-count-max:5; + min-width: expr(var(hb-param-screen-short-edge)-2*var(hb-param-margin-gene-screen)-2*var(hb-param-margin-gene-popup)); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbpushbutton/hbpushbutton.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbpushbutton/hbpushbutton.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbpushbutton/hbpushbutton.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,5 +1,6 @@ -HbPushButton{ + HbPushButton{ layout:icon_button; + min-width:expr(var(hb-param-margin-gene-left)+var(hb-param-margin-gene-right)+var(hb-param-graphic-size-function)); } /* @@ -7,22 +8,21 @@ */ HbPushButton[!icon][!text][!additionalText]{ min-height:expr(var(hb-param-margin-gene-top)+var(hb-param-margin-gene-bottom)+var(hb-param-text-height-secondary)); - min-width:expr(var(hb-param-margin-gene-left)+var(hb-param-margin-gene-right)+var(hb-param-graphic-size-function)); } - /* specifying the min-height for icon only layout as icon has pref-height. specifying the min-width for icon only layout as icon has pref-width. */ HbPushButton[icon][!text][!additionalText]{ layout:icon_button; + /* we are specifying pref -height for icon ,so need to see what could be min height so that it will suits for all usecases*/ min-height:expr(var(hb-param-margin-gene-top)+var(hb-param-margin-gene-bottom)+var(hb-param-text-height-secondary)); - min-width:expr(var(hb-param-margin-gene-left)+var(hb-param-margin-gene-right)+var(hb-param-graphic-size-function)); } HbPushButton[text][!icon][!additionalText]{ layout:text_button; + min-height:expr(var(hb-param-margin-gene-top)+var(hb-param-margin-gene-bottom)+var(hb-param-text-height-secondary)); } /* specifying the min-height for icon + text vertical layout as icon has pref-height. @@ -30,24 +30,28 @@ HbPushButton[!stretched][icon][text][!additionalText]{ layout:icon_text_Vertical; - min-height:expr(var(hb-param-margin-gene-top)+var(hb-param-margin-gene-bottom)+var(hb-param-text-height-secondary)); - /*min-width:expr(var(hb-param-margin-gene-left) + var(hb-param-margin-gene-right) + var(hb-param-graphic-size-function));*/ + /* we are using pref height for icon, so not included in calculation*/ + min-height:expr(var(hb-param-margin-gene-center-align)+var(hb-param-margin-gene-center-align)+var(hb-param-margin-gene-middle-vertical)+var(hb-param-text-height-tiny)); } HbPushButton[stretched][icon][text][!additionalText]{ layout:icon_text_Horizontal; + min-height:expr(var(hb-param-margin-gene-top)+var(hb-param-margin-gene-bottom)+ var(hb-param-graphic-size-function)); } HbPushButton[!stretched][icon][text][additionalText]{ - layout:icon_text_additionalText_vertical; + layout:icon_text_additionalText_vertical; + min-height:expr(var(hb-param-margin-gene-top)+var(hb-param-margin-gene-bottom)+ var(hb-param-graphic-size-primary-large)); } HbPushButton[stretched][icon][text][additionalText]{ layout:icon_text_additionalText_horizontal; + min-height:expr(var(hb-param-margin-gene-top)+var(hb-param-margin-gene-bottom)+ var(hb-param-graphic-size-function)); } HbPushButton[!stretched][additionalText][text][!icon]{ - layout:text_additionalText_vertical; + layout:text_additionalText_vertical; + min-height:expr(var(hb-param-margin-gene-center-align)+var(hb-param-margin-gene-center-align)+var(hb-param-margin-gene-middle-vertical)+var(hb-param-text-height-title)+var(hb-param-text-height-tiny)); } /* @@ -156,6 +160,9 @@ top: -var(hb-param-margin-gene-top); right:var(hb-param-margin-gene-right); text-height:var(hb-param-text-height-primary); + /* set width pref */ + /*pref-width: 0.0un; + size-policy-vertical:fixed;*/ text-align:left; text-line-count-max:1; } @@ -168,6 +175,9 @@ right:var(hb-param-margin-gene-right); font-variant:secondary; text-height:var(hb-param-text-height-secondary); + /* set width pref */ + /*pref-width: 0.0un; + size-policy-vertical:fixed;*/ text-align:left; text-line-count-max:1; } @@ -187,6 +197,9 @@ { left:-var(hb-param-margin-gene-middle-horizontal); text-height:var(hb-param-text-height-primary); + /* set width pref */ + pref-width: 10.0un; + size-policy-vertical:fixed; text-align:left; text-line-count-max:1; } @@ -197,6 +210,8 @@ right:var(hb-param-margin-gene-right); font-variant:secondary; text-height:var(hb-param-text-height-secondary); + pref-width: 10.0un; + size-policy-vertical:fixed; text-align:left; text-line-count-max:1; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbratingslider/hbratingslider.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbratingslider/hbratingslider.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbratingslider/hbratingslider.css Thu Jul 22 16:36:53 2010 +0100 @@ -11,6 +11,7 @@ top:0.0un; bottom: 0.0un; fixed-height: var(hb-param-graphic-size-primary-small); + pref-width:var(hb-param-screen-short-edge); } HbRatingSlider::toucharea{ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbscreen/hbscreen.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbscreen/hbscreen.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbscreen/hbscreen.css Thu Jul 22 16:36:53 2010 +0100 @@ -81,6 +81,20 @@ fixed-height: expr((2/3)*var(hb-param-widget-chrome-height)); } +HbScreen::titlebar[titleBarMinimizable="true"]::right-to-left{ + left: 0un; + right: -expr((1/3)*var(hb-param-widget-chrome-height)); + top: 0un; + fixed-height: expr((2/3)*var(hb-param-widget-chrome-height)); +} + +HbScreen::titlebar[titleBarMinimizable="false"]::right-to-left{ + left: 0un; + right: 0un; + top: 0un; + fixed-height: expr((2/3)*var(hb-param-widget-chrome-height)); +} + HbScreen::navi{ fixed-height: 7.5un; size-policy-horizontal:preferred; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectioncontrol/hbselectioncontrol.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectioncontrol/hbselectioncontrol.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectioncontrol/hbselectioncontrol.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,13 @@ HbSelectionControl::handle-icon { - fixed-width:2.4un; - fixed-height:2.4un; + fixed-width:var(hb-param-graphic-size-secondary); + fixed-height:var(hb-param-graphic-size-secondary); } HbSelectionControl::handle-toucharea { - fixed-height:9.0un; - fixed-width:9.0un; + fixed-height:var(hb-param-touch-area-gene-primary-large); + fixed-width:var(hb-param-touch-area-gene-primary-large); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogcontentwidget/hbselectiondialogcontentwidget.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogcontentwidget/hbselectiondialogcontentwidget.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogcontentwidget/hbselectiondialogcontentwidget.css Thu Jul 22 16:36:53 2010 +0100 @@ -7,23 +7,4 @@ } -HbSelectionDialogContentWidget[multiSelection]::counter -{ - fixed-width: 14un; - text-align: right; - text-height: var(hb-param-text-height-tiny); - text-line-count-max: 1; - text-line-count-min: 1; - font-variant:secondary; - right:var(hb-param-margin-gene-popup); -} - - - -HbSelectionDialogContentWidget[multiSelection]::checkbox -{ - left:-var(hb-param-margin-gene-popup); - top:-var(hb-param-margin-gene-popup); - bottom:var(hb-param-margin-gene-popup); - right:var(hb-param-margin-gene-popup); -} \ No newline at end of file + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogcontentwidget/hbselectiondialogcontentwidget.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogcontentwidget/hbselectiondialogcontentwidget.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogcontentwidget/hbselectiondialogcontentwidget.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -9,15 +9,13 @@ - - + + + - - - + - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogmarkwidget/hbselectiondialogmarkwidget.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogmarkwidget/hbselectiondialogmarkwidget.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,24 @@ +HbSelectionDialogMarkWidget{ + layout:default; +} + +HbSelectionDialogMarkWidget::counter +{ + fixed-width: 14un; + text-align: right; + text-height: var(hb-param-text-height-tiny); + text-line-count-max: 1; + text-line-count-min: 1; + font-variant:secondary; + right:var(hb-param-margin-gene-popup); +} + + + +HbSelectionDialogMarkWidget::checkbox +{ + /*left:-var(hb-param-margin-gene-popup); + top:-var(hb-param-margin-gene-popup); + bottom:var(hb-param-margin-gene-popup); + right:var(hb-param-margin-gene-popup); */ +} \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogmarkwidget/hbselectiondialogmarkwidget.widgetml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogmarkwidget/hbselectiondialogmarkwidget.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogmarkwidget/hbselectiondialogmarkwidget_color.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbselectiondialogmarkwidget/hbselectiondialogmarkwidget_color.css Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,6 @@ +HbSelectionDialogMarkWidget::counter +{ + color: var(qtc_viewtitle_normal); +} + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslider/hbslider.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslider/hbslider.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslider/hbslider.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,19 +1,19 @@ -HbSlider[orientation="Horizontal"][TickLabelPresent] + +HbSlider[orientation="Horizontal"] { - layout:slider_horizontal_withticklabel; -} - -HbSlider[orientation="Horizontal"][!TickLabelPresent] -{ - layout:slider_horizontal_withoutticklabel; + layout:slider_horizontal; min-height:expr(2*var(hb-param-widget-slider-thumb-width)); } -/*HbVolumeSliderPopup > HbSliderPopupContentWidget > HbSlider[orientation="Vertical"]::control:portrait +HbVolumeSliderPopup > HbSliderPopupContentWidget > HbSlider[orientation="Vertical"]::control:portrait { min-height:25un; min-width:0.0un; size-policy-horizontal:fixed; size-policy-vertical:minimum-expanding; + top:-var(hb-param-margin-gene-top); + bottom:var(hb-param-margin-gene-bottom); + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-middle-horizontal); } HbZoomSliderPopup > HbSliderPopupContentWidget > HbSlider[orientation="Vertical"]::control:portrait @@ -22,7 +22,11 @@ min-width:0.0un; size-policy-horizontal:fixed; size-policy-vertical:minimum-expanding; -}*/ + top:-var(hb-param-margin-gene-top); + bottom:var(hb-param-margin-gene-bottom); + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-middle-horizontal); +} HbSlider[orientation="Vertical"]::control { @@ -30,6 +34,10 @@ min-width:0.0un; size-policy-horizontal:fixed; size-policy-vertical:minimum-expanding; + top:-var(hb-param-margin-gene-top); + bottom:var(hb-param-margin-gene-bottom); + left:-var(hb-param-margin-gene-middle-horizontal); + right:var(hb-param-margin-gene-middle-horizontal); } @@ -41,14 +49,9 @@ size-policy-horizontal:minimum-expanding; } -HbSlider[orientation="Vertical"][TickLabelPresent] +HbSlider[orientation="Vertical"] { - layout:slider_vertical_withticklabel; -} - -HbSlider[orientation="Vertical"][!TickLabelPresent] -{ - layout:slider_vertical_withoutticklabel; + layout:slider_vertical; min-width:expr(2*var(hb-param-widget-slider-thumb-width)); } @@ -121,15 +124,13 @@ { right:var(hb-param-margin-gene-right); } -HbSlider[orientation="Vertical"]::control -{ - top:-var(hb-param-margin-gene-top); - bottom:var(hb-param-margin-gene-bottom); -} + HbSlider[orientation="Horizontal"]::control { left:-var(hb-param-margin-gene-left); right:var(hb-param-margin-gene-right); + top:-var(hb-param-margin-gene-middle-horizontal); + bottom:var(hb-param-margin-gene-middle-horizontal); } HbSlider[orientation="Vertical"]::decrement-icon { @@ -182,9 +183,86 @@ HbSlider::spacerLeft{ size-policy-horizontal: expanding; } + +HbSlider::spacerTextRight{ + size-policy-horizontal: expanding; +} +HbSlider::spacerTextLeft{ + size-policy-horizontal: expanding; +} HbSlider::spacerTop{ size-policy-vertical: expanding; } HbSlider::spacerBottom{ size-policy-vertical: expanding; } + + +/*Ticks left vertical*/ +HbSlider::tick-marksleft +{ + left:-var(hb-param-margin-gene-middle-horizontal); + top:0.0un; + bottom:0.0un; + fixed-width:1.0un; + size-policy-vertical:preferred; + +} + +HbSlider::tick-textsleft +{ + top:0.0un; + bottom:0.0un; + left:-var(hb-param-margin-gene-popup); + fixed-width:7.5un; + size-policy-vertical:preferred; + +} +/*Ticks right vertical*/ +HbSlider::tick-marksright +{ + + right:var(hb-param-margin-gene-middle-horizontal); + fixed-width:1.0un; + size-policy-vertical:preferred; + +} + +HbSlider::tick-textsright +{ + fixed-width:7.5un; + size-policy-vertical:preferred; + right:var(hb-param-margin-gene-popup); +} +/*Ticks above horizontal*/ +HbSlider::tick-marksabove +{ + top:-var(hb-param-margin-gene-middle-vertical); + bottom:var(hb-param-margin-gene-middle-vertical); + fixed-height:1.0un; + size-policy-horizontal:preferred; + +} + +HbSlider::tick-textsabove +{ + fixed-height:var(hb-param-text-height-tiny); + size-policy-horizontal:preferred; + +} +/*Ticks below horizontal*/ +HbSlider::tick-marksbelow +{ + top:-var(hb-param-margin-gene-middle-vertical); + bottom:var(hb-param-margin-gene-middle-vertical); + fixed-height:1.0un; + size-policy-horizontal:preferred; + +} + +HbSlider::tick-textsbelow +{ + fixed-height:var(hb-param-text-height-tiny); + size-policy-horizontal:preferred; +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslider/hbslider.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslider/hbslider.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslider/hbslider.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -1,126 +1,102 @@ - + + + + + + + + + + + + + + + + + - - + + + + - + + + - + - + - + + + + + + + + + + + - - - - - - - - - - - + + + - - - - - - - - - + + + - - - - - - - - - - - - - + + - - - + + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidercontrol/hbslidercontrol.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidercontrol/hbslidercontrol.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidercontrol/hbslidercontrol.css Thu Jul 22 16:36:53 2010 +0100 @@ -56,71 +56,4 @@ } -/*Ticks left vertical*/ -HbSliderControl::tick-marksleft -{ - right:var(hb-param-margin-gene-middle-horizontal); - left:-var(hb-param-margin-gene-middle-horizontal); - top:0.0un; - bottom:0.0un; - fixed-width:1.0un; - size-policy-vertical:preferred; -} - -HbSliderControl::tick-textsleft -{ - top:0.0un; - bottom:0.0un; - fixed-width:7.5un; - size-policy-vertical:preferred; - -} -/*Ticks right vertical*/ -HbSliderControl::tick-marksright -{ - left:-var(hb-param-margin-gene-middle-horizontal); - right:var(hb-param-margin-gene-middle-horizontal); - fixed-width:1.0un; - size-policy-vertical:preferred; - -} - -HbSliderControl::tick-textsright -{ - fixed-width:7.5un; - size-policy-vertical:preferred; - -} -/*Ticks above horizontal*/ -HbSliderControl::tick-marksabove -{ - top:-var(hb-param-margin-gene-middle-vertical); - bottom:var(hb-param-margin-gene-middle-vertical); - fixed-height:1.0un; - size-policy-horizontal:preferred; - -} - -HbSliderControl::tick-textsabove -{ - fixed-height:var(hb-param-text-height-tiny); - size-policy-horizontal:preferred; - -} -/*Ticks below horizontal*/ -HbSliderControl::tick-marksbelow -{ - top:-var(hb-param-margin-gene-middle-vertical); - bottom:var(hb-param-margin-gene-middle-vertical); - fixed-height:1.0un; - size-policy-horizontal:preferred; - -} - -HbSliderControl::tick-textsbelow -{ - fixed-height:var(hb-param-text-height-tiny); - size-policy-horizontal:preferred; -} - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidercontrol/hbslidercontrol.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidercontrol/hbslidercontrol.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidercontrol/hbslidercontrol.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -1,53 +1,29 @@ - - - - - - - - - - + - + + - - - - + + + - - - - - - - - - - - - - - - - - + + + - @@ -57,13 +33,6 @@ - - - - - - - \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbsliderpopupcontentwidget/hbsliderpopupcontentwidget.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbsliderpopupcontentwidget/hbsliderpopupcontentwidget.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbsliderpopupcontentwidget/hbsliderpopupcontentwidget.css Thu Jul 22 16:36:53 2010 +0100 @@ -3,14 +3,6 @@ layout:slider_popup; } -/* popup slider*/ -HbSliderPopupContentWidget::slider -{ - top:-var(hb-param-margin-gene-popup); - left:-var(hb-param-margin-gene-popup); - bottom:var(hb-param-margin-gene-popup); - right:var(hb-param-margin-gene-popup); -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarks/hbslidertickmarks.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarks/hbslidertickmarks.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarks/hbslidertickmarks.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,4 +1,4 @@ -HbSliderControl[orientation="Horizontal"] > HbSliderTickmarks +HbSlider[orientation="Horizontal"] > HbSliderTickmarks { fixed-width-major: 0.5un; fixed-height-major: 1un; @@ -8,7 +8,7 @@ -HbSliderControl[orientation="Vertical"] > HbSliderTickmarks +HbSlider[orientation="Vertical"] > HbSliderTickmarks { fixed-height-major: 0.5un; fixed-width-major: 1un; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarkslabel/hbslidertickmarkslabel.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarkslabel/hbslidertickmarkslabel.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarkslabel/hbslidertickmarkslabel.css Thu Jul 22 16:36:53 2010 +0100 @@ -15,33 +15,33 @@ text-line-count-max:1; } -HbSliderTickmarksLabel[orientation="1"]::tickmark-majorlabel +HbSlider[orientation="Horizontal"] > HbSliderTickmarksLabel::tickmark-majorlabel { text-align: center center; } -HbSliderTickmarksLabel[orientation="1"]::tickmark-minorlabel +HbSlider[orientation="Horizontal"] > HbSliderTickmarksLabel::tickmark-minorlabel { text-align: center center; } /*Vertical orientation major and minor label*/ -HbSliderTickmarksLabel[orientation="2"][TicksLeft="true"]::tickmark-majorlabel +HbSlider[orientation="Vertical"] > HbSliderTickmarksLabel[TicksLeft="true"]::tickmark-majorlabel { text-align: right center; } -HbSliderTickmarksLabel[orientation="2"][TicksRight="true"]::tickmark-majorlabel +HbSlider[orientation="Vertical"] > HbSliderTickmarksLabel[TicksRight="true"]::tickmark-majorlabel { text-align: left center; } -HbSliderTickmarksLabel[orientation="2"][TicksLeft="true"]::tickmark-minorlabel +HbSlider[orientation="Vertical"] >HbSliderTickmarksLabel[TicksLeft="true"]::tickmark-minorlabel { text-align: right center; } -HbSliderTickmarksLabel[orientation="2"][TicksRight="true"]::tickmark-minorlabel +HbSlider[orientation="Vertical"] >HbSliderTickmarksLabel[TicksRight="true"]::tickmark-minorlabel { text-align: left center; } \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarkslabel/hbslidertickmarkslabel_color.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarkslabel/hbslidertickmarkslabel_color.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbslidertickmarkslabel/hbslidertickmarkslabel_color.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,9 +1,19 @@ -HbSliderTickmarksLabel[state= "normal"]::tickmark-majorlabel +HbSliderPopupContentWidget > HbSlider > HbSliderTickmarksLabel::tickmark-majorlabel +{ + color: var(qtc_popup_trans_normal); +} + +HbSliderPopupContentWidget > HbSlider > HbSliderTickmarksLabel::tickmark-minorlabel { color: var(qtc_popup_trans_normal); } -HbSliderTickmarksLabel[state= "normal"]::tickmark-minorlabel +HbSliderTickmarksLabel::tickmark-majorlabel { - color: var(qtc_popup_trans_normal); + color: var(qtc_default_main_pane_normal); } + +HbSliderTickmarksLabel::tickmark-minorlabel +{ + color: var(qtc_default_main_pane_normal); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbstatusbar/hbstatusbar.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbstatusbar/hbstatusbar.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbstatusbar/hbstatusbar.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,13 +1,17 @@ HbStatusBar { layout:default; - mirroring: disabled; + layout-direction: left-to-right; } HbStatusBar::timetext { font-variant: secondary; - fixed-width: 11un; + text-align: center; + size-policy-horizontal: ignored; + text-line-count-min: 1; + text-line-count-max: 1; + text-wrap-mode: no-wrap; fixed-height: 2.5un; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbstatusbar/hbstatusbar.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbstatusbar/hbstatusbar.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbstatusbar/hbstatusbar.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -5,7 +5,8 @@ - + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlebar/hbtitlebar.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlebar/hbtitlebar.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlebar/hbtitlebar.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,7 +1,7 @@ HbTitleBar { layout:default; - mirroring: disabled; + layout-direction: left-to-right; } HbTitleBar::status{ @@ -26,6 +26,7 @@ HbTitleBar::toucharea { + top: expr((1/3)*var(hb-param-widget-chrome-height)); fixed-width: expr(2/3*var(hb-param-widget-chrome-height)); fixed-height: var(hb-param-widget-chrome-height); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlepane/hbtitlepane.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlepane/hbtitlepane.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlepane/hbtitlepane.css Thu Jul 22 16:36:53 2010 +0100 @@ -32,3 +32,9 @@ { layout-direction: right-to-left; } + +HbTitlePane::toucharea +{ + top: expr((1/3)*var(hb-param-widget-chrome-height)); + fixed-height: var(hb-param-widget-chrome-height); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlepane/hbtitlepane.widgetml --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlepane/hbtitlepane.widgetml Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtitlepane/hbtitlepane.widgetml Thu Jul 22 16:36:53 2010 +0100 @@ -6,6 +6,9 @@ + + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbarextension/hbtoolbarextension.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbarextension/hbtoolbarextension.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbarextension/hbtoolbarextension.css Thu Jul 22 16:36:53 2010 +0100 @@ -8,17 +8,3 @@ max-height:var(hb-param-screen-height); min-width:0un; } - -HbToolBarExtension::heading { - left:-var(hb-param-margin-gene-popup); - right:var(hb-param-margin-gene-popup); - top:-var(hb-param-margin-gene-popup); - bottom:var(hb-param-margin-gene-popup); -} - -HbToolBarExtension::heading::text { - text-height:var(hb-param-text-height-primary); - text-align:left; - text-line-count-max: 1; - font-variant:primary; -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbutton/hbtoolbutton.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbutton/hbtoolbutton.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbutton/hbtoolbutton.css Thu Jul 22 16:36:53 2010 +0100 @@ -113,10 +113,6 @@ text-line-count-max: 1; } -HbToolButton[dialogtoolbar]{ - fixed-height:var(hb-param-widget-popup-softkey-height); -} - HbToolBar > HbToolButton[dialogtoolbar]::text { left:-0.75un; right:0.75un; @@ -125,3 +121,23 @@ text-align:center center; text-line-count-max: 1; } + +HbTitleBar > HbToolButton[buttonStyle="0"]::icon{ + fixed-width:var(hb-param-graphic-size-secondary); + fixed-height:var(hb-param-graphic-size-secondary); +} + +HbTitleBar > HbToolButton[buttonStyle="1"]::icon{ + fixed-width:var(hb-param-graphic-size-function); + fixed-height:var(hb-param-graphic-size-function); +} + +HbTitleBar > HbToolButton[buttonStyle="2"]::icon{ + fixed-width:var(hb-param-graphic-size-function); + fixed-height:var(hb-param-graphic-size-function); +} + +HbTitleBar > HbToolButton[buttonStyle="3"]::icon{ + fixed-width:var(hb-param-graphic-size-primary-small); + fixed-height:var(hb-param-graphic-size-primary-small); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbutton/hbtoolbutton_color.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbutton/hbtoolbutton_color.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtoolbutton/hbtoolbutton_color.css Thu Jul 22 16:36:53 2010 +0100 @@ -88,5 +88,5 @@ } HbTitleBar > HbNavigationButton::icon { - color:(qtc_title_pane_normal); + color:var(qtc_title_pane_normal); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtooltiplabel/hbtooltiplabel.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtooltiplabel/hbtooltiplabel.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtooltiplabel/hbtooltiplabel.css Thu Jul 22 16:36:53 2010 +0100 @@ -16,4 +16,5 @@ text-line-count-max: 1; font-variant:secondary; text-height:var(hb-param-text-height-tiny); + text-wrap-mode:no-wrap; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtumbleview/hbtumbleview.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtumbleview/hbtumbleview.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtumbleview/hbtumbleview.css Thu Jul 22 16:36:53 2010 +0100 @@ -6,17 +6,16 @@ HbTumbleView[scrollDirections="Horizontal"] { layout:tumble-layout; - min-width: 1un; + min-width: 1un;/*Need this for uniform tumbler widths, when grouped together*/ } HbTumbleView[scrollDirections="Vertical"] { layout:tumble-layout; - min-width: 1un; + min-width: 1un;/*Need this for uniform tumbler widths, when grouped together*/ } HbTumbleView::highlight { - fixed-height: expr(var(hb-param-text-height-secondary)+2*var(hb-param-margin-gene-middle-vertical)); - + fixed-height: expr(var(hb-param-text-height-primary)+var(hb-param-margin-gene-bottom)+var(hb-param-margin-gene-top)); } HbTumbleView::separator{ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtumbleviewitem/hbtumbleviewitem.css --- a/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtumbleviewitem/hbtumbleviewitem.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/rules/widgets/hbtumbleviewitem/hbtumbleviewitem.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,6 +1,6 @@ -HbTumbleViewItem[layoutName="default"][modelItemType="StandardItem"][!icon-1][!text-2]{ +HbTumbleViewItem{ layout:tumble-layout; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/resources/themes/style/hbdefault/variables/color/hbcolorgroup.css --- a/src/hbcore/resources/themes/style/hbdefault/variables/color/hbcolorgroup.css Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/resources/themes/style/hbdefault/variables/color/hbcolorgroup.css Thu Jul 22 16:36:53 2010 +0100 @@ -1,8 +1,69 @@ +/* Application specific color groups */ + + +@variables +{ +/* Application specific - Conversational list */ +qtc_conv_list_received_normal:#505050; /* Modified 05.02.2010 */ +qtc_conv_list_received_pressed:#FFFFFF; /* Modified 05.02.2010 */ +qtc_conv_list_received_highlight:#FFFFFF; /* Modified 05.02.2010 */ +qtc_conv_list_sent_normal:#505050; /* Modified 05.02.2010 */ +qtc_conv_list_sent_pressed:#FFFFFF; /* Modified 05.02.2010 */ +qtc_conv_list_sent_highlight:#FFFFFF; /* Modified 05.02.2010 */ +qtc_conv_list_dimmed:#787878; /* Added 26.03.2010 */ + +/* Application specific - Calendar */ +qtc_cal_grid_line:#DCDCDC; /* Added 05.02.2010 */ +qtc_cal_month_highlighted_text:#FFFFFF; /* Added 05.02.2010 */ +qtc_cal_month_active_dates:#505050; /* Added 05.02.2010 */ +qtc_cal_month_notactive_dates:#A0A0A0; /* Added 05.02.2010 */ +qtc_cal_month_current_day:#66CCAD; /* Added 05.02.2010 */ +qtc_cal_week_day:#505050; /* Added 05.02.2010 */ +qtc_cal_day_preview_heading:#FFFFFF; /* Added 05.02.2010 */ +qtc_cal_day_preview_text:#FFFFFF; /* Added 05.02.2010 */ +qtc_cal_day_hour_lines:#505050; /* Added 05.02.2010 */ +qtc_cal_monthgrid_title:#FFFFFF; /* Added 05.02.2010 */ + +/* Application specific - Call handling */ +qtc_callhandling_answer_normal:#FFFFFF; /* Added 05.02.2010 */ +qtc_callhandling_answer_pressed:#FFFFFF; /* Added 05.02.2010 */ +qtc_callhandling_answer_highlight:#FFFFFF; /* Added 05.02.2010 */ +qtc_callhandling_reject_normal:#FFFFFF; /* Added 05.02.2010 */ +qtc_callhandling_reject_pressed:#FFFFFF; /* Added 05.02.2010 */ +qtc_callhandling_reject_highlight:#FFFFFF; /* Added 05.02.2010 */ + +/* Application specific - Home screen */ +qtc_hs_list_item_title_normal:#505050; /* Added 05.02.2010 */ +qtc_hs_list_title2_normal:#3C3C3C; +qtc_hs_list_item_content_normal:#519FB9; /* Added 05.02.2010 */ +qtc_hs_list_item_pressed:#FFFFFF; /* Added 05.02.2010 */ +qtc_hs_list_item_latched:#FFFFFF; +qtc_hs_list_item_highlight:#FFFFFF; /* Added 05.02.2010 */ +qtc_hs_badge:#FFFFFF; /* Added 01.03.2010 */ +qtc_hs_cal:#3C3C3C; /* Added 18.03.2010 */ +qtc_hs_snapguide:#f7931e; /* Added 24.05.2010 */ + +/* Application specific - Radio & Calculator */ +qtc_lcd_title_normal:#505050; /* Added 11.02.2010 */ +qtc_lcd_content_normal:#519FB9; /* Added 11.02.2010 */ +qtc_lcd_link_normal:#33C8FF; /* Added 22.02.2010 */ +qtc_radio_tuner_normal:#505050; /* Added 05.02.2010 */ +qtc_radio_tuner_line:#3C3C3C; /* Added 05.02.2010 */ + +/* Application specific - Multimedia */ +qtc_multimedia_trans_normal:#FFFFFF; /* Modified 02.06.2010 */ +qtc_multimedia_trans_pressed:#FFFFFF; /* Added 19.02.2010 */ +qtc_multimedia_trans_disabled:#787878; /* Added 09.03.2010 */ + +/* Application specific - Messaging */ +qtc_messaging_char_count:#FFFFFF; /* Added 19.04.2010 */ +} + /* Widget color groups */ - @variables + +@variables { - /* Default palette */ qtc_default_decor_normal:#3C3C3C; qtc_default_decor_pressed:#FFFFFF; @@ -21,10 +82,10 @@ qtc_default_popup_disabled:#9B9B9B; /* Title pane */ -qtc_title_pane_normal:#FFFFFF; +qtc_title_pane_normal:#3C3C3C; /* Modified 26.05.2010 */ qtc_title_pane_pressed:#FFFFFF; qtc_title_pane_highlight:#FFFFFF; -qtc_title_pane_latched:#FFFFFF; +qtc_title_pane_latched:#000000; /* Modified 26.05.2010 */ qtc_title_pane_trans_normal:#FFFFFF; qtc_title_pane_trans_pressed:#FFFFFF; qtc_title_pane_trans_highlight:#FFFFFF; @@ -39,15 +100,11 @@ qtc_view_link_normal:#33C8FF; qtc_view_visited_normal:#B378FF; qtc_view_separator_normal:#9B9B9B; +qtc_view_normal_secondary:#FFFFFF; /* Main area - View title */ qtc_viewtitle_normal:#3C3C3C; -/* Main area - Tab */ -qtc_tab_active_normal:#3C3C3C; -qtc_tab_passive_normal:#3C3C3C; -qtc_tab_passive_Pressed:#3C3C3C; - /* Main area - Grid */ qtc_grid_normal:#595B5D; qtc_grid_pressed:#FFFFFF; @@ -172,55 +229,5 @@ qtc_input_preview_normal:#3C3C3C; /* Modified 22.02.2010 */ qtc_input_hint_normal:#A0A0A0; /* Added 05.03.2010 */ qtc_input_grid_line:#787878; /* Added 12.03.2010 */ - - -/* Application specific - Conversational list */ -qtc_conv_list_received_normal:#505050; /* Modified 05.02.2010 */ -qtc_conv_list_received_pressed:#FFFFFF; /* Modified 05.02.2010 */ -qtc_conv_list_received_highlight:#FFFFFF; /* Modified 05.02.2010 */ -qtc_conv_list_sent_normal:#505050; /* Modified 05.02.2010 */ -qtc_conv_list_sent_pressed:#FFFFFF; /* Modified 05.02.2010 */ -qtc_conv_list_sent_highlight:#FFFFFF; /* Modified 05.02.2010 */ -qtc_conv_list_dimmed:#787878; /* Added 26.03.2010 */ - -/* Application specific - Calendar */ -qtc_cal_grid_line:#DCDCDC; /* Added 05.02.2010 */ -qtc_cal_month_highlighted_text:#FFFFFF; /* Added 05.02.2010 */ -qtc_cal_month_active_dates:#505050; /* Added 05.02.2010 */ -qtc_cal_month_notactive_dates:#A0A0A0; /* Added 05.02.2010 */ -qtc_cal_month_current_day:#66CCAD; /* Added 05.02.2010 */ -qtc_cal_week_day:#505050; /* Added 05.02.2010 */ -qtc_cal_day_preview_heading:#FFFFFF; /* Added 05.02.2010 */ -qtc_cal_day_preview_text:#FFFFFF; /* Added 05.02.2010 */ -qtc_cal_day_hour_lines:#505050; /* Added 05.02.2010 */ -qtc_cal_monthgrid_title:#FFFFFF; /* Added 05.02.2010 */ +} -/* Application specific - Call handling */ -qtc_callhandling_answer_normal:#FFFFFF; /* Added 05.02.2010 */ -qtc_callhandling_answer_pressed:#FFFFFF; /* Added 05.02.2010 */ -qtc_callhandling_answer_highlight:#FFFFFF; /* Added 05.02.2010 */ -qtc_callhandling_reject_normal:#FFFFFF; /* Added 05.02.2010 */ -qtc_callhandling_reject_pressed:#FFFFFF; /* Added 05.02.2010 */ -qtc_callhandling_reject_highlight:#FFFFFF; /* Added 05.02.2010 */ - -/* Application specific - Home screen */ -qtc_hs_list_item_title_normal:#505050; /* Added 05.02.2010 */ -qtc_hs_list_item_content_normal:#519FB9; /* Added 05.02.2010 */ -qtc_hs_list_item_pressed:#FFFFFF; /* Added 05.02.2010 */ -qtc_hs_list_item_highlight:#FFFFFF; /* Added 05.02.2010 */ -qtc_hs_badge:#FFFFFF; /* Added 01.03.2010 */ -qtc_hs_cal:#3C3C3C; /* Added 18.03.2010 */ - -/* Application specific - Radio & Calculator */ -qtc_lcd_title_normal:#505050; /* Added 11.02.2010 */ -qtc_lcd_content_normal:#519FB9; /* Added 11.02.2010 */ -qtc_lcd_link_normal:#33C8FF; /* Added 22.02.2010 */ -qtc_radio_tuner_normal:#505050; /* Added 05.02.2010 */ -qtc_radio_tuner_line:#3C3C3C; /* Added 05.02.2010 */ - -/* Application specific - Multimedia */ -qtc_multimedia_trans:#FFFFFF; /* Modified 19.02.2010 */ -qtc_multimedia_trans_pressed:#FFFFFF; /* Added 19.02.2010 */ -qtc_multimedia_trans_disabled:#787878; /* Added 09.03.2010 */ - -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyle.cpp --- a/src/hbcore/style/hbstyle.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyle.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,6 +23,7 @@ ** ****************************************************************************/ +#include "hbstyle_p.h" #include "hbstyleoptionslider_p.h" #include "hbstyleoptionsliderelement_p.h" #include "hbstyleoptionpushbutton_p.h" @@ -49,7 +50,6 @@ #include "hbstyleoptionindicatorbutton_p.h" #include "hbstyleoptionsignalindicator_p.h" #include "hbstyleoptionbatteryindicator_p.h" -#include "hbstyle_p.h" #include "hbstyleloader.h" #include "hbwidgetloader_p.h" #include "hbwidget_p.h" @@ -87,8 +87,6 @@ #include #include -#include -#include "hbstyleinterface_p.h" #include #include "hbstyleselector_p.h" @@ -99,7 +97,8 @@ #include "hbnamespace_p.h" -#include "hbmeshlayout_p.h" +#include "hbanchorlayout.h" +#include #include #include @@ -108,6 +107,9 @@ #include "hbrepeatitem_p.h" #include +#include + +Q_DECLARE_METATYPE(QGraphicsLayout*) //Uncomment next define(s) in order to get more debug prints. //Similar define exists also in the engine side. @@ -132,13 +134,16 @@ call the updatePrimitive method. Generally primitives should be updated only when a state change occurs. When a widget uses primitives to construct - itself it does not need a paint() method at all since primitives (widget's childs) are doing the drawing. + itself it does not need a paint() method at all since primitives (widget's children) are doing the drawing. Painting for the primitives occurs from the graphics scene. + HbStyle has some caching functionality and thus it should not be instantiated explicitly, but + accessed only through HbWidget::style() or HbInstance::style() APIs. + */ /*! - + \deprecated P_PushButton_icon is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -146,7 +151,7 @@ \deprecated P_PushButton_text is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_PushButton_additionaltext is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -346,7 +351,7 @@ \deprecated P_ListViewItem_icon is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_ItemHighlight_background is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -402,11 +407,11 @@ \deprecated P_IndicatorGrou\deprecated P_signalicon is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_IndicatorGrou\deprecated P_batteryicon is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_SignalIndicator_icon is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -458,7 +463,7 @@ \deprecated P_ProgressBar_waittrack is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_ProgressBar_mintext is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -470,7 +475,7 @@ \deprecated P_Softkey_background is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_NavigationButton_background is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -486,7 +491,7 @@ \deprecated P_ItemViewItem_frame is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_SelectionControl_selectionstart is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -534,7 +539,7 @@ \deprecated P_ProgressSliderHandle_background is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). - + \deprecated P_ProgressSliderHandle_icon is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString). @@ -791,16 +796,41 @@ static const QString GLOBAL_PARAMETERS_LOCATION = QLatin1String(":/themes/style/hbdefault/variables/layout/zoom/0/hbglobalparameters.css"); +static const char* LAYOUT_PTR_PROPERTY = "HbStyle_layout_ptr"; +static const char* LAYOUT_NAME_PROPERTY = "HbStyle_layout_name"; + +inline void overrideSpacing( HbAnchorLayout *layout, const QString &name, Hb::Edge edge, qreal val ) +{ + if( name.isNull() ) { + return; + } + QList list = layout->anchors(); + for( int i = 0; i < list.size(); i++ ) { + HbAnchor *anchor = list.at(i); + if( ( anchor->startNodeId() == name ) && ( anchor->startEdge() == edge ) ) { + anchor->setDirection( val < 0 ? HbAnchor::Negative : HbAnchor::Positive ); + anchor->setPreferredLength( qAbs(val) ); + if (anchor->anchorId().isEmpty()) { + // assuming it's a fixed anchor + anchor->setSizePolicy( QSizePolicy::Fixed ); + } else { + // assuming it's a "spacer" and we want to override the minimum length + anchor->setMinimumLength( qAbs(val) ); + } + } + } +} /*! Constructor + +Should not be called explicitly. Use HbWidget::style() or HbInstance::style() instead. */ HbStyle::HbStyle() : d_ptr(new HbStylePrivate) { Q_D( HbStyle ); d->q_ptr = this; - QObject::connect(hbInstance->theme(), SIGNAL(changed()), this, SLOT(_q_onThemeChanged())); } /*! @@ -811,155 +841,12 @@ delete d_ptr; } -/*! - - \deprecated HbStyle::registerPlugin(const QString&) - is deprecated. Style plugins are not supported anymore. - - Registers the style plugin with the Style system. This method can be called by a custom widget - or application in order to register the style plugin that implements the custom graphics primitives. - This method results in loading of the plugin, if the plugin is registered for the first time. - It returns the base ID for the primitives implemented by the style plugin. The custom widget - can use the range of integers from (BaseID) to (BaseID+count-1) to refer to the custom - primitives, where count is the number of primitives supported by the plugin. The style - plugin must return the correct number of primitives when the primitiveCount() method is called. - In case of errors the method returns < 0. Note also that for each registerPlugin there must be - a unregisterPlugin call, the last unregisterPlugin call for a plugin causes the plugin to be unloaded. - - If the style plugin implementation returns valid path with layout defition files (CSS+WidgetML) - from layoutPath() method the layout definitions CSSs gets read when calling registerPlugin(). - - \param pluginName, name of the Plugin library to be dynamically loaded - \return int the base ID to be used for the primitives implemented by the style plugin - \sa unregisterPlugin() - */ -int HbStyle::registerPlugin(const QString &pluginName) -{ - Q_D( const HbStyle ); - - // check if the plugin is already registered - if (d->registeredPlugins.contains(pluginName)) { - // increase the reference count - d->registeredPlugins.value(pluginName)->refCount++; - // return the base ID of the primitives enumeration - return d->registeredPlugins.value(pluginName)->primitiveBaseId; - } - - // load the plugin - HbPluginLoader* loader = new HbPluginLoader(pluginName); - if (!loader) - return -1; - - // get the instance pointer - QObject* pluginInstance = loader->instance(); - if (!pluginInstance) { - - // try the additional paths - QFileInfo fileInfo(pluginName); - foreach (QString additionalPath, hbInstance->libraryPaths()) { - const QDir pluginDir(additionalPath); - loader->setPluginName(pluginDir.absoluteFilePath(fileInfo.fileName())); - pluginInstance = loader->instance(); - if (pluginInstance) { - break; - } - } - - if (!pluginInstance) { - delete loader; - return -1; - } - } - - HbStyleInterface *stylePlugin = qobject_cast(pluginInstance); - - int primitiveCount = stylePlugin->primitiveCount(); - if (primitiveCount <= 0) { - delete pluginInstance; - delete loader; - return -1; - } - - HbStyleInterfaceInfo* info = new HbStyleInterfaceInfo(); - info->loader = loader; - info->primitiveBaseId = d->nextAvailableId; - - // make entries for the primitives in the hash table - for (int i=d->nextAvailableId; i<(d->nextAvailableId+primitiveCount); i++) - { - d->customPrimitives.insert(i, info); - } - - // make entry for the plugin in the registered plugins hash table - HbStylePluginInfo* pluginInfo = new HbStylePluginInfo(); - pluginInfo->primitiveBaseId = d->nextAvailableId; - pluginInfo->primitiveCount = primitiveCount; - pluginInfo->refCount = 1; - - d->registeredPlugins.insert(pluginName, pluginInfo); - d->nextAvailableId += primitiveCount; - - // register associated style files - HbWidgetStyleLoader::instance()->addFilePath( - stylePlugin->layoutPath(), - HbLayeredStyleLoader::Concern_Layouts, - HbLayeredStyleLoader::Priority_Core); - d->pluginStylePaths.insert(pluginName, stylePlugin->layoutPath()); - - return pluginInfo->primitiveBaseId; -} - /*! - \deprecated HbStyle::unregisterPlugin(const QString&) - is deprecated. Style plugins are not supported anymore. - - Un-registers the style plugin. - If the reference count becomes zero, the plugin is unloaded and the primitive IDs are de-registered - If a client has called registerPlugin() it must unregister the style plugin with this method. - - \param pluginName, name of the Plugin library - */ -void HbStyle::unregisterPlugin(const QString &pluginName) -{ - Q_D( const HbStyle ); - if (d->registeredPlugins.contains(pluginName)) { - HbStylePluginInfo *info = d->registeredPlugins.value(pluginName); - info->refCount--; - // unload plugin and remove from list - if (info->refCount == 0) { - HbStyleInterfaceInfo* styleInfo = d->customPrimitives.value(info->primitiveBaseId); - delete styleInfo->loader->instance(); - delete styleInfo->loader; - delete styleInfo; - for (int i=info->primitiveBaseId; i< (info->primitiveBaseId+info->primitiveCount); i++) { - d->customPrimitives.remove(i); - } - d->registeredPlugins.remove(pluginName); - - // unregister associated style files - HbWidgetStyleLoader::instance()->removeFilePath( - d->pluginStylePaths.value(pluginName), - HbLayeredStyleLoader::Concern_Layouts, - HbLayeredStyleLoader::Priority_Core); - d->pluginStylePaths.remove(pluginName); - - if( d->registeredPlugins.count() == 0 ){ - // no plugins loaded, can reset the id counter - d->nextAvailableId = HbStyle::P_CustomBase; - } - - } - } -} - - -/*! - - \deprecated HbStyle::createPrimitive(HbStyle::Primitive, QGraphicsItem*) + \deprecated HbStyle::createPrimitive(HbStyle::Primitive, QGraphicsItem*) is deprecated. This method will be replaced with an altered version which will use new base primitive enumerations. - + Creates instances of primitive graphics items. This method should be used by all widgets that support styling. When changing the style the returned primitives can be replaced with an altered version of the primitives, or with a completely different primitive, to create a custom appearance. This shouldn't cause changes to the widget if the functional design @@ -979,15 +866,6 @@ QGraphicsItem *HbStyle::createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent ) const { - Q_D( const HbStyle ); - - if (d->customPrimitives.contains(primitive)) { - HbStyleInterfaceInfo* info = d->customPrimitives.value(primitive); - QObject* pluginInstance = info->loader->instance(); - HbStyleInterface *stylePlugin = qobject_cast(pluginInstance); - return stylePlugin->createPrimitive((HbStyle::Primitive)(primitive-info->primitiveBaseId), parent); - } - switch (primitive){ case P_MenuItem_submenuindicator: { @@ -1014,7 +892,7 @@ case P_ProgressDialog_icon: { HbIconItem *iconItem = new HbIconItem(HbIcon(),parent); setItemName(iconItem, QLatin1String("icon")); - return iconItem; + return iconItem; } case P_CheckBox_icon: @@ -1023,19 +901,19 @@ case P_GridViewItem_icon: { HbIconItem *item = q_check_ptr(new HbIconItem(HbIcon(),parent)); setItemName(item, QLatin1String("icon")); - return item; + return item; } case P_DataGroup_icon: { HbIconItem *item = new HbIconItem(HbIcon(), parent); setItemName(item, QLatin1String("dataGroup_Icon")); - return item; + return item; } case P_DataItem_icon: { HbIconItem *item = new HbIconItem(HbIcon(), parent); setItemName(item, QLatin1String("dataItem_Icon")); - return item; + return item; } case P_ComboBox_text: { @@ -1096,14 +974,14 @@ ta->setZValue(TOUCHAREA_ZVALUE); return ta; } - case P_ProgressSliderHandle_toucharea: + case P_ProgressSliderHandle_toucharea: { HbTouchArea *ta = new HbTouchArea(parent); ta->setFlag(QGraphicsItem::ItemIsFocusable); setItemName(ta, QLatin1String("toucharea")); ta->setZValue(TOUCHAREA_ZVALUE); if(parent){ - parent->setHandlesChildEvents(true); + parent->setFiltersChildEvents(true); } return ta; } @@ -1117,13 +995,13 @@ case P_PushButton_toucharea: // Generic implementation, can add other cases here case P_CheckBox_toucharea: case P_RatingSlider_toucharea: - case P_SliderElement_touchhandle: + case P_SliderElement_touchhandle: { HbTouchArea *ta = new HbTouchArea(parent); ta->setFlag(QGraphicsItem::ItemIsFocusable); setItemName(ta, QLatin1String("toucharea")); if(parent){ - parent->setHandlesChildEvents(true); + parent->setFiltersChildEvents(true); } return ta; } @@ -1134,7 +1012,7 @@ setItemName(ta, QLatin1String("toucharea")); // NOTE:: This is a temporary fix //if(parent){ - // parent->setHandlesChildEvents(true); + // parent->setHandlesChildEvents(true); //} return ta; } @@ -1143,17 +1021,30 @@ HbTouchArea *ta = new HbTouchArea(parent); ta->setFlag(QGraphicsItem::ItemIsFocusable); setItemName(ta, QLatin1String("combobox_button_toucharea")); - /*if(parent){ - parent->setHandlesChildEvents(true); - }*/ + if(parent){ + parent->setFiltersChildEvents(true); + } return ta; } - case P_TitleBar_toucharea: { + case P_TitleBar_toucharea: + { HbTouchArea *ta = new HbTouchArea(parent); ta->setFlag(QGraphicsItem::ItemIsFocusable); setItemName(ta, QLatin1String("toucharea")); return ta; } + case P_IndicatorButton_toucharea: + case P_TitlePane_toucharea: + case P_NavigationButton_toucharea: + { + HbTouchArea *ta = new HbTouchArea(parent); + ta->setFlag(QGraphicsItem::ItemIsFocusable); + setItemName(ta, QLatin1String("toucharea")); + if (parent){ + parent->setHandlesChildEvents(true); + } + return ta; + } case P_SliderElement_touchdecrease: case P_SliderElement_touchincrease: case P_SliderElement_touchgroove: @@ -1161,7 +1052,7 @@ HbTouchArea *ta = new HbTouchArea(parent); ta->setFlag(QGraphicsItem::ItemIsFocusable); if(parent){ - //parent->setHandlesChildEvents(true); + parent->setFiltersChildEvents(true); } return ta; } @@ -1201,8 +1092,8 @@ ti->setAlignment(Qt::AlignCenter); return ti; } - - case P_Label_richtext: + + case P_Label_richtext: { HbRichTextItem *rti = new HbRichTextItem(parent); setItemName(rti, QLatin1String("text")); @@ -1244,6 +1135,7 @@ { HbFrameItem *n = new HbFrameItem(parent); n->setZValue(-1); + n->frameDrawer().setFillWholeRect(true); setItemName(n, "frame"); return n; } @@ -1273,7 +1165,7 @@ case P_DateTimePicker_separator:{ HbFrameItem *frameItem= new HbFrameItem(parent);//TODO:make it icon once iconitem setGeomoetry works for tumbleview return frameItem; - } + } case P_DataGroup_background : { HbFrameItem *n = new HbFrameItem(parent); @@ -1314,6 +1206,7 @@ case P_ProgressBar_track: { HbProgressTrackItem *n = new HbProgressTrackItem(parent); + n->frameDrawer().setFillWholeRect(true); n->setZValue(-2); return n; } @@ -1350,6 +1243,13 @@ setItemName(n, QLatin1String("handleindication")); return n; } + case P_IndicatorButton_eventindication: + { + HbIconItem *n = new HbIconItem(parent); + n->setFlags(HbIcon::Colorized); + setItemName(n, QLatin1String("eventindication")); + return n; + } case P_IndicatorGroup_icon1: { HbIconItem *n = new HbIconItem(parent); @@ -1433,7 +1333,7 @@ HbFrameItem *n = new HbFrameItem(parent); n->setZValue(-1); return n; - } + } case P_GroupBoxMarquee_text: case P_TitlePane_text: { @@ -1498,7 +1398,7 @@ case P_RatingSlider_track: return new HbRepeatMaskItem(parent); - + case P_RatingSlider_layout: { HbWidgetBase *layout = new HbWidgetBase(parent); setItemName(layout, "frame"); @@ -1552,6 +1452,7 @@ case P_ItemViewItem_background: { HbIconItem *iconItem = q_check_ptr(new HbIconItem(parent)); + iconItem->setZValue(-3.0); setItemName(iconItem, QLatin1String("background")); return iconItem; } @@ -1614,15 +1515,16 @@ return n; } case P_ItemViewItem_focus: { - HbFrameItem *item = q_check_ptr(new HbFrameItem(parent)); - //setItemName(item, QLatin1String("focus-indicator")); - return item; + HbFrameItem *frameItem = q_check_ptr(new HbFrameItem(parent)); + frameItem->setZValue(-1.0); + return frameItem; } - case P_ItemHighlight_background: + case P_ItemHighlight_background: return new HbFrameItem(parent); case P_ItemViewItem_frame: { HbFrameItem *item = q_check_ptr(new HbFrameItem(parent)); + item->setZValue(-4.0); setItemName(item,"frame"); return item; } @@ -1706,11 +1608,11 @@ is deprecated. This method will be made private and finally removed since primitive updating will be done in the widgets. Updates the state and content of widget's child primitives. Update for a styled primitive should happen always when - a state change that affects drawing occurs. Such a situation can be for example pressing of a button (change background image), or - changing a text for a widget having text content. The updatePrimitive() implementation for each primitive element can be considered - as a part of widget's implementation. Note that it's up to the widget to decide what the styleoption contains and what the updatePrimitive() method + a state change that affects drawing occurs. Such a situation can be for example pressing of a button (change background image), or + changing a text for a widget having text content. The updatePrimitive() implementation for each primitive element can be considered + as a part of widget's implementation. Note that it's up to the widget to decide what the styleoption contains and what the updatePrimitive() method uses the styleoption data for. - + \sa HbStyle::createPrimitive \param item Primitive graphicsitem. \param primitive To identify the primitive to create. @@ -1722,29 +1624,23 @@ { Q_D( const HbStyle ); - if (d->customPrimitives.contains(primitive)) { - HbStyleInterfaceInfo* info = d->customPrimitives.value(primitive); - QObject* pluginInstance = info->loader->instance(); - HbStyleInterface *stylePlugin = qobject_cast(pluginInstance); - return stylePlugin->updatePrimitive(item, (HbStyle::Primitive)(primitive-info->primitiveBaseId), option); - } - switch(primitive){ case P_PushButton_icon: { - if (const HbStyleOptionPushButton *opt = + if (const HbStyleOptionPushButton *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = static_cast(item); //iconItem->setIconName(opt->icon.iconName()); - iconItem->setIcon(opt->icon); // with this call iconitem refresh issue is there + iconItem->setIcon(opt->icon); // with this call iconitem refresh issue is there iconItem->setMode(d->iconMode(opt->state)); iconItem->setState(d->iconState(opt->state)); + iconItem->setAlignment(Qt::AlignCenter); } break; } case P_GroupBoxHeading_icon: { - if (const HbStyleOptionGroupBox *opt = + if (const HbStyleOptionGroupBox *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = static_cast(item); if (opt->collapsed) { @@ -1757,7 +1653,7 @@ } case P_DataGroup_icon: { - if (const HbStyleOptionDataGroupHeadingWidget *opt = + if (const HbStyleOptionDataGroupHeadingWidget *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = static_cast(item); if (opt->expanded) { @@ -1799,51 +1695,55 @@ if (const HbStyleOptionComboBox *opt = qstyleoption_cast(option)) { HbTextItem *comboTextItem = static_cast(item); comboTextItem->setText(opt->text); + comboTextItem->setTextWrapping(Hb::TextNoWrap); } - break; + break; case P_PushButton_text: { - if (const HbStyleOptionPushButton *opt = + if (const HbStyleOptionPushButton *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); textItem->setText(opt->text); //default alignment will come from css, //if api flag is set ,then alignment from style is taken. if (opt->hasTextAlignment) { - textItem->setAlignment( opt->textAlignment ); - } + textItem->setAlignment( opt->textAlignment ); + } textItem->setTextWrapping(Hb::TextWordWrap); } } break; case P_ProgressDialog_text: { - if (const HbStyleOptionProgressDialog *opt = + if (const HbStyleOptionProgressDialog *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); - textItem->setText(opt->text); + textItem->setText(opt->text); } break; } case P_PushButton_additionaltext: { - if (const HbStyleOptionPushButton *opt = + if (const HbStyleOptionPushButton *opt = qstyleoption_cast(option)) { HbTextItem *additionalTextItem = static_cast(item); additionalTextItem->setText(opt->additionalText); //default alignment will come from css, //if api flag is set ,then alignment from style is taken. if (opt->hasAdditionalTextAlignment) { - additionalTextItem->setAlignment( opt->additionalTextAlignment ); - } + additionalTextItem->setAlignment( opt->additionalTextAlignment ); + } additionalTextItem->setTextWrapping(Hb::TextWordWrap); - } + } } break; case P_PushButton_toucharea: // Generic implementation, can add other cases here case P_ComboBoxButton_toucharea: case P_CheckBox_toucharea: case P_TitleBar_toucharea: + case P_IndicatorButton_toucharea: + case P_TitlePane_toucharea: + case P_NavigationButton_toucharea: case P_SliderElement_touchdecrease: case P_SliderElement_touchincrease: case P_SliderElement_touchgroove: @@ -1856,16 +1756,17 @@ break; case P_DataGroup_heading: { - if (const HbStyleOptionDataGroupHeadingWidget *opt = + if (const HbStyleOptionDataGroupHeadingWidget *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); textItem->setText(opt->heading); + textItem->setTextWrapping(Hb::TextNoWrap); } break; } case P_DataGroup_description: { - if (const HbStyleOptionDataGroupHeadingWidget *opt = + if (const HbStyleOptionDataGroupHeadingWidget *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); textItem->setText(opt->description); @@ -1874,7 +1775,7 @@ } case P_DataForm_heading: { - if (const HbStyleOptionDataForm *opt = + if (const HbStyleOptionDataForm *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); textItem->setText(opt->heading); @@ -1883,7 +1784,7 @@ } case P_DataForm_description: { - if (const HbStyleOptionDataForm *opt = + if (const HbStyleOptionDataForm *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); HbFontSpec spec(HbFontSpec::Secondary); @@ -1911,24 +1812,38 @@ textItem->setText(opt->text); } break; - case P_ProgressBar_text: { - if (const HbStyleOptionProgressBar *opt = qstyleoption_cast(option)) { - HbTextItem *textItem = static_cast(item); - textItem->setAlignment(Qt::AlignCenter); - textItem->setZValue(100); - textItem->setText(opt->text); - } - break; - } + case P_ProgressBar_text: { + if (const HbStyleOptionProgressBar *opt = qstyleoption_cast(option)) { + HbTextItem *textItem = static_cast(item); + textItem->setAlignment(Qt::AlignCenter); + textItem->setZValue(100); + textItem->setText(opt->text); + } + break; + } case P_DataGroup_background: { - if (const HbStyleOptionDataGroupHeadingWidget *opt = + if (const HbStyleOptionDataGroupHeadingWidget *opt = qstyleoption_cast(option)) { HbFrameItem *frameItem = static_cast( item ); if(!frameItem){ return; } + QString frameGraphicsName; + QIcon::Mode mode = QIcon::Disabled; + if (opt->state & QStyle::State_Enabled) { + mode = QIcon::Normal; + } + if (opt->state & QStyle::State_Active) { + mode = QIcon::Active; + } + if (opt->state & QStyle::State_Selected) { + mode = QIcon::Selected; + } frameItem->setZValue(-1.0); - if(opt->pressed) { + if(mode == QIcon::Disabled) { + frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_disabled")); + } + else if(opt->pressed ) { frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_pressed")); } else { frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_parent_normal")); @@ -1939,19 +1854,37 @@ break; } case P_DataGroupComboBackground: { - HbFrameItem *frameItem = static_cast( item ); - if(!frameItem){ - return; + if (const HbStyleOptionDataGroup *opt = qstyleoption_cast(option)) { + QString frameGraphicsName; + QIcon::Mode mode = QIcon::Disabled; + HbFrameItem *frameItem = static_cast( item ); + if(!frameItem){ + return; + } + if (opt->state & QStyle::State_Enabled) { + mode = QIcon::Normal; + } + if (opt->state & QStyle::State_Active) { + mode = QIcon::Active; + } + if (opt->state & QStyle::State_Selected) { + mode = QIcon::Selected; + } + if (mode == QIcon::Disabled ) { + frameGraphicsName = QLatin1String("qtg_fr_list_disabled"); + } else { + frameGraphicsName = QLatin1String("qtg_fr_list_parent_normal"); + } + frameItem->frameDrawer().setFrameGraphicsName(frameGraphicsName); + frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); } - frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_parent_normal")); - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); break; } case P_GroupBoxHeading_background: { if (const HbStyleOptionGroupBox *opt = qstyleoption_cast(option)) { HbFrameItem *frameItem = static_cast( item ); - + if(!frameItem){ return; } @@ -1967,7 +1900,7 @@ frameGraphicsName = QLatin1String("qtg_fr_list_highlight"); } } - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); frameItem->frameDrawer().setFrameGraphicsName(frameGraphicsName); } break; @@ -1976,7 +1909,7 @@ case P_GroupBoxContent_background: { if (const HbStyleOption *opt = qstyleoption_cast(option)) { HbFrameItem *frameItem = static_cast( item ); - + if(!frameItem){ return; } @@ -1989,26 +1922,44 @@ } else { frameGraphicsName = QLatin1String("qtg_fr_groupbox_highlight"); } - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); + frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); frameItem->frameDrawer().setFrameGraphicsName(frameGraphicsName); } break; } - + case P_DataItem_background: { - HbFrameItem *frameItem = static_cast( item ); - if(!frameItem){ - return; + if (const HbStyleOptionDataFormViewItem *opt = qstyleoption_cast(option)) { + QString frameGraphicsName; + HbFrameItem *frameItem = static_cast( item ); + if(!frameItem){ + return; + } + QIcon::Mode mode = QIcon::Disabled; + if (opt->state & QStyle::State_Enabled) { + mode = QIcon::Normal; + } + if (opt->state & QStyle::State_Active) { + mode = QIcon::Active; + } + if (opt->state & QStyle::State_Selected) { + mode = QIcon::Selected; + } + if (mode == QIcon::Disabled ) { + frameGraphicsName = QLatin1String("qtg_fr_list_disabled"); + } else { + frameGraphicsName = QLatin1String("qtg_fr_list_parent_normal"); + } + frameItem->frameDrawer().setFrameGraphicsName(frameGraphicsName); + frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); } - - frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_normal")); - frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); break; } case P_DataItem_label: { if (const HbStyleOptionDataFormViewItem *opt = qstyleoption_cast(option)) { HbTextItem *textitem = static_cast( item ); textitem->setText(opt->label); + textitem->setTextWrapping(Hb::TextNoWrap); } break; } @@ -2020,7 +1971,7 @@ break; } case P_PushButton_background: { - if (const HbStyleOptionPushButton *opt = + if (const HbStyleOptionPushButton *opt = qstyleoption_cast(option)) { HbFrameItem *frameItem = static_cast( item ); QString frameGraphicsName; @@ -2111,19 +2062,19 @@ break; } case P_StatusBar_timetext: { - if (const HbStyleOptionStatusBar *opt = + if (const HbStyleOptionStatusBar *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); textItem->setText(opt->timeText); } break; } - - case P_IndicatorGroup_icon1: - case P_IndicatorGroup_icon2: - case P_IndicatorGroup_icon3: - case P_IndicatorGroup_icon4: - { + + case P_IndicatorGroup_icon1: + case P_IndicatorGroup_icon2: + case P_IndicatorGroup_icon3: + case P_IndicatorGroup_icon4: + { const HbStyleOptionIndicatorGroup *opt = qstyleoption_cast(option); if (opt) { HbIconItem *iconItem = qgraphicsitem_cast(item); @@ -2132,7 +2083,7 @@ break; } - case P_IndicatorButton_handleindication: { + case P_IndicatorButton_handleindication: { const HbStyleOptionIndicatorButton *opt = qstyleoption_cast(option); if (opt) { HbIconItem *iconItem = static_cast(item); @@ -2141,6 +2092,20 @@ break; } + case P_IndicatorButton_eventindication: { + const HbStyleOptionIndicatorButton *opt = qstyleoption_cast(option); + if (opt) { + HbIconItem *iconItem = static_cast(item); + if (opt->twoIcons) { + iconItem->setIconName("qtg_mono_new_event"); + iconItem->setVisible(true); + } else { + iconItem->setVisible(false); + } + } + break; + } + case P_SignalIndicator_icon: { const HbStyleOptionSignalIndicator *opt = qstyleoption_cast(option); if (opt) { @@ -2309,7 +2274,6 @@ HbMarqueeItem *marqueeItem = static_cast( item ); if (marqueeItem) { marqueeItem->setText(opt->caption); - marqueeItem->startAnimation(); } } break; @@ -2351,7 +2315,7 @@ break; } case P_PushButton_focus: { - if (const HbStyleOptionPushButton *opt = + if (const HbStyleOptionPushButton *opt = qstyleoption_cast(option)) { HbFrameItem *iconItem = static_cast(item); iconItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_btn_highlight")); @@ -2435,9 +2399,9 @@ switch (opt->toolBarPosition) { case HbStyleOptionToolButton::TB_OnlyOne: if (opt->orientation == Qt::Vertical) { - list << QLatin1String("_l") << QLatin1String("_c") << QLatin1String("_r"); + list << QLatin1String("_l") << QLatin1String("_c") << QLatin1String("_r"); } else { - list << QLatin1String("_t") << QLatin1String("_c") << QLatin1String("_b"); + list << QLatin1String("_t") << QLatin1String("_c") << QLatin1String("_b"); } break; case HbStyleOptionToolButton::TB_Beginning: @@ -2463,7 +2427,7 @@ break; default: - break; + break; } frameItem->frameDrawer().setFileNameSuffixList(list); if (mode == QIcon::Disabled && state == QIcon::Off) { @@ -2481,6 +2445,7 @@ } frameItem->frameDrawer().setFrameGraphicsName(QString ("%0%1").arg(frameGraphicsHeader).arg(frameGraphicsFooter)); + frameItem->frameDrawer().setMirroringMode(HbIcon::LayoutDirection); break; } @@ -2488,7 +2453,7 @@ case P_SliderTickMark_majoricon: { - if (const HbStyleOptionSlider *opt = + if (const HbStyleOptionSlider *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = qgraphicsitem_cast(item); iconItem->setMode(d->iconMode(opt->state)); @@ -2500,11 +2465,11 @@ iconItem->setState(d->iconState(opt->state)); } break; - + } case P_SliderTickMark_minoricon: { - if (const HbStyleOptionSlider *opt = + if (const HbStyleOptionSlider *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = qgraphicsitem_cast(item); iconItem->setMode(d->iconMode(opt->state)); @@ -2516,30 +2481,30 @@ iconItem->setState(d->iconState(opt->state)); } break; - - } + + } case P_SliderTickMark_majorlabel: { - if (const HbStyleOptionSlider *opt = + if (const HbStyleOptionSlider *opt = qstyleoption_cast(option)) { HbTextItem *textItem = qgraphicsitem_cast(item); - + textItem->setText( opt->text ); } break; - + } case P_SliderTickMark_minorlabel: { - if (const HbStyleOptionSlider *opt = + if (const HbStyleOptionSlider *opt = qstyleoption_cast(option)) { HbTextItem *textItem = qgraphicsitem_cast(item); textItem->setText( opt->text ); } break; - - } + + } case P_Slider_progressgroove: { if (const HbStyleOptionSlider *opt = qstyleoption_cast(option)) { @@ -2556,7 +2521,7 @@ frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical); frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_slider_v_filled")); frameItem->setInverted(!opt->upsideDown); - frameItem->frameDrawer().setMirroringMode(HbIcon::Prevented); + frameItem->frameDrawer().setMirroringMode(HbIcon::Prevented); } frameItem->frameDrawer().setFillWholeRect(true); frameItem->setMaximum(opt->maximum); @@ -2577,18 +2542,27 @@ if (opt->orientation == Qt::Horizontal) { type = HbFrameDrawer::ThreePiecesHorizontal; - if(!opt->groovePressed){ - name = QLatin1String("qtg_fr_slider_h_frame_normal"); - } - else { - name = QLatin1String("qtg_fr_slider_h_frame_pressed"); + if (opt->state & QStyle::State_Enabled) { + if(!opt->groovePressed){ + name = QLatin1String("qtg_fr_slider_h_frame_normal"); + } + else { + name = QLatin1String("qtg_fr_slider_h_frame_pressed"); + } + } else { + name = QLatin1String("qtg_fr_slider_h_frame_disabled"); } } else if (opt->orientation == Qt::Vertical) { - if(!opt->groovePressed){ - name = QLatin1String("qtg_fr_slider_v_frame_normal"); - } - else { - name = QLatin1String("qtg_fr_slider_v_frame_pressed"); + if (opt->state & QStyle::State_Enabled) { + if(!opt->groovePressed){ + name = QLatin1String("qtg_fr_slider_v_frame_normal"); + } + else { + name = QLatin1String("qtg_fr_slider_v_frame_pressed"); + } + } else { + name = QLatin1String("qtg_fr_slider_v_frame_disabled"); + } type = HbFrameDrawer::ThreePiecesVertical; } @@ -2612,6 +2586,7 @@ else { thumbPath=opt->thumbPath; + iconItem->setAlignment(Qt::AlignCenter); } iconItem->setIconName(thumbPath); iconItem->setAspectRatioMode(Qt::KeepAspectRatio); @@ -2667,7 +2642,7 @@ } else { iconItem->setIconName(QLatin1String("qtg_mono_speaker")); } - } + } } break; } @@ -2693,15 +2668,28 @@ case P_CheckBox_icon: { if (const HbStyleOptionCheckBox *opt = qstyleoption_cast(option)){ HbIconItem *iconItem = static_cast(item); - if (opt->state.testFlag(QStyle::State_On)) { - iconItem->setState(QIcon::On); - iconItem->setIconName(QLatin1String("qtg_small_selected")); - } else if (opt->state.testFlag(QStyle::State_Off)) { - iconItem->setState(QIcon::Off); - iconItem->setIconName(QLatin1String("qtg_small_unselected")); - } else if (opt->state.testFlag(QStyle::State_NoChange)) { - iconItem->setState(QIcon::On); - iconItem->setIconName(QLatin1String("qtg_small_selected_partial")); + if (opt->state.testFlag(QStyle::State_Selected) ) { + if (opt->state.testFlag(QStyle::State_On)) { + iconItem->setState(QIcon::On); + iconItem->setIconName(QLatin1String("qtg_small_selected_highlight")); + } else if (opt->state.testFlag(QStyle::State_Off)) { + iconItem->setState(QIcon::Off); + iconItem->setIconName(QLatin1String("qtg_small_unselected_highlight")); + } else if (opt->state.testFlag(QStyle::State_NoChange)) { + iconItem->setState(QIcon::On); + iconItem->setIconName(QLatin1String("qtg_small_selected_partial")); + } + } else { + if (opt->state.testFlag(QStyle::State_On)) { + iconItem->setState(QIcon::On); + iconItem->setIconName(QLatin1String("qtg_small_selected")); + } else if (opt->state.testFlag(QStyle::State_Off)) { + iconItem->setState(QIcon::Off); + iconItem->setIconName(QLatin1String("qtg_small_unselected")); + } else if (opt->state.testFlag(QStyle::State_NoChange)) { + iconItem->setState(QIcon::On); + iconItem->setIconName(QLatin1String("qtg_small_selected_partial")); + } } } break; @@ -2795,7 +2783,7 @@ } else { frameGraphicsName = QLatin1String("qtg_fr_combobox_normal"); } - } else { + } else { frameGraphicsName = QLatin1String("qtg_fr_combobox_disabled"); } frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); @@ -2816,7 +2804,7 @@ } else { iconGraphicsName = QLatin1String("qtg_graf_combobox_button_normal"); } - } else { + } else { iconGraphicsName = QLatin1String("qtg_graf_combobox_button_disabled"); } iconItem->setIconName(iconGraphicsName); @@ -2861,7 +2849,7 @@ case P_Label_richtext: if (const HbStyleOptionLabel *opt = qstyleoption_cast(option)) { HbRichTextItem *textItem = static_cast(item); - textItem->setAlignment(opt->alignment); + textItem->setAlignment(opt->alignment); textItem->setTextWrapping(opt->textWrapMode); if(!opt->fontSpec.isNull()) { textItem->setFontSpec(opt->fontSpec); @@ -2885,7 +2873,7 @@ if (const HbStyleOptionMenuItem *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = static_cast(item); if (opt->checked) { - iconItem->setIconName(QLatin1String("qtg_small_selected")); + iconItem->setIconName(QLatin1String("qtg_small_tick")); } else { iconItem->setIcon(HbIcon()); } @@ -3048,7 +3036,7 @@ HbTextItem *textItem = static_cast(item); textItem->setAlignment(opt->textAlignment); textItem->setFontSpec(HbFontSpec(HbFontSpec::Secondary)); - textItem->setTextWrapping(opt->wrappingText); + textItem->setTextWrapping(opt->textTextWrapping); textItem->setText(opt->text); } break; @@ -3056,10 +3044,14 @@ if (const HbStyleOptionNotificationDialog *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); - textItem->setAlignment(opt->titleAlignment); textItem->setFontSpec(HbFontSpec(HbFontSpec::Primary)); - textItem->setTextWrapping(opt->wrappingTitle); + textItem->setTextWrapping(opt->titleTextWrapping); + if (opt->titleTextWrapping == Hb::TextNoWrap) { + textItem->setElideMode(Qt::ElideNone); + } else { + textItem->setElideMode(Qt::ElideRight); + } textItem->setText(opt->title); } break; @@ -3111,7 +3103,7 @@ default: break; } - } else { + } else { icon->setIcon(opt->icon); } } @@ -3119,7 +3111,7 @@ case P_ListViewItem_text: if (const HbStyleOptionListViewItem *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); - + if (opt->index == 1) { if (opt->multilineSecondaryTextSupported) { if (opt->minimumLines != -1) { @@ -3163,9 +3155,11 @@ case P_ListViewItem_icon: if (const HbStyleOptionListViewItem *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = static_cast(item); - + setItemName(iconItem, QLatin1String("icon-") + QString::number(opt->index + 1)); - iconItem->setZValue(opt->index + 1); + if (iconItem->zValue() != opt->index + 1) { + iconItem->setZValue(opt->index + 1); + } if (opt->content.canConvert()){ iconItem->setIcon(opt->content.value()); @@ -3259,7 +3253,7 @@ frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical); frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_v_frame")); } - frameItem->frameDrawer().setFillWholeRect(true); + // frameItem->frameDrawer().setFillWholeRect(true); } break; case P_ProgressBar_track: @@ -3269,15 +3263,16 @@ if(!frameItem->isVisible()) { break; } - frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); + if(opt->orientation == Qt::Horizontal){ - frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_h_filled")); + frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); + frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_h_filled")); } else{ frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical); frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_v_filled")); } - frameItem->frameDrawer().setFillWholeRect(true); + frameItem->setMaximum(opt->maximum); frameItem->setMinimum(opt->minimum); frameItem->setValue(opt->progressValue); @@ -3288,7 +3283,7 @@ } break; case P_ProgressBar_waittrack: - if (const HbStyleOptionProgressBar *opt = qstyleoption_cast(option)) { + if (const HbStyleOptionProgressBar *opt = qstyleoption_cast(option)) { HbRepeatIconItem *iconItem = static_cast(item); iconItem->setOrientation(opt->orientation); if( !iconItem->isVisible() ) { @@ -3305,12 +3300,12 @@ } } break; - + case P_ProgressSlider_frame: if (const HbStyleOptionProgressSlider *opt = qstyleoption_cast(option)) { HbFrameItem *frameItem = static_cast(item); frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); - if (opt->disableState ) { + if (opt->disableState ) { frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_frame_disabled")); } else { @@ -3321,15 +3316,21 @@ frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_frame_normal")); } } - frameItem->frameDrawer().setFillWholeRect(true); - frameItem->update(); + frameItem->frameDrawer().setFillWholeRect(true); + //frameItem->update(); } break; case P_ProgressSlider_track: // The ProgressValue Mask if (const HbStyleOptionProgressSlider *opt = qstyleoption_cast(option)) { HbProgressTrackItem* frameItem = static_cast(item); frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); - frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_loaded")); + + if (opt->disableState ) { + frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_loaded_disabled")); + } + else { + frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_loaded")); + } frameItem->frameDrawer().setFillWholeRect(true); frameItem->setMaximum(opt->maximum); frameItem->setMinimum(opt->minimum); @@ -3337,14 +3338,19 @@ frameItem->setInverted(opt->inverted); frameItem->setOrientation(opt->orientation); frameItem->update(); - } + } break; case P_ProgressSlider_slidertrack: // The Slider Position Mask if (const HbStyleOptionProgressSlider *opt = qstyleoption_cast(option)) { HbProgressTrackItem* frameItem = static_cast(item); frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); - frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_played")); + if (opt->disableState ) { + frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_played_disabled")); + } + else { + frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_played")); + } frameItem->frameDrawer().setFillWholeRect(true); frameItem->setMaximum(opt->maximum); frameItem->setMinimum(opt->minimum); @@ -3352,43 +3358,56 @@ frameItem->setInverted(opt->inverted); frameItem->setOrientation(opt->orientation); frameItem->update(); - } + } break; case P_ProgressBar_mintext: { - if (const HbStyleOptionProgressBar *opt = + if (const HbStyleOptionProgressBar *opt = + qstyleoption_cast(option)) { + HbTextItem *textItem = static_cast(item); + if(!item) { + return; + } + textItem->setTextWrapping(Hb::TextWrapAnywhere); + textItem->setText(opt->minText); + } + break; + } + + case P_ProgressBar_maxtext: { + if (const HbStyleOptionProgressBar *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); if(!item) { return; } textItem->setTextWrapping(Hb::TextWrapAnywhere); - textItem->setText(opt->minText); - } - break; - } - - case P_ProgressBar_maxtext: { - if (const HbStyleOptionProgressBar *opt = - qstyleoption_cast(option)) { - HbTextItem *textItem = static_cast(item); - if(!item) { - return; - } - textItem->setTextWrapping(Hb::TextWrapAnywhere); - textItem->setText(opt->maxText); + textItem->setText(opt->maxText); } break; } case P_RatingSlider_frame:{ - if (const HbStyleOptionRatingSlider *opt = qstyleoption_cast(option)) { + if (const HbStyleOptionRatingSlider *opt = qstyleoption_cast(option)) { HbRepeatItem *repeatItem = static_cast(item); repeatItem->setRepeatingNumber(opt->noOfStars); - if(opt->unRatedGraphicsName != QString()){ + if (!opt->unRatedGraphicsName.isEmpty()) { repeatItem->setName(opt->unRatedGraphicsName); } else { - repeatItem->setName(QLatin1String("qtg_graf_ratingslider_unrated")); + if(opt->disableState) { + repeatItem->setName(QLatin1String("qtg_graf_ratingslider_unrated_disabled")); + + } + else { + if(opt->pressedState) { + + repeatItem->setName(QLatin1String("qtg_graf_ratingslider_unrated_pressed")); + } + else { + + repeatItem->setName(QLatin1String("qtg_graf_ratingslider_unrated")); + } + } } repeatItem->setGeometry(opt->boundingRect); repeatItem->update(); @@ -3397,17 +3416,31 @@ } case P_RatingSlider_track:{ - if (const HbStyleOptionRatingSlider *opt = qstyleoption_cast(option)) { + if (const HbStyleOptionRatingSlider *opt = qstyleoption_cast(option)) { HbRepeatMaskItem *repeatItem = static_cast(item); repeatItem->setMaskValue(opt->progressValue); repeatItem->setMaximum(opt->noOfIntervals); repeatItem->setInverted(opt->inverted); repeatItem->setRepeatingNumber(opt->noOfStars); - if(opt->ratedGraphicsName != QString()){ + if (!opt->ratedGraphicsName.isEmpty()) { repeatItem->setName(opt->ratedGraphicsName); } else { - repeatItem->setName(QLatin1String("qtg_graf_ratingslider_rated")); + if(opt->disableState) { + repeatItem->setName(QLatin1String("qtg_graf_ratingslider_rated_disabled")); + + + } + else { + + if(opt->pressedState) { + + repeatItem->setName(QLatin1String("qtg_graf_ratingslider_rated_pressed")); + } + else { + repeatItem->setName(QLatin1String("qtg_graf_ratingslider_rated")); + } + } } repeatItem->setGeometry(opt->boundingRect); repeatItem->update(); @@ -3443,7 +3476,6 @@ case P_ItemViewItem_background: if (const HbStyleOptionAbstractViewItem *opt = qstyleoption_cast(option)) { HbIconItem *iconItem = static_cast(item); - iconItem->setZValue(-3.0); iconItem->setGeometry(opt->boundingRect); if (opt->background.canConvert()){ iconItem->setIcon(opt->background.value()); @@ -3453,10 +3485,9 @@ } break; - case P_ItemViewItem_frame: + case P_ItemViewItem_frame: if (const HbStyleOptionAbstractViewItem *opt = qstyleoption_cast(option)) { HbFrameItem *frameItem = static_cast(item); - frameItem->setZValue(-4.0); frameItem->setGeometry(opt->boundingRect); if (opt->background.canConvert()) { @@ -3466,14 +3497,14 @@ } else if (opt->viewItemType == Hb::ItemType_TreeViewItem) { if (opt->modelItemType == Hb::ParentItem) { frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? + frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? QLatin1String("qtg_fr_popup_list_parent_normal") : QLatin1String("qtg_fr_list_parent_normal")); } else if (opt->modelItemType == Hb::SeparatorItem) { frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_separator")); } else { frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? + frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? QLatin1String("qtg_fr_popup_list_normal") : QLatin1String("qtg_fr_list_normal")); } } else if ( opt->viewItemType == Hb::ItemType_ListViewItem @@ -3483,13 +3514,13 @@ frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_separator")); } else { frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? + frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? QLatin1String("qtg_fr_popup_list_normal") : QLatin1String("qtg_fr_list_normal")); } } else if (opt->viewItemType == Hb::ItemType_GridViewItem || opt->viewItemType == HbPrivate::ItemType_ColorGridViewItem) { frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); - frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? + frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? QLatin1String("qtg_fr_popup_grid_normal") : QLatin1String("qtg_fr_grid_normal")); } else{ @@ -3500,7 +3531,6 @@ case P_ItemViewItem_focus: if (const HbStyleOptionAbstractViewItem *opt = qstyleoption_cast(option)) { HbFrameItem *frameItem = static_cast(item); - frameItem->setZValue(-1.0); frameItem->setGeometry(opt->boundingRect); if (opt->viewItemType == Hb::ItemType_TreeViewItem @@ -3570,7 +3600,24 @@ case P_TumbleView_background: if (const HbStyleOption *opt = qstyleoption_cast(option)) { if(HbFrameItem *frameItem = qgraphicsitem_cast(item)) { - frameItem->frameDrawer().setFrameGraphicsName("qtg_fr_tumbler_bg"); + + //Temporary source to avoid introducing new style primitive for selection dialog mark widget background item. + QGraphicsItem *parent = frameItem->parentItem(); + const QMetaObject *obj = parent->toGraphicsObject()->metaObject(); + + QString className; + if(obj){ + className = obj->className(); + } + /////////////////////////////////////////////////////////// + + if( !className.compare("HbTumbleView") ){ + frameItem->frameDrawer().setFrameGraphicsName("qtg_fr_tumbler_bg"); + } + else if( !className.compare("HbSelectionDialogMarkWidget") ) + { + frameItem->frameDrawer().setFrameGraphicsName("qtg_fr_groupbox"); + } frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); frameItem->setZValue(-5); //TODO:temp fix, issue with css rule picking in derived class @@ -3579,7 +3626,7 @@ } } break; - case P_TumbleView_frame: + case P_TumbleView_frame: if (const HbStyleOption *opt = qstyleoption_cast(option)) { if(HbFrameItem *frameItem = qgraphicsitem_cast(item)) { frameItem->frameDrawer().setFrameGraphicsName("qtg_fr_tumbler_overlay"); @@ -3599,11 +3646,11 @@ frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal); frameItem->setZValue(3); //TODO:temp fix, issue with css rule picking in derived class - + //frameItem->setGeometry(0,(opt->boundingRect.height()-frameItem->boundingRect().height())/2,opt->boundingRect.width(),opt->boundingRect.height()); Q_UNUSED(opt); } - + } break; @@ -3634,7 +3681,7 @@ } } break; - case P_DateTimePicker_frame: + case P_DateTimePicker_frame: if (const HbStyleOption *opt = qstyleoption_cast(option)) { if(HbFrameItem *frameItem = qgraphicsitem_cast(item)) { frameItem->frameDrawer().setFrameGraphicsName("qtg_fr_tumbler_overlay"); @@ -3661,27 +3708,28 @@ } break; case P_InputDialog_text: - if (const HbStyleOptionInputDialog *opt = + if (const HbStyleOptionInputDialog *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); if(!item) { return; } textItem->setTextWrapping(Hb::TextWrapAnywhere); - textItem->setText(opt->text); + textItem->setText(opt->text); } break; case P_InputDialog_additionaltext: - if (const HbStyleOptionInputDialog *opt = + if (const HbStyleOptionInputDialog *opt = qstyleoption_cast(option)) { HbTextItem *textItem = static_cast(item); if(!item) { return; } textItem->setTextWrapping(Hb::TextWrapAnywhere); - textItem->setText(opt->additionalText); - } + textItem->setText(opt->additionalText); + } break; + default: return; }; @@ -3742,9 +3790,10 @@ */ void HbStylePrivate::polishItem( const HbVector &styleRules, - HbWidget* widget, + HbWidget *widget, QGraphicsItem *item, const QString &name, + HbDeviceProfile &profile, bool layoutDefined) const { if (name.isEmpty() && widget != item) { @@ -3762,38 +3811,26 @@ } #endif - HbDeviceProfile profile(HbDeviceProfile::profile(widget)); - const HbVector decl = declarations(styleRules, name, widget, profile); #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Number of maching CSS declarations: " << decl.count(); + qDebug() << "HbStyle::polishItem : -- Number of matching CSS declarations: " << decl.count(); #endif HbCss::ValueExtractor extractor(decl, layoutParameters, profile); - HbCss::GeometryValues geomValues; - HbCss::PositionValues posValues; - - bool extracted = extractor.extractGeometry(geomValues); -#ifndef HBSTYLE_DEBUG - Q_UNUSED(extracted); -#endif + HbCss::KnownProperties prop; + + if ( !extractor.extractKnownProperties(prop) ) { #ifdef HBSTYLE_DEBUG - if ( !extracted ) { - qDebug() << "HbStyle::polishItem : -- No geometry overrides found"; - } + qDebug() << "HbStyle::polishItem : -- No polish overrides found"; #endif - extracted = extractor.extractPosition(posValues); -#ifdef HBSTYLE_DEBUG - if ( !extracted ) { - qDebug() << "HbStyle::polishItem : -- No position overrides found"; + return; } -#endif if ( item ) { - if (posValues.mFlags & HbCss::ExtractedZValue) { + if (prop.mFlags & HbCss::ExtractedZValue) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting zvalue: " << posValues.mZ; + qDebug() << "HbStyle::polishItem : -- Setting zvalue: " << prop.mZ; #endif - item->setZValue(posValues.mZ); + item->setZValue(prop.mZ); } } @@ -3801,13 +3838,13 @@ ? static_cast(item) : 0; if ( gWidget ) { - if (posValues.mFlags & HbCss::ExtractedLayoutDirection) { + if (prop.mFlags & HbCss::ExtractedLayoutDir) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting layout direction: " << posValues.mLayoutDirection; + qDebug() << "HbStyle::polishItem : -- Setting layout direction: " << prop.mLayoutDir; #endif - if (posValues.mLayoutDirection == HbCss::LayoutDirection_LeftToRight) { + if (prop.mLayoutDir == HbCss::LayoutDirection_LeftToRight) { gWidget->setLayoutDirection(Qt::LeftToRight); - } else if (posValues.mLayoutDirection == HbCss::LayoutDirection_RightToLeft) { + } else if (prop.mLayoutDir == HbCss::LayoutDirection_RightToLeft) { gWidget->setLayoutDirection(Qt::RightToLeft); } else { gWidget->unsetLayoutDirection(); @@ -3818,274 +3855,303 @@ HbWidgetBase *hbWidget = qobject_cast(gWidget); if ( hbWidget ) { HbWidgetBasePrivate* hbWidget_p = HbWidgetBasePrivate::d_ptr(hbWidget); - QFont font; - HbFontSpec fontSpec; - int dummy; - if (extractor.extractFont(&font, &fontSpec, &dummy)) { - if ( !fontSpec.isNull() ) { - if ( font == QFont() ) { + if ( prop.mFlags & HbCss::ExtractedFontSpec ) { + if ( !(prop.mFlags & HbCss::ExtractedFont) ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting fontspec: " << fontSpec.role(); + qDebug() << "HbStyle::polishItem : -- Setting fontspec: " << prop.mFontSpec.role() << prop.mFontSpec.textHeight(); #endif - hbWidget->setFontSpec(fontSpec); - } else { -#ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting fontspec with overrides: " - << fontSpec.role() << font; -#endif - hbWidget->setFont(fontSpec.font().resolve(font)); - } + hbWidget->setFontSpec(prop.mFontSpec); } else { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting explicit font: " << font; + qDebug() << "HbStyle::polishItem : -- Setting fontspec with overrides: " + << prop.mFontSpec.role() << prop.mFontSpec.textHeight() << prop.mFont; #endif - hbWidget->setFont(font); + hbWidget->setFont(prop.mFontSpec.font().resolve(prop.mFont)); } + } else if ( prop.mFlags & HbCss::ExtractedFont ) { +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishItem : -- Setting explicit font: " << prop.mFont; +#endif + hbWidget->setFont(prop.mFont); } HbIconItem* icon = qobject_cast(hbWidget); if (icon) { - Qt::AspectRatioMode mode; - if (extractor.extractAspectRatioMode(&mode) + if (prop.mFlags & HbCss::ExtractedAspectRatioMode && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_IconAspectRatioMode)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting aspect ratio mode: " << mode; + qDebug() << "HbStyle::polishItem : -- Setting aspect ratio mode: " << prop.mAspectRatioMode; #endif - icon->setAspectRatioMode(mode); + icon->setAspectRatioMode(prop.mAspectRatioMode); hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconAspectRatioMode, false); } - if(!hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_IconBrush)){ - QBrush brush; - QString uri; - HbCss::Repeat repeat = HbCss::Repeat_XY; - Qt::Alignment alignment = Qt::AlignTop | Qt::AlignLeft; - HbCss::Attachment attachment = HbCss::Attachment_Scroll; - HbCss::Origin origin = HbCss::Origin_Padding; - HbCss::Origin clip = HbCss::Origin_Border; - if (extractor.extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip)) { + if ( prop.mFlags & HbCss::ExtractedAlignment + && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_IconAlign)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting icon background: " << brush; + qDebug() << "HbStyle::polishItem : -- Setting icon alignment: " << prop.mAlignment; #endif - icon->setBrush( brush ); - } else { -#ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Resetting icon background"; -#endif - icon->setBrush( QBrush() ); - } - hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconBrush, false); + icon->setAlignment( prop.mAlignment ); + hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconAlign, false); } } HbTextItem* text = qobject_cast(hbWidget); if (text) { - HbCss::TextValues textValues; - if ( extractor.extractTextValues( textValues ) ) { - if ( textValues.mFlags & HbCss::ExtractedLineCountMin - && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) { + if ( prop.mFlags & HbCss::ExtractedMinLines + && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting text min lines: " << textValues.mLineCountMin; + qDebug() << "HbStyle::polishItem : -- Setting text min lines: " << prop.mMinLines; #endif - text->setMinimumLines( textValues.mLineCountMin ); - hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false); - } - if ( textValues.mFlags & HbCss::ExtractedLineCountMax - && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax)) { + text->setMinimumLines( prop.mMinLines ); + hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false); + } + if ( prop.mFlags & HbCss::ExtractedMaxLines + && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting text max lines: " << textValues.mLineCountMax; + qDebug() << "HbStyle::polishItem : -- Setting text max lines: " << prop.mMaxLines; #endif - text->setMaximumLines( textValues.mLineCountMax ); - hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false); - } + text->setMaximumLines( prop.mMaxLines ); + hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false); } - if ( posValues.mFlags & HbCss::ExtractedTextAlign + if ( prop.mFlags & HbCss::ExtractedAlignment && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting text alignment: " << posValues.mTextAlignment; + qDebug() << "HbStyle::polishItem : -- Setting text alignment: " << prop.mAlignment; #endif - text->setAlignment( posValues.mTextAlignment ); + text->setAlignment( prop.mAlignment ); hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign, false); } - if ( posValues.mFlags & HbCss::ExtractedWrapMode + if ( prop.mFlags & HbCss::ExtractedWrapMode && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting wrap mode : " << posValues.mTextWrapMode; + qDebug() << "HbStyle::polishItem : -- Setting wrap mode : " << prop.mTextWrapMode; #endif - text->setTextWrapping( posValues.mTextWrapMode ); + text->setTextWrapping( prop.mTextWrapMode ); hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode, false); } } HbRichTextItem* richtext = qobject_cast(hbWidget); if (richtext) { - if ( posValues.mFlags & HbCss::ExtractedTextAlign + if ( prop.mFlags & HbCss::ExtractedAlignment && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting text alignment: " << posValues.mTextAlignment; + qDebug() << "HbStyle::polishItem : -- Setting text alignment: " << prop.mAlignment; #endif - richtext->setAlignment( posValues.mTextAlignment ); + richtext->setAlignment( prop.mAlignment ); hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign, false); } - if ( posValues.mFlags & HbCss::ExtractedWrapMode + if ( prop.mFlags & HbCss::ExtractedWrapMode && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting wrap mode : " << posValues.mTextWrapMode; + qDebug() << "HbStyle::polishItem : -- Setting wrap mode : " << prop.mTextWrapMode; #endif - richtext->setTextWrapping( posValues.mTextWrapMode ); + richtext->setTextWrapping( prop.mTextWrapMode ); hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode, false); } } HbFrameItem *frame = qobject_cast(hbWidget); if (frame && !frame->frameDrawer().d->testBorderApiProtectionFlag()) { - qreal borderWidths[HbCss::NumEdges] = { 0.0,0.0,0.0,0.0 }; - QBrush borderColors[HbCss::NumEdges]; - HbCss::BorderStyle borderStyles[HbCss::NumEdges]; - QSize borderRadii[4]; - - if (extractor.extractBorder(borderWidths,borderColors,borderStyles,borderRadii)) { + if (prop.mFlags & HbCss::ExtractedBorderWidths) { #ifdef HBSTYLE_DEBUG qDebug() << "HbStyle::polishItem : -- Setting border widths (l,t,r,b):" - << borderWidths[HbCss::LeftEdge] - << borderWidths[HbCss::TopEdge] - << borderWidths[HbCss::RightEdge] - << borderWidths[HbCss::BottomEdge]; + << prop.mBorderWidths[HbCss::LeftEdge] + << prop.mBorderWidths[HbCss::TopEdge] + << prop.mBorderWidths[HbCss::RightEdge] + << prop.mBorderWidths[HbCss::BottomEdge]; #endif frame->frameDrawer().setBorderWidths( - borderWidths[HbCss::LeftEdge], - borderWidths[HbCss::TopEdge], - borderWidths[HbCss::RightEdge], - borderWidths[HbCss::BottomEdge]); + prop.mBorderWidths[HbCss::LeftEdge], + prop.mBorderWidths[HbCss::TopEdge], + prop.mBorderWidths[HbCss::RightEdge], + prop.mBorderWidths[HbCss::BottomEdge]); frame->frameDrawer().d->setBorderApiProtectionFlag(false); } } if ( hbWidget->inherits( "HbLineEdit" ) ) { - HbCss::TextValues textValues; - if ( extractor.extractTextValues( textValues ) ) { - if ( textValues.mFlags & HbCss::ExtractedLineCountMin - && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) { + if ( prop.mFlags & HbCss::ExtractedMinLines + && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting text min lines: " << textValues.mLineCountMin; + qDebug() << "HbStyle::polishItem : -- Setting text min lines: " << prop.mMinLines; #endif - hbWidget->setProperty( "minRows", textValues.mLineCountMin ); - hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false); - } - if ( textValues.mFlags & HbCss::ExtractedLineCountMax - && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) { + hbWidget->setProperty( "minRows", prop.mMinLines ); + hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false); + } + if ( prop.mFlags & HbCss::ExtractedMaxLines + && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting text max lines: " << textValues.mLineCountMax; + qDebug() << "HbStyle::polishItem : -- Setting text max lines: " << prop.mMaxLines; #endif - hbWidget->setProperty( "maxRows", textValues.mLineCountMax ); - hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false); - } + hbWidget->setProperty( "maxRows", prop.mMaxLines ); + hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false); } } } - QGraphicsLayoutItem* lItem = (item && item->isWidget()) ? (QGraphicsLayoutItem*)static_cast(item) : 0; - if ( !lItem ) { - lItem = widget->layoutPrimitive(name); - if ( lItem && !lItem->graphicsItem() ) { - // assume it is spacer - static_cast(widget->layout())->setItemId( lItem, name ); - } - } + QGraphicsLayoutItem* lItem = (item && item->isWidget()) + ? (QGraphicsLayoutItem*)static_cast(item) + : 0; if ( lItem ) { - if ( geomValues.mFlags & HbCss::ExtractedMinW ) { + if ( prop.mFlags & HbCss::ExtractedMinW ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting minimum width: " << geomValues.mMinW; + qDebug() << "HbStyle::polishItem : -- Setting minimum width: " << prop.mMinW; #endif - lItem->setMinimumWidth( geomValues.mMinW ); + lItem->setMinimumWidth( prop.mMinW ); } - if ( geomValues.mFlags & HbCss::ExtractedMinH ) { + if ( prop.mFlags & HbCss::ExtractedMinH ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting minimum height: " << geomValues.mMinH; + qDebug() << "HbStyle::polishItem : -- Setting minimum height: " << prop.mMinH; #endif - lItem->setMinimumHeight( geomValues.mMinH ); + lItem->setMinimumHeight( prop.mMinH ); } - if ( geomValues.mFlags & HbCss::ExtractedPrefW ) { + if ( prop.mFlags & HbCss::ExtractedPrefW ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting preferred width: " << geomValues.mPrefW; + qDebug() << "HbStyle::polishItem : -- Setting preferred width: " << prop.mPrefW; #endif - lItem->setPreferredWidth( geomValues.mPrefW ); + lItem->setPreferredWidth( prop.mPrefW ); } - if ( geomValues.mFlags & HbCss::ExtractedPrefH ) { + if ( prop.mFlags & HbCss::ExtractedPrefH ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting preferred height: " << geomValues.mPrefH; + qDebug() << "HbStyle::polishItem : -- Setting preferred height: " << prop.mPrefH; #endif - lItem->setPreferredHeight( geomValues.mPrefH ); + lItem->setPreferredHeight( prop.mPrefH ); } - if ( geomValues.mFlags & HbCss::ExtractedMaxW ) { + if ( prop.mFlags & HbCss::ExtractedMaxW ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting maximum width: " << geomValues.mMaxW; + qDebug() << "HbStyle::polishItem : -- Setting maximum width: " << prop.mMaxW; #endif - lItem->setMaximumWidth( geomValues.mMaxW ); + lItem->setMaximumWidth( prop.mMaxW ); } - if ( geomValues.mFlags & HbCss::ExtractedMaxH ) { + if ( prop.mFlags & HbCss::ExtractedMaxH ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting maximum height: " << geomValues.mMaxH; + qDebug() << "HbStyle::polishItem : -- Setting maximum height: " << prop.mMaxH; #endif - lItem->setMaximumHeight( geomValues.mMaxH ); + lItem->setMaximumHeight( prop.mMaxH ); } QSizePolicy itemPol = lItem->sizePolicy(); - if ( geomValues.mFlags & HbCss::ExtractedPolHor ) { + if ( prop.mFlags & HbCss::ExtractedPolHor ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting horizontal size policy: " << geomValues.mSizePolicy.horizontalPolicy(); + qDebug() << "HbStyle::polishItem : -- Setting horizontal size policy: " << prop.mSizePolicy.horizontalPolicy(); #endif - itemPol.setHorizontalPolicy(geomValues.mSizePolicy.horizontalPolicy()); + itemPol.setHorizontalPolicy(prop.mSizePolicy.horizontalPolicy()); } - if ( geomValues.mFlags & HbCss::ExtractedPolVer ) { + if ( prop.mFlags & HbCss::ExtractedPolVer ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting vertical size policy: " << geomValues.mSizePolicy.verticalPolicy(); + qDebug() << "HbStyle::polishItem : -- Setting vertical size policy: " << prop.mSizePolicy.verticalPolicy(); #endif - itemPol.setVerticalPolicy(geomValues.mSizePolicy.verticalPolicy()); + itemPol.setVerticalPolicy(prop.mSizePolicy.verticalPolicy()); } lItem->setSizePolicy(itemPol); } if (layoutDefined) { - HbMeshLayout *layout = static_cast(widget->layout()); + HbAnchorLayout *layout = static_cast(widget->layout()); if ( layout ) { - if (posValues.mFlags & HbCss::ExtractedLeft) { + if (prop.mFlags & HbCss::ExtractedLeft) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting left override: " << posValues.mLeft; + qDebug() << "HbStyle::polishItem : -- Setting left override: " << prop.mLeft; #endif - layout->overrideSpacing(name, Hb::LeftEdge, posValues.mLeft); + overrideSpacing(layout, name, Hb::LeftEdge, prop.mLeft); } - if (posValues.mFlags & HbCss::ExtractedRight) { + if (prop.mFlags & HbCss::ExtractedRight) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting right override: " << posValues.mRight; + qDebug() << "HbStyle::polishItem : -- Setting right override: " << prop.mRight; #endif - layout->overrideSpacing(name, Hb::RightEdge, posValues.mRight); + overrideSpacing(layout, name, Hb::RightEdge, prop.mRight); } - if (posValues.mFlags & HbCss::ExtractedTop) { + if (prop.mFlags & HbCss::ExtractedTop) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting top override: " << posValues.mTop; + qDebug() << "HbStyle::polishItem : -- Setting top override: " << prop.mTop; #endif - layout->overrideSpacing(name, Hb::TopEdge, posValues.mTop); + overrideSpacing(layout, name, Hb::TopEdge, prop.mTop); } - if (posValues.mFlags & HbCss::ExtractedBottom) { + if (prop.mFlags & HbCss::ExtractedBottom) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting bottom override: " << posValues.mBottom; + qDebug() << "HbStyle::polishItem : -- Setting bottom override: " << prop.mBottom; #endif - layout->overrideSpacing(name, Hb::BottomEdge, posValues.mBottom); + overrideSpacing(layout, name, Hb::BottomEdge, prop.mBottom); } - if (posValues.mFlags & HbCss::ExtractedCenterH) { + if (prop.mFlags & HbCss::ExtractedCenterH) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting centerh override: " << posValues.mCenterH; + qDebug() << "HbStyle::polishItem : -- Setting centerh override: " << prop.mCenterH; #endif - layout->overrideSpacing(name, Hb::CenterHEdge, posValues.mCenterH); + overrideSpacing(layout, name, Hb::CenterHEdge, prop.mCenterH); } - if (posValues.mFlags & HbCss::ExtractedCenterV) { + if (prop.mFlags & HbCss::ExtractedCenterV) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polishItem : -- Setting centerv override: " << posValues.mCenterV; + qDebug() << "HbStyle::polishItem : -- Setting centerv override: " << prop.mCenterV; #endif - layout->overrideSpacing(name, Hb::CenterVEdge, posValues.mCenterV); + overrideSpacing(layout, name, Hb::CenterVEdge, prop.mCenterV); } } } } +void HbStylePrivate::polishAnchor( + const HbVector &styleRules, + HbWidget *widget, + HbAnchor *anchor, + HbDeviceProfile &profile) const +{ +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polish : -- --"; + qDebug() << "HbStyle::polishAnchor : -- anchor id: " << anchor->anchorId(); +#endif + + const HbVector decl = declarations(styleRules, anchor->anchorId(), widget, profile); +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishAnchor : -- Number of matching CSS declarations: " << decl.count(); +#endif + HbCss::ValueExtractor extractor(decl, layoutParameters, profile); + HbCss::KnownProperties prop; + + if ( !extractor.extractKnownProperties(prop) ) { +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishAnchor : -- No polish overrides found"; +#endif + return; + } + + + if ( prop.mFlags & HbCss::ExtractedMinH || prop.mFlags & HbCss::ExtractedMinW ) { + qreal minLength = prop.mFlags & HbCss::ExtractedMinH ? prop.mMinH : prop.mMinW; +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishAnchor : -- Setting minimum length: " << minLength; +#endif + anchor->setMinimumLength( minLength ); + } + if ( prop.mFlags & HbCss::ExtractedPrefH || prop.mFlags & HbCss::ExtractedPrefW ) { + qreal prefLength = prop.mFlags & HbCss::ExtractedPrefH ? prop.mPrefH : prop.mPrefW; +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishAnchor : -- Setting preferred length: " << prefLength; +#endif + anchor->setPreferredLength( prefLength ); + } + if ( prop.mFlags & HbCss::ExtractedMaxH || prop.mFlags & HbCss::ExtractedMaxW ) { + qreal maxLength = prop.mFlags & HbCss::ExtractedMaxH ? prop.mMaxH : prop.mMaxW; +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishAnchor : -- Setting maximum length: " << maxLength; +#endif + anchor->setMaximumLength( maxLength ); + } + if ( prop.mFlags & HbCss::ExtractedPolVer || prop.mFlags & HbCss::ExtractedPolHor ) { + QSizePolicy::Policy policy = prop.mFlags & HbCss::ExtractedPolVer + ? prop.mSizePolicy.verticalPolicy() : prop.mSizePolicy.horizontalPolicy(); +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishAnchor : -- Setting size policy: " << policy; +#endif + anchor->setSizePolicy( policy ); + } + if ( prop.mFlags & HbCss::ExtractedAnchorDir ) { +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::polishAnchor : -- Setting anchor direction: " << prop.mAnchorDir; +#endif + anchor->setDirection( prop.mAnchorDir ); + } +} + + #define NODEPTR_N(x) HbCss::StyleSelector::NodePtr n = {n.ptr = (void *)x}; /*! @@ -4094,14 +4160,14 @@ This method should be called only by HbWidget (base class). The inherited classes should not call this method directly, but use the HbWidget's polish loop instead. - + This method reads the CSS and WidgetML definition for a given widget and positions the sub-elements inside it. Note you need to set the names for the sub-elements with HbStyle::setItemName method before this method is called. Note that this method is heavy on the system resources and should be called absolutely when necessary by the widget. - + \param widget, HbWidget to be polished \param params, style parameters to be returned to the caller */ @@ -4151,7 +4217,7 @@ } const HbVector decl = declarations(styleRules, "", widget, profile); #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polish : Number of maching CSS declarations: " << decl.count(); + qDebug() << "HbStyle::polish : Number of matching CSS declarations: " << decl.count(); #endif d->ensureLayoutParameters(profile); @@ -4161,12 +4227,12 @@ if ( params.count() ) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polish : Extracting parameters."; + qDebug() << "HbStyle::polish : Extracting custom properties."; #endif - extractor.extractParameters( params.params(), params.values() ); + extractor.extractCustomProperties( params.keys(), params.values() ); } - bool layoutDefined = extractor.extractLayout(&layoutName, §ionName); + bool layoutDefined = extractor.extractLayout(layoutName, sectionName); #ifdef HBSTYLE_DEBUG if (!layoutDefined) { qDebug() << "HbStyle::polish : Couldn't find layout name for the widget."; @@ -4175,67 +4241,81 @@ } #endif - QStringList meshIds; - HbMeshLayout *meshLayout(0); + QStringList nodeIds; + HbAnchorLayout *anchorLayout(0); if (layoutDefined) { - QString cachedLayoutName = widgetLayoutNames[widget]; - bool cached = (cachedLayoutName == layoutName ); - if ( !cached ) { + // check that we do not override the user defined layout + const QVariant layoutPtrByStyleV = widget->property( LAYOUT_PTR_PROPERTY ); + const QGraphicsLayout *layoutPtrByStyle = layoutPtrByStyleV.isValid() ? layoutPtrByStyleV.value() : 0; + const QGraphicsLayout *existingLayoutPtr = widget->layout(); + + if ( existingLayoutPtr && (existingLayoutPtr!=layoutPtrByStyle) ) { + // widget has a layout, but it is not created by the style -> we cannot override. #ifdef HBSTYLE_DEBUG - qDebug() << "LayoutName cache miss."; + qDebug() << "HbStyle::polish : layout overridden by user"; +#endif // HBSTYLE_DEBUG + } else { + const QVariant existingLayoutNameV = widget->property( LAYOUT_NAME_PROPERTY ); + const QString existingLayoutName = existingLayoutNameV.isValid() ? existingLayoutNameV.toString() : QString(); + const bool cached = (existingLayoutName == layoutName ); + if ( !cached ) { +#ifdef HBSTYLE_DEBUG + qDebug() << "LayoutName cache miss."; #endif - HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance(); - if ( !loader->loadWidgetML(widget, layoutName, sectionName)) { + HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance(); + if ( !loader->loadWidgetML(widget, layoutName, sectionName)) { #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::polish : Failed to load WidgetML"; + qDebug() << "HbStyle::polish : Failed to load WidgetML"; #endif - return; + return; + } + const QVariant ptrVariant = QVariant::fromValue( widget->layout() ); + widget->setProperty( LAYOUT_PTR_PROPERTY, ptrVariant ); + widget->setProperty( LAYOUT_NAME_PROPERTY, QVariant( layoutName ) ); } - widgetLayoutNames[widget] = layoutName; - if (cachedLayoutName.isNull()) { - // Cached for the first time. Connect to destroyed signal. - QObject::connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(widgetDestroyed(QObject*))); + + anchorLayout = static_cast(widget->layout()); + if (cached) { #ifdef HBSTYLE_DEBUG - qDebug() << "Cached first time. Connected to destroy signal."; - } else { - qDebug() << "Cached nth time."; + qDebug() << "LayoutName cache hit."; #endif + anchorLayout->removeMappings(); } + + anchorLayout->setMapping(anchorLayout, ""); + nodeIds = anchorLayout->nodeIds(); } - meshLayout = static_cast(widget->layout()); - if (cached) { -#ifdef HBSTYLE_DEBUG - qDebug() << "LayoutName cache hit."; -#endif - meshLayout->clearItemIds(); - } - - meshLayout->setItemId(meshLayout, ""); - meshIds = meshLayout->nodeIds(); - } // polish widget and subitems - d->polishItem(styleRules, widget, widget, "", false); + d->polishItem(styleRules, widget, widget, "", profile, false); QList list = widget->childItems(); foreach (QGraphicsItem* item, list) { QString name = HbStyle::itemName(item); - if ( meshLayout && !name.isEmpty() ) { + if ( anchorLayout && !name.isEmpty() ) { // Assuming that all items with "itemName" are widgets. - meshLayout->setItemId(static_cast(item), name); - // Remove from "meshIds" so that we don't call polishItem + anchorLayout->setMapping(static_cast(item), name); + // Remove from "nodeIds" so that we don't call polishItem // twice for this item. - meshIds.removeAll(name); + nodeIds.removeAll(name); } - d->polishItem(styleRules, widget, item, name, layoutDefined); + d->polishItem(styleRules, widget, item, name, profile, layoutDefined); } - foreach (QString meshId, meshIds) { - // These are the "missing" mesh items. Need to call polishItem - // for them, too, for getting the mesh anchor spacings right. - // if there are mesh ids, layoutDefined is always true. - if ( !meshId.isEmpty() ) { - d->polishItem(styleRules, widget, 0, meshId, true); + foreach (QString nodeId, nodeIds) { + // These are the "missing" anchor items. Need to call polishItem + // for them, too, for getting the anchor spacings right. + // if there are anchor node ids, layoutDefined is always true. + if ( !nodeId.isEmpty() ) { + d->polishItem(styleRules, widget, 0, nodeId, profile, true); + } + } + if ( anchorLayout ) { + QList anchors = anchorLayout->anchors(); + foreach (HbAnchor* anchor, anchors) { + if ( !anchor->anchorId().isEmpty() ) { + d->polishAnchor(styleRules, widget, anchor, profile); + } } } } @@ -4248,62 +4328,79 @@ \param widget, widget whose themed parameters are supposed to be updated \param item, graphics item whose themed parameters are supposed to be updated */ -void HbStylePrivate::updateThemedItems( const HbVector &styleRules, - QGraphicsItem *item ) const +void HbStylePrivate::updateThemedItems( + const HbVector &styleRules, + QGraphicsItem *item, + HbDeviceProfile &profile) const { - + QString name = HbStyle::itemName(item); if (name.isEmpty() ) { return; } - + HbTextItem* text = qgraphicsitem_cast( item ); + HbRichTextItem* richtext = qgraphicsitem_cast( item ); HbIconItem* iconItem = qgraphicsitem_cast( item ); HbMarqueeItem* marqueeItem = qgraphicsitem_cast( item ); - if(! (text || iconItem || marqueeItem ) ){ + if(! (text || richtext || iconItem || marqueeItem ) ){ return; } - - HbDeviceProfile profile; + const HbVector decl = declarations(styleRules, name, 0, profile); #ifdef HBSTYLE_DEBUG - qDebug() << "HbStyle::updateThemedItems : -- Number of maching CSS declarations: " << decl.count(); + qDebug() << "HbStyle::updateThemedItems : -- Number of matching CSS declarations: " << decl.count(); #endif - ensureColorParameters(); - HbCss::ValueExtractor extractor(decl, colorParameters, profile); - + + HbCss::ValueExtractor extractor(decl, profile); + QColor col; - bool extracted = extractor.extractColor( &col ); + bool extracted = extractor.extractColor( col ); if (!extracted || !col.isValid()) { // Setting non black or white default color to make it visisble in black or white theme col.setRgb(255,0,255); } //apply the themed color to text-item - if(text) { + if(text) { #ifdef HBSTYLE_DEBUG if ( !extracted ) { qDebug() << "HbStyle::getColor : -- No color information found"; } -#endif +#endif if ( !HbWidgetBasePrivate::d_ptr(text)->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor ) ){ text->setTextColor(col); HbWidgetBasePrivate::d_ptr(text)->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor, false); } - } - if(iconItem){ - //applying color to mono-colorised icons from theme - iconItem->setColor( col ); + } + + if(richtext) { +#ifdef HBSTYLE_DEBUG + if ( !extracted ) { + qDebug() << "HbStyle::getColor : -- No color information found"; + } +#endif + if ( !HbWidgetBasePrivate::d_ptr(richtext)->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor ) ){ + richtext->setTextDefaultColor(col); + HbWidgetBasePrivate::d_ptr(richtext)->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor, false); + } + } + + if (iconItem) { + // Applying color to mono-colorised icons from theme. Using setColor() + // here would be wrong. It would lead to loosing the user-supplied color + // in some cases so use the special setThemedColor() instead. + HbIconItemPrivate::d_ptr(iconItem)->setThemedColor( col ); } if(marqueeItem){ //applying color to the marquee-item from theme if(!HbWidgetBasePrivate::d_ptr(marqueeItem)->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor)) { - marqueeItem->setTextColor( col ); + marqueeItem->setTextColor( col ); HbWidgetBasePrivate::d_ptr(marqueeItem)->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor, false); } } } - + /*! HbStyle::updateThemedParams() @@ -4343,21 +4440,21 @@ #endif return; } - + // update themed items QList list = widget->childItems(); foreach (QGraphicsItem* item, list) { - d->updateThemedItems(styleRules, item); + d->updateThemedItems(styleRules, item, profile); } } /*! - Checkes whether given widget has orienation specific style + Checkes whether given widget has orienation specific style rules. This can be used for optimizing orientation switch. */ bool HbStyle::hasOrientationSpecificStyleRules(HbWidget *widget) { - HbLayeredStyleLoader *styleLoader = + HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Layouts); NODEPTR_N(widget); return styleLoader->hasOrientationSpecificStyleRules(n); @@ -4368,7 +4465,7 @@ */ void HbStyle::widgetDestroyed(QObject* obj) { - widgetLayoutNames.remove((const QGraphicsWidget *)obj); + Q_UNUSED( obj ); } /*! @@ -4388,16 +4485,26 @@ */ void HbStyle::setItemName( QGraphicsItem *item, const QString &name ) { - if (item && itemName(item) != name) { + QString originalName = itemName(item); + if (item && originalName != name) { item->setData( ItemName, name ); QGraphicsItem* parent = item->parentItem(); QGraphicsLayoutItem* lItem = (item->isWidget()) ? (QGraphicsLayoutItem*)static_cast(item) : 0; if (lItem && parent && parent->isWidget()) { QGraphicsWidget* parentW = static_cast(parent); - if ( parentW->layout() && widgetLayoutNames.contains(parentW) ) { - HbMeshLayout* layout = static_cast(parentW->layout()); + const QVariant layoutPtrByStyleV = parentW->property( LAYOUT_PTR_PROPERTY ); + const QGraphicsLayout *layoutPtrByStyle = layoutPtrByStyleV.isValid() ? layoutPtrByStyleV.value() : 0; + if ( parentW->layout() && (parentW->layout()==layoutPtrByStyle)) { + HbAnchorLayout* layout = static_cast(parentW->layout()); if ( layout->indexOf(lItem) != -1 ) { - layout->setItemId(lItem, name.isEmpty() ? QString() : name); + if( name.isEmpty() ) { + layout->removeMapping(originalName); + } else { + if ( !originalName.isEmpty() ) { + layout->removeMapping(originalName); + } + layout->setMapping(lItem, name); + } } } } @@ -4420,18 +4527,18 @@ } /*! - Returns a value of a global style parameter. The value is returned in pixels. + Returns a value of a global style parameter. The value is returned in pixels. Available parameters can be found from hbglobalparameters.css. By using these parameters applications get consistent look. - \param variable Name of the global parameter. + \param param Name of the global parameter. \param value Returns value of the global parameter. \param profile Device profile of the used HbMainWindow. Primary display's. device profile HbDeviceProfile::current() is used if the value is omitted. - \return true if the variable were found. + \return true if the variable was found. */ -bool HbStyle::parameter(const QString& parameter, qreal& value, const HbDeviceProfile &profile) const +bool HbStyle::parameter(const QString& param, qreal& value, const HbDeviceProfile &profile) const { HbDeviceProfile effectiveProfile = profile; if ( effectiveProfile.isNull() ) { @@ -4442,39 +4549,39 @@ HbCss::ValueExtractor valueExtractor(d->layoutParameters, true, effectiveProfile); // todo: parsing variable/expression is done here so that there is no need to change API // also parameters method not changed (this change is done for docml/widgetml parsing) - if (parameter.startsWith("var(") && parameter.endsWith(")")) { - return valueExtractor.extractValue(parameter.mid(4,parameter.length()-5), value); - } else if (parameter.startsWith("-var(") && parameter.endsWith(")")) { - bool retVal = valueExtractor.extractValue(parameter.mid(5,parameter.length()-6), value); + if (param.startsWith(QLatin1String("var(")) && param.endsWith(QLatin1String(")"))) { + return valueExtractor.extractVariableValue(param.mid(4,param.length()-5), value); + } else if (param.startsWith(QLatin1String("-var(")) && param.endsWith(QLatin1String(")"))) { + bool retVal = valueExtractor.extractVariableValue(param.mid(5,param.length()-6), value); value = -value; return retVal; - } else if (parameter.startsWith("expr(") && parameter.endsWith(")")) { - QString expressionString = parameter.mid(5,parameter.length()-6); + } else if (param.startsWith(QLatin1String("expr(")) && param.endsWith(QLatin1String(")"))) { + QString expressionString = param.mid(5,param.length()-6); return valueExtractor.extractExpressionValue(expressionString, value); - } else if (parameter.startsWith("-expr(") && parameter.endsWith(")")) { - QString expressionString = parameter.mid(6,parameter.length()-7); + } else if (param.startsWith(QLatin1String("-expr(")) && param.endsWith(QLatin1String(")"))) { + QString expressionString = param.mid(6,param.length()-7); bool retVal = valueExtractor.extractExpressionValue(expressionString, value); value = -value; return retVal; } - return valueExtractor.extractValue(parameter, value); + return valueExtractor.extractVariableValue(param, value); } /*! - Returns copy of all global style parameters. Both names and values + Returns copy of all global style parameters. Both names and values of the parameters are returned. The values are returned in pixels. Available parameters can be found from hbglobalparameters.css. By using these parameters applications get consistent look. Usage of this API (instead of parameter) is recommended if an application needs to fetch several parameters in one place. - \param parameters Contains names and values of all global style parameters. + \param params Contains names and values of all global style parameters. \param profile Device profile of the used HbMainWindow. Primary display's device profile HbDeviceProfile::current() is used if the value is omitted. */ -void HbStyle::parameters(HbStyleParameters ¶meters, const HbDeviceProfile &profile) const +void HbStyle::parameters(HbStyleParameters ¶ms, const HbDeviceProfile &profile) const { HbDeviceProfile effectiveProfile = profile; if ( effectiveProfile.isNull() ) { @@ -4487,25 +4594,74 @@ qreal value = 0; QHash::const_iterator i = d->layoutParameters.constBegin(); while (i != d->layoutParameters.constEnd()) { - if (valueExtractor.extractValue(i.key(), value)) { - parameters.addParameter(i.key(), value); + if (valueExtractor.extractVariableValue(i.key(), value)) { + params.addParameter(i.key(), value); } ++i; } } +/*! + Returns values for widget specific style parameters. The names of the parameters + are passed in with \a params. + + This method should be used only if you need to access widget specific parameters out + of the polish loop. It is more efficient to use HbWidget::polish(HbStyleParameters ¶ms) + if you don't need to access the parameters before the (first) polish event. + + \param parameters, style parameters to be returned to the caller + \param widget, HbWidget to be polished + \sa HbStyle::polish, HbStyle::parameters and HbWidget::polish +*/ +void HbStyle::widgetParameters(HbStyleParameters ¶ms, HbWidget* widget) const +{ + Q_D( const HbStyle ); + if( !widget || !params.count() ) { + return; + } +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::widgetParameters : Parameters for" << widget->metaObject()->className(); +#endif + + HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Layouts); + if(!styleLoader){ +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::widgetParameters : HbLayeredStyleLoader returned a null pointer."; +#endif + return; + } + HbDeviceProfile profile(HbDeviceProfile::profile(widget)); + NODEPTR_N(widget); + + HbVector styleRules = styleLoader->styleRulesForNode(n, profile.orientation()); + +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::widgetParameters : Number of style rules:" << styleRules.count(); +#endif + if (!styleRules.count()) { + return; + } + const HbVector decl = declarations(styleRules, "", widget, profile); +#ifdef HBSTYLE_DEBUG + qDebug() << "HbStyle::widgetParameters : Number of matching CSS declarations: " << decl.count(); +#endif + d->ensureLayoutParameters(profile); + + HbCss::ValueExtractor extractor(decl, d->layoutParameters, profile); + extractor.extractCustomProperties( params.keys(), params.values() ); +} + /*! \internal */ HbStylePrivate::HbStylePrivate() { - nextAvailableId = HbStyle::P_CustomBase; HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance(); if(loader){ - loader->addFilePath(STYLE_LOCATION, HbLayeredStyleLoader::Concern_Layouts, + loader->addFilePath(STYLE_LOCATION, HbLayeredStyleLoader::Concern_Layouts, HbLayeredStyleLoader::Priority_Core); - loader->addFilePath(COLOR_STYLE_LOCATION, HbLayeredStyleLoader::Concern_Colors, + loader->addFilePath(COLOR_STYLE_LOCATION, HbLayeredStyleLoader::Concern_Colors, HbLayeredStyleLoader::Priority_Core); } } @@ -4516,54 +4672,56 @@ HbStylePrivate::~HbStylePrivate() { layoutParameters.clear(); - colorParameters.clear(); HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance(); if(loader){ - loader->removeFilePath(STYLE_LOCATION, HbLayeredStyleLoader::Concern_Layouts, + loader->removeFilePath(STYLE_LOCATION, HbLayeredStyleLoader::Concern_Layouts, HbLayeredStyleLoader::Priority_Core); - loader->removeFilePath(COLOR_STYLE_LOCATION, HbLayeredStyleLoader::Concern_Colors, + loader->removeFilePath(COLOR_STYLE_LOCATION, HbLayeredStyleLoader::Concern_Colors, HbLayeredStyleLoader::Priority_Core); } } -void HbStylePrivate::_q_onThemeChanged() -{ - colorParameters.clear(); -} - /*! \internal */ QString HbStylePrivate::logicalName(HbStyle::Primitive primitive, const QStyleOption *option) const { - switch(primitive){ - case HbStyle::P_Slider_thumb:{ + switch (primitive) { + + case HbStyle::P_Slider_thumb: { const HbStyleOptionSlider *opt = qstyleoption_cast(option); - QString iconPath; - - switch (opt->orientation){ - case Qt::Horizontal:{ - if( opt->state&QStyle::State_Sunken) - iconPath= "qtg_graf_slider_h_handle_pressed"; - else - iconPath= "qtg_graf_slider_h_handle_normal"; - return (iconPath); - } - case Qt::Vertical:{ - if( opt->state&QStyle::State_Sunken) - iconPath= "qtg_graf_slider_v_handle_pressed"; - else - iconPath= "qtg_graf_slider_v_handle_normal"; - return (iconPath); - } - default: break; + if (opt) { + QString iconPath; + switch (opt->orientation) { + + case Qt::Horizontal: + if (opt->state & QStyle::State_Sunken) + iconPath = "qtg_graf_slider_h_handle_pressed"; + else + iconPath = "qtg_graf_slider_h_handle_normal"; + return iconPath; + + case Qt::Vertical: + if (opt->state & QStyle::State_Sunken) + iconPath = "qtg_graf_slider_v_handle_pressed"; + else + iconPath = "qtg_graf_slider_v_handle_normal"; + return iconPath; + + default: + break; + + } } } - default: break; + + default: + break; + } -return QString(); + return QString(); } /*! @@ -4592,20 +4750,6 @@ return icon; } -/*! -\internal -*/ -HbStyleInterface *HbStylePrivate::stylePluginInterface( HbStyle::Primitive primitive ) const -{ - - if (customPrimitives.contains(primitive)) { - HbStyleInterfaceInfo* info = customPrimitives.value(primitive); - QObject* pluginInstance = info->loader->instance(); - HbStyleInterface *stylePlugin = qobject_cast(pluginInstance); - return stylePlugin; - } - return 0; -} /*! \internal @@ -4617,7 +4761,7 @@ if (firstParse) { HbCss::Parser parser; parser.init(GLOBAL_PARAMETERS_LOCATION, true); - HbCss::StyleSheet *styleSheet = new(HbCss::StyleSheet); + HbCss::StyleSheet *styleSheet = HbMemoryUtils::create(HbMemoryManager::HeapMemory); parser.parse(styleSheet); HbStyleSelector selector; @@ -4634,7 +4778,7 @@ { HbCss::Declaration decl; decl.property = "hb-param-screen-width"; - decl.propertyId = HbCss::UnknownProperty; + decl.propertyId = HbCss::Property_Unknown; HbCss::Value val; val.type = HbCss::Value::Number; val.variant = HbVariant((double)pSize.width(),HbMemoryManager::HeapMemory); @@ -4644,7 +4788,7 @@ { HbCss::Declaration decl; decl.property = "hb-param-screen-height"; - decl.propertyId = HbCss::UnknownProperty; + decl.propertyId = HbCss::Property_Unknown; HbCss::Value val; val.type = HbCss::Value::Number; val.variant = HbVariant((double)pSize.height(),HbMemoryManager::HeapMemory); @@ -4654,7 +4798,7 @@ { HbCss::Declaration decl; decl.property = "hb-param-screen-short-edge"; - decl.propertyId = HbCss::UnknownProperty; + decl.propertyId = HbCss::Property_Unknown; HbCss::Value val; val.type = HbCss::Value::Number; val.variant = HbVariant((double)qMin(pSize.height(),pSize.width()),HbMemoryManager::HeapMemory); @@ -4664,7 +4808,7 @@ { HbCss::Declaration decl; decl.property = "hb-param-screen-long-edge"; - decl.propertyId = HbCss::UnknownProperty; + decl.propertyId = HbCss::Property_Unknown; HbCss::Value val; val.type = HbCss::Value::Number; val.variant = HbVariant((double)qMax(pSize.height(),pSize.width()),HbMemoryManager::HeapMemory); @@ -4674,22 +4818,12 @@ } } -void HbStylePrivate::ensureColorParameters() const -{ - if (colorParameters.isEmpty()) { - HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); - styleLoader->variableRuleSets(&colorParameters); - } -} - /*! \internal */ void HbStylePrivate::clearStyleSheetCaches() { - widgetLayoutNames.clear(); styleRulesCache.clear(); - colorParameters.clear(); } HbWidgetBasePrivate *HbStylePrivate::widgetBasePrivate(HbWidgetBase *widgetBase) const @@ -4697,5 +4831,4 @@ return HbWidgetBasePrivate::d_ptr(widgetBase); } - #include "moc_hbstyle.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyle.h --- a/src/hbcore/style/hbstyle.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyle.h Thu Jul 22 16:36:53 2010 +0100 @@ -114,6 +114,7 @@ P_TitlePane_background, P_TitlePane_text, P_TitlePane_icon, + P_TitlePane_toucharea, P_TitleBar_toucharea, P_SignalIndicator_icon, P_SignalLevel_background, @@ -131,8 +132,11 @@ P_ProgressBar_mintext, P_ProgressBar_maxtext, P_NavigationButton_background, + P_NavigationButton_toucharea, P_IndicatorButton_background, P_IndicatorButton_handleindication, + P_IndicatorButton_eventindication, + P_IndicatorButton_toucharea, P_ItemViewItem_frame, P_SelectionControl_selectionstart, P_SelectionControl_selectionend, @@ -223,14 +227,13 @@ virtual QGraphicsItem *createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent = 0 ) const; virtual void updatePrimitive( QGraphicsItem *item, HbStyle::Primitive primitive, const QStyleOption *option ) const; - int registerPlugin(const QString &pluginName); - void unregisterPlugin(const QString &pluginName); - static void setItemName( QGraphicsItem *item, const QString &name ); static QString itemName( const QGraphicsItem *item ); - bool parameter(const QString ¶meter, qreal &value, const HbDeviceProfile &profile = HbDeviceProfile()) const; - void parameters(HbStyleParameters ¶meters, const HbDeviceProfile &profile = HbDeviceProfile()) const; + bool parameter(const QString ¶m, qreal &value, const HbDeviceProfile &profile = HbDeviceProfile()) const; + void parameters(HbStyleParameters ¶ms, const HbDeviceProfile &profile = HbDeviceProfile()) const; + + void widgetParameters(HbStyleParameters ¶ms, HbWidget* widget) const; protected: friend class HbWidget; @@ -249,8 +252,6 @@ private: Q_DISABLE_COPY( HbStyle ) Q_DECLARE_PRIVATE_D( d_ptr, HbStyle ) - - Q_PRIVATE_SLOT(d_func(), void _q_onThemeChanged()) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyle_p.h --- a/src/hbcore/style/hbstyle_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyle_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,26 +44,9 @@ #include "hbcssparser_p.h" class HbWidget; -class HbPluginLoader; -class HbStyleInterface; class HbWidgetBasePrivate; +class HbAnchor; -class HbStylePluginInfo -{ -public: - int primitiveBaseId; - int primitiveCount; - int refCount; -}; - -class HbStyleInterfaceInfo -{ -public: - HbPluginLoader* loader; - int primitiveBaseId; -}; - -static QHash widgetLayoutNames; class HbStylePrivate { @@ -75,29 +58,34 @@ QString logicalName(HbStyle::Primitive primitive, const QStyleOption *option) const; QIcon::Mode iconMode(QStyle::State state) const; QIcon::State iconState(QStyle::State state) const; - HbStyleInterface *stylePluginInterface( HbStyle::Primitive primitive ) const; + - void polishItem(const HbVector &styleRules, HbWidget *widget, - QGraphicsItem *item, const QString &name, bool layoutDefined) const; - void updateThemedItems( const HbVector &styleRules, - QGraphicsItem *item ) const; + void polishItem( + const HbVector &styleRules, + HbWidget *widget, + QGraphicsItem *item, + const QString &name, + HbDeviceProfile &profile, + bool layoutDefined) const; + void polishAnchor( + const HbVector &styleRules, + HbWidget *widget, + HbAnchor *anchor, + HbDeviceProfile &profile) const; + void updateThemedItems( + const HbVector &styleRules, + QGraphicsItem *item, + HbDeviceProfile &profile) const; void ensureLayoutParameters(const HbDeviceProfile &profile) const; - void ensureColorParameters() const; - void _q_onThemeChanged(); void clearStyleSheetCaches(); HbWidgetBasePrivate *widgetBasePrivate(HbWidgetBase *widgetBase) const; HbStyle* q_ptr; - mutable QHash customPrimitives; - mutable QHash registeredPlugins; - mutable QHash pluginStylePaths; - mutable int nextAvailableId; - mutable QHash colorParameters; mutable QHash layoutParameters; mutable QString layoutParametersProfileName; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleinterface.cpp --- a/src/hbcore/style/hbstyleinterface.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - - -#include "hbstyleinterface_p.h" - - -/*! - \deprecated HbStyleInterface::deprecated() - is deprecated. Style plugins are deprecated, stop using style plugins. -*/ -void HbStyleInterface::deprecated() -{ -} - -/*! - \fn virtual int primitiveCount() const = 0; - - Return the count of primitives created / supported by this plugin. -*/ - -/*! - \fn virtual QGraphicsItem *createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent = 0 ) const = 0; - - Returns primitives created in this plugin. Note that the primitive parameter range is internal to the plugin. This means that - you can define your plugin's primitives in your domain (for example app domain). When calling create/updatePrimitive from your custom - widget use plugin's base id + your primitive's id. See also the documentation from HbStyle::createPrimitive. -*/ - -/*! - \fn virtual void updatePrimitive( QGraphicsItem *item, HbStyle::Primitive primitive, const QStyleOption *option ) const = 0; - - Updates the primitives defined in this plugin. See more documentation from HbStyle::updatePrimitive. - -*/ - -/*! - \fn virtual QString layoutPath() const = 0; - - Returns the path to layout definition files (CSS/WidgetML). The path can define several CSS and WidgetML files. The directory can contain - several widgets' layout definitions. Subdirectories are not supported. The filenames in the directory must match with the widgets' class - names. For example class called MyExampleWidget should have myexamplewidget.css and myexamplewidget.widgetml in the directory returned by layoutPath(). - - -*/ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoption.cpp --- a/src/hbcore/style/hbstyleoption.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoption.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,11 +25,7 @@ #include -/*! - - \deprecated HbStyleOption::HbStyleOption(int, int) - is deprecated. Styleoptions will not be public. - +/* \class HbStyleOption \brief HbStyleOption is the base class for all Hbwidgets Style Options */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoption_p.h --- a/src/hbcore/style/hbstyleoption_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoption_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOption : public QStyleOptionGraphicsItem { public: @@ -89,7 +89,7 @@ enum StyleOptionType { Type = HbSO_Widget }; enum StyleOptionVersion { Version = 1 }; - QFont font; // DEPRECATED + QFont font; QRectF boundingRect; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionabstractviewitem.cpp --- a/src/hbcore/style/hbstyleoptionabstractviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionabstractviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,18 +29,18 @@ #include -/*! +/* \class HbStyleOptionAbstractViewItem \brief HbStyleOptionAbstractViewItem has the style component for abstract view item primitives */ -/*! +/* \var HbStyleOptionAbstractViewItem::checkState This variable holds what is the checkstate of the item. */ -/*! +/* \var HbStyleOptionAbstractViewItem::background This variable holds content (if any) that is set as item's background. @@ -48,10 +48,8 @@ Default value is NULL variant. */ -/*! +/* \var HbStyleOptionAbstractViewItem::itemName - \deprecated HbStyleOptionAbstractViewItem::itemName - is deprecated. This variable will cease to exist in near future. HbStyleOptionListViewItem::itemNameIndex replaces this variable. This variable holds content item name of the primitive item required by css/xml layouting. @@ -59,7 +57,7 @@ */ -/*! +/* \var HbStyleOptionAbstractViewItem::modelItemType This variable holds what is the type of the model item that view item is representing. @@ -67,7 +65,7 @@ Default value is Hb::StandardItem. */ -/*! +/* \var HbStyleOptionAbstractViewItem::viewItemType This variable holds what is the type of the view item. This is value returned by QGraphicsItem::type(). @@ -75,13 +73,13 @@ Default is Hb::ItemType_Last+1 */ -/*! +/* \var HbStyleOptionAbstractViewItem::index The model index that the view item represents. */ -/*! +/* \var HbStyleOptionAbstractViewItem::singleSelectionMode This variable holds information whether HbAbstractItemView::SelectionMode mode is used. If it is used, set this variable On. @@ -90,17 +88,11 @@ mode is in use. */ -/*! \var HbStyleOptionAbstractViewItem::insidePopup +/* \var HbStyleOptionAbstractViewItem::insidePopup Indicates whether widget and its children (classes derived from HbWidgetBase) are inside popup. */ -/*! - \deprecated HbStyleOptionAbstractViewItem::HbStyleOptionAbstractViewItem() - is deprecated. Styleoptions will not be public. - -*/ - HbStyleOptionAbstractViewItem::HbStyleOptionAbstractViewItem() : HbStyleOption(), modelItemType(Hb::StandardItem), @@ -111,13 +103,6 @@ type = Type; version = Version; } - -/*! - \deprecated HbStyleOptionAbstractViewItem::HbStyleOptionAbstractViewItem(const HbStyleOptionAbstractViewItem&) - is deprecated. Styleoptions will not be public. - -*/ - HbStyleOptionAbstractViewItem::HbStyleOptionAbstractViewItem(const HbStyleOptionAbstractViewItem &other) : HbStyleOption(other), checkState(other.checkState), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionabstractviewitem_p.h --- a/src/hbcore/style/hbstyleoptionabstractviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionabstractviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionAbstractViewItem : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionbatteryindicator.cpp --- a/src/hbcore/style/hbstyleoptionbatteryindicator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionbatteryindicator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,11 +25,8 @@ #include "hbstyleoptionbatteryindicator_p.h" -/*! - - \deprecated HbStyleOptionBatteryIndicator::HbStyleOptionBatteryIndicator() - is deprecated. Styleoptions will not be public. - +/* + \class HbStyleOptionBatteryIndicator \brief HbStyleOptionBatteryIndicator has the style component for battery indicator */ @@ -43,12 +40,6 @@ version = Version; } -/*! - - \deprecated HbStyleOptionBatteryIndicator::HbStyleOptionBatteryIndicator(const HbStyleOptionBatteryIndicator&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionBatteryIndicator::HbStyleOptionBatteryIndicator(const HbStyleOptionBatteryIndicator &other) : HbStyleOption(other), batteryLevel(other.batteryLevel), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioncheckbox.cpp --- a/src/hbcore/style/hbstyleoptioncheckbox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioncheckbox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,27 +26,16 @@ #include -/*! +/* \class HbStyleOptionCheckBox \brief HbStyleOptionCheckBox has the style component for checkbox primitives */ - - -/*! - \deprecated HbStyleOptionCheckBox::HbStyleOptionCheckBox() - is deprecated. Styleoptions will not be public. -*/ - HbStyleOptionCheckBox::HbStyleOptionCheckBox() { type = Type; version = Version; } -/*! - \deprecated HbStyleOptionCheckBox::HbStyleOptionCheckBox(const HbStyleOptionCheckBox&) - is deprecated. Styleoptions will not be public. -*/ HbStyleOptionCheckBox::HbStyleOptionCheckBox(const HbStyleOptionCheckBox &other) : HbStyleOption(other), text(other.text) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioncheckbox_p.h --- a/src/hbcore/style/hbstyleoptioncheckbox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioncheckbox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionCheckBox : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioncolorgridviewitem.cpp --- a/src/hbcore/style/hbstyleoptioncolorgridviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioncolorgridviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,16 +25,11 @@ #include -/*! +/* \class HbStyleOptionColorGridViewItem \brief HbStyleOptionColorGridViewItem has the style component for color grid view item primitives */ -/*! - - \deprecated HbStyleOptionColorGridViewItem::HbStyleOptionColorGridViewItem() - is deprecated. Styleoptions will not be public. -*/ HbStyleOptionColorGridViewItem::HbStyleOptionColorGridViewItem() : HbStyleOptionGridViewItem(), color(Qt::black), @@ -44,11 +39,7 @@ type = Type; version = Version; } -/*! - \deprecated HbStyleOptionColorGridViewItem::HbStyleOptionColorGridViewItem(const HbStyleOptionColorGridViewItem&) - is deprecated. Styleoptions will not be public. -*/ HbStyleOptionColorGridViewItem::HbStyleOptionColorGridViewItem(const HbStyleOptionColorGridViewItem &other) : HbStyleOptionGridViewItem(other), color(other.color), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioncolorgridviewitem_p.h --- a/src/hbcore/style/hbstyleoptioncolorgridviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioncolorgridviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionColorGridViewItem : public HbStyleOptionGridViewItem { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioncombobox.cpp --- a/src/hbcore/style/hbstyleoptioncombobox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioncombobox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,32 +25,23 @@ #include -/*! +/* \class HbStyleOptionComboBox \brief HbStyleOptionComboBox has the style component for label primitives */ -/*! +/* \var HbStyleOptionLabel::text Text shown in the comboBox, if not NULL. */ -/*! - - \deprecated HbStyleOptionComboBox::HbStyleOptionComboBox() - is deprecated. Styleoptions will not be public. -*/ HbStyleOptionComboBox::HbStyleOptionComboBox() : HbStyleOption(HbSO_Combo) { type = Type; version = Version; } -/*! - \deprecated HbStyleOptionComboBox::HbStyleOptionComboBox(const HbStyleOptionComboBox&) - is deprecated. Styleoptions will not be public. -*/ HbStyleOptionComboBox::HbStyleOptionComboBox(const HbStyleOptionComboBox &other) : HbStyleOption(other), text(other.text) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioncombobox_p.h --- a/src/hbcore/style/hbstyleoptioncombobox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioncombobox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionComboBox : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondataform.cpp --- a/src/hbcore/style/hbstyleoptiondataform.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondataform.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,20 +26,12 @@ #include -/*! - \deprecated HbStyleOptionDataForm::HbStyleOptionDataForm() - is deprecated. Styleoptions will not be public. -*/ HbStyleOptionDataForm::HbStyleOptionDataForm() : HbStyleOption(HbSO_DataForm) { type = Type; version = Version; } -/*! - \deprecated HbStyleOptionDataForm::HbStyleOptionDataForm(const HbStyleOptionDataForm&) - is deprecated. Styleoptions will not be public. -*/ HbStyleOptionDataForm::HbStyleOptionDataForm(const HbStyleOptionDataForm &other) : HbStyleOption(other), heading(other.heading), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondataform_p.h --- a/src/hbcore/style/hbstyleoptiondataform_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondataform_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionDataForm : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondataformviewitem.cpp --- a/src/hbcore/style/hbstyleoptiondataformviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondataformviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,17 +25,11 @@ #include -/*! +/* \class HbStyleOptionDataFormViewItem \brief HbStyleOptionDataFormViewItem has the style component for data item primitives */ -/*! - - \deprecated HbStyleOptionDataFormViewItem::HbStyleOptionDataFormViewItem() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionDataFormViewItem::HbStyleOptionDataFormViewItem() : HbStyleOption() @@ -44,12 +38,6 @@ version = Version; } -/*! - - \deprecated HbStyleOptionDataFormViewItem::HbStyleOptionDataFormViewItem(const HbStyleOptionDataFormViewItem&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionDataFormViewItem::HbStyleOptionDataFormViewItem(const HbStyleOptionDataFormViewItem &other) : HbStyleOption(other) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondataformviewitem_p.h --- a/src/hbcore/style/hbstyleoptiondataformviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondataformviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionDataFormViewItem : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondatagroup.cpp --- a/src/hbcore/style/hbstyleoptiondatagroup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondatagroup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,25 +26,12 @@ #include -/*! - - \deprecated HbStyleOptionDataGroup::HbStyleOptionDataGroup() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionDataGroup::HbStyleOptionDataGroup() : HbStyleOption(HbSO_DataGroup) { type = Type; version = Version; } -/*! - - \deprecated HbStyleOptionDataGroup::HbStyleOptionDataGroup(const HbStyleOptionDataGroup&) - is deprecated. Styleoptions will not be public. - -*/ - HbStyleOptionDataGroup::HbStyleOptionDataGroup(const HbStyleOptionDataGroup &other) : HbStyleOption(other), description(other.description) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondatagroup_p.h --- a/src/hbcore/style/hbstyleoptiondatagroup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondatagroup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionDataGroup : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondatagroupheadingwidget.cpp --- a/src/hbcore/style/hbstyleoptiondatagroupheadingwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondatagroupheadingwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,12 +27,7 @@ -/*! - \deprecated HbStyleOptionDataGroupHeadingWidget::HbStyleOptionDataGroupHeadingWidget() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionDataGroupHeadingWidget::HbStyleOptionDataGroupHeadingWidget() : expanded(false), pressed(false) @@ -41,12 +36,6 @@ version = Version; } -/*! - - \deprecated HbStyleOptionDataGroupHeadingWidget::HbStyleOptionDataGroupHeadingWidget(const HbStyleOptionDataGroupHeadingWidget&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionDataGroupHeadingWidget::HbStyleOptionDataGroupHeadingWidget(const HbStyleOptionDataGroupHeadingWidget &other) : HbStyleOption(other), heading(other.heading), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiondatagroupheadingwidget_p.h --- a/src/hbcore/style/hbstyleoptiondatagroupheadingwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiondatagroupheadingwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionDataGroupHeadingWidget : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiongridviewitem.cpp --- a/src/hbcore/style/hbstyleoptiongridviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiongridviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,31 +25,23 @@ #include "hbstyleoptiongridviewitem_p.h" -/*! +/* \class HbStyleOptionGridViewItem \brief HbStyleOptionGridViewItem has the style component for grid view item primitives */ -/*! +/* \var HbStyleOptionGridViewItem::text Text shown in the grid view item, if not NULL. */ -/*! +/* \var HbStyleOptionGridViewItem::icon Icon shown in the grid view item, if not NULL. */ - - -/*! - - \deprecated HbStyleOptionGridViewItem::HbStyleOptionGridViewItem() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionGridViewItem::HbStyleOptionGridViewItem() : HbStyleOptionAbstractViewItem() { @@ -57,12 +49,6 @@ version = Version; } -/*! - - \deprecated HbStyleOptionGridViewItem::HbStyleOptionGridViewItem(const HbStyleOptionGridViewItem&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionGridViewItem::HbStyleOptionGridViewItem(const HbStyleOptionGridViewItem &other) : HbStyleOptionAbstractViewItem(other) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiongridviewitem_p.h --- a/src/hbcore/style/hbstyleoptiongridviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiongridviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,7 +32,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionGridViewItem : public HbStyleOptionAbstractViewItem { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiongroupbox.cpp --- a/src/hbcore/style/hbstyleoptiongroupbox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiongroupbox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,18 +26,12 @@ #include -/*! +/* \class HbStyleOptionGroupBox \brief HbStyleOptionGroupBox has the style component for GroupBox primitives */ -/*! - - \deprecated HbStyleOptionGroupBox::HbStyleOptionGroupBox() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionGroupBox::HbStyleOptionGroupBox(): collapsed(false), heading(QString()), @@ -48,12 +42,7 @@ version = Version; } -/*! - \deprecated HbStyleOptionGroupBox::HbStyleOptionGroupBox(const HbStyleOptionGroupBox&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionGroupBox::HbStyleOptionGroupBox(const HbStyleOptionGroupBox &other) : HbStyleOption(other), collapsed( other.collapsed ), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiongroupbox_p.h --- a/src/hbcore/style/hbstyleoptiongroupbox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiongroupbox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionGroupBox : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionindexfeedback.cpp --- a/src/hbcore/style/hbstyleoptionindexfeedback.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionindexfeedback.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,39 +25,32 @@ #include -/*! +/* \class HbStyleOptionIndexFeedback \brief HbStyleOptionIndexFeedback hsa the style components for index feedback primatives. */ -/*! +/* \var HbStyleOptionIndexFeedback::text Text shown in the indexFeedbackPopup, if not NULL. */ -/*! +/* \var HbStyleOptionIndexFeedback::fontSpec The font specification for text used in the index feedback. */ -/*! +/* \var HbStyleOptionIndexFeedback::textRect \brief The bounding rect for the text when displaying the index feedback. */ -/*! +/* \var HbStyleOptionIndexFeedback::popupRect \brief The bounding rect for the popup background when displaying index feedback. */ - -/*! - - \deprecated HbStyleOptionIndexFeedback::HbStyleOptionIndexFeedback() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionIndexFeedback::HbStyleOptionIndexFeedback() : fontSpec(HbFontSpec::Primary) { @@ -65,12 +58,6 @@ version = Version; } -/*! - - \deprecated HbStyleOptionIndexFeedback::HbStyleOptionIndexFeedback(const HbStyleOptionIndexFeedback&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionIndexFeedback::HbStyleOptionIndexFeedback(const HbStyleOptionIndexFeedback &other) : HbStyleOption(other), text(other.text), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionindexfeedback_p.h --- a/src/hbcore/style/hbstyleoptionindexfeedback_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionindexfeedback_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionIndexFeedback : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionindicatorbutton.cpp --- a/src/hbcore/style/hbstyleoptionindicatorbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionindicatorbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,33 +25,20 @@ #include "hbstyleoptionindicatorbutton_p.h" -/*! +/* \class HbStyleOptionIndicatorButton \brief HbStyleOptionIndicatorButton has the style component for the indicator button */ - - -/*! - - \deprecated HbStyleOptionIndicatorButton::HbStyleOptionIndicatorButton() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionIndicatorButton::HbStyleOptionIndicatorButton() : - HbStyleOption(), mode(QIcon::Normal), transparent(false) + HbStyleOption(), mode(QIcon::Normal), transparent(false), twoIcons(false) { type = Type; version = Version; } -/*! - \deprecated HbStyleOptionIndicatorButton::HbStyleOptionIndicatorButton(const HbStyleOptionIndicatorButton&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionIndicatorButton::HbStyleOptionIndicatorButton(const HbStyleOptionIndicatorButton &other) : - HbStyleOption(other), mode(other.mode), transparent(other.transparent) + HbStyleOption(other), mode(other.mode), transparent(other.transparent), twoIcons(other.twoIcons) { type = Type; version = Version; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionindicatorbutton_p.h --- a/src/hbcore/style/hbstyleoptionindicatorbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionindicatorbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionIndicatorButton : public HbStyleOption { public: @@ -41,6 +41,7 @@ QIcon::Mode mode; bool transparent; + bool twoIcons; }; #endif // HBSTYLEOPTIONINDICATORBUTTON_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionindicatorgroup.cpp --- a/src/hbcore/style/hbstyleoptionindicatorgroup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionindicatorgroup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,31 +25,17 @@ #include "hbstyleoptionindicatorgroup_p.h" -/*! +/* \class HbStyleOptionIndicatorGroup \brief HbStyleOptionIndicatorGroup has the style component for indicator group */ - -/*! - - \deprecated HbStyleOptionIndicatorGroup::HbStyleOptionIndicatorGroup() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionIndicatorGroup::HbStyleOptionIndicatorGroup() { type = Type; version = Version; } - -/*! - - \deprecated HbStyleOptionIndicatorGroup::HbStyleOptionIndicatorGroup(const HbStyleOptionIndicatorGroup&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionIndicatorGroup::HbStyleOptionIndicatorGroup(const HbStyleOptionIndicatorGroup &other) : HbStyleOption(other), iconName(other.iconName) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionindicatorgroup_p.h --- a/src/hbcore/style/hbstyleoptionindicatorgroup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionindicatorgroup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionIndicatorGroup : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioninputdialog.cpp --- a/src/hbcore/style/hbstyleoptioninputdialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioninputdialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,18 +25,11 @@ #include "hbstyleoptioninputdialog_p.h" -/*! +/* \class HbStyleOptionInputDialog \brief HbStyleOptionInputDialog has the style component for inpudialog primitives */ - -/*! - - \deprecated HbStyleOptionInputDialog::HbStyleOptionInputDialog() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionInputDialog::HbStyleOptionInputDialog() : HbStyleOptionPopup(), text(), @@ -46,13 +39,6 @@ version = Version; } - -/*! - - \deprecated HbStyleOptionInputDialog::HbStyleOptionInputDialog(const HbStyleOptionInputDialog&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionInputDialog::HbStyleOptionInputDialog(const HbStyleOptionInputDialog &other) : HbStyleOptionPopup(other), text(other.text), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptioninputdialog_p.h --- a/src/hbcore/style/hbstyleoptioninputdialog_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptioninputdialog_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionInputDialog : public HbStyleOptionPopup { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionlabel.cpp --- a/src/hbcore/style/hbstyleoptionlabel.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionlabel.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,43 +25,38 @@ #include -/*! +/* \class HbStyleOptionLabel \brief HbStyleOptionLabel has the style component for label primitives */ -/*! +/* \var HbStyleOptionLabel::text Text shown in the label, if not NULL. */ -/*! +/* \var HbStyleOptionLabel::alignment Alignment of text or icon in the bounding rectangular */ -/*! +/* \var HbStyleOptionLabel::elideMode Elide mode of the text. */ -/*! +/* \var HbStyleOptionLabel::icon Icon shown in the label, if not NULL. */ -/*! +/* \var HbStyleOptionLabel::aspectRatioMode Aspect ratio mode of icon. */ -/*! - \deprecated HbStyleOptionLabel::HbStyleOptionLabel() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionLabel::HbStyleOptionLabel() : HbStyleOption(HbSO_Label), text(), fontSpec(), /*HbFontSpec::Primary*/ @@ -75,13 +70,6 @@ version = Version; } - -/*! - - \deprecated HbStyleOptionLabel::HbStyleOptionLabel(const HbStyleOptionLabel&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionLabel::HbStyleOptionLabel(const HbStyleOptionLabel &other) : HbStyleOption(other), text(other.text), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionlabel_p.h --- a/src/hbcore/style/hbstyleoptionlabel_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionlabel_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionLabel : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionlistviewitem.cpp --- a/src/hbcore/style/hbstyleoptionlistviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionlistviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,13 +25,13 @@ #include "hbstyleoptionlistviewitem_p.h" -/*! +/* \class HbStyleOptionListViewItem \brief HbStyleOptionListViewItem has the style component for list view item primitives */ -/*! +/* \var HbStyleOptionListViewItem::content This variable holds content (if any) that is set as item's data. @@ -43,7 +43,7 @@ \sa HbStyleOptionListViewItem::primaryText */ -/*! +/* \var HbStyleOptionListViewItem::role Defines role of an model item, from which content is read. @@ -52,7 +52,7 @@ \sa HbStyleOptionListViewItem::content */ -/*! +/* \var HbStyleOptionListViewItem::index This variable holds index of the primitive item required by css/xml layouting, when @@ -66,7 +66,7 @@ Default value is 0. */ -/*! +/* \var HbStyleOptionListViewItem::minimumLines This variable holds minimum count of lines reserved for secondary text (i.e. when index is 1). @@ -84,7 +84,7 @@ \sa HbListViewItem::setSecondaryTextRowCount() */ -/*! +/* \var HbStyleOptionListViewItem::maximumLines This variable holds minimum count of lines reserved for secondary text (i.e. when index is 1). @@ -102,7 +102,7 @@ \sa HbListViewItem::setSecondaryTextRowCount() */ -/*! +/* \var HbStyleOptionListViewItem::multilineSecondaryTextSupported This variable holds whether multine line secondary text is supported. @@ -114,14 +114,6 @@ \sa HbListViewItem::setSecondaryTextRowCount() */ - - -/*! - - \deprecated HbStyleOptionListViewItem::HbStyleOptionListViewItem() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionListViewItem::HbStyleOptionListViewItem() : HbStyleOptionAbstractViewItem(), role(Qt::DisplayRole), @@ -134,13 +126,6 @@ version = Version; } - -/*! - - \deprecated HbStyleOptionListViewItem::HbStyleOptionListViewItem(const HbStyleOptionListViewItem&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionListViewItem::HbStyleOptionListViewItem(const HbStyleOptionListViewItem &other) : HbStyleOptionAbstractViewItem(other), content(other.content), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionlistviewitem_p.h --- a/src/hbcore/style/hbstyleoptionlistviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionlistviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionListViewItem : public HbStyleOptionAbstractViewItem { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionmenuitem.cpp --- a/src/hbcore/style/hbstyleoptionmenuitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionmenuitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,18 +25,10 @@ #include "hbstyleoptionmenuitem_p.h" -/*! +/* \class HbStyleOptionMenuItem \brief HbStyleOptionMenuItem has the style component for menu item primitives */ - - -/*! - - \deprecated HbStyleOptionMenuItem::HbStyleOptionMenuItem() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionMenuItem::HbStyleOptionMenuItem() : text(), arrow(false), @@ -48,13 +40,6 @@ version = Version; } - -/*! - - \deprecated HbStyleOptionMenuItem::HbStyleOptionMenuItem(const HbStyleOptionMenuItem&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionMenuItem::HbStyleOptionMenuItem(const HbStyleOptionMenuItem &other) : HbStyleOption(other), text(other.text), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionmenuitem_p.h --- a/src/hbcore/style/hbstyleoptionmenuitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionmenuitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionMenuItem : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionmessagebox.cpp --- a/src/hbcore/style/hbstyleoptionmessagebox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionmessagebox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,19 +25,12 @@ #include "hbstyleoptionmessagebox_p.h" -/*! - \this class is deprecated. +/* + \class HbStyleOptionMessageBox \brief HbStyleOptionMessageBox has the style component for note primitives */ - -/*! - - \deprecated HbStyleOptionMessageBox::HbStyleOptionMessageBox() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionMessageBox::HbStyleOptionMessageBox() : HbStyleOptionPopup(), text(), @@ -50,12 +43,6 @@ version = Version; } -/*! - - \deprecated HbStyleOptionMessageBox::HbStyleOptionMessageBox(const HbStyleOptionMessageBox&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionMessageBox::HbStyleOptionMessageBox(const HbStyleOptionMessageBox &other) : HbStyleOptionPopup(other), text(other.text), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionmessagebox_p.h --- a/src/hbcore/style/hbstyleoptionmessagebox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionmessagebox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionMessageBox : public HbStyleOptionPopup { public: @@ -47,6 +47,7 @@ Qt::Alignment iconAlignment; //deprecated bool textWrapping; //deprecated enum MessageBoxType { + MessageTypeNone, MessageTypeInformation, MessageTypeQuestion, MessageTypeWarning diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionnavigationbutton.cpp --- a/src/hbcore/style/hbstyleoptionnavigationbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionnavigationbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,31 +25,18 @@ #include "hbstyleoptionnavigationbutton_p.h" -/*! +/* \class HbStyleOptionNavigationButton \brief HbStyleOptionNavigationButton has the style component for the navigation button */ - - -/*! - - \deprecated HbStyleOptionNavigationButton::HbStyleOptionNavigationButton() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionNavigationButton::HbStyleOptionNavigationButton() : HbStyleOption(), mode(QIcon::Normal), transparent(false) { type = Type; version = Version; } -/*! - \deprecated HbStyleOptionNavigationButton::HbStyleOptionNavigationButton(const HbStyleOptionNavigationButton&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionNavigationButton::HbStyleOptionNavigationButton(const HbStyleOptionNavigationButton &other) : HbStyleOption(other), mode(other.mode), transparent(other.transparent) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionnavigationbutton_p.h --- a/src/hbcore/style/hbstyleoptionnavigationbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionnavigationbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionNavigationButton : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionnotificationdialog.cpp --- a/src/hbcore/style/hbstyleoptionnotificationdialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionnotificationdialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,52 +25,25 @@ #include "hbstyleoptionnotificationdialog_p.h" -/*! +/* \class HbStyleOptionNotificationDialog \brief HbStyleOptionNotificationDialog has the style component for notification dialog. */ -/*! - \deprecated HbStyleOptionNotificationDialog::titleWrapping - is deprecated. Use wrappingTitle instead. -*/ - -/*! - \deprecated HbStyleOptionNotificationDialog::textWrapping - is deprecated. Use wrappingText instead. -*/ - - - -/*! - - \deprecated HbStyleOptionNotificationDialog::HbStyleOptionNotificationDialog() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionNotificationDialog::HbStyleOptionNotificationDialog() : - titleAlignment(Qt::AlignLeft|Qt::AlignVCenter), - textAlignment(Qt::AlignLeft|Qt::AlignVCenter), - iconAlignment(Qt::AlignCenter), - titleWrapping(false), - textWrapping(false), - isLink(false), - wrappingTitle(Hb::TextNoWrap), - wrappingText(Hb::TextNoWrap) + titleAlignment(Qt::AlignLeft|Qt::AlignVCenter), + textAlignment(Qt::AlignLeft|Qt::AlignVCenter), + iconAlignment(Qt::AlignCenter), + isLink(false), + titleTextWrapping(Hb::TextNoWrap), + textTextWrapping(Hb::TextNoWrap) { type = Type; version = Version; } - -/*! - - \deprecated HbStyleOptionNotificationDialog::HbStyleOptionNotificationDialog(const HbStyleOptionNotificationDialog&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionNotificationDialog::HbStyleOptionNotificationDialog( - const HbStyleOptionNotificationDialog &other) : + const HbStyleOptionNotificationDialog &other) : HbStyleOptionPopup(other), title(other.title), text(other.text), @@ -78,11 +51,9 @@ titleAlignment(other.titleAlignment), textAlignment(other.textAlignment), iconAlignment(other.iconAlignment), - titleWrapping(other.titleWrapping), - textWrapping(other.textWrapping), isLink(other.isLink), - wrappingTitle(other.wrappingTitle), - wrappingText(other.wrappingText) + titleTextWrapping(other.titleTextWrapping), + textTextWrapping(other.textTextWrapping) { type = Type; version = Version; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionnotificationdialog_p.h --- a/src/hbcore/style/hbstyleoptionnotificationdialog_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionnotificationdialog_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,7 @@ #include -//Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionNotificationDialog : public HbStyleOptionPopup { public: @@ -49,11 +49,9 @@ Qt::Alignment titleAlignment; Qt::Alignment textAlignment; Qt::Alignment iconAlignment; - bool titleWrapping; - bool textWrapping; bool isLink; - Hb::TextWrapping wrappingTitle; - Hb::TextWrapping wrappingText; + Hb::TextWrapping titleTextWrapping; + Hb::TextWrapping textTextWrapping; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionpopup.cpp --- a/src/hbcore/style/hbstyleoptionpopup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionpopup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,31 +25,17 @@ #include "hbstyleoptionpopup_p.h" -/*! +/* \class HbStyleOptionPopup \brief HbStyleOptionPopup has the style component for popup primitives */ - -/*! - - \deprecated HbStyleOptionPopup::HbStyleOptionPopup() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionPopup::HbStyleOptionPopup() { type = Type; version = Version; } - -/*! - - \deprecated HbStyleOptionPopup::HbStyleOptionPopup(const HbStyleOptionPopup&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionPopup::HbStyleOptionPopup(const HbStyleOptionPopup &other) : HbStyleOption(other) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionpopup_p.h --- a/src/hbcore/style/hbstyleoptionpopup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionpopup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -//Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionPopup : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionprogressbar.cpp --- a/src/hbcore/style/hbstyleoptionprogressbar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionprogressbar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,19 +27,12 @@ #include "hbstyleoptionprogressbar_p.h" -/*! +/* \class HbStyleOptionProgressBar \brief HbStyleOptionProgressBar has the style component for progress bar primitives */ - -/*! - - \deprecated HbStyleOptionProgressBar::HbStyleOptionProgressBar() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionProgressBar::HbStyleOptionProgressBar() : progressValue(0), minimum(0), @@ -60,14 +53,6 @@ type = Type; version = Version; } - - -/*! - - \deprecated HbStyleOptionProgressBar::HbStyleOptionProgressBar(const HbStyleOptionProgressBar&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionProgressBar::HbStyleOptionProgressBar(const HbStyleOptionProgressBar &other) : HbStyleOption(other), progressValue(other.progressValue), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionprogressdialog.cpp --- a/src/hbcore/style/hbstyleoptionprogressdialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionprogressdialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,18 +25,11 @@ #include "hbstyleoptionprogressdialog_p.h" -/*! +/* \class HbStyleOptionProgressDialog \brief HbStyleOptionProgressDialog has the style component for progress dialog primitives */ - -/*! - - \deprecated HbStyleOptionProgressDialog::HbStyleOptionProgressDialog() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionProgressDialog::HbStyleOptionProgressDialog() : HbStyleOption(), icon(), @@ -46,13 +39,6 @@ version = Version; } - -/*! - - \deprecated HbStyleOptionProgressDialog::HbStyleOptionProgressDialog(const HbStyleOptionProgressDialog&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionProgressDialog::HbStyleOptionProgressDialog(const HbStyleOptionProgressDialog &other) : HbStyleOption(other), icon(other.icon), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionprogressdialog_p.h --- a/src/hbcore/style/hbstyleoptionprogressdialog_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionprogressdialog_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -//Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionProgressDialog : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionpushbutton.cpp --- a/src/hbcore/style/hbstyleoptionpushbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionpushbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,19 +26,11 @@ #include "hbstyleoptionpushbutton_p.h" #include "hbicon.h" -/*! +/* \class HbStyleOptionPushButton \brief HbStyleOptionPushButton has the style component for push button primitives */ - - -/*! - - \deprecated HbStyleOptionPushButton::HbStyleOptionPushButton() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionPushButton::HbStyleOptionPushButton() : background(), icon(), text(),backgroundFrameDrawer(0) { @@ -46,13 +38,6 @@ version = Version; } - -/*! - - \deprecated HbStyleOptionPushButton::HbStyleOptionPushButton(const HbStyleOptionPushButton&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionPushButton::HbStyleOptionPushButton(const HbStyleOptionPushButton &other) : HbStyleOption(other), background(other.background), icon(other.icon), text(other.text),backgroundFrameDrawer(other.backgroundFrameDrawer) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionpushbutton_p.h --- a/src/hbcore/style/hbstyleoptionpushbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionpushbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionPushButton : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionratingslider.cpp --- a/src/hbcore/style/hbstyleoptionratingslider.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionratingslider.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,33 +27,18 @@ #include "hbstyleoptionratingslider_p.h" -/*! +/* \class HbStyleOptionProgressBar \brief HbStyleOptionProgressBar has the style component for progress bar primitives */ - -/*! - - \deprecated HbStyleOptionRatingSlider::HbStyleOptionRatingSlider() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionRatingSlider::HbStyleOptionRatingSlider() { type = Type; version = Version; } - - -/*! - - \deprecated HbStyleOptionRatingSlider::HbStyleOptionRatingSlider(const HbStyleOptionRatingSlider&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionRatingSlider::HbStyleOptionRatingSlider(const HbStyleOptionRatingSlider &other) : HbStyleOption(other), progressValue(other.progressValue), @@ -61,7 +46,10 @@ noOfIntervals(other.noOfIntervals), noOfStars(other.noOfStars), unRatedGraphicsName(other.unRatedGraphicsName), - ratedGraphicsName(other.ratedGraphicsName) + ratedGraphicsName(other.ratedGraphicsName), + disableState(false), + pressedState(false) + { type = Type; version = Version; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionratingslider_p.h --- a/src/hbcore/style/hbstyleoptionratingslider_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionratingslider_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -//Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionRatingSlider : public HbStyleOption { public: @@ -45,6 +45,8 @@ int noOfStars; QString unRatedGraphicsName; QString ratedGraphicsName; + bool disableState; + bool pressedState; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionscrollbar.cpp --- a/src/hbcore/style/hbstyleoptionscrollbar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionscrollbar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,18 +25,12 @@ #include "hbstyleoptionscrollbar_p.h" -/*! +/* \class HbStyleOptionScrollBar \brief HbStyleOptionScrollBar has the style component for scroll bar primitives */ -/*! - - \deprecated HbStyleOptionScrollBar::HbStyleOptionScrollBar() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionScrollBar::HbStyleOptionScrollBar() : orientation(Qt::Vertical), thumbPressed(false), @@ -47,12 +41,7 @@ version = Version; } -/*! - \deprecated HbStyleOptionScrollBar::HbStyleOptionScrollBar(const HbStyleOptionScrollBar&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionScrollBar::HbStyleOptionScrollBar(const HbStyleOptionScrollBar &other) : HbStyleOption(other), orientation(other.orientation) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionscrollbar_p.h --- a/src/hbcore/style/hbstyleoptionscrollbar_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionscrollbar_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -//Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionScrollBar : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionsignalindicator.cpp --- a/src/hbcore/style/hbstyleoptionsignalindicator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionsignalindicator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,18 +25,12 @@ #include "hbstyleoptionsignalindicator_p.h" -/*! +/* \class HbStyleOptionSignalIndicator \brief HbStyleOptionSignalIndicator has the style component for the signal indicator */ -/*! - - \deprecated HbStyleOptionSignalIndicator::HbStyleOptionSignalIndicator() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionSignalIndicator::HbStyleOptionSignalIndicator() : HbStyleOption(), networkMode(0), @@ -47,12 +41,6 @@ version = Version; } -/*! - - \deprecated HbStyleOptionSignalIndicator::HbStyleOptionSignalIndicator(const HbStyleOptionSignalIndicator&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionSignalIndicator::HbStyleOptionSignalIndicator(const HbStyleOptionSignalIndicator &other) : HbStyleOption(other), networkMode(other.networkMode), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionsignalindicator_p.h --- a/src/hbcore/style/hbstyleoptionsignalindicator_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionsignalindicator_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionSignalIndicator : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionslider.cpp --- a/src/hbcore/style/hbstyleoptionslider.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionslider.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,18 +25,12 @@ #include "hbstyleoptionslider_p.h" -/*! +/* \class HbStyleOptionSlider \brief HbStyleOptionSlider has the style component for slider primitives */ -/*! - - \deprecated HbStyleOptionSlider::HbStyleOptionSlider() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionSlider::HbStyleOptionSlider() : maximum(0), minimum(0), @@ -61,12 +55,7 @@ type = Type; version = Version; } -/*! - \deprecated HbStyleOptionSlider::HbStyleOptionSlider(const HbStyleOptionSlider&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionSlider::HbStyleOptionSlider(const HbStyleOptionSlider &other) : HbStyleOption(other), maximum(other.maximum), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionslider_p.h --- a/src/hbcore/style/hbstyleoptionslider_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionslider_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionSlider : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionstatusbar.cpp --- a/src/hbcore/style/hbstyleoptionstatusbar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionstatusbar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,31 +25,17 @@ #include "hbstyleoptionstatusbar_p.h" -/*! +/* \class HbStyleOptionStatusBar \brief HbStyleOptionStatusBar has the style component for statusbar */ - -/*! - - \deprecated HbStyleOptionStatusBar::HbStyleOptionStatusBar() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionStatusBar::HbStyleOptionStatusBar() : transparent(false) { type = Type; version = Version; } - -/*! - - \deprecated HbStyleOptionStatusBar::HbStyleOptionStatusBar(const HbStyleOptionStatusBar&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionStatusBar::HbStyleOptionStatusBar(const HbStyleOptionStatusBar &other) : HbStyleOption(other) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptionstatusbar_p.h --- a/src/hbcore/style/hbstyleoptionstatusbar_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptionstatusbar_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,7 @@ #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionStatusBar : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontitlepane.cpp --- a/src/hbcore/style/hbstyleoptiontitlepane.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontitlepane.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,18 +25,12 @@ #include "hbstyleoptiontitlepane_p.h" -/*! +/* \class HbStyleOptionTitlePane \brief HbStyleOptionTitlePane has the style component for title pane */ -/*! - - \deprecated HbStyleOptionTitlePane::HbStyleOptionTitlePane() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionTitlePane::HbStyleOptionTitlePane() : HbStyleOption(), caption(""), mode(QIcon::Normal), transparent(false) { @@ -44,13 +38,6 @@ version = Version; } - -/*! - - \deprecated HbStyleOptionTitlePane::HbStyleOptionTitlePane(const HbStyleOptionTitlePane&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionTitlePane::HbStyleOptionTitlePane(const HbStyleOptionTitlePane &other) : HbStyleOption(other), caption(other.caption), mode(other.mode), transparent(other.transparent) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontitlepane_p.h --- a/src/hbcore/style/hbstyleoptiontitlepane_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontitlepane_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionTitlePane : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontoolbutton.cpp --- a/src/hbcore/style/hbstyleoptiontoolbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontoolbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,17 +25,12 @@ #include -/*! +/* \class HbStyleOptionToolButton \brief HbStyleOptionToolButton has the style component for tool button primitives */ -/*! - \deprecated HbStyleOptionToolButton::HbStyleOptionToolButton() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionToolButton::HbStyleOptionToolButton() : HbStyleOption(HbSO_ToolButton), icon(), customBackground(), @@ -50,12 +45,7 @@ version = Version; } -/*! - \deprecated HbStyleOptionToolButton::HbStyleOptionToolButton(const HbStyleOptionToolButton&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionToolButton::HbStyleOptionToolButton(const HbStyleOptionToolButton &other) : HbStyleOption(other), icon(other.icon), diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontoolbutton_p.h --- a/src/hbcore/style/hbstyleoptiontoolbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontoolbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionToolButton : public HbStyleOption { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontooltip.cpp --- a/src/hbcore/style/hbstyleoptiontooltip.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontooltip.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,29 +25,18 @@ #include "hbstyleoptiontooltip_p.h" -/*! +/* \class HbStyleOptionToolTip \brief HbStyleOptionToolTip has the style component for tooltip primitives */ -/*! - \deprecated HbStyleOptionToolTip::HbStyleOptionToolTip() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionToolTip::HbStyleOptionToolTip() { type = Type; version = Version; } -/*! - - \deprecated HbStyleOptionToolTip::HbStyleOptionToolTip(const HbStyleOptionToolTip&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionToolTip::HbStyleOptionToolTip(const HbStyleOptionToolTip &other) : HbStyleOptionPopup(other) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontooltip_p.h --- a/src/hbcore/style/hbstyleoptiontooltip_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontooltip_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionToolTip : public HbStyleOptionPopup { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontreeviewitem.cpp --- a/src/hbcore/style/hbstyleoptiontreeviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontreeviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,23 +25,18 @@ #include "hbstyleoptiontreeviewitem_p.h" -/*! +/* \class HbStyleOptionTreeViewItem \brief HbStyleOptionTreeViewItem has the style component for tree view item primitives */ -/*! +/* \var HbStyleOptionTreeViewItem::expanded This variable holds whether tree item is expanded or collapsed. */ -/*! - \deprecated HbStyleOptionTreeViewItem::HbStyleOptionTreeViewItem() - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionTreeViewItem::HbStyleOptionTreeViewItem() : HbStyleOptionListViewItem(), expanded(false) @@ -50,12 +45,7 @@ version = Version; } -/*! - \deprecated HbStyleOptionTreeViewItem::HbStyleOptionTreeViewItem(const HbStyleOptionTreeViewItem&) - is deprecated. Styleoptions will not be public. - -*/ HbStyleOptionTreeViewItem::HbStyleOptionTreeViewItem(const HbStyleOptionTreeViewItem &other) : HbStyleOptionListViewItem(other), expanded(other.expanded) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleoptiontreeviewitem_p.h --- a/src/hbcore/style/hbstyleoptiontreeviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleoptiontreeviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include -// Deprecated + class HB_CORE_PRIVATE_EXPORT HbStyleOptionTreeViewItem : public HbStyleOptionListViewItem { public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleparameters.cpp --- a/src/hbcore/style/hbstyleparameters.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleparameters.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,7 @@ public: HbStyleParametersPrivate(); - QList params; + QList keys; QList values; }; HbStyleParametersPrivate::HbStyleParametersPrivate() @@ -72,7 +72,7 @@ */ int HbStyleParameters::count() { - return d_ptr->params.count(); + return d_ptr->keys.count(); } /*! @@ -80,23 +80,31 @@ Returns the index of the parameter with given name. - \param param name of the parameter + \param key name of the parameter \return index of given parameter */ -int HbStyleParameters::indexOf( const QString& param ) +int HbStyleParameters::indexOf( const QString& key ) { - return d_ptr->params.indexOf(param); + return d_ptr->keys.indexOf(key); } /*! Returns the name of the parameter at given index. \param index position of the parameter - \return name of the parameter + \return key name of the parameter +*/ +QString HbStyleParameters::key( int index ) +{ + return d_ptr->keys.at(index); +} + +/*! + Equals to key(index). */ QString HbStyleParameters::parameter( int index ) { - return d_ptr->params.at(index); + return key(index); } /*! @@ -113,14 +121,14 @@ /*! Returns the value of the parameter with given name. - This is a convenience method. Equals to calling value(indexOf(param)). + This is a convenience method. Equals to calling value(indexOf(key)). - \param param name of the parameter + \param key name of the parameter \return value of the parameter */ -QVariant HbStyleParameters::value( const QString ¶m ) +QVariant HbStyleParameters::value( const QString &key ) { - int index = indexOf(param); + int index = indexOf(key); if ( index >= 0 && index < d_ptr->values.count() ) return value(index); @@ -154,12 +162,12 @@ /*! Add a new parameter. - \param param name of the parameter to be added + \param key name of the parameter to be added \param value default value */ -void HbStyleParameters::addParameter( const QString ¶m, const QVariant &value ) +void HbStyleParameters::addParameter( const QString &key, const QVariant &value ) { - d_ptr->params.append(param); + d_ptr->keys.append(key); d_ptr->values.append(value); } @@ -170,16 +178,16 @@ */ void HbStyleParameters::removeAt( int index ) { - d_ptr->params.removeAt(index); + d_ptr->keys.removeAt(index); d_ptr->values.removeAt(index); } /*! \internal */ -QList &HbStyleParameters::params() +QList &HbStyleParameters::keys() { - return d_ptr->params; + return d_ptr->keys; } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/hbstyleparameters.h --- a/src/hbcore/style/hbstyleparameters.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/hbstyleparameters.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,21 +38,22 @@ virtual ~HbStyleParameters(); int count(); - int indexOf( const QString& param ); + int indexOf( const QString& key ); + QString key( int index ); QString parameter( int index ); QVariant value( int index ); - QVariant value( const QString ¶m ); + QVariant value( const QString &key ); void setValue( int index, const QVariant &value ); - void setValue( const QString ¶m, const QVariant &value ); + void setValue( const QString &key, const QVariant &value ); - void addParameter( const QString ¶m, const QVariant &value = QVariant() ); + void addParameter( const QString &key, const QVariant &value = QVariant() ); void removeAt( int index ); private: friend class HbStyle; - QList ¶ms(); + QList &keys(); QList &values(); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/style/style.pri --- a/src/hbcore/style/style.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/style/style.pri Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,6 @@ PUBLIC_HEADERS += $$PWD/hbstyle.h PUBLIC_HEADERS += $$PWD/hbstyleparameters.h - PRIVATE_HEADERS += $$PWD/hbstyleoption_p.h PRIVATE_HEADERS += $$PWD/hbstyleoptionabstractviewitem_p.h PRIVATE_HEADERS += $$PWD/hbstyleoptioncheckbox_p.h @@ -61,7 +60,6 @@ PRIVATE_HEADERS += $$PWD/hbstyleoptionratingslider_p.h PRIVATE_HEADERS += $$PWD/hbstyleoptioncombobox_p.h PRIVATE_HEADERS += $$PWD/hbstyleoptioninputdialog_p.h -PRIVATE_HEADERS += $$PWD/hbstyleinterface_p.h PRIVATE_HEADERS += $$PWD/hbstyle_p.h PRIVATE_HEADERS += $$PWD/hbstyleoptionsliderelement_p.h PRIVATE_HEADERS += $$PWD/hbstyleoptionprogresssliderhandle_p.h @@ -102,7 +100,6 @@ SOURCES += $$PWD/hbstyleoptiontooltip.cpp SOURCES += $$PWD/hbstyleoptiontreeviewitem.cpp SOURCES += $$PWD/hbstyleparameters.cpp -SOURCES += $$PWD/hbstyleinterface.cpp SOURCES += $$PWD/hbstyleoptiondataform.cpp SOURCES += $$PWD/hbstyleoptiondatagroup.cpp SOURCES += $$PWD/hbstyleoptiondatagroupheadingwidget.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbdereferencer_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/svgext/hbnvgdecoder/hbdereferencer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,142 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HB_DEREFERENCER_P_H +#define HB_DEREFERENCER_P_H + +#include +#include + +#include "hbnvg_p.h" +#include "hbnvgexception_p.h" + +class HbDereferencer +{ +#define DEREF_PTR(TOTYPE, Offset, Size) do {\ + checkOutOfBound(Offset + Size); \ + return * (TOTYPE *)&mReadStream[mTotalRead + Offset];\ + } while (0) +public: + + HbDereferencer(quint8* buf, qint32 length) + : mTotalRead(0), + mDataLength(length), + mReadStream((unsigned char*)buf) + { + } + + HbDereferencer(const QByteArray& buffer) + : mTotalRead(0), + mDataLength(buffer.length()), + mReadStream((unsigned char*)buffer.data()) + { + } + + void skip(qint32 length) + { + checkOutOfBound(length); + mTotalRead += length; + } + + qint16 derefInt16(qint16 at = 0) + { + DEREF_PTR(qint16, at, sizeof(qint16)); + } + operator qint16() + { + return derefInt16(); + } + + qint32 derefInt32(qint32 at = 0) + { + DEREF_PTR(qint32, at, sizeof(qint32)); + } + + operator qint32() + { + return derefInt32(); + } + + qint8 derefInt8(qint32 at = 0) + { + DEREF_PTR(qint8, at, sizeof(qint8)); + } + + operator qint8() + { + return derefInt8(); + } + + quint8* derefInt8Array(qint32 length, qint32 at = 0) + { + checkOutOfBound(at + length); + return (quint8 *)&mReadStream[mTotalRead + at]; + } + + float derefReal32(qint32 at = 0) + { + DEREF_PTR(float, at, sizeof(float)); + } + operator float() + { + return derefReal32(); + } + + void assertBound(qint32 length, qint32 at = 0) + { + checkOutOfBound(at + length); + } + + quint8* getPtr() const + { + return mReadStream; + } + + qint32 getLength() const + { + return mDataLength; + } + + qint32 getReadingPos() const + { + return mTotalRead; + } + +private: + void checkOutOfBound(qint32 length) + { + if (mTotalRead + length > mDataLength || + mTotalRead + length < 0){ + throw HbNvgException(HbNvgEngine::NvgErrEof); + } + } + + qint32 mTotalRead; + qint32 mDataLength; + quint8* mReadStream; +}; + +#endif + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvg.cpp --- a/src/hbcore/svgext/hbnvgdecoder/hbnvg.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvg.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,8 +28,8 @@ #include "hbnvgutil_p.h" #include "hbnvgcsicon_p.h" #include "hbnvgiconfactory_p.h" -#include "hbnvgicondata_p.h" #include "hbnvgexception_p.h" +#include "hbdereferencer_p.h" #include @@ -42,29 +42,6 @@ const qint32 NVG_VIEWBOX_HEIGHT_OFS = 48; const qint32 NvgOffsetReserved1 = 6; -void HbNvgIconList::addNvgIcon(HbNvgIconFactory::HbNvgIconType type, HbNvgIcon * nvgIcon) -{ - if (type <= HbNvgIconFactory::NvgCs) { - if (icons[type]) { - delete icons[type]; - } - icons[type] = nvgIcon; - } -} - -HbNvgIcon * HbNvgIconList::getIcon(HbNvgIconFactory::HbNvgIconType type) -{ - if (type <= HbNvgIconFactory::NvgCs) { - return icons[type]; - } - return 0; -} - -HbNvgIconList::~HbNvgIconList() -{ - delete icons[HbNvgIconFactory::NvgCs]; -} - HbNvgEnginePrivate::HbNvgEnginePrivate(): mCurrentBufferSize(1, 1), mRotateAngle(0.0), @@ -72,8 +49,6 @@ mCentreY(0.0), mPreserveAspectSetting(HbNvgEngine::NvgPreserveAspectRatioXmidYmid), mSmilFitSetting(HbNvgEngine::NvgMeet), - mVgImageBinder(0), - mCreatingNvgIcon(false), mCurrentNvgIcon(0), mLastError(HbNvgEngine::NvgErrNone), mMirrored(false) @@ -84,9 +59,7 @@ HbNvgEnginePrivate::~HbNvgEnginePrivate() { -#ifdef OPENVG_OBJECT_CACHING - delete mCurrentNvgIcon; -#endif + delete mCurrentNvgIcon; } void HbNvgEnginePrivate::rotate(float angle, float centreX, float centreY) @@ -117,9 +90,7 @@ if (viewboxWidth > 0 && viewboxHeight > 0) { ret = QSize(viewboxWidth, viewboxHeight); - } else { - ret = QSize(0, 0); - } + } } return ret; } @@ -151,7 +122,6 @@ try { doDrawNvg(buffer, size); - } catch (const std::bad_alloc & e) { mLastError = HbNvgEngine::NvgErrNoMemory; } catch (const HbNvgException & e) { @@ -163,32 +133,6 @@ return mLastError; } -HbNvgIcon * HbNvgEnginePrivate::createNvgIcon(const QByteArray &buffer, const QSize& size) -{ - NVG_DEBUGP1("Creating NvgCsIcon"); - - mCurrentNvgIcon = 0; - -#ifdef OPENVG_OBJECT_CACHING - mCreatingNvgIcon = true; - - mLastError = drawNvg(buffer, size); - if (mLastError != NvgErrNone) { - delete mCurrentNvgIcon; - mCurrentNvgIcon = 0; - NVG_DEBUGP2("Creating NvgCsIcon failed %d\n", mLastError); - } - - mCreatingNvgIcon = false; -#else - QByteArray tempArray = buffer; - QSize tempSize = size; - Q_UNUSED(tempArray); - Q_UNUSED(tempSize); -#endif - return mCurrentNvgIcon; -} - void HbNvgEnginePrivate::doDrawNvg(const QByteArray & buffer, const QSize &size) { // if size is null then return without doing anything @@ -211,63 +155,14 @@ quint16 reserved1 = nvgIconData.derefInt16(NvgOffsetReserved1) & 0x03; HbNvgIconFactory::HbNvgIconType iconType = (HbNvgIconFactory::HbNvgIconType)(reserved1 & 0x03); -#ifdef OPENVG_OBJECT_CACHING - mCurrentNvgIcon = HbNvgIconFactory::create(iconType); - QScopedPointer nvgIcon(mCurrentNvgIcon); -#else - HbNvgIcon * nvGIcon = mIconList.getIcon(iconType); - if (!nvGIcon) { - mCurrentNvgIcon = HbNvgIconFactory::create(iconType); - mIconList.addNvgIcon(iconType, mCurrentNvgIcon); - } else { - mCurrentNvgIcon = nvGIcon; - } -#endif - + if (!mCurrentNvgIcon) { + mCurrentNvgIcon = HbNvgIconFactory::create(iconType); + } + mCurrentNvgIcon->setPreserveAspectRatio(mPreserveAspectSetting, mSmilFitSetting); mCurrentNvgIcon->rotate(mRotateAngle, mCentreX, mCentreY); - mCurrentNvgIcon->setVgImageBinder(mVgImageBinder); mCurrentNvgIcon->enableMirroring(mMirrored); - -#ifdef OPENVG_OBJECT_CACHING - if (mCreatingNvgIcon) { - mCurrentNvgIcon->create(buffer, size); - nvgIcon.take(); - } else { - mCurrentNvgIcon->directDraw(buffer, size); - } -#else mCurrentNvgIcon->directDraw(buffer, size); -#endif -} - -void HbNvgEnginePrivate::setBackgroundColor(const QColor &rgba8888Color) -{ - mBackgroundColor = rgba8888Color; -} - -void HbNvgEnginePrivate::clearBackground() -{ - quint32 rgba = (mBackgroundColor.rgba() << 8) | (mBackgroundColor.rgba() >> 24); - qint32 r, g, b, a; - r = (qint32)((rgba & 0xFF000000) >> 24); - g = (qint32)((rgba & 0x00FF0000) >> 16); - b = (qint32)((rgba & 0x0000FF00) >> 8); - a = (qint32)(rgba & 0x000000FF); - - r += r >> 7; g += g >> 7; b += b >> 7; a += a >> 7; - - const VGfloat Inverse255 = 1.0f / 256.0f; - const VGfloat clearColor[4] = {(Inverse255 * VGfloat(r)), - (Inverse255 * VGfloat(g)), - (Inverse255 * VGfloat(b)), - (Inverse255 * VGfloat(a)) - }; - - vgSeti(VG_SCISSORING, VG_FALSE); - vgSetfv(VG_CLEAR_COLOR, 4, clearColor); - vgClear(0, 0, mCurrentBufferSize.width(), mCurrentBufferSize.height()); - vgSeti(VG_SCISSORING, VG_TRUE); } /*! @@ -314,15 +209,6 @@ } /*! - Creates the nvgicon with the content \a buffer of size \a size and - return pointer to the HbNvgIcon. - */ -HbNvgIcon * HbNvgEngine::createNvgIcon(const QByteArray &buffer, const QSize &size) -{ - return d_ptr->createNvgIcon(buffer, size); -} - -/*! Draw the nvg graphic with the content \a buffer of size \a size. */ HbNvgEngine::HbNvgErrorType HbNvgEngine::drawNvg(const QByteArray &buffer, const QSize &size) @@ -331,14 +217,6 @@ } /*! - Set the HbVgImageBinder \a imageBinder to the HbNvgEngine - */ -void HbNvgEngine::setVgImageBinder(HbVgImageBinder *imageBinder) -{ - d_ptr->setVgImageBinder(imageBinder); -} - -/*! Returns HbNvgEngine::HbNvgErrorType as draw status of the HbNvgEngine. */ HbNvgEngine::HbNvgErrorType HbNvgEngine::error()const @@ -346,27 +224,38 @@ return d_ptr->error(); } -/*! - Sets the \a rgba8888Color as background color of the nvg graphics. - */ -void HbNvgEngine::setBackgroundColor(const QColor &rgba8888Color) -{ - d_ptr->setBackgroundColor(rgba8888Color); -} - void HbNvgEngine::enableMirroring(bool mirroringMode) { d_ptr->enableMirroring(mirroringMode); } -/*! - Clears the background color of the nvg graphic. - */ + +HbNvgIcon * HbNvgEngine::createNvgIcon(const QByteArray &buffer, const QSize &size) +{ + // TODO @ Deprecated + Q_UNUSED(buffer); + Q_UNUSED(size); + return 0; +} + +void HbNvgEngine::setVgImageBinder(HbVgImageBinder *imageBinder) +{ + // TODO @ Deprecated + Q_UNUSED(imageBinder); +} + +void HbNvgEngine::setBackgroundColor(const QColor &rgba8888Color) +{ + // TODO @ Deprecated + Q_UNUSED(rgba8888Color); +} + void HbNvgEngine::clearBackground() { - d_ptr->clearBackground(); + // TODO @ Deprecated } + HbNvgEngine::HbNvgErrorType openVgErrorToHbNvgError(qint32 error) { HbNvgEngine::HbNvgErrorType symError = HbNvgEngine::NvgErrNone; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvg_p_p.h --- a/src/hbcore/svgext/hbnvgdecoder/hbnvg_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvg_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,24 +34,6 @@ class HbNvgIcon; class HbVgImageBinder; -class HbNvgIconList -{ -public: - HbNvgIconList() - { - icons[HbNvgIconFactory::NvgCs] = 0; - } - - void addNvgIcon(HbNvgIconFactory::HbNvgIconType type, HbNvgIcon * nvgIcon); - - HbNvgIcon * getIcon(HbNvgIconFactory::HbNvgIconType type); - - ~HbNvgIconList(); - -private: - HbNvgIcon * icons[HbNvgIconFactory::NvgCs + 1]; -}; - class HbNvgEnginePrivate { public : @@ -68,12 +50,6 @@ HbNvgEngine::HbNvgErrorType drawNvg(const QByteArray &buffer, const QSize &size); - HbNvgIcon * createNvgIcon(const QByteArray &buffer, const QSize &size); - - void setVgImageBinder(HbVgImageBinder *imageBinder) { - mVgImageBinder = imageBinder; - } - HbNvgEngine::HbNvgErrorType error()const { return mLastError; } @@ -82,10 +58,6 @@ mMirrored = mirroringMode; } - void setBackgroundColor(const QColor &rgba8888Color); - - void clearBackground(); - private : void doDrawNvg(const QByteArray &buffer, const QSize &size); @@ -98,7 +70,7 @@ private : QSize mCurrentBufferSize; - + VGfloat mRotateAngle; float mCentreX; float mCentreY; @@ -106,19 +78,13 @@ HbNvgEngine::HbNvgAlignType mPreserveAspectSetting; HbNvgEngine::HbNvgMeetType mSmilFitSetting; - QColor mBackgroundColor; - HbVgImageBinder * mVgImageBinder; - - bool mCreatingNvgIcon; HbNvgIcon * mCurrentNvgIcon; - HbNvgEngine::HbNvgErrorType mLastError; bool mMirrored; VGint mMatrixMode; VGfloat mImageMatrix[9]; VGfloat mPathMatrix[9]; - HbNvgIconList mIconList; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgcsicon.cpp --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgcsicon.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvgcsicon.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,10 +24,10 @@ ****************************************************************************/ #include "hbnvgcsicon_p.h" -#include "hbnvgicondata_p.h" #include "hbnvgfittoviewbox_p.h" #include "hbnvgutil_p.h" #include "hbnvgexception_p.h" +#include "hbdereferencer_p.h" #include #include @@ -118,33 +118,18 @@ */ HbNvgCsIcon::HbNvgCsIcon() - : mPaintFill(VG_INVALID_HANDLE), + :mPaintFill(VG_INVALID_HANDLE), mPaintStroke(VG_INVALID_HANDLE), mVgPath(VG_INVALID_HANDLE), mLastPathDataType(0), mDoFill(VG_FALSE), mDoStroke(VG_FALSE), - mCreatingNvgIcon(0), mPreserveAspectSetting(HbNvgEngine::NvgPreserveAspectRatioXmidYmid), mSmilFitSetting(HbNvgEngine::NvgMeet), - mNvgIconData(0), - mLastFillPaintType(0), - mLastStrokePaintType(0), - mLastFillPaintColor(0), - mLastStrkePaintColor(0), - mResetFillPaint(0), - mResetStrokePaint(0), mMirrored(false) { } -void HbNvgCsIcon::setIconData(const QByteArray &buffer) -{ - mNvgIconData = new HbNvgIconData(buffer.size()); - Q_CHECK_PTR(mNvgIconData); - Q_CHECK_PTR(mNvgIconData); -} - HbNvgCsIcon::~HbNvgCsIcon() { if (mPaintFill) { @@ -159,17 +144,6 @@ vgSetPaint(VG_INVALID_HANDLE, VG_FILL_PATH); vgSetPaint(VG_INVALID_HANDLE, VG_STROKE_PATH); - - delete mNvgIconData; -} - - -void HbNvgCsIcon::setViewBox(float x, float y, float w, float h) -{ - mViewBoxX = x; - mViewBoxY = y; - mViewBoxW = w; - mViewBoxH = h; } /*! @@ -205,23 +179,11 @@ */ void HbNvgCsIcon ::directDraw(const QByteArray &buffer, const QSize &targetSize) { - drawCommandSection(buffer, targetSize, 0); + drawCommandSection(buffer, targetSize); } -/*! - Create the nvg graphic data \a buffer of size \a targetSize - and return the status of the draw. -*/ -void HbNvgCsIcon::create(const QByteArray &buffer, const QSize& targetSize) -{ - drawCommandSection(buffer, targetSize, 1); -} - -void HbNvgCsIcon::drawCommandSection(const QByteArray &buffer, const QSize & targetSize, - qint32 objectCaching) -{ - mCreatingNvgIcon = objectCaching; - +void HbNvgCsIcon::drawCommandSection(const QByteArray &buffer, const QSize & targetSize) +{ HbDereferencer iconData(buffer); qint16 headerSize = iconData.derefInt16(NVG_HEADERSIZE_OFS); quint8 nvgVersion = iconData.derefInt8(NVG_VERSION_OFS); @@ -254,8 +216,6 @@ // Everything gets restored to the original values before we return. vgLoadMatrix(currentPathMatrix); -// applyScissoring(currentPathMatrix, targetSize); - /* * set the rotation angle if available */ @@ -391,9 +351,7 @@ strokeWidth = commandSection->derefReal32(); } - COND_COM_OC(mCreatingNvgIcon, - addSetStrokeWidthCommand(strokeWidth), - vgSetf(VG_STROKE_LINE_WIDTH, strokeWidth)); + vgSetf(VG_STROKE_LINE_WIDTH, strokeWidth); } break; case CMD_SET_STROKE_MITER_LIMIT: { @@ -413,9 +371,7 @@ miterLimit = commandSection->derefReal32(); } - COND_COM_OC(mCreatingNvgIcon, - addSetStrokeMiterLimitCommand(miterLimit), - vgSetf(VG_STROKE_MITER_LIMIT, miterLimit)); + vgSetf(VG_STROKE_MITER_LIMIT, miterLimit); } break; case CMD_SET_STROKE_LINE_JOIN_CAP: { @@ -450,10 +406,8 @@ break; } - COND_COM_OC(mCreatingNvgIcon, - addStrokeLineJoinCapCommand(capStyle, lineJoinStyle), - vgSeti(VG_STROKE_CAP_STYLE, capStyle); - vgSeti(VG_STROKE_JOIN_STYLE, lineJoinStyle);); + vgSeti(VG_STROKE_CAP_STYLE, capStyle); + vgSeti(VG_STROKE_JOIN_STYLE, lineJoinStyle); } break; default: { @@ -505,74 +459,19 @@ Q_CHECK_PTR(viewBoxTx); QScopedPointer viewboxTrnsfr(viewBoxTx); - /* - * this is bit unreadable, - * need to find a better design to separate the object caching solution from normal rendering, - */ - - COND_COM_OC_NOC( { - if (mCreatingNvgIcon) { - setViewBox(viewboxX, viewboxY, viewboxW, viewboxH); - } else { - viewboxTrnsfr->setAllignment(mPreserveAspectSetting); - viewboxTrnsfr->setScaling(mSmilFitSetting); - - if (viewboxW > 0 && viewboxH > 0) { - viewboxTrnsfr->setViewBox(viewboxX, viewboxY, viewboxW, viewboxH); - } - - qint32 width = aTargetSize.width(); - qint32 height = aTargetSize.height(); - - viewboxTrnsfr->setWindowViewportTrans(QRect(0, 0, width, height), QSize(0, 0)); - } - }, { - viewboxTrnsfr->setAllignment(mPreserveAspectSetting); - viewboxTrnsfr->setScaling(mSmilFitSetting); - - if (viewboxW > 0 && viewboxH > 0) { - viewboxTrnsfr->setViewBox(viewboxX, viewboxY, viewboxW, viewboxH); - } - - qint32 width = targetSize.width(); - qint32 height = targetSize.height(); + viewboxTrnsfr->setAllignment(mPreserveAspectSetting); + viewboxTrnsfr->setScaling(mSmilFitSetting); - viewboxTrnsfr->setWindowViewportTrans(QRect(0, 0, width, height), QSize(0, 0)); - }); -} - -void HbNvgCsIcon::applyScissoring(VGfloat *aMatrix, const QSize& targetSize) -{ - /* - * calculate the rectangle with respect to the transformation applied - * and set the scissoring rect - */ - QPoint leftBottom = getTranslatedPoint(aMatrix, QPoint(0, 0)); - QPoint leftTop = getTranslatedPoint(aMatrix, QPoint(0, targetSize.height())); - QPoint rightBottom = getTranslatedPoint(aMatrix, QPoint(targetSize.width(), 0)); - QPoint rightTop = getTranslatedPoint(aMatrix, QPoint(targetSize.width(), targetSize.height())); + if (viewboxW > 0 && viewboxH > 0) { + viewboxTrnsfr->setViewBox(viewboxX, viewboxY, viewboxW, viewboxH); + } - VGfloat minX = leftBottom.x(); - VGfloat minY = leftBottom.y(); - VGfloat maxX = leftBottom.x(); - VGfloat maxY = leftBottom.y(); - - minX = minVal4(leftBottom.x(), leftTop.x(), rightBottom.x(), rightTop.x()); - minY = minVal4(leftBottom.y(), leftTop.y(), rightBottom.y(), rightTop.y()); + qint32 width = targetSize.width(); + qint32 height = targetSize.height(); - maxX = maxVal4(leftBottom.x(), leftTop.x(), rightBottom.x(), rightTop.x()); - maxY = maxVal4(leftBottom.y(), leftTop.y(), rightBottom.y(), rightTop.y()); - - VGfloat newW = maxX - minX; - VGfloat newH = maxY - minY; - - VGint clipRect[] = {minX, minY, newW, newH}; - - vgSeti(VG_SCISSORING, VG_TRUE); - vgSetiv(VG_SCISSOR_RECTS, 4, clipRect); + viewboxTrnsfr->setWindowViewportTrans(QRect(0, 0, width, height), QSize(0, 0)); } - HbNvgEngine::HbNvgErrorType HbNvgCsIcon::initializeGc() { if (mPaintFill == VG_INVALID_HANDLE) { @@ -687,8 +586,6 @@ void HbNvgCsIcon::setFillPaint(HbDereferencer *iconData) { - COND_COM_OC_OOC(register qint32 drawingMode = mCreatingNvgIcon); - quint32 commonData = iconData->derefInt32(); quint32 paintType = commonData & 0x07; quint16 specifcData = (commonData >> 16) & 0xff; @@ -696,15 +593,7 @@ switch (paintType) { case PAINT_LGRAD: { mGradPaintFill = mPaintFill; - COND_COM_OC_OOC( - if (mCreatingNvgIcon) { - // CNVGCSIcon will destroy the paint handle - mGradPaintFill = vgCreatePaint(); - if (mGradPaintFill == VG_INVALID_HANDLE) { - throw HbNvgException(openVgErrorToHbNvgError(vgGetError())); - } - }); - + // gradient data, the data will be word aligned float* gradData = (float*)iconData->derefInt8Array(4 * sizeof(VGfloat), sizeof(float)); @@ -721,31 +610,17 @@ gradMatrix1[2], gradMatrix1[5], 1.0f }; - COND_COM_OC(drawingMode, - addLinearGradientCommand(4, gradData, gradMatrix, mGradPaintFill), - vgLoadMatrix(gradMatrix);); + vgLoadMatrix(gradMatrix); Q_UNUSED(identityMatrix); } else { - COND_COM_OC(drawingMode, - addLinearGradientCommand(4, gradData, (VGfloat*)identityMatrix, mGradPaintFill), - vgLoadIdentity()); + vgLoadIdentity(); } - - COND_COM_OC(drawingMode, ; , - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE)); + vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); } break; case PAINT_RGRAD: { mGradPaintFill = mPaintFill; - - COND_COM_OC_OOC( - if (mCreatingNvgIcon) { - mGradPaintFill = vgCreatePaint(); - if (mGradPaintFill == VG_INVALID_HANDLE) { - throw HbNvgException(openVgErrorToHbNvgError(vgGetError())); - } - }); - + // gradient data, the data will be word aligned float* gradData = (float*)iconData->derefInt8Array(4 * sizeof(VGfloat), sizeof(quint32)); @@ -762,18 +637,12 @@ gradMatrix1[2], gradMatrix1[5], 1.0f }; - COND_COM_OC(drawingMode, - addRadialGradientCommand(5, gradData, gradMatrix, mGradPaintFill), - vgLoadMatrix(gradMatrix)); + vgLoadMatrix(gradMatrix); Q_UNUSED(identityMatrix); } else { - COND_COM_OC(drawingMode, - addRadialGradientCommand(5, gradData, (VGfloat*)identityMatrix, mGradPaintFill), - vgLoadIdentity()); + vgLoadIdentity(); } - - COND_COM_OC(drawingMode, ; , - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE)); + vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); } break; case PAINT_FLAT: { @@ -781,10 +650,8 @@ rgba = (rgba & 0xffffff00) | mFillAlpha; - COND_COM_OC(drawingMode, - addSetColorCommand(rgba), - vgSetParameteri(mPaintFill, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR); - vgSetColor(mPaintFill, rgba)); + vgSetParameteri(mPaintFill, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR); + vgSetColor(mPaintFill, rgba); } break; default: { @@ -894,28 +761,18 @@ paintMode = VG_FILL_PATH; } - COND_COM_OC(mCreatingNvgIcon, { - VGPath path = createPath(); + vgClearPath(mVgPath, VG_PATH_CAPABILITY_APPEND_TO); - if (path != VG_INVALID_HANDLE) { - vgAppendPathData(path, numSegments, pathSegments, pathData); - } else { - addPathData(numSegments, pathSegments, pathData); - } - addDrawPathCommand(path, paintMode); - }, { - vgClearPath(mVgPath, VG_PATH_CAPABILITY_APPEND_TO); + vgAppendPathData(mVgPath, numSegments, pathSegments, pathData); + vgDrawPath(mVgPath, paintMode); - vgAppendPathData(mVgPath, numSegments, pathSegments, pathData); - vgDrawPath(mVgPath, paintMode); - }); mDoStroke = VG_FALSE; mDoFill = VG_FALSE; } void HbNvgCsIcon::setTransform(HbDereferencer * iconData, quint32 & counter, const VGfloat* currentMatrix) { - COND_COM_OC(mCreatingNvgIcon, ; , vgLoadMatrix(currentMatrix)); + vgLoadMatrix(currentMatrix); quint32 commonData = iconData->derefInt32(); quint32 transformType = (commonData & 0x00ff0000) >> 16 ; @@ -966,19 +823,12 @@ } } - COND_COM_OC(mCreatingNvgIcon, - addSetTransformCommand(matrixTemp, 1), - vgMultMatrix(matrixTemp)); - } else { - COND_COM_OC(mCreatingNvgIcon, - addSetTransformCommand(matrixTemp, 0), ;); - } + vgMultMatrix(matrixTemp); + } } void HbNvgCsIcon::setStrokePaint(HbDereferencer * iconData) { - COND_COM_OC_OOC(register qint32 drawingMode = mCreatingNvgIcon;); - quint32 commonData = iconData->derefInt32(); quint32 strokeType = commonData & 0x07; quint16 specifcData = (commonData >> 16) & 0xff; @@ -987,21 +837,12 @@ case STROKE_LGRAD: { mGradPaintStroke = mPaintStroke; - COND_COM_OC_OOC( - if (mCreatingNvgIcon) { - mGradPaintStroke = vgCreatePaint(); - if (mGradPaintStroke == VG_INVALID_HANDLE) { - throw HbNvgException(HbNvgEngine::NvgErrBadHandle); - } - }); - // gradient data, the data will be word aligned float* gradData = (float*)iconData->derefInt8Array(4 * sizeof(VGfloat), sizeof(float)); - COND_COM_OC(drawingMode, ; , - vgSetParameteri(mGradPaintStroke, VG_PAINT_TYPE, VG_PAINT_TYPE_LINEAR_GRADIENT); - vgSetParameterfv(mGradPaintStroke, VG_PAINT_LINEAR_GRADIENT, 4, gradData); - vgSeti(VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER)); + vgSetParameteri(mGradPaintStroke, VG_PAINT_TYPE, VG_PAINT_TYPE_LINEAR_GRADIENT); + vgSetParameterfv(mGradPaintStroke, VG_PAINT_LINEAR_GRADIENT, 4, gradData); + vgSeti(VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER); if (specifcData & 0x1) { float* gradMatrix1 = (float*)iconData->derefInt8Array(6 * sizeof(VGfloat), @@ -1012,14 +853,10 @@ gradMatrix1[2], gradMatrix1[5], 1.0f }; - COND_COM_OC(drawingMode, - addStrokeLinearGradientCommand(4, gradData, gradMatrix, mGradPaintStroke), - vgLoadMatrix(gradMatrix)); + vgLoadMatrix(gradMatrix); Q_UNUSED(identityMatrix); } else { - COND_COM_OC(drawingMode, - addStrokeLinearGradientCommand(4, gradData, (VGfloat*)identityMatrix, mGradPaintStroke), - vgLoadIdentity()); + vgLoadIdentity(); } vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); } @@ -1027,20 +864,12 @@ case STROKE_RGRAD: { mGradPaintStroke = mPaintStroke; - COND_COM_OC_OOC( - if (mCreatingNvgIcon) { - mGradPaintStroke = vgCreatePaint(); - if (mGradPaintStroke == VG_INVALID_HANDLE) { - throw HbNvgException(HbNvgEngine::NvgErrBadHandle); - } - }); // gradient data, the data will be word aligned float* gradData = (float*)iconData->derefInt8Array(5 * sizeof(VGfloat), sizeof(quint32)); - COND_COM_OC(drawingMode, ; , - vgSetParameteri(mGradPaintStroke, VG_PAINT_TYPE, VG_PAINT_TYPE_RADIAL_GRADIENT); - vgSetParameterfv(mGradPaintStroke, VG_PAINT_RADIAL_GRADIENT, 5, gradData); - vgSeti(VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER)); + vgSetParameteri(mGradPaintStroke, VG_PAINT_TYPE, VG_PAINT_TYPE_RADIAL_GRADIENT); + vgSetParameterfv(mGradPaintStroke, VG_PAINT_RADIAL_GRADIENT, 5, gradData); + vgSeti(VG_MATRIX_MODE, VG_MATRIX_STROKE_PAINT_TO_USER); if (specifcData & 0x1) { float* gradMatrix1 = (float*)iconData->derefInt8Array(6 * sizeof(VGfloat), @@ -1050,14 +879,10 @@ gradMatrix1[2], gradMatrix1[5], 1.0f }; - COND_COM_OC(drawingMode, - addStrokeRadialGradientCommand(4, gradData, gradMatrix, mGradPaintStroke), - vgLoadMatrix(gradMatrix)); + vgLoadMatrix(gradMatrix); Q_UNUSED(identityMatrix); } else { - COND_COM_OC(drawingMode, - addStrokeRadialGradientCommand(4, gradData, (VGfloat*)identityMatrix, mGradPaintStroke), - vgLoadIdentity()); + vgLoadIdentity(); } vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); } @@ -1093,425 +918,13 @@ quint32 rgba = iconData->derefInt32(NVG_RGBA_OFS); rgba = (rgba & 0xffffff00) | mStrokeAlpha; // replace alpha - COND_COM_OC(drawingMode, - addStrokeSetColorCommand(rgba), - vgSetParameteri(mPaintStroke, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR); - vgSetColor(mPaintStroke, rgba)); + vgSetParameteri(mPaintStroke, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR); + vgSetColor(mPaintStroke, rgba); } break; } } -#ifdef OPENVG_OBJECT_CACHING -VGPath HbNvgCsIcon::createPath() -{ - VGPath path = VG_INVALID_HANDLE; - switch (mLastPathDataType) { - case NvgEightBitEncoding: { - path = vgCreatePath(VG_PATH_FORMAT_STANDARD, - VG_PATH_DATATYPE_S_16, 1.0f / 2.0f, 0.0f, 0, 0, - VG_PATH_CAPABILITY_APPEND_TO); - } - break; - - case NvgSixteenBitEncoding: { - path = vgCreatePath(VG_PATH_FORMAT_STANDARD, - VG_PATH_DATATYPE_S_16, 1.0f / 16.0f, 0.0f, 0, 0, - VG_PATH_CAPABILITY_APPEND_TO); - } - break; - - case NvgThirtyTwoBitEncoding: { - path = vgCreatePath(VG_PATH_FORMAT_STANDARD, - VG_PATH_DATATYPE_S_32, 1.0f / 65536.0f, 0.0f, 0, 0, - VG_PATH_CAPABILITY_APPEND_TO); - } - break; - default: - break; - } - return path; -} -#endif - -void HbNvgCsIcon::addPathData(VGint numSegments, const VGubyte * pathSegments, const void * pathData) -{ - mNvgIconData->encodeUint32(NvgPathData); - mNvgIconData->encodeUint32(numSegments); - mNvgIconData->encodeData(pathSegments, numSegments); - - qint32 coordinateCount = 0; - for (qint32 i = 0; i < numSegments; ++i) { - switch (pathSegments[i]) { - case VG_HLINE_TO: - case VG_VLINE_TO: - coordinateCount += 1; - break; - case VG_MOVE_TO: - case VG_LINE_TO: - case VG_SQUAD_TO: - coordinateCount += 2; - break; - case VG_QUAD_TO: - case VG_SCUBIC_TO: - coordinateCount += 4; - break; - case VG_SCCWARC_TO: - case VG_SCWARC_TO: - case VG_LCCWARC_TO: - case VG_LCWARC_TO: - coordinateCount += 5; - break; - case VG_CUBIC_TO: - coordinateCount += 6; - break; - default: - break; - } - } - mNvgIconData->encodeUint16(coordinateCount); - mNvgIconData->encodeData(pathData, coordinateCount * 4); -} - -void HbNvgCsIcon::addDrawPathCommand(VGPath path, VGbitfield paintMode) -{ - mNvgIconData->encodeUint32(NvgPath); - mNvgIconData->encodeUint32(path); - mNvgIconData->encodeUint32(paintMode); -} - -void HbNvgCsIcon::addLinearGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint) -{ - mNvgIconData->encodeUint32(NvgPaint); - addLinearGradientCommandData(paint, count, gradientData, gradientMatrix); -} - -void HbNvgCsIcon::addRadialGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint) -{ - mNvgIconData->encodeUint32(NvgPaint); - addRadialGradientCommandData(paint, count, gradientData, gradientMatrix); -} - -void HbNvgCsIcon::addSetColorCommand(VGuint rgba) -{ - mNvgIconData->encodeUint32(NvgPaint); - mNvgIconData->encodeUint32(VG_PAINT_TYPE_COLOR); - mNvgIconData->encodeUint32(rgba); -} - -void HbNvgCsIcon::addColorRampCommand(VGPaint paint) -{ - mNvgIconData->encodeUint32(NvgColorRamp); - mNvgIconData->encodeUint32(paint); -} - -void HbNvgCsIcon::addSetTransformCommand(const VGfloat* transformMatrix, int aFlag) -{ - mNvgIconData->encodeUint32(NvgTransform); - mNvgIconData->encodeData(transformMatrix, 9 * sizeof(VGfloat)); - mNvgIconData->encodeUint32(aFlag); -} - -void HbNvgCsIcon::addSetStrokeWidthCommand(VGfloat strokeWidth) -{ - mNvgIconData->encodeUint32(NvgStrokeWidth); - mNvgIconData->encodeReal32(strokeWidth); -} - -void HbNvgCsIcon::addSetStrokeMiterLimitCommand(VGfloat miterLimit) -{ - mNvgIconData->encodeUint32(NvgStrokeMiterLimit); - mNvgIconData->encodeReal32(miterLimit); -} - -void HbNvgCsIcon::addStrokeLineJoinCapCommand(VGint capStyle, VGint joinStyle) -{ - mNvgIconData->encodeUint32(NvgStrokeLineJoinCap); - mNvgIconData->encodeUint32(capStyle); - mNvgIconData->encodeUint32(joinStyle); -} - -void HbNvgCsIcon::addStrokeLinearGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint) -{ - mNvgIconData->encodeUint32(NvgStrokePaint); - addLinearGradientCommandData(paint, count, gradientData, gradientMatrix); -} - -void HbNvgCsIcon::addStrokeRadialGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint) -{ - mNvgIconData->encodeUint32(NvgStrokePaint); - addRadialGradientCommandData(paint, count, gradientData, gradientMatrix); -} - -void HbNvgCsIcon::addStrokeSetColorCommand(VGuint rgba) -{ - mNvgIconData->encodeUint32(NvgStrokePaint); - addSetColorCommandData(rgba); -} - -void HbNvgCsIcon::addStrokeColorRampCommand(VGPaint paint) -{ - mNvgIconData->encodeUint32(NvgStrokeColorRamp); - mNvgIconData->encodeUint32(paint); -} - -void HbNvgCsIcon::addLinearGradientCommandData(VGPaint paint, VGint count, VGfloat* gradientData, VGfloat* gradientMatrix) -{ - mNvgIconData->encodeUint32(VG_PAINT_TYPE_LINEAR_GRADIENT); - mNvgIconData->encodeUint32(paint); - mNvgIconData->encodeUint32(count); - mNvgIconData->encodeData(gradientData, count * sizeof(VGfloat)); - mNvgIconData->encodeData(gradientMatrix, 9 * sizeof(VGfloat)); -} - -void HbNvgCsIcon::addRadialGradientCommandData(VGPaint paint, VGint count, VGfloat* gradientData, VGfloat* gradientMatrix) -{ - mNvgIconData->encodeUint32(VG_PAINT_TYPE_RADIAL_GRADIENT); - mNvgIconData->encodeUint32(paint); - mNvgIconData->encodeUint32(count); - mNvgIconData->encodeData(gradientData, count * sizeof(VGfloat)); - mNvgIconData->encodeData(gradientMatrix, 9 * sizeof(VGfloat)); -} - -void HbNvgCsIcon::addSetColorCommandData(VGuint rgba) -{ - mNvgIconData->encodeUint32(VG_PAINT_TYPE_COLOR); - mNvgIconData->encodeUint32(rgba); -} - -HbNvgEngine::HbNvgErrorType HbNvgCsIcon::draw(const QSize &size) -{ - NVG_DEBUGP2("DRAWING NvgCsIcon %s, ", __FUNCTION__); - - HbNvgEngine::HbNvgErrorType error = HbNvgEngine::NvgErrNone; - - // Get Matrix modes and all caller matrices (must be restored afterwards) - updateClientMatrices(); - - //Exception handling has to happen - error = doDraw(size); - - // restore everything as we may have changed matrix mode - restoreClientMatrices(); - - return error; -} - -HbNvgEngine::HbNvgErrorType HbNvgCsIcon::doDraw(const QSize &size) -{ - HbNvgEngine::HbNvgErrorType ret = HbNvgEngine::NvgErrNone; - - vgSetPaint(mPaintFill, VG_FILL_PATH); - vgSetPaint(mPaintStroke, VG_STROKE_PATH); - mLastFillPaintColor = 0; - mLastStrkePaintColor = 0; - mLastFillPaintType = 0; - mLastStrokePaintType = 0; - - VGfloat currentPathMatrix[9]; - vgGetMatrix(currentPathMatrix); - - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - vgLoadMatrix(currentPathMatrix); - setRotation(); -#ifdef __MIRROR_ - vgScale(1.0f, -1.0f); - vgTranslate(0, (VGfloat)(-size.height())); -#endif - - setViewBoxToViewTransformation(size); - - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - - VGfloat currentMatrix[9]; - - vgGetMatrix(currentMatrix); - - mNvgIconData->beginRead(); - - while (!mNvgIconData->eof()) { - switch (mNvgIconData->readInt32()) { - case NvgPath: { - VGPath path = (VGPath)mNvgIconData->readInt32(); - VGPaintMode paintMode = (VGPaintMode)mNvgIconData->readInt32(); - - if (path == VG_INVALID_HANDLE) { - vgDrawPath(mVgPath, paintMode); - } else { - vgDrawPath(path, paintMode); - } - break; - } - case NvgPathData: { - if (mVgPath != VG_INVALID_HANDLE) { - - VGint numSegments = mNvgIconData->readInt32(); - - VGubyte *pSegArry = new VGubyte[numSegments]; - Q_CHECK_PTR(pSegArry); - QScopedArrayPointer pathSegments(pSegArry); - mNvgIconData->read(pathSegments.data(), numSegments); - - VGint coordinateCount = mNvgIconData->readInt32(); - - VGubyte *pDataArry = new VGubyte[coordinateCount * 4]; - Q_CHECK_PTR(pDataArry); - QScopedArrayPointer pathData(pDataArry); - mNvgIconData->read(pathData.data(), coordinateCount * 4); - - vgClearPath(mVgPath, VG_PATH_CAPABILITY_APPEND_TO); - vgAppendPathData(mVgPath, numSegments, pathSegments.data(), pathData.data()); - } - break; - } - case NvgPaint: { - drawPaint(mPaintFill, VG_MATRIX_FILL_PAINT_TO_USER, mLastFillPaintType, mLastFillPaintColor, VG_FILL_PATH); - break; - } - case NvgColorRamp: { - mNvgIconData->readInt32(); - break; - } - case NvgTransform: { - qint32 flag; - VGfloat transformMatrix[9]; - - mNvgIconData->read((quint8 *)transformMatrix, 9 * sizeof(VGfloat)); - flag = mNvgIconData->readInt32(); - - vgLoadMatrix(currentMatrix); - if (flag) { - vgMultMatrix(transformMatrix); - } - - break; - } - case NvgStrokeWidth: { - VGfloat strokeWidth = mNvgIconData->readReal32(); - vgSetf(VG_STROKE_LINE_WIDTH, strokeWidth); - break; - } - - case NvgStrokeMiterLimit: { - VGfloat miterLimit = mNvgIconData->readReal32(); - vgSetf(VG_STROKE_MITER_LIMIT, miterLimit); - break; - } - - case NvgStrokeLineJoinCap: { - VGint lineJoin = mNvgIconData->readInt32(); - VGint cap = mNvgIconData->readInt32(); - - vgSeti(VG_STROKE_JOIN_STYLE, (VGJoinStyle)lineJoin); - vgSeti(VG_STROKE_CAP_STYLE, (VGCapStyle)cap); - break; - } - case NvgStrokePaint: { - drawPaint(mPaintStroke, VG_MATRIX_STROKE_PAINT_TO_USER, mLastStrokePaintType, mLastStrkePaintColor, VG_STROKE_PATH); - break; - } - case NvgStrokeColorRamp: { - mNvgIconData->readInt32(); - break; - } - default: { - throw HbNvgException(HbNvgEngine::NvgErrCorrupt); - } - } - } - - mNvgIconData->endRead(); - - return ret; -} - -void HbNvgCsIcon::drawColorRamp(VGPaint paint) -{ - qint32 stopCount = mNvgIconData->readInt32(); - - VGfloat *crs = new VGfloat[stopCount]; - Q_CHECK_PTR(crs); - QScopedArrayPointer colorRamps(crs); - - mNvgIconData->read((quint8 *)colorRamps.data(), stopCount * sizeof(VGfloat)); - vgSetParameteri(paint, VG_PAINT_COLOR_RAMP_SPREAD_MODE, VG_COLOR_RAMP_SPREAD_PAD); - vgSetParameterfv(paint, VG_PAINT_COLOR_RAMP_STOPS, stopCount, colorRamps.data()); -} - -void HbNvgCsIcon::drawPaint(VGPaint paint, VGMatrixMode matrixMode, quint32 & lastPaintType, quint32 &lastPaintColor, VGPaintMode paintMode) -{ - VGPaintType paintType = (VGPaintType)mNvgIconData->readInt32(); - - if (paintType == VG_PAINT_TYPE_LINEAR_GRADIENT || - paintType == VG_PAINT_TYPE_RADIAL_GRADIENT) { - VGPaintParamType paintPType = VG_PAINT_LINEAR_GRADIENT; - if (paintType == VG_PAINT_TYPE_RADIAL_GRADIENT) { - paintPType = VG_PAINT_RADIAL_GRADIENT; - } - - VGPaint paintHandle = mNvgIconData->readInt32(); - qint32 count = mNvgIconData->readInt32(); - VGfloat gradientData[5]; - VGfloat gradientMatrix[9]; - - mNvgIconData->read((quint8 *)gradientData, count * sizeof(VGfloat)); - mNvgIconData->read((quint8 *)gradientMatrix, 9 * sizeof(VGfloat)); - - if (paintHandle) { - vgSetPaint(paintHandle, paintMode); - vgSeti(VG_MATRIX_MODE, matrixMode); - vgLoadMatrix(gradientMatrix); - if (paintMode == VG_FILL_PATH) { - mResetFillPaint = 1; - } else { - mResetStrokePaint = 1; - } - } else { - if (lastPaintType != (quint32)paintType) { - vgSetParameteri(paint, VG_PAINT_TYPE, paintType); - } - vgSetParameterfv(paint, paintPType, count, gradientData); - - vgSeti(VG_MATRIX_MODE, matrixMode); - vgLoadMatrix(gradientMatrix); - } - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - } else if (paintType == VG_PAINT_TYPE_COLOR) { - if (paintMode == VG_FILL_PATH && mResetFillPaint) { - mResetFillPaint = 0; - vgSetPaint(paint, paintMode); - } else if (paintMode == VG_STROKE_PATH && mResetStrokePaint) { - mResetStrokePaint = 0; - vgSetPaint(paint, paintMode); - } - quint32 color = static_cast(mNvgIconData->readInt32()); - if (lastPaintType != (quint32)paintType) { - vgSetParameteri(paint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR); - vgSetColor(paint, color); - } else { - if (lastPaintColor != color) { - vgSetColor(paint, color); - } - } - lastPaintColor = color; - } else { - throw HbNvgException(HbNvgEngine::NvgErrCorrupt); - } - lastPaintType = paintType; -} - -void HbNvgCsIcon::setViewBoxToViewTransformation(const QSize &size) -{ - HbNvgFitToViewBoxImpl *viewBoxTx = new HbNvgFitToViewBoxImpl(); - Q_CHECK_PTR(viewBoxTx); - QScopedPointer fitToViewBoxImpl(viewBoxTx); - - fitToViewBoxImpl->setAllignment(mPreserveAspectSetting); - fitToViewBoxImpl->setScaling(mSmilFitSetting); - fitToViewBoxImpl->setViewBox(mViewBoxX, mViewBoxY, mViewBoxW, mViewBoxH); - fitToViewBoxImpl->setWindowViewportTrans(QRect(0, 0, size.width(), size.height()), QSize(0, 0)); -} - void HbNvgCsIcon::setRotation() { if (mRotationAngle) { @@ -1520,67 +933,3 @@ vgTranslate(-mRotationX, -mRotationY); } } - -void HbNvgCsIcon::updateClientMatrices() -{ - mMatrixMode = vgGeti(VG_MATRIX_MODE); - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - vgGetMatrix(mPathMatrix); - vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); - vgGetMatrix(mImageMatrix); - vgSeti(VG_MATRIX_MODE, mMatrixMode); -} - -void HbNvgCsIcon::restoreClientMatrices() -{ - vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE); - vgLoadMatrix(mPathMatrix); - vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE); - vgLoadMatrix(mImageMatrix); - vgSeti(VG_MATRIX_MODE, mMatrixMode); -} - -QPoint HbNvgCsIcon::getTranslatedPoint(VGfloat *trMatrix, const QPoint &point) -{ - QPoint trPoint; - - trPoint.setX(trMatrix[0] * point.x() + trMatrix[3] * point.y() + trMatrix[6]); - trPoint.setY(trMatrix[1] * point.x() + trMatrix[4] * point.y() + trMatrix[7]); - - return trPoint; -} - -VGfloat HbNvgCsIcon::minVal4(VGfloat x1, VGfloat x2, VGfloat x3, VGfloat x4) -{ - VGfloat min = x1; - - if (min > x2) { - min = x2; - } - if (min > x3) { - min = x3; - } - if (min > x4) { - min = x4; - } - - return min; -} - -VGfloat HbNvgCsIcon::maxVal4(VGfloat x1, VGfloat x2, VGfloat x3, VGfloat x4) -{ - VGfloat max = x1; - - if (max < x2) { - max = x2; - } - if (max < x3) { - max = x3; - } - if (max < x4) { - max = x4; - } - - return max; -} - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgcsicon_p.h --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgcsicon_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvgcsicon_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -47,7 +47,6 @@ }; class HbDereferencer; -class HbNvgIconData; class HbNvgEngine; class HbOpenVgHandleStore; class HbNvgFitToViewBoxImpl; @@ -73,9 +72,20 @@ virtual ~HbNvgCsIcon(); - virtual HbNvgEngine::HbNvgErrorType draw(const QSize &size); + HbNvgEngine::HbNvgErrorType draw(const QSize &size) + { + // TODO @ Deprecated, remove from base class + Q_UNUSED(size); + return HbNvgEngine::NvgErrNone; + } - void setViewBox(float x, float y, float w, float h) ; + void setViewBox(float x, float y, float w, float h) + { + mViewBoxX = x; + mViewBoxY = y; + mViewBoxW = w; + mViewBoxH = h; + } void setPreserveAspectRatio(HbNvgEngine::HbNvgAlignType preserveAspectSetting, HbNvgEngine::HbNvgMeetType smilFitSetting); @@ -86,72 +96,25 @@ void directDraw(const QByteArray &buffer, const QSize &targetSize); - void create(const QByteArray &buffer, const QSize& targetSize); - - void setIconData(const QByteArray &buffer); + void create(const QByteArray &buffer, const QSize& targetSize) + { + // TODO @ Deprecated, remove from base class + Q_UNUSED(buffer); + Q_UNUSED(targetSize); + } private: HbNvgEngine::HbNvgErrorType initializeGc(); - void drawCommandSection(const QByteArray &buffer, const QSize &targetSize, qint32 objectCaching); + void drawCommandSection(const QByteArray &buffer, const QSize &targetSize); HbNvgEngine::HbNvgErrorType createPathHandle(qint16 pathDataType, float scale, float bias); HbNvgEngine::HbNvgErrorType doDraw(const QSize &size); - void addDrawPathCommand(VGPath path, VGbitfield paintMode); - - void addPathData(VGint numSegments, const VGubyte * pathSegments, const void * pathData); - - void addLinearGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint); - - void addRadialGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint); - - void addSetColorCommand(VGuint rgba); - - void addColorRampCommand(VGPaint paint); - - void addSetTransformCommand(const VGfloat* transformMatrix, qint32 flag); - - void addSetStrokeWidthCommand(VGfloat strokeWidth); - - void addSetStrokeMiterLimitCommand(VGfloat miterLimit); - - void addStrokeLineJoinCapCommand(VGint capStyle, VGint joinStyle); - - void addStrokeLinearGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint); - - void addStrokeRadialGradientCommand(VGint count, VGfloat* gradientData, VGfloat* gradientMatrix, VGPaint paint); - - void addStrokeSetColorCommand(VGuint rgba); - - void addStrokeColorRampCommand(VGPaint paint); - - void addLinearGradientCommandData(VGPaint paint, VGint count, VGfloat* gradientData, VGfloat* gradientMatrix); - - void addRadialGradientCommandData(VGPaint paint, VGint count, VGfloat* gradientData, VGfloat* gradientMatrix); - - void addSetColorCommandData(VGuint rgba); - - void drawPaint(VGPaint paint, VGMatrixMode matrixMode, quint32 &lastPaintType, quint32 &lastPaintColor, VGPaintMode paintMode); - - void drawColorRamp(VGPaint paint); - - void setViewBoxToViewTransformation(const QSize &size); - void setRotation(); - void updateClientMatrices(); - - void restoreClientMatrices(); - - QPoint getTranslatedPoint(VGfloat *trMatrix, const QPoint &point); - - VGfloat maxVal4(VGfloat x1, VGfloat x2, VGfloat x3, VGfloat x4); - - VGfloat minVal4(VGfloat x1, VGfloat x2, VGfloat x3, VGfloat x4); - void setFillPaint(HbDereferencer *iconData); void setColorRamp(HbDereferencer * iconData); @@ -166,13 +129,10 @@ void setStrokeMiterLimit(const quint8* buffer); - void clearBackground(); - void resetNvgState(); void applyViewboxToViewPortTransformation(const QSize& targetSize, float viewboxX, float viewboxY, float viewboxW, float viewboxH); - void applyScissoring(VGfloat *aMatrix, const QSize& targetSize); void executeNvgCsCommandLoop(quint16 commandCount, HbDereferencer * iconData, HbDereferencer * offsetVector, HbDereferencer * commandSection, quint8 nvgVersion); @@ -189,10 +149,6 @@ return((T)((((quint32)value) + sizeof(quint16) - 1)&~(sizeof(quint16) - 1))); } -#ifdef OPENVG_OBJECT_CACHING - VGPath createPath(); -#endif - private: VGPaint mPaintFill; @@ -205,7 +161,6 @@ qint32 mFillAlpha; qint32 mStrokeAlpha; VGPaint mGradPaintStroke; - qint32 mCreatingNvgIcon; float mViewBoxX; float mViewBoxY; float mViewBoxW; @@ -214,17 +169,7 @@ float mRotationX; float mRotationY; HbNvgEngine::HbNvgAlignType mPreserveAspectSetting; - HbNvgEngine::HbNvgMeetType mSmilFitSetting; - HbNvgIconData * mNvgIconData; - VGint mMatrixMode; - VGfloat mImageMatrix[9]; - VGfloat mPathMatrix[9]; - quint32 mLastFillPaintType; - quint32 mLastStrokePaintType; - quint32 mLastFillPaintColor; - quint32 mLastStrkePaintColor; - quint32 mResetFillPaint; - quint32 mResetStrokePaint; + HbNvgEngine::HbNvgMeetType mSmilFitSetting; bool mMirrored; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgdecoder.pri --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgdecoder.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvgdecoder.pri Thu Jul 22 16:36:53 2010 +0100 @@ -29,12 +29,8 @@ PRIVATE_HEADERS += $$PWD/hbnvg_p.h PRIVATE_HEADERS += $$PWD/hbnvgicon_p.h - PRIVATE_HEADERS += $$PWD/hbnvgfittoviewbox_p.h -PRIVATE_HEADERS += $$PWD/hbnvgimagebinder_p.h - -PRIVATE_HEADERS += $$PWD/hbnvgicondata_p.h - +PRIVATE_HEADERS += $$PWD/hbdereferencer_p.h PRIVATE_HEADERS += $$PWD/hbnvgcsicon_p.h PRIVATE_HEADERS += $$PWD/hbnvgiconfactory_p.h PRIVATE_HEADERS += $$PWD/hbnvg_p_p.h @@ -42,8 +38,6 @@ PRIVATE_HEADERS += $$PWD/hbnvgenginepool_p.h SOURCES += $$PWD/hbnvgfittoviewbox.cpp -SOURCES += $$PWD/hbnvgicondata.cpp - SOURCES += $$PWD/hbnvgcsicon.cpp SOURCES += $$PWD/hbnvgiconfactory.cpp SOURCES += $$PWD/hbnvg.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgenginepool.cpp --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgenginepool.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvgenginepool.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,7 @@ HbPooledNVGEngine * HbNvgEnginePool::getNvgEngine() { - HbPooledNVGEngine* pNvgEngine; + HbPooledNVGEngine* pNvgEngine = 0; if (!pooledEngine) { pooledEngine = new HbNvgEngineInstance; Q_CHECK_PTR(pooledEngine); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgfittoviewbox.cpp --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgfittoviewbox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvgfittoviewbox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,17 +25,8 @@ #include "hbnvgfittoviewbox_p.h" -const qreal zero = 0.0f ; -const qreal one = 1.0f ; - HbNvgFitToViewBoxImpl::HbNvgFitToViewBoxImpl() - : mM00(one), - mM01(zero), - mM02(zero), - mM10(zero), - mM11(one), - mM12(zero), - mViewBoxDefined(false), + :mViewBoxDefined(false), mAlign(HbNvgEngine::NvgPreserveAspectRatioXmidYmid), mMeetSlice(HbNvgEngine::NvgMeet) { @@ -52,7 +43,6 @@ void HbNvgFitToViewBoxImpl::setWindowViewportTrans(const QRect &viewPort, const QSize &size) { - //VIEWPORT NUMBERS qreal viewPortX = viewPort.left(); qreal viewPortY = viewPort.top(); @@ -320,19 +310,3 @@ vgTranslate(xtrans, ytrans); } -void HbNvgFitToViewBoxImpl::concatenate(qreal m00, qreal m01, qreal m02, qreal m10, qreal m11, qreal m12) -{ - qreal m0; - qreal m1; - m0 = mM00; - m1 = mM01; - mM00 = m00 * m0 + m10 * m1; - mM01 = m01 * m0 + m11 * m1; - mM02 += m02 * m0 + m12 * m1; - m0 = mM10; - m1 = mM11; - mM11 = m01 * m0 + m11 * m1; - mM10 = m00 * m0 + m10 * m1; - mM12 += m02 * m0 + m12 * m1; -} - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgfittoviewbox_p.h --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgfittoviewbox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvgfittoviewbox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,7 +49,6 @@ mViewBoxDefined = true; } - void setAllignment(HbNvgEngine::HbNvgAlignType alignStatus) { mAlign = alignStatus; @@ -60,46 +59,11 @@ mMeetSlice = meetSlice; } - void setTransform(qreal m00, qreal m01, qreal m02, qreal m10, qreal m11, qreal m12) - { - mM00 = m00; - mM01 = m01; - mM02 = m02; - mM10 = m10; - mM11 = m11; - mM12 = m12; - } - - void translate(qreal tx, qreal ty) - { - qreal lTranslateMatrix[6] = { 1, 0, tx, 0, 1, ty}; - concatenate(lTranslateMatrix); - } - - void scale(qreal sx, qreal sy) - { - qreal lScaleMatrix[6] = { sx, 0, 0, 0, sy, 0}; - concatenate(lScaleMatrix); - } - - void concatenate(qreal *matrix) - { - concatenate(matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]); - } void setWindowViewportTrans(const QRect &viewPort, const QSize &size); - void concatenate(qreal m00, qreal m01, qreal m02, qreal m10, qreal m11, qreal m12); - private: - qreal mM00; - qreal mM01; - qreal mM02; - qreal mM10; - qreal mM11; - qreal mM12; - qreal mVbX; qreal mVbY; qreal mVbW; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgicondata.cpp --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgicondata.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbnvgicondata_p.h" - -HbNvgIconData::HbNvgIconData(quint32 length) - : mNvgData(0), - totalRead(0), - readStream(0) -{ - mNvgData = new QByteArray(0, length); - Q_CHECK_PTR(mNvgData); -} - -HbNvgIconData::HbNvgIconData(const QByteArray &buffer) - : mNvgData(0), - totalRead(0), - readStream(0) -{ - mNvgData = new QByteArray(buffer); - Q_CHECK_PTR(mNvgData); - dataSize = mNvgData->length(); - - //set the reading pointers - beginRead(); -} - -HbNvgIconData::~HbNvgIconData() -{ - delete mNvgData; -} - -qint32 HbNvgIconData::encodeData(const void *data, quint32 length) -{ - mNvgData->append((const char*)data , length); - return (qint32)HbNvgEngine::NvgErrNone; //in error case, exception will be thrown -} - -void HbNvgIconData::beginRead() -{ - dataSize = mNvgData->length(); - totalRead = 0; - readStream = (quint8 *)mNvgData->data(); -} - -void HbNvgIconData::endRead() -{ -} - -#define STR_TO_OTHER_DIR(TOTYPE) do {\ - TOTYPE data = *(TOTYPE *)&readStream[totalRead];\ - totalRead += sizeof(TOTYPE);\ - return data;\ - } while (0) - - -#define STR_TO_OTHER_IDIR(TOTYPE) do {\ - TOTYPE data;\ - quint8 * dataPtr = (quint8 *)&data;\ - for (qint32 i = 0; i < sizeof(TOTYPE); ++i)\ - {\ - dataPtr[i] = readStream[totalRead+i];\ - }\ - totalRead += sizeof(TOTYPE);\ - return data;\ - } while (0) - -#define STR_TO_OTHER(TOTYPE) do {\ - checkOutOfBound(sizeof(TOTYPE));\ - if (reinterpret_cast(&readStream[totalRead]) & (sizeof(TOTYPE) - 1))\ - {\ - STR_TO_OTHER_IDIR(TOTYPE);\ - }\ - else\ - {\ - STR_TO_OTHER_DIR(TOTYPE);\ - }\ - } while (0) - -qint16 HbNvgIconData::readInt16() -{ - STR_TO_OTHER(qint16); -} - -qint32 HbNvgIconData::readInt32() -{ - STR_TO_OTHER(qint32); -} - -qint8 HbNvgIconData::readInt8() -{ - STR_TO_OTHER_DIR(qint8); -} - -float HbNvgIconData::readReal32() -{ - STR_TO_OTHER(float); -} - -qreal HbNvgIconData::readReal64() -{ - checkOutOfBound(sizeof(qreal)); - STR_TO_OTHER(qreal); -} - -void HbNvgIconData::read(quint8 *ptr, qint32 length) -{ - checkOutOfBound(length); - memcpy(ptr, &readStream[totalRead], length); - totalRead += length; -} - -void HbNvgIconData::skip(qint32 length) -{ - checkOutOfBound(length); - totalRead += length; -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgicondata_p.h --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgicondata_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,230 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HB_NVGICONDATA_P_H -#define HB_NVGICONDATA_P_H - -#include -#include - -#include "hbnvg_p.h" -#include "hbnvgexception_p.h" - -class HbNvgIconData -{ -public: - HbNvgIconData(quint32 length = 0); - - HbNvgIconData(const QByteArray &buffer); - - ~HbNvgIconData(); - - qint32 encodeUint8(quint8 aVal) - { - return encodeData(&aVal, sizeof(aVal)); - } - - qint32 encodeUint16(quint16 aVal) - { - return encodeData(&aVal, sizeof(aVal)); - } - - qint32 encodeUint32(quint32 aVal) - { - return encodeData(&aVal, sizeof(aVal)); - } - - int encodeReal32(float aVal) - { - return encodeData(&aVal, sizeof(aVal)); - } - qint32 encodeReal64(double aVal) - { - return encodeData(&aVal, sizeof(aVal)); - } - - qint32 encodeData(const void *data, quint32 length); - - void beginRead(); - - void endRead(); - - qint16 readInt16(); - - qint32 readInt32(); - - qint8 readInt8(); - - void read(quint8 *ptr, qint32 length); - - float readReal32(); - - qreal readReal64(); - - qint32 readPos() const - { - return totalRead; - } - - void skip(qint32 length); - - const char* buffer() { - return mNvgData->data() ; - } - - bool eof() const - { - return (totalRead >= dataSize); - } - - qint32 dataLength() const - { - return dataSize; - } - -private: - - void checkOutOfBound(qint32 length) - { - if (totalRead + length > dataSize || - totalRead + length < 0){ - throw HbNvgException(HbNvgEngine::NvgErrEof); - } - } - - QByteArray* mNvgData; - qint32 totalRead; - qint32 dataSize; - quint8 * readStream; -}; - -class HbDereferencer -{ -#define DEREF_PTR(TOTYPE, Offset, Size) do {\ - checkOutOfBound(Offset + Size); \ - return * (TOTYPE *)&mReadStream[mTotalRead + Offset];\ - } while (0) -public: - - HbDereferencer(quint8* buf, qint32 length) - : mTotalRead(0), - mDataLength(length), - mReadStream((unsigned char*)buf) - { - } - - HbDereferencer(const QByteArray& buffer) - : mTotalRead(0), - mDataLength(buffer.length()), - mReadStream((unsigned char*)buffer.data()) - { - } - - void skip(qint32 length) - { - checkOutOfBound(length); - mTotalRead += length; - } - - qint16 derefInt16(qint16 at = 0) - { - DEREF_PTR(qint16, at, sizeof(qint16)); - } - operator qint16() - { - return derefInt16(); - } - - qint32 derefInt32(qint32 at = 0) - { - DEREF_PTR(qint32, at, sizeof(qint32)); - } - - operator qint32() - { - return derefInt32(); - } - - qint8 derefInt8(qint32 at = 0) - { - DEREF_PTR(qint8, at, sizeof(qint8)); - } - - operator qint8() - { - return derefInt8(); - } - - quint8* derefInt8Array(qint32 length, qint32 at = 0) - { - checkOutOfBound(at + length); - return (quint8 *)&mReadStream[mTotalRead + at]; - } - - float derefReal32(qint32 at = 0) - { - DEREF_PTR(float, at, sizeof(float)); - } - operator float() - { - return derefReal32(); - } - - void assertBound(qint32 length, qint32 at = 0) - { - checkOutOfBound(at + length); - } - - quint8* getPtr() const - { - return mReadStream; - } - - qint32 getLength() const - { - return mDataLength; - } - - qint32 getReadingPos() const - { - return mTotalRead; - } - -private: - void checkOutOfBound(qint32 length) - { - if (mTotalRead + length > mDataLength || - mTotalRead + length < 0){ - throw HbNvgException(HbNvgEngine::NvgErrEof); - } - } - - qint32 mTotalRead; - qint32 mDataLength; - quint8* mReadStream; -}; - -#endif - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgimagebinder_p.h --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgimagebinder_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HB_VGIMAGEBINDER_P_H -#define HB_VGIMAGEBINDER_P_H - -class HbVgImageBinder -{ -public: - virtual ~HbVgImageBinder() {} - - virtual qint32 bindClientBuffer(quint32 buffer) = 0; - - virtual qint32 unbindClientBuffer() = 0; -}; - -#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/svgext/hbnvgdecoder/hbnvgutil_p.h --- a/src/hbcore/svgext/hbnvgdecoder/hbnvgutil_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/svgext/hbnvgdecoder/hbnvgutil_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -217,37 +217,6 @@ #endif -#ifdef OPENVG_OBJECT_CACHING -// first one is for openVG object caching, the macro is used for testing purpose -#define COND_COM_OC(obj, s1, s2) if (obj) { s1; } else { s2; } - -// if object caching is enabled take the first one, which is for object caching, -// else the second one -#define COND_COM_OC_NOC(s1, s2) s1 - -// if object caching is enabled take the first one, which is for object caching -// else don't do anything -#define COND_COM_OC_OOC(s1) s1 - -#else - -// first one is for openVG object caching, the macro is used for testing purpose -#define COND_COM_OC(obj, s1, s2) s2 - -// if object caching is enabled take the first one, which is for object caching, -// else the second one -#define COND_COM_OC_NOC(s1, s2) s2 - -// if object caching is enabled take the first one, which is for object caching -// else don't do anything -// if object caching is enabled take the first one, which is for object caching -// else don't do anything -#define COND_COM_OC_OOC(s1) - -// if object caching is enabled take the first one, which is for object caching -// else don't do anything -#endif - /* * There is an Align4 function in symbian which does the alignement * this is just to check whether the given pointer is aligned or not diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbcolorscheme.cpp --- a/src/hbcore/theme/hbcolorscheme.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbcolorscheme.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,8 @@ \class HbColorScheme \brief HbColorScheme class is used to query colors from theme. - HbColorScheme class has a single static functions to query colors from theme. + HbColorScheme class has a single static functions to query colors from current theme. If + color is not found from current theme then it is queried from base theme. \sa QColor HbColorScheme::color(const QString &colorRole) @@ -39,9 +40,9 @@ look and feel and be themable. For example, a custom widget may want to have background color same as that of HbDialog. In such scenario the widget can query standard "popupbackground" color from theme. - Following code queries color of popoup forground and applies it to a text item. + Following code queries color of HbTextEdit's normal text color and applies it to a text item. \code - QColor col = HbColorScheme::color("popupforeground"); + QColor col = HbColorScheme::color("qtc_textedit_normal"); if (col.isValid()) { mytextitem->setTextColor(col); } @@ -52,30 +53,21 @@ need not to do it again by themselves. It is sufficient that widgets make sure that colors being used to paint the graphics item has been updated in the handler of HbEvent::ThemeChanged. - - The color-role may contain information about the state also, e.g. "foreground_enabled". - - \warning List of standard color roles is not yet finalized + - The color-role may contain information about the state also, e.g. "qtc_button_pressed". */ /*! * \fn QColor HbColorScheme::color(const QString &colorRole)) - * This function returns value of some predefined \a colorRole. + * This function returns value of \a colorRole. * * See class level document for detailed example *. */ #include -#include "hbcolortheme_p.h" - -/*! -Constructor -*/ -HbColorScheme::HbColorScheme() -{ -} +#include QColor HbColorScheme::color( const QString &colorRole ) { - return HbColorTheme::instance()->color(colorRole); + return HbTheme::instance()->color(colorRole); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbcolortheme_p.cpp --- a/src/hbcore/theme/hbcolortheme_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,174 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbcolortheme_p.h" -#include "hbcolortheme_p_p.h" -#include "hbstandarddirs_p.h" -#include "hbinstance.h" -#include "hbthemeutils_p.h" - -#include -#include - -/*! - * Private class Constructor - */ -HbColorThemePrivate::HbColorThemePrivate() -{ - -} - -void HbColorThemePrivate::setCurrentTheme(const QString& themeName) -{ - // If new theme is different from earlier set theme - if (currentTheme != themeName) { - bool reloadAll = currentTheme.isEmpty(); - currentTheme = themeName; - reloadColorFiles( reloadAll ); - } -} - -/*! - * HbColorThemePrivate::reloadColorFiles - * - * \a sender can be true or false depending upon whether all css files need to be reloaded or is done selectively - */ -void HbColorThemePrivate::reloadColorFiles(bool sender) -{ - QMap hierarchyVariableListWithPathInfo = - HbThemeUtils::constructHierarchyListWithPathInfo("variables/color/hbcolorgroup.css", currentTheme, Hb::StyleSheetResource); - HbStandardDirs::findResourceList(hierarchyVariableListWithPathInfo,Hb::StyleSheetResource, true); - -#ifdef THEME_SERVER_TRACES - qDebug() << "CSS files:"; - foreach ( const QString& file, hierarchyVariableListWithPathInfo ) - qDebug() << file; -#endif // THEME_SERVER_TRACES - - cssif.initialise(hierarchyVariableListWithPathInfo, sender); - -} - -/*! - * HbColorThemePrivate::resolveColor - * - * \a values vector containing color information - */ -QColor HbColorThemePrivate::resolveColor( HbCss::Value value ) const -{ - return value.variant.toColor(); -} - -/*! - * Destructor - */ -HbColorThemePrivate::~HbColorThemePrivate() -{ - -} - -Q_GLOBAL_STATIC(HbColorTheme, globalColorTheme) -HbColorTheme *HbColorTheme::self = 0; - -HbColorTheme *HbColorTheme::instance () -{ - return globalColorTheme(); -} - -/*! - * HbColorTheme::color - * - * \a widget parent widget - * \a colorAttribute attribute for which color information is being requested - */ -QColor HbColorTheme::color( const QGraphicsWidget * widget, - const QString &colorAttribute ) const -{ - Q_D(const HbColorTheme); - - HbCss::Value value = d->cssif.findAttribute( widget, colorAttribute ); - return d->resolveColor( value ); -} - -/*! - * HbColorTheme::color - * - * \a colorRole colorRole can be either "foreground" or "background" etc. - */ -QColor HbColorTheme::color( const QString &colorRole ) const -{ - Q_D(const HbColorTheme); - HbCss::Value value = d->cssif.findVariable( colorRole ); - return d->resolveColor( value ); -} - -/*! - * HbColorTheme::HbColorTheme() - * - * Constructor - */ -HbColorTheme::HbColorTheme (): d_ptr( new HbColorThemePrivate ) -{ - self = this; -} - -/*! - * HbColorTheme::~HbColorTheme() - * - * Destructor - */ -HbColorTheme::~HbColorTheme () -{ - delete d_ptr; -} - -/*! - * HbColorTheme::setCurrentTheme() - * - * \a themeName name of the new theme to be set - */ -void HbColorTheme::setCurrentTheme ( const QString& themeName ) -{ - Q_D(HbColorTheme); - d->setCurrentTheme(themeName); -} - -/*! - * HbColorTheme::reloadCss() - * - * Reloads the color-related css files for the current theme - */ -void HbColorTheme::reloadCss() -{ - Q_D(HbColorTheme); - d->cssif.flush(); - d->reloadColorFiles( true ); -} - -void HbColorTheme::flushVariableCache() -{ - Q_D(HbColorTheme); - d->cssif.flushVariableCache(); -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbcolortheme_p.h --- a/src/hbcore/theme/hbcolortheme_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBCOLORTHEME_H -#define HBCOLORTHEME_H - -#include -#include - -QT_BEGIN_NAMESPACE - class QObject; - class QGraphicsWidget; -QT_END_NAMESPACE - - class HbColorThemePrivate; -class TestHbColorTheme; - -class HB_AUTOTEST_EXPORT HbColorTheme -{ - friend class TestHbColorTheme; -public: - - HbColorTheme(); - ~HbColorTheme(); - - void setCurrentTheme(const QString& currentTheme); - static HbColorTheme *instance(); - - QColor color(const QGraphicsWidget * wid, const QString &prop) const; - QColor color(const QString &colorRole) const; - void reloadCss(); - void flushVariableCache(); - -private: - HbColorThemePrivate * const d_ptr; - static HbColorTheme *self; - Q_DISABLE_COPY (HbColorTheme) - Q_DECLARE_PRIVATE_D(d_ptr, HbColorTheme) -}; - -#endif // HBCOLORTHEME_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbcolortheme_p_p.h --- a/src/hbcore/theme/hbcolortheme_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBCOLORTHEME_P_H -#define HBCOLORTHEME_P_H - -#include -#include -#include "hbcssthemeinterface_p.h" -#include "hbcssparser_p.h" - - -class HB_AUTOTEST_EXPORT HbColorThemePrivate -{ -public: - HbColorThemePrivate(); - void setCurrentTheme(const QString& themeName); - void reloadColorFiles(bool sender); - QColor resolveColor(HbCss::Value values) const; - ~HbColorThemePrivate(); - - QString currentTheme; - HbCssThemeInterface cssif; -}; - -#endif // HBCOLORTHEME_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbcssthemeinterface_p.cpp --- a/src/hbcore/theme/hbcssthemeinterface_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,149 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbcssthemeinterface_p.h" //class header -#include - -#define FILE_VERSION(major, minor) (int)((major<<16)|minor) - -/*! - \class HbCssThemeInterface - \brief HbCssThemeInterface is an internal class. - * - */ - - - /*! - * \fn HbCssThemeInterface::initialise(const QStringList& list,bool loadAllFiles,bool enableBinarySupport =false) - * Function to populate the interface with css files - * \a list list of css files, priority wise - * \a loadAllFiles ,On application launch all files are loaded and on theme change unchanged files are not loaded. - * \a enableBinarySupport optional flag for using the binary functionality - */ -void HbCssThemeInterface::initialise(const QMap & list,bool loadAllFiles, - bool enableBinarySupport) -{ - int handle; - flushVariableCache(); - HbLayeredStyleLoader *loader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); - - //first unload the layers, for which the contents are different after theme change - if (handles.size() != 0) { - QMap::const_iterator itr; - for (itr = handles.constBegin(); itr != handles.constEnd(); ++itr){ - loader->unload(itr.key(),itr.value()); - } - handles.clear(); - } - - QMap::const_iterator i; - for (i = list.constBegin(); i != list.constEnd(); ++i){ - if(loadAllFiles) { - handle =loader->load(i.value(),(HbLayeredStyleLoader::LayerPriority) i.key(),enableBinarySupport); - if (((HbLayeredStyleLoader::LayerPriority) i.key() != HbLayeredStyleLoader::Priority_Core) && ((HbLayeredStyleLoader::LayerPriority) i.key() != HbLayeredStyleLoader::Priority_Operator )) { - handles.insertMulti(handle, (HbLayeredStyleLoader::LayerPriority) i.key()); - } - - } - else{ - if (((HbLayeredStyleLoader::LayerPriority) i.key() != HbLayeredStyleLoader::Priority_Core) && ((HbLayeredStyleLoader::LayerPriority) i.key() != HbLayeredStyleLoader::Priority_Operator )) { - handle = loader->load(i.value(),(HbLayeredStyleLoader::LayerPriority) i.key(),enableBinarySupport); - handles.insertMulti(handle, (HbLayeredStyleLoader::LayerPriority) i.key()); - } - - } - - } -} - -/*! - * \fn HbCssThemeInterface::flush() - * - */ -void HbCssThemeInterface::flush() -{ - HbLayeredStyleLoader *loader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); - loader->clear(); - flushVariableCache(); -} - -void HbCssThemeInterface::flushVariableCache() -{ - mVariables.clear(); -} - -/*! - * \fn HbCssThemeInterface::findAttribute(const QGraphicsWidget* w, QString attribute) - * Function for finding an attribute - * \a w widget pointer of QGraphicsWidget which will act as a selector - * For Universal Selector (*) pass NULL. - * \a attribute name of attribute - * \return list of values. - */ -HbCss::Value HbCssThemeInterface::findAttribute( - const QGraphicsWidget *w, const QString& attribute) const -{ - StyleSelector::NodePtr n; - n.ptr = (void *)w; - HbCss::Value value; - - HbLayeredStyleLoader *loader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); - HbDeviceProfile profile(HbDeviceProfile::profile(w)); - HbCss::ValueExtractor valueExtractor(loader->declarationsForNode(n, profile.orientation()), true); - valueExtractor.extractValue(attribute, value); - - if ( value.type == Value::Variable) { - value = findVariable ( value.variant.toString ()); - } - - return value; -} - -/*! - * \fn HbCssThemeInterface::findVariable(const QString& variableName) const - * Function for finding an attribute - * \a variableName name of color group - * \return list of values. - */ -HbCss::Value HbCssThemeInterface::findVariable( - const QString& variableName) const -{ - if ( mVariables.isEmpty() ) { - HbLayeredStyleLoader *loader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors); - loader->variableRuleSets(&mVariables); - } - - HbCss::Value value; - HbCss::ValueExtractor valueExtractor(mVariables, true); - valueExtractor.extractValue(variableName, value); - - //for varibale cascading support - if ( value.type == Value::Variable){ - value = findVariable ( value.variant.toString ()); - } - - return value; -} - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbcssthemeinterface_p.h --- a/src/hbcore/theme/hbcssthemeinterface_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBCSSTHEMEINTERFACE_P_H -#define HBCSSTHEMEINTERFACE_P_H - -#include -#include "hblayeredstyleloader_p.h" - -using namespace HbCss; - -class HB_AUTOTEST_EXPORT HbCssThemeInterface -{ -public: - - HbCssThemeInterface(){}; - - void initialise( const QMap& alist, - bool loadAllFiles, - bool enableBinarySupport = false ); - - HbCss::Value findAttribute( const QGraphicsWidget * aWidget, - const QString& attributeName ) const; - - HbCss::Value findVariable( const QString& variableName )const; - - void flush(); - void flushVariableCache(); - -private: - QMap handles; - mutable QHash mVariables; - -}; -#endif //HBCSSTHEMEINTERFACE_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbeffecttheme_p.cpp --- a/src/hbcore/theme/hbeffecttheme_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbeffecttheme_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,22 +23,17 @@ ** ****************************************************************************/ -#include -#include - +#include "hbeffecttheme_p.h" #include "hbthemecommon_p.h" -#include "hbstandarddirs_p.h" -#include "hbinstance.h" -#include "hbeffecttheme_p.h" -#include "hbthemeutils_p.h" #include "hbeffectinternal_p.h" #include "hbthemeindex_p.h" #include "hbtheme.h" #include "hbtheme_p.h" -#ifdef Q_OS_SYMBIAN +#include +#include + static const char *effectFileSuffix = ".fxml"; -#endif class HB_AUTOTEST_EXPORT HbEffectThemePrivate { @@ -47,26 +42,13 @@ ~HbEffectThemePrivate(); void initialise(const QString &themeName); +public: QString mThemeName; - QStringList mDirList; - QStringList mListOfExistingFolders; }; void HbEffectThemePrivate::initialise(const QString &themeName) { mThemeName = themeName; - - QMap maplist = HbThemeUtils::constructHierarchyListWithPathInfo( - QString(), mThemeName, Hb::EffectResource); - - mDirList.clear(); - - QList list = maplist.values(); // sorted by key - for (int i = list.count() - 1; i >= 0; --i) { // take highest prio first - mDirList.append(list.at(i)); - } - - mListOfExistingFolders = HbStandardDirs::findExistingFolderList(mDirList, mThemeName, Hb::EffectResource); } HbEffectThemePrivate::HbEffectThemePrivate() @@ -91,37 +73,22 @@ #ifdef THEME_INDEX_TRACES qDebug() << "ThemeIndex: getEffectXml effect: " << fileNameLogical; #endif - -#ifdef Q_OS_SYMBIAN - // Try to get themed icon information from theme index - QString resourceName(fileNameLogical); - resourceName.append(effectFileSuffix); - HbThemeIndexResource resource(resourceName); - if (resource.isValid()) { - return resource.fullFileName(); - } -#endif // Q_OS_SYMBIAN - - // Assuming logical name will not have '.' and full filepath will - // always have some extension. - if (!fileNameLogical.contains('.')) { - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: getEffectXml index not used, do a lookup from file system!"; - #endif + if (HbThemeUtils::isLogicalName(fileNameLogical)) { + // Try to get themed icon information from theme index + QString resourceName(fileNameLogical); + resourceName.append(effectFileSuffix); - foreach (const QString &dir, d_ptr->mListOfExistingFolders) { - QString candidateFullName = dir + fileNameLogical + ".fxml"; - QFile resource(candidateFullName); - if (resource.exists()) { - if (d_ptr->mListOfExistingFolders.last() != dir) { - fromTheme = true; - } - return candidateFullName; - } + HbThemeIndexResource resource(resourceName); + if (resource.isValid()) { + fromTheme = true; + return resource.fullFileName(); } } - return fileNameLogical; + + // Not a logical name or not found in theme + fromTheme = false; + return fileNameLogical; } HbEffectTheme::HbEffectTheme() @@ -135,10 +102,9 @@ delete d_ptr; } -void HbEffectTheme::setCurrentTheme(const QString& themeName) +void HbEffectTheme::setCurrentTheme(const QString &themeName) { d_ptr->initialise(themeName); - d_ptr->mThemeName = themeName; HbEffectInternal::reloadFxmlFiles(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbeffecttheme_p.h --- a/src/hbcore/theme/hbeffecttheme_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbeffecttheme_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,7 @@ QString currentTheme() const; private: - HbEffectThemePrivate* d_ptr; + HbEffectThemePrivate *d_ptr; static HbEffectTheme *self; Q_DISABLE_COPY(HbEffectTheme) friend class TestHbEffectTheme; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbtheme.cpp --- a/src/hbcore/theme/hbtheme.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbtheme.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,17 +25,14 @@ #include "hbtheme.h" #include "hbtheme_p.h" #include "hbthemeclient_p.h" -#include -#include -#include "hbstandarddirs_p.h" #include "hbicontheme_p.h" -#include "hbcolortheme_p.h" #include "hbthemeutils_p.h" #include "hbiconloader_p.h" -#include "hbcolortheme_p_p.h" -#include "hbcolortheme_p.h" #include "hbeffecttheme_p.h" #include "hbeffectinternal_p.h" +#include "hbthemeindex_p.h" +#include + /*! @stable @hbcore @@ -74,7 +71,7 @@ /*! Returns static instance */ -HbTheme* HbTheme::instance() +HbTheme *HbTheme::instance() { static HbTheme theInstance; return &theInstance; @@ -86,7 +83,7 @@ */ QString HbTheme::name() const { - return d_ptr->currentTheme; + return d_ptr->iconTheme.name(); } /*! @@ -98,13 +95,23 @@ } /*! + Returns the color for definition \a colorRole + */ +QColor HbTheme::color(const QString &colorRole) const +{ + HbThemeIndexResource resource(colorRole); + if (resource.isValid()) { + return resource.colorValue(); + } + return QColor(); +} + +/*! Constructor */ HbTheme::HbTheme() : d_ptr(new HbThemePrivate) { d_ptr->q_ptr = this; - d_ptr->fetchCurrentThemeFromSettings(); - HbThemeUtils::initSettings(); d_ptr->handleThemeChange(); } @@ -121,12 +128,14 @@ */ HbThemePrivate::HbThemePrivate() { +#ifdef Q_OS_SYMBIAN // Condition added to check if the client itself is server. if(THEME_SERVER_NAME != HbMemoryUtils::getCleanAppName()) { if(!HbThemeClient::global()->connectToServer()) { - qWarning()<<"ThemeClient unable to connect to server in HbThemePrivate::HbThemePrivate."; + qWarning() << "ThemeClient unable to connect to server in HbThemePrivate::HbThemePrivate."; } } +#endif } /*! @@ -134,23 +143,13 @@ */ HbThemePrivate::~HbThemePrivate() { +#ifdef Q_OS_SYMBIAN HbThemeClient::releaseInstance(); GET_MEMORY_MANAGER( HbMemoryManager::HeapMemory ) if (manager) { manager->releaseInstance(HbMemoryManager::HeapMemory); } -} - -/*! - Retrieves the current theme from setting -*/ -void HbThemePrivate::fetchCurrentThemeFromSettings() -{ - currentTheme = HbThemeUtils::getThemeSetting(HbThemeUtils::CurrentThemeSetting); - if (currentTheme.trimmed().isEmpty()){ - currentTheme = HbThemeUtils::defaultTheme().name; - HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, currentTheme); - } +#endif } /*! @@ -161,39 +160,35 @@ Q_Q(HbTheme); QString newTheme; if (str.isEmpty()) { - newTheme = HbThemeUtils::getThemeSetting(HbThemeUtils::CurrentThemeSetting); + HbThemeIndexInfo info = HbThemeUtils::getThemeIndexInfo(ActiveTheme); + if (info.address) { + newTheme = info.name; + } else { + newTheme = HbThemeUtils::getThemeSetting(HbThemeUtils::CurrentThemeSetting); + } } else { newTheme = str; - // Update the new currentTheme setting in HbThemeUtils. + // Update the new currentTheme to local settings in HbThemeUtils. HbThemeUtils::updateThemeSetting(HbThemeUtils::CurrentThemeSetting, newTheme); } iconTheme.setCurrentTheme(newTheme); - HbColorTheme::instance()->setCurrentTheme(newTheme); HbEffectTheme::instance()->setCurrentTheme(newTheme); - // The server sends the signal only if the theme is changed from the previous theme - // Hence here, we need not check whether the theme differs from currentTheme or not. - if(currentTheme != newTheme) { - currentTheme = newTheme; - // This should be used to replace pixmaps from the old theme with the pixmaps from the new theme - // In application side this is needed only when icon size can be different in different theme. - iconTheme.emitUpdateIcons(); + // This should be used to replace pixmaps from the old theme with the pixmaps from the new theme + // In application side this is needed only when icon size can be different in different theme. + iconTheme.emitUpdateIcons(); - emit q->changed(); - // This signal should be used to update the screen after the theme change - it's handled by HbInstance. - emit q->changeFinished(); - } + emit q->changed(); + // This signal should be used to update the screen after the theme change - it's handled by HbInstance. + emit q->changeFinished(); } /*! - Clears the contents to reload new css files + Clears the contents to reload new files */ void HbThemePrivate::updateTheme(const QStringList &updatedFiles) { - // Reload the CSS - HbColorTheme::instance()->reloadCss(); - // Reload effects HbEffectInternal::reloadFxmlFiles(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbtheme.h --- a/src/hbcore/theme/hbtheme.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbtheme.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,7 @@ #define HBTHEME_H #include +#include #include #include @@ -38,12 +39,14 @@ class HB_CORE_EXPORT HbTheme : public QObject { -Q_OBJECT + Q_OBJECT public: static HbTheme *instance(); QString name() const; QString description() const; + QColor color(const QString &colorRole) const; + signals: void changed(); void changeFinished(); @@ -61,7 +64,6 @@ friend class HbWidgetLoader; friend class HbEffectController; friend class HbDeviceProfile; - friend class HbEffectTheme; friend class HbThemeIndexResource; Q_DECLARE_PRIVATE_D( d_ptr, HbTheme ) Q_DISABLE_COPY(HbTheme) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbtheme_p.h --- a/src/hbcore/theme/hbtheme_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbtheme_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,24 +28,21 @@ #include "hbicontheme_p.h" #include "hbthemeindex_p.h" #include "hbtheme.h" +#include "hbthemeutils_p.h" class HbThemePrivate { Q_DECLARE_PUBLIC(HbTheme) public: void handleThemeChange(const QString &str = QString()); - void fetchCurrentThemeFromSettings(); void updateTheme(const QStringList &updatedFiles); HbThemePrivate(); ~HbThemePrivate(); static HbThemePrivate *d_ptr(HbTheme *t) { return t->d_func(); } static HbThemePrivate *instance() { return HbTheme::instance()->d_func(); } - QStringList iconDirectories() { return iconTheme.dirList();} public: - QString currentTheme; - HbIconTheme iconTheme; - HbTheme* q_ptr; - + HbIconTheme iconTheme; + HbTheme *q_ptr; }; #endif /* HBTHEME_P_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemeclient_generic_p.cpp --- a/src/hbcore/theme/hbthemeclient_generic_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemeclient_generic_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,88 +23,34 @@ ** ****************************************************************************/ -#include "hbthemeclient_p_p.h" -#include -#include -#include -#include -#include -#include - #include #include #include +#include #include -#include "hbthemecommon_p.h" -#include "hbmemorymanager_p.h" -#define WAIT_TIME_TO_CONNECT_TO_SERVER 500 -#define WAIT_TIME_TO_START_SERVER 5000 -#if defined(Q_OS_SYMBIAN) || defined(Q_OS_WIN) -static const QString SERVERFILENAME = QLatin1String("hbthemeserver.exe"); -#else -static const QString SERVERFILENAME = QLatin1String("hbthemeserver"); -#endif -static const QString SERVERFILEPATH = QLatin1String(HB_BIN_DIR) + QDir::separator() + SERVERFILENAME; -static const QStringList SERVERARGUMENTS = QStringList() << QLatin1String("-start"); +#include "hbthemeclient_p_p.h" +#include "hbthemecommon_p.h" + +#include +#include +#include /** * Constructor */ -HbThemeClientPrivate::HbThemeClientPrivate():clientConnected( false ),localSocket( new QLocalSocket() ) +HbThemeClientPrivate::HbThemeClientPrivate() : + iniFileWatcher(0), + clientConnected(false) { #ifdef THEME_SERVER_TRACES qDebug() << Q_FUNC_INFO ; #endif -} -/** - * connectToServer - */ -bool HbThemeClientPrivate::connectToServer() -{ - localSocket->connectToServer(THEME_SERVER_NAME); - - // This logic needs to be improved - bool success = localSocket->waitForConnected(WAIT_TIME_TO_CONNECT_TO_SERVER); - -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << "Socket Connect status: " << success; -#endif - - if(!success) { - QProcess *newProcess = new QProcess(); - if (QFile::exists(SERVERFILENAME)) { - newProcess->start(SERVERFILENAME, SERVERARGUMENTS); - success = newProcess->waitForStarted(WAIT_TIME_TO_START_SERVER); - } - if (!success) { - newProcess->start(SERVERFILEPATH, SERVERARGUMENTS); - success = newProcess->waitForStarted(WAIT_TIME_TO_START_SERVER); - } -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << "Server Start Status: " << success << "Error = " << newProcess->error (); -#endif - - // If server started - if (success) { - // ToDo: This is to wait for server to start running. Logic needs to be improved. - newProcess->waitForFinished(3000); -#ifdef THEME_SERVER_TRACES - qDebug() <connectToServer(THEME_SERVER_NAME); - success = localSocket->waitForConnected(); -#ifdef THEME_SERVER_TRACES - qDebug() <addPath(settings.fileName()); + connect(iniFileWatcher, SIGNAL(fileChanged(QString)), this, SLOT(iniFileChanged(QString))); } /** @@ -112,1150 +58,48 @@ */ HbThemeClientPrivate::~HbThemeClientPrivate() { - localSocket->disconnectFromServer(); - delete localSocket; -} -QSizeF HbThemeClientPrivate::getSharedIconDefaultSize(const QString& iconPath) -{ - // Not implemented atm... - Q_UNUSED(iconPath) - return QSizeF(); -} - -/** - * HbThemeClientPrivate::getSharedIconInfo() - */ -HbSharedIconInfo HbThemeClientPrivate::getSharedIconInfo(const QString& iconPath , - const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - HbIconLoader::IconLoaderOptions options, - const QColor &color, - HbRenderingMode renderMode) -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - HbSharedIconInfo iconInfo; - iconInfo.type = INVALID_FORMAT; - - if ( !clientConnected ) { - return iconInfo; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType; - requestType = EIconLookup; - outputDataStream << (int)requestType; - outputDataStream << iconPath; - outputDataStream << size; - outputDataStream << aspectRatioMode; - outputDataStream << mode; - outputDataStream << mirrored; - outputDataStream << options; - outputDataStream << color; - outputDataStream << renderMode; - - //@to do block the segment upto the connect - // changeTheme() slot should not be called for pixmap lookup case. So disconnecting. - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); -#ifdef THEME_SERVER_TRACES - qDebug() <<"image req : " <readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - // Need to handle the situation when both themechange - // request and pixmap info comes at the same time - // Just posting the ThemeChnaged event so that it can be handled - // as next event and current pixmap load is not interrupted - if (EIconLookup==request) { - readIconInfo(inputDataStream, iconInfo); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection==request){ - // Asked for pixmap, got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EIconLookup==request) { - readIconInfo(inputDataStream, iconInfo); - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - return iconInfo; -} - -/* - * HbThemeClientPrivate::getSharedLayoutDefs() - * - * Returns the layout definition for the given file name,layout name,section name -*/ - -HbWidgetLoader::LayoutDefinition *HbThemeClientPrivate::getSharedLayoutDefs(const QString &fileName,const QString &layout,const QString §ion) -{ - if ( !clientConnected ) { - return 0; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = EWidgetMLLookup; - - outputDataStream << (int)requestType; - outputDataStream << fileName; - outputDataStream << layout; - outputDataStream << section; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(&inputByteArray,QIODevice::ReadOnly); - HbThemeServerRequest request; - int temp; - int sharedMLOffset = -1; - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - if (EWidgetMLLookup==request) { - inputDataStream >> sharedMLOffset; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - }else if (EThemeSelection==request){ - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EWidgetMLLookup==request) { - inputDataStream >> sharedMLOffset; - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - if (sharedMLOffset >= 0) { - return HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, sharedMLOffset); - } else { - return 0; - } -} - -/** - * HbThemeClientPrivate::getSharedStyleSheet() - */ -HbCss::StyleSheet *HbThemeClientPrivate::getSharedStyleSheet(const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - - if ( !clientConnected ) { - return 0; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = EStyleSheetLookup; - - outputDataStream << (int)requestType; - outputDataStream << fileName; - outputDataStream << priority; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); -#ifdef THEME_SERVER_TRACES - qDebug() <<"stylesheet req : " <readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - - //-1 represents invalid offset - int cssOffset = -1; - - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - // Need to handle the situation when both themechange - // request and stylesheet lookup info comes at the same time - // Just posting the ThemeChanged event so that it can be handled - // as next event and current stylesheet load is not interrupted - if (EStyleSheetLookup==request) { - inputDataStream >> cssOffset; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection==request){ - // Asked for stylesheet, got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EStyleSheetLookup==request) { - inputDataStream >> cssOffset; - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - //if a valid offset is obtained from the server return this offset - if (cssOffset >= 0) { - return HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, cssOffset); - } else { - return 0; - } } /** - * HbThemeClientPrivate::deviceProfiles() + * HbThemeClientPrivate::iniFileChanged() */ -HbDeviceProfileList *HbThemeClientPrivate::deviceProfiles() +void HbThemeClientPrivate::iniFileChanged(QString iniFile) { -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - - if ( !clientConnected ) { - return 0; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = EDeviceProfileOffset; - - outputDataStream << (int)requestType; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - - //-1 represents invalid offset - int deviceProfileOffset = -1; - - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - if (EDeviceProfileOffset == request) { - inputDataStream >> deviceProfileOffset; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - }else if (EThemeSelection==request){ - // Asked for DeviceProfiles Offset, got theme change request.. - // clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EDeviceProfileOffset== request) { - inputDataStream >> deviceProfileOffset; - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - //if a valid offset is obtained from the server return this offset - if (deviceProfileOffset >= 0) { - return HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, deviceProfileOffset); - } else { - return 0; - } -} - -/** - * HbThemeClientPrivate::getSharedEffect() - */ -HbEffectFxmlData *HbThemeClientPrivate::getSharedEffect(const QString &filePath) -{ + Q_UNUSED(iniFile); #ifdef THEME_SERVER_TRACES qDebug() << Q_FUNC_INFO; #endif - - if ( !clientConnected ) { - return 0; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = EEffectLookupFilePath; - - outputDataStream << (int)requestType; - outputDataStream << filePath; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - -#ifdef THEME_SERVER_TRACES - qDebug() <<"EEffectLookupFilePath req : " <readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - - //-1 represents invalid offset - int effectOffset = -1; - - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; + QSettings settings(QSettings::IniFormat, QSettings::UserScope, QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT)); + QString newTheme = settings.value("currenttheme").toString(); - // Need to handle the situation when both themechange - // request and effect lookup info comes at the same time - // Just posting the ThemeChanged event so that it can be handled - // as next event and current effect load is not interrupted - if (request==EEffectLookupFilePath) { - inputDataStream >> effectOffset; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection==request){ - // Asked for effect, got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EEffectLookupFilePath==request) { - inputDataStream >> effectOffset; - } + if (!HbThemeUtils::isThemeValid(newTheme)) { + // check if the theme name is logical + newTheme = QDir::fromNativeSeparators(qgetenv("HB_THEMES_DIR")) + + '/' + HbThemeUtils::platformHierarchy + '/' + + HbThemeUtils::iconsResourceFolder + '/' + newTheme; + if (!HbThemeUtils::isThemeValid(newTheme)) { + // use default theme since new theme cannot be resolved + newTheme = HbThemeUtils::getThemeSetting(HbThemeUtils::DefaultThemeSetting); } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - //if a valid offset is obtained from the server return this offset - if (effectOffset >= 0) { - return HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, effectOffset); - } - else { - return 0; - } -} - -/** - * HbThemeClientPrivate::addSharedEffect() - */ -bool HbThemeClientPrivate::addSharedEffect(const QString& filePath) -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - if ( !clientConnected ) { - return false; + disconnect(iniFileWatcher, SIGNAL(fileChanged(QString)), this, SLOT(iniFileChanged(QString))); + HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, newTheme); + connect(iniFileWatcher, SIGNAL(fileChanged(QString)), this, SLOT(iniFileChanged(QString))); + } else { + HbThemeUtils::updateThemeSetting(HbThemeUtils::CurrentThemeSetting, newTheme); } - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = EEffectAdd; - - outputDataStream << (int)requestType; - outputDataStream << filePath; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - -#ifdef THEME_SERVER_TRACES - qDebug() <<"effectAdd req : " <readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - - //-1 represents an error adding file to server - int effectAddReply = -1; - - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - - //TODO how to really handle situation when adding an effect when theme changes?? - - // Need to handle the situation when both themechange - // request and effect lookup info comes at the same time - // Just posting the ThemeChanged event so that it can be handled - // as next event and current effect load is not interrupted - if (request==EEffectAdd) { - inputDataStream >> effectAddReply; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection==request){ - // Asked for effect, got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EEffectAdd==request) { - inputDataStream >> effectAddReply; - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - if(effectAddReply >= 0) - return true; - else - return false; -} - -/** - * HbThemeClientPrivate::changeTheme() - */ -void HbThemeClientPrivate::changeTheme() -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - int request; - inputDataStream >> request; - -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << "recognizer: "<> themeName; -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO <<"themeName is : " <> updatedFiles; - hbInstance->theme()->d_ptr->updateTheme(updatedFiles); - } + HbThemeUtils::loadHeapThemeIndex(ActiveTheme); + hbInstance->theme()->d_ptr->handleThemeChange(newTheme); } /** - * HbThemeClientPrivate::readIconInfo() + * HbThemeClientPrivate::setTheme() */ -void HbThemeClientPrivate::readIconInfo(QDataStream &dataStream, HbSharedIconInfo &iconInfo) +void HbThemeClientPrivate::setTheme(const QString &theme) { - int temp; - int tempType; - dataStream >> tempType; - iconInfo.type = (HbIconFormatType)tempType; - - if( iconInfo.type == OTHER_SUPPORTED_FORMATS || iconInfo.type == SVG ){ - dataStream >> iconInfo.pixmapData.offset; - dataStream >> iconInfo.pixmapData.width; - dataStream >> iconInfo.pixmapData.height; - dataStream >> iconInfo.pixmapData.defaultWidth; - dataStream >> iconInfo.pixmapData.defaultHeight; - dataStream >> temp; - iconInfo.pixmapData.format= (QImage::Format)temp; - } - else if (/*iconInfo.type == SVG ||*/ iconInfo.type == PIC ){ - dataStream >> iconInfo.picData.offset; - dataStream >> iconInfo.picData.dataSize; - dataStream >> iconInfo.picData.defaultWidth; - dataStream >> iconInfo.picData.defaultHeight; - - } - else if(iconInfo.type == NVG ){ - dataStream >> iconInfo.nvgData.offset; - dataStream >> iconInfo.nvgData.dataSize; - } - else if (iconInfo.type == BLOB) { - dataStream >> iconInfo.blobData.offset; - dataStream >> iconInfo.blobData.dataSize; + if (HbThemeUtils::isThemeValid(theme)) { + HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, theme); } } - -/** - * HbThemeClientPrivate::handleThemeChange() - */ -void HbThemeClientPrivate::handleThemeChange(const QString &themeName) -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO <<"themeChanged(): called"; -#endif - hbInstance->theme()->d_ptr->handleThemeChange(themeName); -} - -/** - * HbThemeClientPrivate::event() - */ -bool HbThemeClientPrivate::event(QEvent *e) -{ - if (e->type() == HbEvent::ThemeChanged) { - hbInstance->theme()->d_ptr->handleThemeChange(); - return true; - } - return QObject::event(e); -} - -/** - * HbThemeClientPrivate::unloadIcon() - */ -void HbThemeClientPrivate::unloadIcon(const QString& iconPath , - const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - const QColor& color, - HbRenderingMode renderMode) -{ - if ( !clientConnected ) { - return; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType; - requestType = EUnloadIcon; - outputDataStream << (int)requestType; - outputDataStream << iconPath; - outputDataStream << size; - outputDataStream << aspectRatioMode; - outputDataStream << mode; - outputDataStream << mirrored; - //outputDataStream << options; - outputDataStream << color; - outputDataStream << renderMode; - - //@to do block the segment upto the connect - // changeTheme() slot should not be called for pixmap lookup case. So disconnecting. - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - // Need to handle the situation when both themechange - // request and Reference count decrement comes at the same time - // Just posting the ThemeChnaged event so that it can be handled - // as next event and current pixmap load is not interrupted - if (EUnloadIcon ==request) { - - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection==request){ - // Asked for reference count decrement got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EUnloadIcon == request) { - - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - -} - -/** - * HbThemeClientPrivate::unLoadMultiIcon() - * - * unload multiple icons -*/ -void HbThemeClientPrivate::unLoadMultiIcon(const QStringList& iconPathList, - const QVector &sizeList, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - const QColor &color, - HbRenderingMode renderMode) -{ - if ( !clientConnected ) { - return; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType; - requestType = EUnloadMultiIcon; - outputDataStream << (int)requestType; - for(int i = 0; i < iconPathList.count(); i++) { - outputDataStream << iconPathList[i]; - outputDataStream << sizeList[i]; - } - - outputDataStream << aspectRatioMode; - outputDataStream << mode; - outputDataStream << mirrored; - //outputDataStream << options; - outputDataStream << color; - outputDataStream << renderMode; - - //@to do block the segment upto the connect - // changeTheme() slot should not be called for pixmap lookup case. So disconnecting. - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - // Need to handle the situation when both themechange - // request and Reference count decrement comes at the same time - // Just posting the ThemeChnaged event so that it can be handled - // as next event and current pixmap load is not interrupted - if (EUnloadMultiIcon ==request) { - - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection==request){ - // Asked for reference count decrement got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EUnloadIcon == request) { - - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); -} - - - -HbSharedIconInfo HbThemeClientPrivate::getMultiPartIconInfo(const QStringList &multiPartIconList, - const HbMultiPartSizeData &multiPartIconData , - const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - HbIconLoader::IconLoaderOptions options, - const QColor &color, - HbRenderingMode renderMode) - -{ - -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - HbSharedIconInfo iconInfo; - iconInfo.type = INVALID_FORMAT; - if ( !clientConnected ) { - return iconInfo; - } - - - int noOfPieces = 1; - if (multiPartIconData.multiPartIconId.contains("_3PV",Qt::CaseInsensitive) - || multiPartIconData.multiPartIconId.contains("_3PH",Qt::CaseInsensitive)) { - noOfPieces = 3; - } else if (multiPartIconData.multiPartIconId.contains("_9P",Qt::CaseInsensitive)) { - noOfPieces = 9; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType; - requestType = EMultiPieceIcon; - outputDataStream << (int)requestType; - outputDataStream << multiPartIconList; - outputDataStream << multiPartIconData.multiPartIconId; - - for (int i = 0; i< noOfPieces; i++) { - outputDataStream << multiPartIconData.sources[i]; - } - - for (int i = 0; i < noOfPieces; i++) { - outputDataStream << multiPartIconData.targets[i]; - } - - for (int i = 0; i < noOfPieces; i++) { - outputDataStream << multiPartIconData.pixmapSizes[i]; - } - outputDataStream << size; - outputDataStream << aspectRatioMode; - outputDataStream << mode; - outputDataStream << mirrored; - outputDataStream << options; - outputDataStream << color; - outputDataStream << renderMode; - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); -#ifdef THEME_SERVER_TRACES - qDebug() <<"image req : " <readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - // Need to handle the situation when both themechange - // request and pixmap info comes at the same time - // Just posting the ThemeChnaged event so that it can be handled - // as next event and current pixmap load is not interrupted - if (EMultiPieceIcon == request) { - readIconInfo(inputDataStream, iconInfo); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection == request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection == request) { - // Asked for pixmap, got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EMultiPieceIcon==request) { - readIconInfo(inputDataStream, iconInfo); - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - return iconInfo; -} - -/** - * getMultiIconInfo function returns a list of HbSharedIconInfo - * for the given list of frameitems. - */ -HbSharedIconInfoList HbThemeClientPrivate::getMultiIconInfo(const QStringList &multiPartIconList, - const QVector &sizeList, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - HbIconLoader::IconLoaderOptions options, - const QColor &color, - HbRenderingMode renderMode) -{ - HbSharedIconInfoList sharedIconInfoList; - -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - if ( !clientConnected ) { - return sharedIconInfoList; - } - - int noOfPieces = multiPartIconList.count(); - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType; - requestType = EMultiIcon; - outputDataStream << (int)requestType; - outputDataStream << multiPartIconList; - outputDataStream << sizeList; - outputDataStream << aspectRatioMode; - outputDataStream << mode; - outputDataStream << mirrored; - outputDataStream << options; - outputDataStream << color; - outputDataStream << renderMode; - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); -#ifdef THEME_SERVER_TRACES - qDebug() <<"image req : " <readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - // Need to handle the situation when both themechange - // request and pixmap info comes at the same time - // Just posting the ThemeChnaged event so that it can be handled - // as next event and current pixmap load is not interrupted - if (EMultiIcon == request) { - for (int i = 0; i< noOfPieces; i++) { - readIconInfo(inputDataStream, sharedIconInfoList.icon[i]); - } - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection == request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - } - else if (EThemeSelection == request) { - // Asked for pixmap, got theme change request.. clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EMultiIcon==request) { - for (int i = 0; i< noOfPieces; i++) { - readIconInfo(inputDataStream, sharedIconInfoList.icon[i]); - } - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - return sharedIconInfoList; -} - -/** - * HbThemeClientPrivate::notifyForegroundLostToServer() - */ -void HbThemeClientPrivate::notifyForegroundLostToServer() -{ -} - -/** - * HbThemeClientPrivate::freeSharedMemory() - */ -int HbThemeClientPrivate::freeSharedMemory() -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = EFreeSharedMem; - - outputDataStream << (int)requestType; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - - int freeSharedMem = 0; - - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - if (EFreeSharedMem == request) { - inputDataStream >> freeSharedMem; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - }else if (EThemeSelection == request){ - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EFreeSharedMem== request) { - inputDataStream >> freeSharedMem; - } - } - } - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - return freeSharedMem; -} - -/** - * HbThemeClientPrivate::allocatedSharedMemory() - */ -int HbThemeClientPrivate::allocatedSharedMemory() -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = EAllocatedSharedMem; - - outputDataStream << (int)requestType; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - - int allocatedSharedMem = 0; - - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - if (EAllocatedSharedMem == request) { - inputDataStream >> allocatedSharedMem; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - }else if (EThemeSelection == request){ - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EAllocatedSharedMem== request) { - inputDataStream >> allocatedSharedMem; - } - } - } - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - return allocatedSharedMem; -} - -/** - * HbThemeClientPrivate::allocatedHeapMemory() - */ -int HbThemeClientPrivate::allocatedHeapMemory() -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - // currently only supported in Symbian - return -1; -} - -/** - * HbThemeClientPrivate::switchRenderingMode() - */ -bool HbThemeClientPrivate::switchRenderingMode(HbRenderingMode renderMode) -{ - Q_UNUSED(renderMode); - return true; -} - -#ifdef HB_THEME_SERVER_MEMORY_REPORT -void HbThemeClientPrivate::createMemoryReport() const -{ - if ( !clientConnected ) { - return; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = ECreateMemoryReport; - - outputDataStream << (int)requestType; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); -} -#endif - - -/** - * HbThemeClientPrivate::typefaceInfo() - */ -HbTypefaceInfoVector *HbThemeClientPrivate::typefaceInfo() -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - - if ( !clientConnected ) { - return 0; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest requestType = ETypefaceOffset; - - outputDataStream << (int)requestType; - - disconnect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - localSocket->write(outputByteArray); - localSocket->flush(); - localSocket->waitForReadyRead(); - - QByteArray inputByteArray = localSocket->readAll(); - QDataStream inputDataStream(inputByteArray); - HbThemeServerRequest request; - int temp; - - //-1 represents invalid offset - int typefaceOffset = -1; - - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - - if (ETypefaceOffset == request) { - inputDataStream >> typefaceOffset; - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (EThemeSelection==request) { - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - } - } - }else if (EThemeSelection==request){ - // Asked for Typeface Offset, got theme change request.. - // clean theme name - QString themeName; - inputDataStream >> themeName; - QCoreApplication::postEvent(this, new HbEvent(HbEvent::ThemeChanged)); - if (!inputDataStream.atEnd()) { - inputDataStream >> temp; - request = (HbThemeServerRequest)temp; - if (ETypefaceOffset== request) { - inputDataStream >> typefaceOffset; - } - } - } - - // connecting again to handle theme change request from server - connect(localSocket, SIGNAL(readyRead()), this, SLOT(changeTheme())); - - //if a valid offset is obtained from the server return this offset - if (typefaceOffset >= 0) { - return HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, typefaceOffset); - } else { - return 0; - } -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemeclient_p.cpp --- a/src/hbcore/theme/hbthemeclient_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemeclient_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,17 +25,20 @@ #include "hbthemeclient_p.h" #include "hbthemeclient_p_p.h" +#include "hbthemeutils_p.h" #include "hbsharedmemorymanager_p.h" #include "hbmemoryutils_p.h" -static HbThemeClient *clientInst=0; +static const QLatin1String ResourceStylePath(":/themes/style/hbdefault/"); + +static HbThemeClient *clientInst = 0; /** * Constructor */ -HbThemeClient::HbThemeClient():d_ptr(new HbThemeClientPrivate) +HbThemeClient::HbThemeClient() : + d_ptr(new HbThemeClientPrivate) { - } /** @@ -43,14 +46,12 @@ */ bool HbThemeClient::connectToServer() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->connectToServer(); -} - -QSizeF HbThemeClient::getSharedIconDefaultSize(const QString &iconPath) -{ - Q_D(HbThemeClient); - return d->getSharedIconDefaultSize(iconPath); +#else + return false; +#endif } /** @@ -78,6 +79,7 @@ const QColor &color, HbRenderingMode renderMode) { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->getSharedIconInfo(iconPath, size, @@ -87,6 +89,18 @@ options, color, renderMode); +#else + Q_UNUSED(iconPath); + Q_UNUSED(size); + Q_UNUSED(aspectRatioMode); + Q_UNUSED(mode); + Q_UNUSED(mirrored); + Q_UNUSED(options); + Q_UNUSED(color); + Q_UNUSED(renderMode); + + return HbSharedIconInfo(); +#endif } /** @@ -96,6 +110,7 @@ */ QByteArray HbThemeClient::getSharedBlob(const QString &name) { +#ifdef Q_OS_SYMBIAN HbSharedIconInfo info = getSharedIconInfo( name, QSizeF(), @@ -111,10 +126,13 @@ info.blobData.offset), info.blobData.dataSize) : QByteArray(); +#else + Q_UNUSED(name); + return QByteArray(); +#endif } - - HbSharedIconInfo HbThemeClient::getMultiPartIconInfo(const QStringList &multiPartIconList, +HbSharedIconInfo HbThemeClient::getMultiPartIconInfo(const QStringList &multiPartIconList, const HbMultiPartSizeData &multiPartIconData , const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, @@ -124,55 +142,112 @@ const QColor &color, HbRenderingMode renderMode) { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); - return d->getMultiPartIconInfo(multiPartIconList, multiPartIconData, size, aspectRatioMode, mode, mirrored, options, color, renderMode); + return d->getMultiPartIconInfo(multiPartIconList, multiPartIconData, size, + aspectRatioMode, mode, mirrored, options, color, renderMode); +#else + Q_UNUSED(multiPartIconList); + Q_UNUSED(multiPartIconData); + Q_UNUSED(size); + Q_UNUSED(aspectRatioMode); + Q_UNUSED(mode); + Q_UNUSED(mirrored); + Q_UNUSED(options); + Q_UNUSED(color); + Q_UNUSED(renderMode); + + return HbSharedIconInfo(); +#endif } /** * HbThemeClient::getSharedStyleSheet() * - * \a fielName css filename + * \a filePath css filepath. Only acceptable path separator is '/'. * \a priority layer priority */ -HbCss::StyleSheet *HbThemeClient::getSharedStyleSheet(const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) +HbCss::StyleSheet *HbThemeClient::getSharedStyleSheet(const QString &filePath, + HbLayeredStyleLoader::LayerPriority priority) { - int offset = -1; - if( HbLayeredStyleLoader::Priority_Core == priority ) { - offset = sharedCacheItemOffset(HbSharedCache::Stylesheet, fileName); + HbCss::StyleSheet *styleSheet = 0; +#ifdef Q_OS_SYMBIAN + const QString filePathFixed = QDir::fromNativeSeparators(filePath); + + bool requestFromServer = true; + if (filePathFixed.startsWith(QLatin1Char(':')) && !filePathFixed.startsWith(ResourceStylePath)) { + //filePathFixed is located in application resource, parse it on client side. + requestFromServer = false; } - if ( -1 != offset ) { - HbCss::StyleSheet *styleSheet = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory,offset); - return styleSheet; + if (requestFromServer) { + int offset = -1; + if(HbLayeredStyleLoader::Priority_Core == priority) { + offset = sharedCacheItemOffset(HbSharedCache::Stylesheet, filePathFixed); + } + if ( -1 != offset ) { + styleSheet = + HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + offset); + } else { + Q_D(HbThemeClient); + styleSheet = d->getSharedStyleSheet(filePathFixed, priority); + } } - Q_D(HbThemeClient); - return d->getSharedStyleSheet(fileName,priority); +#else + Q_UNUSED(filePath); + Q_UNUSED(priority); +#endif + return styleSheet; } /** * HbThemeClient::getSharedLayoutDefs() - * - * \a fileName - * \a layout - * \a section + * \a filePath layout definition filepath. Only acceptable path separator is '/'. + * \a layout layout name + * \a section section name */ -HbWidgetLoader::LayoutDefinition *HbThemeClient::getSharedLayoutDefs(const QString &fileName,const QString &layout,const QString §ion) +HbWidgetLoader::LayoutDefinition *HbThemeClient::getSharedLayoutDefs(const QString &filePath, + const QString &layout, + const QString §ion) { - int offset = sharedCacheItemOffset(HbSharedCache::LayoutDefinition, fileName + layout + section); - if ( -1 != offset ) { - HbWidgetLoader::LayoutDefinition *layoutDefs = - HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory,offset); - return layoutDefs; + HbWidgetLoader::LayoutDefinition *layoutDefinition = 0; +#ifdef Q_OS_SYMBIAN + const QString filePathFixed = QDir::fromNativeSeparators(filePath); + + bool requestFromServer = true; + if (filePathFixed.startsWith(QLatin1Char(':')) && !filePathFixed.startsWith(ResourceStylePath)) { + //filePathFixed is located in application resource, parse it on client side. + requestFromServer = false; } - Q_D(HbThemeClient); - return d->getSharedLayoutDefs(fileName,layout,section); + if (requestFromServer) { + int offset = sharedCacheLayoutDefinitionOffset(filePathFixed, layout, section); + if (offset != -1) { + layoutDefinition = + HbMemoryUtils::getAddress( + HbMemoryManager::SharedMemory, offset); + } else { + Q_D(HbThemeClient); + layoutDefinition = d->getSharedLayoutDefs(filePathFixed, layout, section); + } + } +#else + Q_UNUSED(filePath); + Q_UNUSED(layout); + Q_UNUSED(section); +#endif + return layoutDefinition; } /** * HbThemeClient::deviceProfiles() */ HbDeviceProfileList *HbThemeClient::deviceProfiles() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->deviceProfiles(); +#else + return 0; +#endif } /** @@ -180,51 +255,71 @@ */ HbTypefaceInfoVector *HbThemeClient::typefaceInfo() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->typefaceInfo(); +#else + return 0; +#endif } - /** * HbThemeClient::notifyForegroundLostToServer() * */ void HbThemeClient::notifyForegroundLostToServer() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); d->notifyForegroundLostToServer(); +#endif } /** * HbThemeClient::getSharedEffect() * - * \a filePath + * \a filePath. Only acceptable path separator is '/'. */ HbEffectFxmlData *HbThemeClient::getSharedEffect(const QString &filePath) { - int offset = sharedCacheItemOffset(HbSharedCache::Effect, filePath); +#ifdef Q_OS_SYMBIAN + const QString filePathFixed = QDir::fromNativeSeparators(filePath); + + int offset = sharedCacheItemOffset(HbSharedCache::Effect, filePathFixed); if ( -1 != offset ) { - HbEffectFxmlData *effectFxmlData = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory,offset); + HbEffectFxmlData *effectFxmlData = + HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, offset); return effectFxmlData; } Q_D(HbThemeClient); - return d->getSharedEffect(filePath); + return d->getSharedEffect(filePathFixed); +#else + Q_UNUSED(filePath); + return 0; +#endif } /** * HbThemeClient::addSharedEffect() * - * \a filePath + * \a filePath. Only acceptable path separator is '/'. */ bool HbThemeClient::addSharedEffect(const QString& filePath) { - int offset = sharedCacheItemOffset(HbSharedCache::Effect, filePath); +#ifdef Q_OS_SYMBIAN + const QString filePathFixed = QDir::fromNativeSeparators(filePath); + + int offset = sharedCacheItemOffset(HbSharedCache::Effect, filePathFixed); if ( -1 != offset ) { // effect already added. return true; } Q_D(HbThemeClient); - return d->addSharedEffect(filePath); + return d->addSharedEffect(filePathFixed); +#else + Q_UNUSED(filePath); + return false; +#endif } /** @@ -247,6 +342,7 @@ const QColor &color, HbRenderingMode renderMode) { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->unloadIcon(iconPath, size, @@ -255,6 +351,15 @@ mirrored, color, renderMode); +#else + Q_UNUSED(iconPath); + Q_UNUSED(size); + Q_UNUSED(aspectRatioMode); + Q_UNUSED(mode); + Q_UNUSED(mirrored); + Q_UNUSED(color); + Q_UNUSED(renderMode); +#endif } /** @@ -275,6 +380,7 @@ const QColor &color, HbRenderingMode renderMode) { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->unLoadMultiIcon(iconPathList, sizeList, @@ -283,6 +389,15 @@ mirrored, color, renderMode); +#else + Q_UNUSED(iconPathList); + Q_UNUSED(sizeList); + Q_UNUSED(aspectRatioMode); + Q_UNUSED(mode); + Q_UNUSED(mirrored); + Q_UNUSED(color); + Q_UNUSED(renderMode); +#endif } /** @@ -290,8 +405,10 @@ */ HbThemeClient::~HbThemeClient() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); delete d; +#endif } /** @@ -299,8 +416,12 @@ */ bool HbThemeClient::clientConnected() const { +#ifdef Q_OS_SYMBIAN Q_D(const HbThemeClient); return d->clientConnected; +#else + return false; +#endif } /** @@ -311,6 +432,7 @@ if ( !clientInst ) { clientInst = new HbThemeClient; } + return clientInst; } @@ -324,15 +446,44 @@ } /** - * sharedCacheItemOffset function returns the offset of the cache item - * for the given key + * returns the offset of the cache item for the given key * \param key * */ -int HbThemeClient::sharedCacheItemOffset(HbSharedCache::ItemType type, const QString & key) +int HbThemeClient::sharedCacheItemOffset(HbSharedCache::ItemType type, const QString &key) { + int offset = -1; +#ifdef Q_OS_SYMBIAN HbSharedCache *cache = HbSharedCache::instance(); - return cache->offset(type, key); + if (cache) { + offset = cache->offset(type, key); + } +#else + Q_UNUSED(type); + Q_UNUSED(key); +#endif + return offset; +} + +/** + * returns the offset of the layout definition for the given file, layout and section. + */ +int HbThemeClient::sharedCacheLayoutDefinitionOffset(const QString &fileName, + const QString &layout, + const QString §ion) +{ + int offset = -1; +#ifdef Q_OS_SYMBIAN + HbSharedCache *cache = HbSharedCache::instance(); + if (cache) { + offset = cache->layoutDefinitionOffset(fileName, layout, section); + } +#else + Q_UNUSED(fileName); + Q_UNUSED(layout); + Q_UNUSED(section); +#endif + return offset; } #ifdef HB_THEME_SERVER_MEMORY_REPORT @@ -342,8 +493,10 @@ */ void HbThemeClient::createMemoryReport() const { +#ifdef Q_OS_SYMBIAN Q_D(const HbThemeClient); d->createMemoryReport(); +#endif } #endif @@ -360,8 +513,22 @@ const QColor &color, HbRenderingMode renderMode) { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); - return d->getMultiIconInfo(multiPartIconList, sizeList,aspectRatioMode, mode, mirrored, options, color, renderMode); + return d->getMultiIconInfo(multiPartIconList, sizeList,aspectRatioMode, mode, + mirrored, options, color, renderMode); +#else + Q_UNUSED(multiPartIconList); + Q_UNUSED(sizeList); + Q_UNUSED(aspectRatioMode); + Q_UNUSED(mode); + Q_UNUSED(mirrored); + Q_UNUSED(options); + Q_UNUSED(color); + Q_UNUSED(renderMode); + + return HbSharedIconInfoList(); +#endif } /** @@ -370,8 +537,12 @@ */ int HbThemeClient::freeSharedMemory() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->freeSharedMemory(); +#else + return 0; +#endif } /** @@ -380,8 +551,12 @@ */ int HbThemeClient::allocatedSharedMemory() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->allocatedSharedMemory(); +#else + return 0; +#endif } /** @@ -390,8 +565,12 @@ */ int HbThemeClient::allocatedHeapMemory() { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->allocatedHeapMemory(); +#else + return 0; +#endif } /** @@ -400,6 +579,17 @@ */ bool HbThemeClient::switchRenderingMode(HbRenderingMode renderMode) { +#ifdef Q_OS_SYMBIAN Q_D(HbThemeClient); return d->switchRenderingMode(renderMode); +#else + Q_UNUSED(renderMode); + return true; +#endif } + +void HbThemeClient::setTheme(const QString &theme) +{ + Q_D(HbThemeClient); + d->setTheme(theme); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemeclient_p.h --- a/src/hbcore/theme/hbthemeclient_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemeclient_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,16 +40,12 @@ class HbThemeClientPrivate; class HbEffectFxmlData; -class HB_AUTOTEST_EXPORT HbThemeClient +class HB_CORE_PRIVATE_EXPORT HbThemeClient { - public: - bool connectToServer(); - QSizeF getSharedIconDefaultSize(const QString &iconPath); - - HbSharedIconInfo getSharedIconInfo(const QString& iconPath , + HbSharedIconInfo getSharedIconInfo(const QString &iconPath, const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -60,20 +56,23 @@ QByteArray getSharedBlob(const QString &name); - HbWidgetLoader::LayoutDefinition *getSharedLayoutDefs(const QString &fileName,const QString &layout,const QString §ion); - - HbCss::StyleSheet *getSharedStyleSheet(const QString &filepath, HbLayeredStyleLoader::LayerPriority priority); + HbWidgetLoader::LayoutDefinition *getSharedLayoutDefs(const QString &fileName, + const QString &layout, + const QString §ion); + HbCss::StyleSheet *getSharedStyleSheet( + const QString &filePath, + HbLayeredStyleLoader::LayerPriority priority); HbEffectFxmlData *getSharedEffect(const QString &filePath); - bool addSharedEffect(const QString& filePath); + bool addSharedEffect(const QString &filePath); HbDeviceProfileList *deviceProfiles(); HbTypefaceInfoVector *typefaceInfo(); void notifyForegroundLostToServer(); - void unloadIcon(const QString& iconPath , + void unloadIcon(const QString &iconPath, const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -81,7 +80,7 @@ const QColor &color, HbRenderingMode renderMode); - void unLoadMultiIcon(const QStringList& iconPathList, + void unLoadMultiIcon(const QStringList &iconPathList, const QVector &sizeList, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -90,7 +89,7 @@ HbRenderingMode renderMode); HbSharedIconInfo getMultiPartIconInfo(const QStringList &multiPartIconList, - const HbMultiPartSizeData &multiPartIconData , + const HbMultiPartSizeData &multiPartIconData, const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -100,16 +99,18 @@ HbRenderingMode renderMode); HbSharedIconInfoList getMultiIconInfo(const QStringList &multiPartIconList, - const QVector &sizeList , + const QVector &sizeList, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, bool mirrored, HbIconLoader::IconLoaderOptions options, const QColor &color, HbRenderingMode renderMode); - + bool switchRenderingMode(HbRenderingMode renderMode); + void setTheme(const QString &theme); + bool clientConnected() const; #ifdef HB_THEME_SERVER_MEMORY_REPORT @@ -127,6 +128,9 @@ private: HbThemeClient(); int sharedCacheItemOffset(HbSharedCache::ItemType type, const QString &key); + int sharedCacheLayoutDefinitionOffset(const QString &filePath, + const QString &layout, + const QString §ion); HbThemeClientPrivate *d_ptr; Q_DECLARE_PRIVATE_D(d_ptr, HbThemeClient) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemeclient_p_p.h --- a/src/hbcore/theme/hbthemeclient_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemeclient_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,12 +43,10 @@ #include #endif +class QFileSystemWatcher; class CHbThemeListenerPrivate; class QSizeF; class HbEffectFxmlData; -#ifndef Q_OS_SYMBIAN -class QLocalSocket; -#endif class HB_AUTOTEST_EXPORT HbThemeClientPrivate : #ifdef Q_OS_SYMBIAN @@ -62,12 +60,12 @@ Q_OBJECT #endif - public: +public: HbThemeClientPrivate(); + +#ifdef Q_OS_SYMBIAN bool connectToServer(); - QSizeF getSharedIconDefaultSize(const QString& iconPath); - HbSharedIconInfo getSharedIconInfo(const QString& iconPath , const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, @@ -75,11 +73,14 @@ bool mirrored, HbIconLoader::IconLoaderOptions options, const QColor &color, - HbRenderingMode renderMode); + HbRenderingMode renderMode); - HbWidgetLoader::LayoutDefinition *getSharedLayoutDefs(const QString &fileName, const QString &layout, const QString §ion); + HbWidgetLoader::LayoutDefinition *getSharedLayoutDefs(const QString &fileName, + const QString &layout, + const QString §ion); - HbCss::StyleSheet *getSharedStyleSheet(const QString &filepath, HbLayeredStyleLoader::LayerPriority priority); + HbCss::StyleSheet *getSharedStyleSheet(const QString &filePath, + HbLayeredStyleLoader::LayerPriority priority); HbEffectFxmlData *getSharedEffect(const QString &filePath); @@ -122,38 +123,33 @@ HbIconLoader::IconLoaderOptions options, const QColor &color, HbRenderingMode renderMode); + void notifyForegroundLostToServer(); bool switchRenderingMode(HbRenderingMode renderMode); int freeSharedMemory(); int allocatedSharedMemory(); int allocatedHeapMemory(); - - ~HbThemeClientPrivate(); - bool event(QEvent *e); - #ifdef HB_THEME_SERVER_MEMORY_REPORT void createMemoryReport() const; #endif -#ifndef Q_OS_SYMBIAN -public slots: - void changeTheme(); -#endif +private: + void handleThemeChange(const QString &themeName); + +#endif // Q_OS_SYMBIAN public: - bool clientConnected; + void setTheme(const QString &theme); + + ~HbThemeClientPrivate(); + +#ifdef Q_OS_SYMBIAN private: - void handleThemeChange(const QString &themeName); -#ifdef Q_OS_SYMBIAN TVersion Version() const; TInt StartServer(); TInt CreateServerProcess(); -#else - void readIconInfo(QDataStream &dataStream, HbSharedIconInfo &iconInfo); -#endif private: -#ifdef Q_OS_SYMBIAN CHbThemeListenerPrivate *themelistener; friend class CHbThemeListenerPrivate; #ifdef HB_SGIMAGE_ICON @@ -162,8 +158,16 @@ #endif #else - QLocalSocket* localSocket; -#endif + +public slots: + void iniFileChanged(QString iniFile); + +private: + QFileSystemWatcher *iniFileWatcher; +#endif // Q_OS_SYMBIAN + +public: + bool clientConnected; }; #endif // HBTHEMECLIENT_P_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemeclient_symbian_p.cpp --- a/src/hbcore/theme/hbthemeclient_symbian_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemeclient_symbian_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -61,22 +61,21 @@ bool HbThemeClientPrivate::connectToServer() { TInt error(KErrNone); - for( int tries(0); tries < 100; tries++) { + for(int tries = 0;;++tries) { error = CreateSession(KThemeServerName, Version(), KDefaultMessageSlots); - if(!error) { - // connected to existing server - OK + if(!error || tries >= 3) { + //session created ok or give up trying. break; } if(error != KErrNotFound && error != KErrServerTerminated) { - // problem other than server not here - propagate error + // problem other than server not here. break; } error = StartServer(); - if(!error || (error ==KErrAlreadyExists)) { - // If server launched ok , try again to connect - continue; + if (error != KErrNone && error != KErrAlreadyExists) { + // unexpected error occurred. + break; } - break; // server not launched : don't cycle round again. } #ifdef HB_SGIMAGE_ICON if (!error && !sgDriverInit) { @@ -86,7 +85,7 @@ } } #endif - return ( clientConnected = (KErrNone == error) ); + return (clientConnected = (KErrNone == error)); } @@ -103,36 +102,12 @@ KThemeServerBuildVersionNumber)); } -QSizeF HbThemeClientPrivate::getSharedIconDefaultSize(const QString& iconPath) -{ - if (!clientConnected) { - return QSizeF(); - } - - QSizeF defaultSize; - - TBuf<256> buffer(iconPath.utf16()); - TPckg retPckg(defaultSize); - - TIconParams params; - params.fileName = buffer; - - TPckg paramPckg(params); - TIpcArgs args(¶mPckg, &retPckg); - - TInt err = SendReceive(EIconDefaultSize, args); - if (KErrNone != err) { - defaultSize = QSizeF(); - } - return defaultSize; -} - /** * HbThemeClientPrivate::getSharedIconInfo() * * Returns the shared icon information */ -HbSharedIconInfo HbThemeClientPrivate::getSharedIconInfo(const QString& iconPath , +HbSharedIconInfo HbThemeClientPrivate::getSharedIconInfo(const QString &iconPath, const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -178,15 +153,16 @@ * getMultiPartIconInfo */ -HbSharedIconInfo HbThemeClientPrivate::getMultiPartIconInfo(const QStringList &multiPartIconList, - const HbMultiPartSizeData &multiPartIconData , - const QSizeF &size, - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - HbIconLoader::IconLoaderOptions options, - const QColor &color, - HbRenderingMode renderMode) +HbSharedIconInfo HbThemeClientPrivate::getMultiPartIconInfo( + const QStringList &multiPartIconList, + const HbMultiPartSizeData &multiPartIconData, + const QSizeF &size, + Qt::AspectRatioMode aspectRatioMode, + QIcon::Mode mode, + bool mirrored, + HbIconLoader::IconLoaderOptions options, + const QColor &color, + HbRenderingMode renderMode) { HbSharedIconInfo sharedIconInfo; sharedIconInfo.type = INVALID_FORMAT; @@ -205,10 +181,10 @@ params.multiPartIconList[i].Copy(pieceIconId); } int noOfPieces = 1; - if (multiPartIconData.multiPartIconId.contains("_3PV",Qt::CaseInsensitive) - || multiPartIconData.multiPartIconId.contains("_3PH",Qt::CaseInsensitive)) { + if (multiPartIconData.multiPartIconId.contains("_3PV", Qt::CaseInsensitive) + || multiPartIconData.multiPartIconId.contains("_3PH", Qt::CaseInsensitive)) { noOfPieces = 3; - } else if (multiPartIconData.multiPartIconId.contains("_9P",Qt::CaseInsensitive)) { + } else if (multiPartIconData.multiPartIconId.contains("_9P", Qt::CaseInsensitive)) { noOfPieces = 9; } @@ -247,12 +223,13 @@ * * Returns the shared css(stylesheet) information */ -HbCss::StyleSheet *HbThemeClientPrivate::getSharedStyleSheet(const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) +HbCss::StyleSheet *HbThemeClientPrivate::getSharedStyleSheet( + const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) { if ( !clientConnected ) { return 0; } - HbCss::StyleSheet* styleSheet(0); + HbCss::StyleSheet *styleSheet(0); TBuf<256> fileDes(fileName.utf16()); TBuf<5> layerPriority; @@ -316,7 +293,8 @@ if (KErrNone == err) { #ifdef THEME_SERVER_TRACES - qDebug() << "HbThemeClientPrivate::getSharedEffect effectInfo.offSet is:" << effectInfo.offset; + qDebug() << "HbThemeClientPrivate::getSharedEffect effectInfo.offSet is:" + << effectInfo.offset; #endif if (effectInfo.offset >= 0) { fxmlData = HbMemoryUtils::getAddress( @@ -335,7 +313,7 @@ * * Adds the shared effect information */ -bool HbThemeClientPrivate::addSharedEffect(const QString& filePath) +bool HbThemeClientPrivate::addSharedEffect(const QString &filePath) { #ifdef THEME_SERVER_TRACES qDebug() << "HbThemeClientPrivate::addSharedEffect" << filePath; @@ -384,7 +362,7 @@ * * unload icon */ -void HbThemeClientPrivate::unloadIcon(const QString& iconPath , +void HbThemeClientPrivate::unloadIcon(const QString &iconPath, const QSizeF &size, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -411,7 +389,7 @@ params.renderMode = (TUint8)renderMode; TPckg paramPckg(params); - TIpcArgs args(¶mPckg,0); + TIpcArgs args(¶mPckg, 0); SendReceive(EUnloadIcon, args); } @@ -420,7 +398,7 @@ * * unload multiple icons */ -void HbThemeClientPrivate::unLoadMultiIcon(const QStringList& iconPathList, +void HbThemeClientPrivate::unLoadMultiIcon(const QStringList &iconPathList, const QVector &sizeList, Qt::AspectRatioMode aspectRatioMode, QIcon::Mode mode, @@ -458,13 +436,14 @@ * * Returns the layout definition for the given file name,layout name,section name */ -HbWidgetLoader::LayoutDefinition* HbThemeClientPrivate::getSharedLayoutDefs(const QString &fileName,const QString &layout,const QString §ion) +HbWidgetLoader::LayoutDefinition *HbThemeClientPrivate::getSharedLayoutDefs( + const QString &fileName, const QString &layout, const QString §ion) { if ( !clientConnected ) { return 0; } - HbWidgetLoader::LayoutDefinition* layoutDef(0); + HbWidgetLoader::LayoutDefinition *layoutDef(0); TBuf<256> fileDes(fileName.utf16()); TBuf<256> layoutDes(layout.utf16()); @@ -492,9 +471,9 @@ HbDeviceProfileList *HbThemeClientPrivate::deviceProfiles() { if ( !clientConnected ) { - if(!connectToServer()) { - qWarning()<<"Theme client unable to connect to server in HbThemeClientPrivate::deviceProfiles"; - return 0; + if(!connectToServer()) { + qWarning() << "Theme client unable to connect to server in HbThemeClientPrivate::deviceProfiles"; + return 0; } } @@ -558,22 +537,21 @@ TInt HbThemeClientPrivate::CreateServerProcess() { TInt result; - const TUid KServerUid2={0x100039CE}; - const TUidType serverUid( KNullUid, KServerUid2, KServerUid3 ); + const TUid KServerUid2 = {0x100039CE}; + const TUidType serverUid(KNullUid, KServerUid2, KServerUid3); RProcess server; _LIT(KThemeServerExe,"hbthemeserver.exe"); - result = server.Create( KThemeServerExe, KNullDesC, EOwnerProcess ); + result = server.Create(KThemeServerExe, KNullDesC, EOwnerProcess); if (KErrNone != result) { return result; } TRequestStatus status; server.Rendezvous(status); - if (status!=KRequestPending) { + if (status != KRequestPending) { server.Kill(0); // abort startup - } - else { + } else { server.Resume(); // logon OK - start the server } User::WaitForRequest(status);// wait for start or death @@ -585,14 +563,15 @@ * getMultiIconInfo function returns a list of HbSharedIconInfo * for the given list of frameitems. */ -HbSharedIconInfoList HbThemeClientPrivate::getMultiIconInfo(const QStringList &multiPartIconList, - const QVector &sizeList , - Qt::AspectRatioMode aspectRatioMode, - QIcon::Mode mode, - bool mirrored, - HbIconLoader::IconLoaderOptions options, - const QColor &color, - HbRenderingMode renderMode) +HbSharedIconInfoList HbThemeClientPrivate::getMultiIconInfo( + const QStringList &multiPartIconList, + const QVector &sizeList, + Qt::AspectRatioMode aspectRatioMode, + QIcon::Mode mode, + bool mirrored, + HbIconLoader::IconLoaderOptions options, + const QColor &color, + HbRenderingMode renderMode) { Q_UNUSED(options) @@ -625,6 +604,15 @@ } /** + * HbThemeClientPrivate::setTheme() + */ +void HbThemeClientPrivate::setTheme(const QString &theme) +{ + // In Symbian P&S is used to change active theme + Q_UNUSED(theme); +} + +/** * Notifies the server about the foreground lost event. */ void HbThemeClientPrivate::notifyForegroundLostToServer() @@ -644,14 +632,16 @@ { int freeSharedMem = -1; if ( !clientConnected ) { - qWarning()<<"Theme client unable to connect to server in HbThemeClientPrivate::freeSharedMemory"; + qWarning() << "Theme client unable to connect to server in HbThemeClientPrivate::freeSharedMemory"; return freeSharedMem; } TPckg freeInfo(freeSharedMem); TIpcArgs args(0, &freeInfo); TInt err = SendReceive(EFreeSharedMem, args); +#ifdef THEME_SERVER_TRACES qDebug() << "HbThemeClientPrivate::freeSharedMemory end"; +#endif return freeSharedMem; } @@ -662,7 +652,7 @@ { int allocatedSharedMem = -1; if ( !clientConnected ) { - qWarning()<<"Theme client unable to connect to server in HbThemeClientPrivate::allocatedSharedMemory"; + qWarning() << "Theme client unable to connect to server in HbThemeClientPrivate::allocatedSharedMemory"; return allocatedSharedMem; } @@ -679,7 +669,7 @@ { int allocatedHeapMem = -1; if ( !clientConnected ) { - qWarning()<<"Theme client unable to connect to server in HbThemeClientPrivate::allocatedHeapMemory"; + qWarning() << "Theme client unable to connect to server in HbThemeClientPrivate::allocatedHeapMemory"; return allocatedHeapMem; } @@ -736,7 +726,7 @@ { if ( !clientConnected ) { if(!connectToServer()) { - qWarning()<<"Theme client unable to connect to server in HbThemeClientPrivate::typefaceInfo"; + qWarning() << "Theme client unable to connect to server in HbThemeClientPrivate::typefaceInfo"; return 0; } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemecommon_p.h --- a/src/hbcore/theme/hbthemecommon_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemecommon_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,6 +38,7 @@ #endif #define THEME_SERVER_NAME "hbthemeserver" +#define SHARED_MEMORY_MANAGER_UNIT_TEST "unittest_hbsharedmemorymanager" #define BIN_CSS_APP "hbbincssmaker" #define BIN_CSS_APP_SYMBIAN "hbbincssmaker_symbian" #ifdef HB_BIN_CSS @@ -46,8 +47,7 @@ #define HB_THEME_SHARED_PIXMAP_CHUNK "themeserver_chunk" #endif #define ORGANIZATION "Nokia" -#define THEME_COMPONENT "Hb Themes" -#define CURRENT_THEME_KEY "CurrentTheme" +#define THEME_COMPONENT "Hb/Themes" // To enable/disable debug messages for theme server functionality // this is master trace switch that enables all theme server related traces @@ -273,13 +273,11 @@ }; // Function codes (opcodes) used in message passing between client and server -enum HbThemeServerRequest - { +enum HbThemeServerRequest { EInvalidServerRequest = 0, EIconLookup = 1, - EIconDefaultSize, EStyleSheetLookup, - EThemeSelection, + EThemeSelection = 4, EMultiPieceIcon, EMultiIcon, EWidgetMLLookup, @@ -311,9 +309,9 @@ EServerAllocReset, EFreeGPUMem, ETotalGPUMem, - EGPULRUSize, ERefCount, #endif + EGPULRUSize, EThemeContentUpdate, EEffectLookupFilePath, EEffectAdd, @@ -330,18 +328,17 @@ #ifdef HB_THEME_SERVER_MEMORY_REPORT ,ECreateMemoryReport #endif - }; + }; //Rendering Modes -enum HbRenderingMode -{ - ESWRendering, - EHWRendering +enum HbRenderingMode { + ESWRendering, + EHWRendering }; struct HbFreeRamNotificationData { - int bytesToFree; - bool useSwRendering; + int bytesToFree; + bool useSwRendering; }; #endif /* HBTHEMECOMMON_P_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemecommon_symbian_p.h --- a/src/hbcore/theme/hbthemecommon_symbian_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemecommon_symbian_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -75,7 +75,7 @@ }; // server name -_LIT(KThemeServerName,"hbthemeserver"); +_LIT(KThemeServerName,"!hbthemeserver"); const TUid KServerUid3={0x20022E82}; // Common unique ID for Pub/Sub const TInt KNewThemeForThemeChanger = 9; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemelistener_symbian_p.cpp --- a/src/hbcore/theme/hbthemelistener_symbian_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemelistener_symbian_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,7 +22,9 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ - +#include "hbthemelistener_symbian_p.h" +#include "hbthemeclient_p_p.h" +#include "hbthemecommon_symbian_p.h" #include #include @@ -34,10 +36,6 @@ #include #endif -#include "hbthemeclient_p_p.h" -#include "hbthemelistener_symbian_p.h" -#include "hbthemecommon_symbian_p.h" - /** * Constructor */ @@ -69,14 +67,19 @@ #endif mRepository->NotifyRequest(HbThemeUtils::CurrentThemeSetting, iStatus); SetActive(); + HbThemeIndexInfo info = HbThemeUtils::getThemeIndexInfo(ActiveTheme); + if (info.address) { + themeClient->handleThemeChange(info.name); + return; + } + // Fallback to reading cenrep TBuf<256> newTheme; if (KErrNone == mRepository->Get(HbThemeUtils::CurrentThemeSetting, newTheme)) { - QString qnewTheme((QChar*)newTheme.Ptr(),newTheme.Length()); + QString qnewTheme((QChar*)newTheme.Ptr(), newTheme.Length()); themeClient->handleThemeChange(qnewTheme); } } - /** * DoCancel */ @@ -84,4 +87,3 @@ { mRepository->NotifyCancelAll(); } - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemelistener_symbian_p.h --- a/src/hbcore/theme/hbthemelistener_symbian_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemelistener_symbian_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,14 +23,16 @@ ** ****************************************************************************/ -#ifndef HBTHEMELISTENER_P_H -#define HBTHEMELISTENER_P_H +#ifndef HBTHEMELISTENER_SYMBIAN_P_H +#define HBTHEMELISTENER_SYMBIAN_P_H #include #include #include -class CHbThemeListenerPrivate:public CActive +class HbThemeClientPrivate; + +class CHbThemeListenerPrivate : public CActive { public: //themeClient is notified, when the theme changes. @@ -44,6 +46,4 @@ CRepository *mRepository; }; -#endif /*HBTHEMELISTENER_P_H_ */ - - +#endif /*HBTHEMELISTENER_SYMBIAN_P_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemeutils_p.cpp --- a/src/hbcore/theme/hbthemeutils_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemeutils_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,6 +24,17 @@ ****************************************************************************/ #include "hbthemeutils_p.h" +#include "hbtheme.h" +#include "hbiniparser_p.h" +#include "hbthemecommon_p.h" +#include "hbthemeclient_p.h" +#include "hbtheme_p.h" + +#ifdef Q_OS_SYMBIAN +#include "hbthemecommon_symbian_p.h" +#include +#include +#endif #include #include @@ -33,54 +44,43 @@ #include #include -#include -#include -#include "hbstandarddirs_p.h" -#include "hbiniparser_p.h" -#include "hblayeredstyleloader_p.h" -#include "hbthemecommon_p.h" - -#ifdef Q_OS_SYMBIAN -#include "hbthemecommon_symbian_p.h" -#include -#include -#endif - // Standard folder names - +const char *HbThemeUtils::themeResourceFolder = "theme"; +const char *HbThemeUtils::platformHierarchy = "themes"; +const char *HbThemeUtils::operatorHierarchy = "prioritytheme"; const char *HbThemeUtils::iconsResourceFolder = "icons"; const char *HbThemeUtils::effectsResourceFolder = "effects"; const char *HbThemeUtils::styleResourceFolder = "style"; -const char *HbThemeUtils::themeResourceFolder = "theme"; -const char *HbThemeUtils::operatorHierarchy = "operatortheme"; -const char *HbThemeUtils::appHierarchy = "apptheme"; -const char *HbThemeUtils::platformHierarchy = "themes"; -const char *operatorNameKey = "OperatorName"; static const char *themeSettingFile = "theme.theme"; static const char *baseThemeVariable = "BaseTheme"; static const char *defaultThemeVariable = "DefaultActiveTheme"; +// Core resource root dir +static const char *coreResourcesRootDir = ":"; + // These are the used setting names corresponding to HbThemeUtils::Setting enumeration. -static const QString settingNames[6] = {"", "basetheme", "defaulttheme", "defaultthemedir", "currenttheme", "operatorbasepath"}; -static const char *getResourceFolderName(Hb::ResourceType resType) +static const QString settingNames[6] = {"", "basetheme", "defaulttheme", + "", "currenttheme", "operatorbasepath"}; + +static HbHeapIndexInfo *heapIndex = 0; + +QString themesDir() { - switch(resType) { - case Hb::IconResource: - return HbThemeUtils::iconsResourceFolder; - case Hb::EffectResource: - return HbThemeUtils::effectsResourceFolder; - case Hb::ThemeResource: - return HbThemeUtils::themeResourceFolder; - case Hb::StyleSheetResource: - return HbThemeUtils::styleResourceFolder; - default: - break; +#ifdef Q_OS_SYMBIAN + static QString mainThemesDir("z:/resource/hb"); +#else + static QString mainThemesDir = QDir::fromNativeSeparators(qgetenv("HB_THEMES_DIR")); + // Do not call absolutePath if the path is empty, + // because it would return current path in that case. + if (!mainThemesDir.isEmpty()) { + mainThemesDir = QDir(mainThemesDir).absolutePath(); } - // This just to avoid warning - return HbThemeUtils::iconsResourceFolder; +#endif + return mainThemesDir; } + /*! @proto @hbcore @@ -94,64 +94,48 @@ */ -class HbThemeUtilsPrivate +class HbThemeSettings { public: - HbThemeUtilsPrivate() : settingsRetrieved(false) + HbThemeSettings() : settingsRetrieved(false) { - // add the operator level, app level and platform level hierarchies in the hierarchy list. - hierarchies << HbHierarchy(HbThemeUtils::operatorHierarchy, HbLayeredStyleLoader::Priority_Operator) -#ifdef USE_APPTHEMES - << HbHierarchy(HbThemeUtils::appHierarchy, HbLayeredStyleLoader::Priority_Application) -#endif - << HbHierarchy(HbThemeUtils::platformHierarchy, HbLayeredStyleLoader::Priority_Theme); } - QString constructOperatorPath(const QString &operatorPath, const QString &fileName) const - { - return operatorPath + '/' + fileName; - } - void initSettings(); + + ~HbThemeSettings(); void readSettings(); + void initSettings(); + QString getThemeFromFile(const QString &variable, const QString &rootDir); public: // data - QString operatorName; - QVector hierarchies; - bool settingsRetrieved; // Setting values are stored here to avoid overhead of reading from QSettings every time. QString currentTheme; QString defaultTheme; - QString defaultThemeRootDir; QString baseTheme; - QString operatorPath; + QString operatorName; }; -void HbThemeUtilsPrivate::initSettings() +HbThemeSettings::~HbThemeSettings() { - // read the operator name from settings - operatorName = HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting).trimmed(); - - // construct operator path - if (!operatorName.isEmpty()) { - QStringList operatorPaths; - operatorPaths << QLatin1String(HbThemeUtils::operatorHierarchy) + '/'; - operatorPaths = HbStandardDirs::findExistingFolderList(operatorPaths, QString(), Hb::IconResource); - for (int i=0;i < operatorPaths.size();i++) { - if (operatorPaths[i] == operatorName) { - operatorPath = operatorPaths[i] + '/' + operatorName; - break; - } + if (heapIndex) { + // Free allocated memory + if (heapIndex->baseTheme.address) { + delete heapIndex->baseTheme.address; } - } + if (heapIndex->priorityTheme.address) { + delete heapIndex->priorityTheme.address; + } + if (heapIndex->activeTheme.address) { + delete heapIndex->activeTheme.address; + } + delete heapIndex; + } } -void HbThemeUtilsPrivate::readSettings() +void HbThemeSettings::readSettings() { - // Read settings from QSettings and store them in member variables to - // avoid slow instantiating of QSettings in advance. - - // The only changing setting is currentThemeSetting and its value is updated in theme change event. + // The only changing setting is currentThemeSetting and its value is updated in server side in theme change event. if (!settingsRetrieved) { #ifdef Q_OS_SYMBIAN @@ -159,239 +143,128 @@ TRAP_IGNORE(repository = CRepository::NewL(KServerUid3)); if (repository) { TBuf<256> value; - if (KErrNone == repository->Get(HbThemeUtils::CurrentThemeSetting,value)) { - QString qvalue((QChar*)value.Ptr(),value.Length()); + if (KErrNone == repository->Get(HbThemeUtils::CurrentThemeSetting, value)) { + QString qvalue((QChar*)value.Ptr(), value.Length()); currentTheme = qvalue.trimmed(); } value.Zero(); - if (KErrNone == repository->Get(HbThemeUtils::DefaultThemeSetting,value)) { - QString qvalue((QChar*)value.Ptr(),value.Length()); + if (KErrNone == repository->Get(HbThemeUtils::DefaultThemeSetting, value)) { + QString qvalue((QChar*)value.Ptr(), value.Length()); defaultTheme = qvalue.trimmed(); } value.Zero(); - if (KErrNone == repository->Get(HbThemeUtils::DefaultThemeRootDirSetting,value)) { - QString qvalue((QChar*)value.Ptr(),value.Length()); - defaultThemeRootDir = qvalue.trimmed(); - } else { - // Use the default value - defaultThemeRootDir = HbStandardDirs::themesDir(); - } - value.Zero(); - if (KErrNone == repository->Get(HbThemeUtils::BaseThemeSetting,value)) { - QString qvalue((QChar*)value.Ptr(),value.Length()); + if (KErrNone == repository->Get(HbThemeUtils::BaseThemeSetting, value)) { + QString qvalue((QChar*)value.Ptr(), value.Length()); baseTheme = qvalue.trimmed(); } value.Zero(); - if (KErrNone == repository->Get(HbThemeUtils::OperatorNameSetting,value)) { - QString qvalue((QChar*)value.Ptr(),value.Length()); + if (KErrNone == repository->Get(HbThemeUtils::OperatorNameSetting, value)) { + QString qvalue((QChar*)value.Ptr(), value.Length()); operatorName = qvalue.trimmed(); } delete repository; } #else - QSettings settings(QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT)); + QSettings settings(QSettings::IniFormat, QSettings::UserScope, QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT)); currentTheme = settings.value(settingNames[HbThemeUtils::CurrentThemeSetting]).toString(); defaultTheme = settings.value(settingNames[HbThemeUtils::DefaultThemeSetting]).toString(); - defaultThemeRootDir = settings.value(settingNames[HbThemeUtils::DefaultThemeRootDirSetting]).toString(); baseTheme = settings.value(settingNames[HbThemeUtils::BaseThemeSetting]).toString(); operatorName = settings.value(settingNames[HbThemeUtils::OperatorNameSetting]).toString(); #endif + initSettings(); + settingsRetrieved = true; } } -static HbThemeUtilsPrivate d; - -void HbThemeUtils::initSettings() +void HbThemeSettings::initSettings() { - d.initSettings(); -} - -/* Adds a new hierarchy level to be used for attribute look-up - * - * @param newHierrachy the name of the new hierrachy - * @param priorityOrder priority order of the new hierarchy top be added. - * if priorityOrder is greater than the currently existing hierarchies, this hierarchy will be appended - * at the end of the hierarchy list - * - * @return the positon in the new hierarchy in the hierarchy list. -1 if the new hierarchy is not added. - */ - -int HbThemeUtils::addHierarchy(const QString &newHierarchy, int priorityOrder) -{ - int retValue = -1; - if (priorityOrder >= 0) { - // check that the hierarchy to be added is neither of opertor level,app level and platform level. - if(newHierarchy != HbThemeUtils::operatorHierarchy - && newHierarchy != HbThemeUtils::appHierarchy - && newHierarchy != HbThemeUtils::platformHierarchy){ - - // if priority given is more than the number of hierarchies already existing, append the new - // hierarchy at end. - HbHierarchy add(newHierarchy, HbLayeredStyleLoader::Priority_Theme); - if (priorityOrder > d.hierarchies.count()) { - d.hierarchies.append(add); - retValue = d.hierarchies.count() - 1; - } - // else insert it at the correct position - else { - d.hierarchies.insert(priorityOrder,add); - retValue = priorityOrder; - } + // Validate base theme + bool modified = false; + if (baseTheme.isEmpty()) { + modified = true; + baseTheme = getThemeFromFile(baseThemeVariable, themesDir()); + if (baseTheme.isEmpty()) { + baseTheme = getThemeFromFile(baseThemeVariable, coreResourcesRootDir); + } + } + if (!HbThemeUtils::isThemeValid(baseTheme)) { + modified = true; + // check if the theme name is logical + baseTheme = themesDir() + '/' + HbThemeUtils::platformHierarchy + '/' + + HbThemeUtils::iconsResourceFolder + '/' + baseTheme; + if (!HbThemeUtils::isThemeValid(baseTheme)) { + baseTheme = getThemeFromFile(baseThemeVariable, coreResourcesRootDir); } } - return retValue; -} + // Save if needed + if (modified) { + HbThemeUtils::setThemeSetting(HbThemeUtils::BaseThemeSetting, baseTheme); + modified = false; + } -/* Removes a hierarchy level from the hierarchy list - * - * @param newHierrachy the name of the hierrachy to be removed. - * - * @ret true if the hierarchy has been removed, else false. - */ -bool HbThemeUtils::removeHierarchy(const QString &hierarchyName) -{ - bool retValue = false; - // check whether an attempt is made to remove operator level, app level or platform level hierarchy - if (hierarchyName != HbThemeUtils::operatorHierarchy - && hierarchyName != HbThemeUtils::appHierarchy - && hierarchyName != HbThemeUtils::platformHierarchy) { - QVector::iterator end = d.hierarchies.end(); - for (QVector::iterator i = d.hierarchies.begin(); i != end; ++i) { - if (i->name == hierarchyName) { - d.hierarchies.erase(i); - retValue = true; - break; - } + // Validate default theme + if (defaultTheme.isEmpty()) { + modified = true; + defaultTheme = getThemeFromFile(defaultThemeVariable, themesDir()); + if (defaultTheme.isEmpty()) { + defaultTheme = getThemeFromFile(defaultThemeVariable, coreResourcesRootDir); } } - return retValue; -} + if (!HbThemeUtils::isThemeValid(defaultTheme)) { + modified = true; + // check if the theme name is logical + defaultTheme = themesDir() + '/' + HbThemeUtils::platformHierarchy + '/' + + HbThemeUtils::iconsResourceFolder + '/' + defaultTheme; + if (!HbThemeUtils::isThemeValid(defaultTheme)) { + defaultTheme = getThemeFromFile(defaultThemeVariable, coreResourcesRootDir); + } + } + if (modified) { + HbThemeUtils::setThemeSetting(HbThemeUtils::DefaultThemeSetting, defaultTheme); + modified = false; + } -QString HbThemeUtils::operatorBasePath() -{ - return d.operatorPath; -} -/* @ret hierarchy of themes in priority. - */ -QVector HbThemeUtils::hierarchies() -{ - return d.hierarchies; + // Validate current theme + if (!HbThemeUtils::isThemeValid(currentTheme)) { + currentTheme = defaultTheme; + HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, currentTheme); + } } -/* It constructs the hierarchy list with complete path info using the existing hierarchy list. - * - * @param fileName name of the file to be appended at end of all hierarchy levels - * @param currentTheme Name of the currently used theme - * @param resType type of Resource whether "style" or "icons" - * - * @ret list of hierarchy of themes in priority.Also appends the default path with least priority. +/* reads the theme from theme.theme file */ -QMap HbThemeUtils::constructHierarchyListWithPathInfo(const QString &fileName, - const QString ¤tTheme, - const Hb::ResourceType resType) +QString HbThemeSettings::getThemeFromFile(const QString &variable, const QString &rootDir) { - QMap hierarchyListWithPathInfo; - - // Map the resource enum to string here - const QString &resourcePath = getResourceFolderName(resType); + QFile themeSetting(rootDir + '/' + HbThemeUtils::platformHierarchy + '/' + themeSettingFile); + QString theme; + HbIniParser iniParser; - foreach (const HbHierarchy &hierarchy, d.hierarchies) { - switch(hierarchy.layerPriority) { - case HbLayeredStyleLoader::Priority_Operator: - if (!d.operatorPath.isEmpty()) { - hierarchyListWithPathInfo.insert(HbLayeredStyleLoader::Priority_Operator, - d.constructOperatorPath(operatorBasePath(), fileName)); - } - break; - case HbLayeredStyleLoader::Priority_Application: - hierarchyListWithPathInfo.insert(HbLayeredStyleLoader::Priority_Application, - (hierarchy.name + '/' + HbMemoryUtils::getCleanAppName() + '/' + resourcePath + '/' + currentTheme + '/' + fileName)); - break; - case HbLayeredStyleLoader::Priority_Theme: - // Add platform theme folder only if it is different from base theme - // Base theme is anyway added at the core priority - if (currentTheme != baseTheme().name) { - hierarchyListWithPathInfo.insert(HbLayeredStyleLoader::Priority_Theme, - (hierarchy.name + '/' + resourcePath + '/' + currentTheme + '/' + fileName)); - } - break; - default: - // this is for a new hierarchy level and for the time being HbLayeredStyleLoader::Priority_Theme prirority is used,since there is no enum defined in hblayeredstyleloader_p.h - // priority should be replaced with respective enum. - hierarchyListWithPathInfo.insert(HbLayeredStyleLoader::Priority_Theme, - (hierarchy.name + '/' + resourcePath + '/' + currentTheme + '/' + fileName)); - } + if (themeSetting.open(QIODevice::ReadOnly) && iniParser.read(&themeSetting)){ + theme = rootDir + '/' + HbThemeUtils::platformHierarchy + '/' + + HbThemeUtils::iconsResourceFolder + '/' + + iniParser.value("Default", variable).trimmed(); } - - if (resType == Hb::StyleSheetResource || resType == Hb::EffectResource) { - // lets add base CSS path too in this list for now - // This comes last in base hierarchy - hierarchyListWithPathInfo.insert(HbLayeredStyleLoader::Priority_Core, - (QLatin1String("themes/") + resourcePath + '/' + baseTheme().name + '/' + fileName)); - } - - return hierarchyListWithPathInfo; + return theme; } -/* returns information of base theme - */ -const HbThemeInfo &HbThemeUtils::baseTheme() -{ - static HbThemeInfo baseThemeInfo; - - if (baseThemeInfo.name.isEmpty()) { - // basetheme is empty, means it was not yet filled with appropriate values - // Check if its value is stored in settings. - baseThemeInfo.name = getThemeSetting(BaseThemeSetting).trimmed(); - if ( baseThemeInfo.name.isEmpty() ) { - // Settings not yet initialized - // Check if Base theme is defined in theme.theme - baseThemeInfo = getBaseThemeFromFile(HbStandardDirs::themesDir()); - if (baseThemeInfo.name.isEmpty()) { - // Base theme does not exists in rom - // Get the base theme info from core resources - baseThemeInfo = getBaseThemeFromFile(coreResourcesRootDir); - } - } else { - // So settings are initialized, it will have other value as well - baseThemeInfo.rootDir = getThemeSetting(DefaultThemeRootDirSetting).trimmed(); - } - } - - return baseThemeInfo; -} - -/* returns name of default theme - */ -HbThemeInfo HbThemeUtils::defaultTheme() -{ - - // getting base theme makes sure that default theme was added in - // QSettings, if it was not already done - const HbThemeInfo &themeInfo = baseTheme(); - - // Assuming the path of default theme and base theme are same - return HbThemeInfo(getThemeSetting(DefaultThemeSetting), themeInfo.rootDir); -} +Q_GLOBAL_STATIC(HbThemeSettings, themeSettings); QString HbThemeUtils::getThemeSetting(Setting setting) { // Make sure settings are read from QSettings. - d.readSettings(); + themeSettings()->readSettings(); switch (setting) { case CurrentThemeSetting: - return d.currentTheme; + return themeSettings()->currentTheme; case DefaultThemeSetting: - return d.defaultTheme; - case DefaultThemeRootDirSetting: - return d.defaultThemeRootDir; + return themeSettings()->defaultTheme; case BaseThemeSetting: - return d.baseTheme; + return themeSettings()->baseTheme; case OperatorNameSetting: - return d.operatorName; + return themeSettings()->operatorName; default: return QString(); } @@ -404,142 +277,237 @@ TRAP_IGNORE(repository = CRepository::NewL(KServerUid3)); if (repository) { TPtrC valueptr(reinterpret_cast(value.constData())); - if (KErrNotFound == repository->Set(setting,valueptr)) { - repository->Create(setting,valueptr); + if (KErrNotFound == repository->Set(setting, valueptr)) { + repository->Create(setting, valueptr); } delete repository; } #else - QSettings settings(QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT)); + QSettings settings(QSettings::IniFormat, QSettings::UserScope, QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT)); settings.setValue(settingNames[setting], QVariant(value)); // Destructor of QSettings flushes the changed setting in the INI file. #endif + updateThemeSetting(setting, value); } /** * Updates the setting's value in stored member variables. * Normally the settings are loaded from QSettings when method getThemeSetting() is called for the first time. -* When there is a change in settings, this method can be used to sync the setting value stored in HbThemeUtilsPrivate. +* When there is a change in settings, this method can be used to sync the setting value stored in HbThemeSettings. * E.g. theme change event updates the current theme setting, currently no other settings are changing their values. */ void HbThemeUtils::updateThemeSetting(Setting setting, const QString &value) { switch (setting) { case CurrentThemeSetting: - d.currentTheme = value; + themeSettings()->currentTheme = value; break; case DefaultThemeSetting: - d.defaultTheme = value; - break; - case DefaultThemeRootDirSetting: - d.defaultThemeRootDir = value; + themeSettings()->defaultTheme = value; break; case BaseThemeSetting: - d.baseTheme = value; + themeSettings()->baseTheme = value; break; case OperatorNameSetting: - d.operatorName = value; + themeSettings()->operatorName = value; break; default: break; } } - -/* reads the theme name from theme.theme file, stores the same in theme settings, - returns the pair of theme name and its root directory - */ -HbThemeInfo HbThemeUtils::getBaseThemeFromFile(const QString &rootDir) -{ - QFile themeSetting(rootDir + '/' + platformHierarchy + '/' + themeSettingFile); - HbThemeInfo themeInfo; - HbIniParser iniParser; - - if (themeSetting.open(QIODevice::ReadOnly) && iniParser.read(&themeSetting)){ - themeInfo.name = iniParser.value("Default", baseThemeVariable).trimmed(); - - QString defaultTheme = iniParser.value("Default", defaultThemeVariable).trimmed(); - - // default theme name may not exist, in which case using base theme as default theme - if (defaultTheme.isEmpty()) { - defaultTheme = themeInfo.name; - } - - // Save theme names in settings - saveBaseThemeSettings(themeInfo, defaultTheme, rootDir); - } - return themeInfo; -} - -void HbThemeUtils::saveBaseThemeSettings(HbThemeInfo &baseThemeInfo, - const QString &defaultTheme, - const QString &rootDir) -{ - // If there is any base theme - if ((!baseThemeInfo.name.isEmpty()) && isThemeValid(HbThemeInfo(baseThemeInfo.name,rootDir))) { - // Save these theme names in settings - setThemeSetting(BaseThemeSetting, baseThemeInfo.name); - setThemeSetting(DefaultThemeRootDirSetting, rootDir); - - // Store default theme also in settings, only if it is valid - if (baseThemeInfo.name == defaultTheme || isThemeValid(HbThemeInfo(defaultTheme, rootDir))) { - setThemeSetting(DefaultThemeSetting, defaultTheme); - } - baseThemeInfo.rootDir = rootDir; - d.settingsRetrieved = false; - } -} /* checks whether the theme is valid */ -bool HbThemeUtils::isThemeValid(const HbThemeInfo &themeInfo) +bool HbThemeUtils::isThemeValid(const QString &themePath) { - // If the theme contains index.theme in icons resources + // If the theme contains .themeindex and index.theme files // it will be assumed valid - QFile themeIndexFile(themeInfo.rootDir + '/' + platformHierarchy + '/' + iconsResourceFolder + "/" + themeInfo.name + "/index.theme"); - return themeIndexFile.open(QIODevice::ReadOnly); + QString indexFile = QString(themePath).replace("/icons/", QString('/')) + ".themeindex"; + return (QFile::exists(themePath + "/index.theme") && QFile::exists(indexFile)); } -const HbThemeIndexInfo HbThemeUtils::getThemeIndexInfo(const HbThemeType &type) +HbThemeIndexInfo HbThemeUtils::getThemeIndexInfo(const HbThemeType &type) { HbThemeIndexInfo info; + +#ifndef Q_OS_SYMBIAN + if (!heapIndex) { + heapIndex = new HbHeapIndexInfo(); + HbThemeUtils::loadHeapThemeIndexes(); + } + + if (heapIndex) { + switch(type) { + case BaseTheme: + info = heapIndex->baseTheme; + break; + case OperatorC: + info = heapIndex->priorityTheme; + break; + case ActiveTheme: + info = heapIndex->activeTheme; + break; + default: + break; + } + } +#else GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - HbSharedChunkHeader *chunkHeader = (HbSharedChunkHeader*)(manager->base()); - - switch(type) { - case BaseTheme: - info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->baseThemeNameOffset)); - info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->baseThemePathOffset)); - info.themeIndexOffset = chunkHeader->baseThemeIndexOffset; - break; - case OperatorC: - info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->operatorThemeDriveCNameOffset)); - info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->operatorThemeDriveCPathOffset)); - info.themeIndexOffset = chunkHeader->operatorThemeDriveCIndexOffset; - break; - case OperatorROM: - info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->operatorThemeRomPathOffset)); - info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->operatorThemeRomPathOffset)); - info.themeIndexOffset = chunkHeader->operatorThemeRomIndexOffset; - break; - case ActiveTheme: - info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->activeThemeNameOffset)); - info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, - chunkHeader->activeThemePathOffset)); - info.themeIndexOffset = chunkHeader->activeThemeIndexOffset; - break; - default: - break; + if (manager) { + HbSharedChunkHeader *chunkHeader = (HbSharedChunkHeader*)(manager->base()); + + switch(type) { + case BaseTheme: + if (chunkHeader->baseThemeIndexOffset > 0) { + info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->baseThemeNameOffset)); + info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->baseThemePathOffset)); + info.address = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->baseThemeIndexOffset); + } + break; + case OperatorC: + if (chunkHeader->operatorThemeDriveCIndexOffset > 0) { + info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->operatorThemeDriveCNameOffset)); + info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->operatorThemeDriveCPathOffset)); + info.address = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->operatorThemeDriveCIndexOffset); + } + break; + case OperatorROM: + if (chunkHeader->operatorThemeRomIndexOffset > 0) { + info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->operatorThemeRomNameOffset)); + info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->operatorThemeRomPathOffset)); + info.address = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->operatorThemeRomIndexOffset); + } + break; + case ActiveTheme: + if (chunkHeader->activeThemeIndexOffset > 0) { + info.name = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->activeThemeNameOffset)); + info.path = QString(HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->activeThemePathOffset)); + info.address = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, + chunkHeader->activeThemeIndexOffset); + } + break; + default: + break; + } } - +#endif // Q_OS_SYMBIAN return info; } +bool HbThemeUtils::isLogicalName(const QString &fileName) +{ + return !(fileName.contains(QChar(':'), Qt::CaseSensitive) || + fileName.contains(QChar('/'), Qt::CaseSensitive) || + fileName.contains(QChar('\\'), Qt::CaseSensitive)); +} +char *HbThemeUtils::createHeapThemeIndex(const HbThemeInfo &theme) +{ + char *address = 0; + + QString path = QDir::toNativeSeparators(theme.rootDir); + QString filename; + + filename.append(path); + filename.append('/'); + filename.append(theme.name); + filename.append(".themeindex"); + + QFile indexFile(filename); + if (indexFile.open(QIODevice::ReadOnly)) { + GET_MEMORY_MANAGER(HbMemoryManager::HeapMemory); + qint64 byteSize = indexFile.size(); + int indexOffset = manager->alloc(byteSize); + if (indexOffset != -1) { + address = HbMemoryUtils::getAddress(HbMemoryManager::HeapMemory, indexOffset); + indexFile.read(address, byteSize); + indexFile.close(); + } + } + + return address; +} + +void HbThemeUtils::loadHeapThemeIndex(HbThemeType type) +{ + if (heapIndex) { + switch(type) { + case BaseTheme: { + if (heapIndex->baseTheme.address) { + delete heapIndex->baseTheme.address; + } + QString baseThemeName = getThemeSetting(BaseThemeSetting); + HbThemeInfo baseInfo; + QDir path(baseThemeName); + baseInfo.name = path.dirName(); + QString absolutePath = path.absolutePath(); + baseInfo.rootDir = absolutePath.left(absolutePath.indexOf("/icons/")); + + heapIndex->baseTheme.address = createHeapThemeIndex(baseInfo); + if (heapIndex->baseTheme.address) { + heapIndex->baseTheme.name = baseInfo.name; + heapIndex->baseTheme.path = baseInfo.rootDir; + } + break; + } + case OperatorC: { + if (heapIndex->priorityTheme.address) { + delete heapIndex->priorityTheme.address; + } + HbThemeInfo operatorInfo; + operatorInfo.name = getThemeSetting(OperatorNameSetting); + if (!operatorInfo.name.isEmpty()) { + operatorInfo.rootDir.append(themesDir() + '/' + QLatin1String(operatorHierarchy)); + heapIndex->priorityTheme.address = createHeapThemeIndex(operatorInfo); + if (heapIndex->priorityTheme.address) { + heapIndex->priorityTheme.name = operatorInfo.name; + heapIndex->priorityTheme.path = operatorInfo.rootDir; + } + } + break; + } + case ActiveTheme: { + if (heapIndex->activeTheme.address) { + delete heapIndex->activeTheme.address; + } + QString currentThemeName = getThemeSetting(CurrentThemeSetting); + QDir path(currentThemeName); + HbThemeInfo activeInfo; + activeInfo.name = path.dirName(); + QString absolutePath = path.absolutePath(); + activeInfo.rootDir = absolutePath.left(absolutePath.indexOf("/icons/")); + + heapIndex->activeTheme.address = createHeapThemeIndex(activeInfo); + if (heapIndex->activeTheme.address) { + heapIndex->activeTheme.name = activeInfo.name; + heapIndex->activeTheme.path = activeInfo.rootDir; + } + break; + } + default: + break; + } + } +} + +void HbThemeUtils::loadHeapThemeIndexes() +{ + // Process base theme index, it is used as parent index also when the current theme is something else + loadHeapThemeIndex(BaseTheme); + // Process operator theme indexes + loadHeapThemeIndex(OperatorC); + // Process current theme index + loadHeapThemeIndex(ActiveTheme); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/hbthemeutils_p.h --- a/src/hbcore/theme/hbthemeutils_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/hbthemeutils_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,24 +33,12 @@ #include #include -#undef USE_APPTHEMES - -struct HbHierarchy -{ - HbHierarchy() {} - HbHierarchy(QString name, - HbLayeredStyleLoader::LayerPriority layerPriority) : name(name), - layerPriority(layerPriority) {} - QString name; - HbLayeredStyleLoader::LayerPriority layerPriority; -}; - struct HbThemeInfo { HbThemeInfo() { } - HbThemeInfo(const QString &themeName, const QString &dir):name(themeName),rootDir(dir) + HbThemeInfo(const QString &themeName, const QString &dir) : name(themeName), rootDir(dir) { } QString name; @@ -60,44 +48,34 @@ struct HbThemeIndexInfo { HbThemeIndexInfo() : - name(QString("")), - path(QString("")), - themeIndexOffset(0) + name(), + path(), + address(0) { } - HbThemeIndexInfo(const QString &themeName, const QString &path, quint32 themeIndexOffset) : + HbThemeIndexInfo(const QString &themeName, const QString &path, char *address) : name(themeName), path(path), - themeIndexOffset(themeIndexOffset) + address(address) { } QString name; QString path; - quint32 themeIndexOffset; + char *address; }; +struct HbHeapIndexInfo { + HbThemeIndexInfo baseTheme; + HbThemeIndexInfo priorityTheme; + HbThemeIndexInfo activeTheme; +}; class HB_CORE_PRIVATE_EXPORT HbThemeUtils { public: - static QVector hierarchies(); - static void initSettings(); - -//following methods for unittests only - static int addHierarchy(const QString& newHierarchy, int priorityOrder); - static bool removeHierarchy(const QString &hierarchy); - static QString operatorBasePath(); -//unittest functions end. - static QMap constructHierarchyListWithPathInfo( - const QString &fileName, - const QString ¤tTheme, - const Hb::ResourceType resType ); - - enum Setting - { + enum Setting { BaseThemeSetting = 0x1, DefaultThemeSetting = 0x2, - DefaultThemeRootDirSetting = 0x3, CurrentThemeSetting = 0x4, OperatorNameSetting = 0x5 }; @@ -105,29 +83,21 @@ static QString getThemeSetting(Setting setting); static void setThemeSetting(Setting setting, const QString &value); static void updateThemeSetting(Setting setting, const QString &value); - + static bool isThemeValid(const QString &themePath); + + static HbThemeIndexInfo getThemeIndexInfo(const HbThemeType& type); - static const HbThemeInfo &baseTheme(); - static HbThemeInfo defaultTheme(); - static bool isThemeValid(const HbThemeInfo &themeInfo); + static bool isLogicalName(const QString &fileName); + static char *createHeapThemeIndex(const HbThemeInfo &theme); + static void loadHeapThemeIndexes(); + static void loadHeapThemeIndex(HbThemeType type); - static const HbThemeIndexInfo getThemeIndexInfo(const HbThemeType& type); - - // Standard folder names + static const char *themeResourceFolder; + static const char *platformHierarchy; + static const char *operatorHierarchy; static const char *iconsResourceFolder; static const char *effectsResourceFolder; static const char *styleResourceFolder; - static const char *themeResourceFolder; - static const char *operatorHierarchy; - static const char *appHierarchy; - static const char *platformHierarchy; - -private: - static HbThemeInfo getBaseThemeFromFile(const QString &rootDir); - static void saveBaseThemeSettings(HbThemeInfo &baseThemeInfo, - const QString &defaultTheme, - const QString &rootDir); }; #endif //HBTHEMEUTILS_P_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/theme/theme.pri --- a/src/hbcore/theme/theme.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/theme/theme.pri Thu Jul 22 16:36:53 2010 +0100 @@ -32,18 +32,13 @@ SOURCES += $$PWD/hbtheme.cpp SOURCES += $$PWD/hbthemeutils_p.cpp -SOURCES += $$PWD/hbcolortheme_p.cpp SOURCES += $$PWD/hbcolorscheme.cpp -SOURCES += $$PWD/hbcssthemeinterface_p.cpp SOURCES += $$PWD/hbthemeclient_p.cpp SOURCES += $$PWD/hbeffecttheme_p.cpp PRIVATE_HEADERS += $$PWD/hbthemecommon_p.h PRIVATE_HEADERS += $$PWD/hbtheme_p.h PRIVATE_HEADERS += $$PWD/hbthemeutils_p.h -PRIVATE_HEADERS += $$PWD/hbcolortheme_p.h -PRIVATE_HEADERS += $$PWD/hbcolortheme_p_p.h -PRIVATE_HEADERS += $$PWD/hbcssthemeinterface_p.h PRIVATE_HEADERS += $$PWD/hbthemeclient_p.h PRIVATE_HEADERS += $$PWD/hbeffecttheme_p.h PRIVATE_HEADERS += $$PWD/hbthemeclient_p_p.h @@ -62,4 +57,4 @@ symbian: { LIBS += -lws32 LIBS += -lcone -} \ No newline at end of file +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdevicemodeinfo_p.cpp --- a/src/hbcore/utils/hbdevicemodeinfo_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdevicemodeinfo_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,27 +23,25 @@ ** ****************************************************************************/ +#include "hbdevicemodeinfo_p.h" +#include "hbwsiniparser_p.h" #include #include #include -#include "hbdevicemodeinfo_p.h" -#include "hbwsiniparser_p.h" - class HbDeviceModeInfoPrivate - { - +{ public: HbDeviceModeInfoPrivate(); - void init(); + void init(const QString &wsIniFile); public: QMap mModes; - }; +}; -void HbDeviceModeInfoPrivate::init() +void HbDeviceModeInfoPrivate::init(const QString &wsIniFile) { - HbWsiniParser::parseModes(mModes); + HbWsiniParser::parseModes(mModes, wsIniFile); } HbDeviceModeInfoPrivate::HbDeviceModeInfoPrivate() @@ -55,17 +53,13 @@ \brief Provides information abstracted from the platform information on all the valid device modes All valid hardware and distinct user physical configurations should be accessed here. - + */ -// ======== LOCAL FUNCTIONS ======== - -// ======== MEMBER FUNCTIONS ======== - -HbDeviceModeInfo::HbDeviceModeInfo() -: d_ptr(new HbDeviceModeInfoPrivate()) +HbDeviceModeInfo::HbDeviceModeInfo(const QString &wsIniFile) + : d_ptr(new HbDeviceModeInfoPrivate()) { - d_ptr->init(); + d_ptr->init(wsIniFile); } HbDeviceModeInfo::~HbDeviceModeInfo() @@ -85,13 +79,10 @@ HbScreenMode *HbDeviceModeInfo::mode(int key) { HbScreenMode *result(0); - if (d_ptr->mModes.contains(key)){ + if (d_ptr->mModes.contains(key)) { HbScreenMode &resultRef = d_ptr->mModes[key]; result = &resultRef; } return result; } - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdevicemodeinfo_p.h --- a/src/hbcore/utils/hbdevicemodeinfo_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdevicemodeinfo_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,18 +34,18 @@ class HbScreenMode; class HB_AUTOTEST_EXPORT HbDeviceModeInfo - { +{ public: - HbDeviceModeInfo(); + HbDeviceModeInfo(const QString &wsIniFile = QString()); ~HbDeviceModeInfo(); - + QList modeNumbers() const; HbScreenMode *mode(int modeNumber); private: - HbDeviceModeInfoPrivate * const d_ptr; + HbDeviceModeInfoPrivate *const d_ptr; Q_DISABLE_COPY(HbDeviceModeInfo) Q_DECLARE_PRIVATE_D(d_ptr, HbDeviceModeInfo) - }; +}; #endif // HBDEVICEMODEINFO_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdeviceprofile.cpp --- a/src/hbcore/utils/hbdeviceprofile.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdeviceprofile.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,20 +35,20 @@ #include // To store the pointer to the deviceProfiles at the client side. -static HbDeviceProfileList *deviceProfilesList = NULL; +static HbDeviceProfileList *deviceProfilesList = 0; #define MM_PER_INCH 25.4 /*! - @stable + @stable @hbcore \class HbDeviceProfile - \brief HbDeviceProfile holds read-only device parameters. - - Instances of this class hold both concrete device specific information - (e.g. physical display size) and aspects that have been configured for + \brief HbDeviceProfile holds read-only device parameters. + + Instances of this class hold both concrete device specific information + (e.g. physical display size) and aspects that have been configured for a specific device (e.g. orientation, unit value). - + */ /*! @@ -79,7 +79,7 @@ { if (d_ptr->deviceProfiles()) { int count = deviceProfilesList->count(); - bool found( false ); + bool found(false); for (int i = 0; !found && i < count; i++) { if (deviceProfilesList->at(i).mName == name) { d_ptr->mProfile = deviceProfilesList->at(i); @@ -174,8 +174,8 @@ } /*! - Returns name of alternate profile. - + Returns name of alternate profile. + Currently this holds information of the profile which is activated on layout switch. Use this information if you need to optimize layout switch. @@ -189,7 +189,7 @@ Returns standard unit value (denoted by 'un'). The unit value is a display-specific multiplier. It is used in intenal - layout calculation. + layout calculation. */ qreal HbDeviceProfile::unitValue() const { @@ -209,7 +209,7 @@ /*! Returns current global profile reflecting properties of primary display. - + Usually, you should not use this method. Instead, use one of \c profile methods. */ @@ -236,7 +236,7 @@ /*! Returns current profile for this graphics item. - + Graphics item must be tied to a scene and scene needs to be part of main window. Otherwise, value returned by \c current is provided. @@ -253,10 +253,10 @@ return current(); } QList views = scene->views(); - foreach(QGraphicsView *view, views) { + foreach(QGraphicsView * view, views) { HbMainWindow *window = qobject_cast(view); if (window) { - HbDeviceProfile profile = + HbDeviceProfile profile = HbMainWindowPrivate::d_ptr(window)->profile(); if (!profile.isNull()) { @@ -280,9 +280,9 @@ QStringList HbDeviceProfilePrivate::profileNames() { QStringList profileNames; - if(deviceProfiles()){ + if (deviceProfiles()) { int profilesCount = deviceProfilesList->count(); - for(int i = 0;i < profilesCount ; i++) { + for (int i = 0; i < profilesCount ; i++) { profileNames.append(deviceProfilesList->at(i).mName); } } @@ -299,19 +299,18 @@ HbDeviceProfileList *HbDeviceProfilePrivate::deviceProfiles() { - if(!deviceProfilesList) { - // Will result in IPC call. gets the shared memory offset from themeserver. + if (!deviceProfilesList) { + // Will result in IPC call. gets the shared memory offset from themeserver. deviceProfilesList = HbThemeClient::global()->deviceProfiles(); } - - if(!deviceProfilesList) { + + if (!deviceProfilesList) { // This is fall back.Create/Get the HbDeviceProfileDatabase Instance at // the client side and read the deviceProfilesList. - qDebug()<<"DeviceProfile offset not returned by themeserver .. working in fallback mode"; HbDeviceProfileDatabase *deviceProfileDataBase = - HbDeviceProfileDatabase::instance(HbMemoryManager::HeapMemory); + HbDeviceProfileDatabase::instance(HbMemoryManager::HeapMemory); deviceProfilesList = HbMemoryUtils::getAddress(HbMemoryManager::HeapMemory, - deviceProfileDataBase->deviceProfilesOffset()); + deviceProfileDataBase->deviceProfilesOffset()); } return deviceProfilesList; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdeviceprofile.h --- a/src/hbcore/utils/hbdeviceprofile.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdeviceprofile.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,7 +49,7 @@ explicit HbDeviceProfile(const QString &name); ~HbDeviceProfile(); - HbDeviceProfile &operator=(const HbDeviceProfile &other); + HbDeviceProfile &operator=(const HbDeviceProfile &other); bool isNull() const; @@ -58,17 +58,17 @@ QSizeF physicalSize() const; QString alternateProfileName() const; bool touch() const; - + Qt::Orientation orientation() const; qreal orientationAngle() const; qreal unitValue() const; qreal ppmValue() const; - + static HbDeviceProfile current(); static HbDeviceProfile profile(const HbMainWindow *window); static HbDeviceProfile profile(const QGraphicsItem *item); - - static QStringList profileNames(); + + static QStringList profileNames(); protected: QSharedDataPointer d_ptr; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdeviceprofile_p.h --- a/src/hbcore/utils/hbdeviceprofile_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdeviceprofile_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,11 +31,10 @@ #include "hbvector_p.h" #include -struct DeviceProfile -{ +struct DeviceProfile { HbString mName; HbString mAltName; - + QSize mLogicalSize; qreal mUnitValue; qreal mPpiValue; @@ -45,8 +44,7 @@ DeviceProfile(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) : mName(type), mAltName(type), mUnitValue(1), mPpiValue(1), - mTouch(true), mUiMetricsFile(type), mOrientationAngle(0) - { + mTouch(true), mUiMetricsFile(type), mOrientationAngle(0) { } }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdeviceprofiledatabase_p.cpp --- a/src/hbcore/utils/hbdeviceprofiledatabase_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdeviceprofiledatabase_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -48,19 +48,17 @@ /* \class HbDeviceProfileDatabase \brief HbDeviceProfileDatabase provides access to supported profile information. - This uses HbDeviceProfileReader and HbWsiniParser to parse the display definition - xml and the device mode ini files respectively. After parsing the files HbDeviceProfileDataBase - will store the List of profiles i.e HbDeviceProfileList in to the sharedmemory and maintains - the offset of it. This class is used by client/server. + This uses HbDeviceProfileReader and HbWsiniParser to parse the display definition + xml and the device mode ini files respectively. After parsing the files HbDeviceProfileDataBase + will store the List of profiles i.e HbDeviceProfileList in to the sharedmemory and maintains + the offset of it. This class is used by client/server. Themeserver will use this class when it starts up. Client uses this class when it is unable to get the deviceprofile information from the themeserver. - - This class is not supposed to use directly. Instead, use \c HbDeviceProfile - and \c HbExtendedDeviceProfile. + + This class is not supposed to use directly. Instead, use \c HbDeviceProfile \sa HbDeviceProfile - \sa HbExtendedDeviceProfile \internal \proto */ @@ -75,15 +73,15 @@ Constructor. */ HbDeviceProfileDatabase::HbDeviceProfileDatabase(HbMemoryManager::MemoryType type) - : mDeviceProfiles(0),mDeviceModes(0),mDeviceProfilesOffset(-1),mType(type) + : mDeviceProfiles(0), mDeviceModes(0), mDeviceProfilesOffset(-1), mType(type) { GET_MEMORY_MANAGER(mType); try { mDeviceProfilesOffset = manager->alloc(sizeof(HbDeviceProfileList)); - mDeviceProfiles = new((char*)manager->base() + mDeviceProfilesOffset) - HbDeviceProfileList(mType); + mDeviceProfiles = new((char *)manager->base() + mDeviceProfilesOffset) + HbDeviceProfileList(mType); init(); - } catch(std::exception &) { + } catch (std::exception &) { if (mDeviceProfilesOffset != -1) { if (mDeviceProfiles) { mDeviceProfiles->~HbDeviceProfileList(); @@ -91,7 +89,7 @@ } manager->free(mDeviceProfilesOffset); mDeviceProfilesOffset = -1; - } + } } } @@ -106,19 +104,20 @@ */ void HbDeviceProfileDatabase::init() { - HbDeviceProfileReader reader(mDeviceProfiles,mType); - + HbDeviceProfileReader reader(mDeviceProfiles, mType); + // resolve correct displaydefinition.xml path for emulator and HW (z:/resource) // or desktop (Qt resource) - + // from HW and emulator QFile file("z:/resource/displaydefinition.xml"); - - if (!file.exists()) + + if (!file.exists()) { file.setFileName(":displaydefinition.xml"); + } if (!file.open(QIODevice::ReadOnly)) { qWarning() - << "HbDeviceProfileDatabase::init : opening file failed:"; + << "HbDeviceProfileDatabase::init : opening file failed:"; } else { reader.read(&file); } @@ -126,29 +125,29 @@ #ifndef SKIP_WSINI // Get the device modes from the device itself mDeviceModes = new HbDeviceModeInfo(); - + #if defined(Q_WS_S60) const QRectF screenGeometry(qApp->desktop()->screenGeometry()); QSizeF screenSize(screenGeometry.size()); - + int i = 0; bool done = false; while (i < mDeviceProfiles->size() && !done) { DeviceProfile profile = mDeviceProfiles->at(i); - if (profile.mLogicalSize.width() == screenSize.width() && - profile.mLogicalSize.height() == screenSize.height()) { + if (profile.mLogicalSize.width() == screenSize.width() && + profile.mLogicalSize.height() == screenSize.height()) { mDeviceProfiles->remove(i); - mDeviceProfiles->insert(0,profile); + mDeviceProfiles->insert(0, profile); done = true; } i++; } #endif - completeProfileData(); + completeProfileData(); #endif #ifdef Q_OS_SYMBIAN initOrientationStatus(); @@ -159,32 +158,32 @@ { // Mark the device profiles as valid or not depending whether they match the device modes // If there are no device modes read in, then no removal is done at all - if (mDeviceProfiles && mDeviceModes && mDeviceModes->modeNumbers().count() > 0){ - for (int i = mDeviceProfiles->size()-1; i >= 0 ; --i) { + if (mDeviceProfiles && mDeviceModes && mDeviceModes->modeNumbers().count() > 0) { + for (int i = mDeviceProfiles->size() - 1; i >= 0 ; --i) { QSize size(mDeviceProfiles->at(i).mLogicalSize); bool found(false); QList l = mDeviceModes->modeNumbers(); for (int j = 0; j < l.count(); j++) { HbScreenMode *mode = mDeviceModes->mode(l[j]); - if (mode->pixelSize() == size){ + if (mode->pixelSize() == size) { found = true; } } - if (!found && mDeviceProfiles->size()>1) { + if (!found && mDeviceProfiles->size() > 1) { // Do not remove the 0-th display mode if is the only one left! mDeviceProfiles->remove(i); } - } - } - - if(mDeviceProfiles) { + } + } + + if (mDeviceProfiles) { const int numberOfProfiles = mDeviceProfiles->size(); for (int i = 0; i < numberOfProfiles; ++i) { - if ( mDeviceProfiles->at(i).mAltName == "" ) { + if (mDeviceProfiles->at(i).mAltName.isEmpty()) { QSize size(mDeviceProfiles->at(i).mLogicalSize); QSize altLogicalSize(size.height(), size.width()); - for (int j = 0; j < numberOfProfiles; ++j ) { - if ( i != j && altLogicalSize == mDeviceProfiles->at(j).mLogicalSize) { + for (int j = 0; j < numberOfProfiles; ++j) { + if (i != j && altLogicalSize == mDeviceProfiles->at(j).mLogicalSize) { mDeviceProfiles->at(i).mAltName = mDeviceProfiles->at(j).mName; break; } @@ -196,8 +195,9 @@ #ifdef Q_OS_SYMBIAN -void HbDeviceProfileDatabase::initOrientationStatus() { - if(HbMemoryManager::SharedMemory == mType) { +void HbDeviceProfileDatabase::initOrientationStatus() +{ + if (HbMemoryManager::SharedMemory == mType) { Qt::Orientation defaultOrientation = Qt::Vertical; if (mDeviceProfiles && mDeviceProfiles->count()) { QSize s = mDeviceProfiles->at(0).mLogicalSize; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdeviceprofiledatabase_p.h --- a/src/hbcore/utils/hbdeviceprofiledatabase_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdeviceprofiledatabase_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,20 +38,20 @@ { public: static HbDeviceProfileDatabase *instance(HbMemoryManager::MemoryType type = - HbMemoryManager::HeapMemory); + HbMemoryManager::HeapMemory); int deviceProfilesOffset(); private: HbDeviceProfileDatabase(HbMemoryManager::MemoryType type = - HbMemoryManager::HeapMemory); + HbMemoryManager::HeapMemory); void init(); void completeProfileData(); #ifdef Q_OS_SYMBIAN void initOrientationStatus(); #endif //Q_OS_SYMBIAN Q_DISABLE_COPY(HbDeviceProfileDatabase) - + private: HbDeviceProfileList *mDeviceProfiles; HbDeviceModeInfo *mDeviceModes; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdeviceprofilemanager_p.cpp --- a/src/hbcore/utils/hbdeviceprofilemanager_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdeviceprofilemanager_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,12 +31,12 @@ /* \class HbDeviceProfileManager \brief HbDeviceProfileManager allows to select specific profile to be used. - + This class is mostly for development purposes where there is need to test applications in different resolutions and settings. - + \sa HbDeviceProfile - + \proto */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbdeviceprofilereader_p.cpp --- a/src/hbcore/utils/hbdeviceprofilereader_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbdeviceprofilereader_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -44,9 +44,9 @@ /*! Constructor. */ HbDeviceProfileReader::HbDeviceProfileReader(HbDeviceProfileList *profileList, - HbMemoryManager::MemoryType type - ) - : QXmlStreamReader(), mDeviceProfileList(profileList),mType(type) + HbMemoryManager::MemoryType type + ) + : QXmlStreamReader(), mDeviceProfileList(profileList), mType(type) { } @@ -74,7 +74,7 @@ readNext(); if (isStartElement()) { - if ( name() == "displayDefinition" ) { + if (name() == "displayDefinition") { readDisplayDefinitions(); } else { raiseError( @@ -98,13 +98,14 @@ if (isEndElement()) { continue; - } + } if (isStartElement()) { - if (name() == "display") + if (name() == "display") { readAttributes(); - else + } else { readUnknownElement(); + } } } } @@ -114,10 +115,10 @@ */ void HbDeviceProfileReader::readAttributes() - { +{ Q_ASSERT(isStartElement() && name() == "display"); QXmlStreamAttributes attrs = attributes(); - + DeviceProfile deviceProfile(mType); int w = attrs.value("resolutionWidth").toString().toInt(); @@ -127,13 +128,13 @@ QString orientationStr = "portrait"; QString altOrientationStr = "landscape"; - if ( w > h ) { + if (w > h) { orientationStr = "landscape"; altOrientationStr = "portrait"; } deviceProfile.mUnitValue = attrs.value("unitValue").toString().toFloat(); deviceProfile.mPpiValue = attrs.value("ppiValue").toString().toFloat(); - deviceProfile.mOrientationAngle= attrs.value("orientationAngle").toString().toInt(); + deviceProfile.mOrientationAngle = attrs.value("orientationAngle").toString().toInt(); QString resName = attrs.value("resolutionName").toString(); // Legacy support for deprecated "styleName" @@ -142,22 +143,21 @@ } // Calculate inch size - qreal diagonal = qSqrt((qreal)(w*w+h*h)); // in "pixels" - int inchSizeX10 = qRound(10*(diagonal / deviceProfile.mPpiValue)); - QString inchSizeStr = QString::number(inchSizeX10/10); + qreal diagonal = qSqrt((qreal)(w * w + h * h)); // in "pixels" + int inchSizeX10 = qRound(10 * (diagonal / deviceProfile.mPpiValue)); + QString inchSizeStr = QString::number(inchSizeX10 / 10); inchSizeStr.append('.'); - inchSizeStr.append(QString::number(inchSizeX10%10)); + inchSizeStr.append(QString::number(inchSizeX10 % 10)); deviceProfile.mName = resName + '-' + inchSizeStr + "-inch_" + orientationStr; deviceProfile.mAltName = resName + '-' + inchSizeStr + "-inch_" + altOrientationStr; bool defaultMode = false; defaultMode = attrs.value("defaultMode").toString() == "true"; - + if (defaultMode) { mDeviceProfileList->insert(0, deviceProfile); - } - else { + } else { mDeviceProfileList->append(deviceProfile); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbextendeddeviceprofile_p.cpp --- a/src/hbcore/utils/hbextendeddeviceprofile_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,137 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbextendeddeviceprofile_p.h" -#include "hbdeviceprofile_p.h" - -/* - \class HbExtendedDeviceProfile - \brief HbExtendedDeviceProfile provides setter methods for \c HbDeviceProfile and - additional internal parameter accessors & setters. - - Note that it's assumed that each device profile has unique name. In addition, - each device profile has 'alternate' profile for the other orientation. - - \sa HbDeviceProfile - \internal - \proto -*/ - - -/*! - Constructor. -*/ -HbExtendedDeviceProfile::HbExtendedDeviceProfile() -: HbDeviceProfile() -{ -} - -/*! - Copy constructor. - \param other source profile. -*/ -HbExtendedDeviceProfile::HbExtendedDeviceProfile(const HbExtendedDeviceProfile &other) -: HbDeviceProfile(other) -{ -} - -/*! - Conversion constructor from \c HbDeviceProfile to \c HbExtendedDeviceProfile. - \param other source profile. -*/ -HbExtendedDeviceProfile::HbExtendedDeviceProfile(const HbDeviceProfile &other) -: HbDeviceProfile(other) -{ -} - -/*! - Constructor for information based on profile name. - If there is no profile with that name, result is default constructed instance. -*/ -HbExtendedDeviceProfile::HbExtendedDeviceProfile(const QString &name) -: HbDeviceProfile(name) -{ -} - -/*! - Assignment operator. - \param other source profile. - \return reference to this profile. -*/ -HbExtendedDeviceProfile &HbExtendedDeviceProfile::operator=(const HbExtendedDeviceProfile &other) -{ - if (this != &other) { - d_ptr = other.d_ptr; - } - return *this; -} - -/*! - Sets name of this profile. - \param name name. -*/ -void HbExtendedDeviceProfile::setName(const QString &name) -{ - d_ptr->mProfile.mName = name; -} - -/*! - Sets logical screen size in pixels. - \param size logical screen size. -*/ -void HbExtendedDeviceProfile::setLogicalSize(const QSize &size) -{ - d_ptr->mProfile.mLogicalSize = size; -} - -/*! - Sets name of alternate profile. - Typically, orientation of alternative profile is opposite of this profile. - \param name name of alternate profile. -*/ -void HbExtendedDeviceProfile::setAlternateProfileName(const QString &name) -{ - d_ptr->mProfile.mAltName = name; -} - -/*! - Sets unit value. - \param value desired new value. -*/ -void HbExtendedDeviceProfile::setUnitValue(qreal value) -{ - d_ptr->mProfile.mUnitValue = value; -} - -/*! - Sets ppi (points per inc) value. - \param value desired new value. -*/ -void HbExtendedDeviceProfile::setPpiValue(qreal value) -{ - d_ptr->mProfile.mPpiValue = value; -} - -// end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbextendeddeviceprofile_p.h --- a/src/hbcore/utils/hbextendeddeviceprofile_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBEXTENDEDDEVICEPROFILE_H -#define HBEXTENDEDDEVICEPROFILE_H - -#include -#include -#include -#include - -class HB_AUTOTEST_EXPORT HbExtendedDeviceProfile : public HbDeviceProfile -{ -public: - HbExtendedDeviceProfile(); - HbExtendedDeviceProfile(const HbExtendedDeviceProfile &other); - explicit HbExtendedDeviceProfile(const HbDeviceProfile &other); - explicit HbExtendedDeviceProfile(const QString &name); - - HbExtendedDeviceProfile &operator=(const HbExtendedDeviceProfile &other); - - void setName(const QString &name); - void setLogicalSize(const QSize &size); - void setAlternateProfileName(const QString &name); - void setUnitValue(qreal value); - void setPpiValue(qreal value); -}; - - -#endif // HBEXTENDEDDEVICEPROFILE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbfeaturemanager.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/utils/hbfeaturemanager.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,211 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hbfeaturemanager_r.h" + +#include + +#if defined(Q_WS_S60) +#include +#else +#include +#endif // Q_WS_S60 + +/*! + @alpha + @hbcore + \class HbFeatureManager + \brief HbFeatureManager is used to control hb internal features. +*/ + +/*! + \enum HbFeatureManager::Feature + + This enum defines the hb internal features. +*/ + +/*! + \var HbFeatureManager::TextMeasurement + + Runtime variation flag for text measurement feature. + + This needs to be enabled if you want to get the localization layout + metrics from your application. + + Zero means disabled, non-zero means enabled. +*/ + +/*! + \var HbFeatureManager::TheTestUtility + + Runtime variation flag for "the test utility" + + This needs to be enabled if you want to utilize "the test utility" + (the four floating buttons) in your application. + + Zero means disabled, non-zero means enabled. +*/ + +/*! + \var HbFeatureManager::LanguageSwitch +*/ + + +#if defined(Q_WS_S60) +const TUid HBFM_CREPO_ID = {0x2002C304}; +#endif + + +class HbFeatureManagerPrivate +{ +public: + HbFeatureManagerPrivate(); + virtual ~HbFeatureManagerPrivate(); + + QString toString( HbFeatureManager::Feature feature ); + +#if defined(Q_WS_S60) + CRepository *mRepo; +#else + QSettings *mSettings; +#endif // Q_WS_S60 +}; + +/*! +\internal +*/ +HbFeatureManagerPrivate::HbFeatureManagerPrivate() +{ +#if defined(Q_WS_S60) + TRAPD( err, mRepo = CRepository::NewL( HBFM_CREPO_ID ) ); + if( err ) { + qWarning( "HbFeatureManager construction fails, error code = %d", err ); + } + // Default values defined in cenrep file. +#else + mSettings = new QSettings( "Nokia", "Hb feature manager" ); + // Set default values: + if( !mSettings->contains( toString( HbFeatureManager::TextMeasurement ) ) ) { + mSettings->setValue( toString( HbFeatureManager::TextMeasurement ), 0 ); + } + if( !mSettings->contains( toString( HbFeatureManager::TheTestUtility ) ) ) { + mSettings->setValue( toString( HbFeatureManager::TheTestUtility ), 0 ); + } +#endif // Q_WS_S60 +} + +/*! +\internal +*/ +HbFeatureManagerPrivate::~HbFeatureManagerPrivate() +{ +#if defined(Q_WS_S60) + delete mRepo; +#else + delete mSettings; +#endif // Q_WS_S60 +} + +/*! +\internal +*/ +QString HbFeatureManagerPrivate::toString( HbFeatureManager::Feature feature ) +{ + return QString( "HbFeature_" ) + QString::number( ( int )feature ); +} + +/*! + Default constructor. +*/ +HbFeatureManager::HbFeatureManager() : + d(new HbFeatureManagerPrivate) +{ +} + +/*! + Returns singleton instance +*/ +HbFeatureManager *HbFeatureManager::instance() +{ + static HbFeatureManager theManager; + return &theManager; +} + +/*! + Destructor +*/ +HbFeatureManager::~HbFeatureManager() +{ + delete d; +} + +/*! + Returns the status of requested feature. +*/ +int HbFeatureManager::featureStatus( Feature feature ) +{ +#if defined(Q_WS_S60) + if (!d->mRepo) { + return 0; + } + TUint32 key = (TUint32)feature; + TInt value = 0; + TInt error = d->mRepo->Get( key, value ); + if( error != KErrNone ) { + qWarning( "HbFeatureManager getting the feature fails, error code = %d", error ); + } else { + return (int)value; + } + +#else + if( d->mSettings->contains( d->toString( feature ) ) ) { + return d->mSettings->value( d->toString( feature ) ).toInt(); + } +#endif + return 0; +} + + +/*! + Sets the status of requested feature to given value. +*/ +void HbFeatureManager::setFeatureStatus( Feature feature, int status ) +{ +#if defined(Q_WS_S60) + if (!d->mRepo) { + return; + } + TUint32 key = (TUint32)feature; + TInt value = (TInt)status; + TInt error = d->mRepo->Set( key, value ); + if( error != KErrNone ) { + qWarning( "HbFeatureManager setting the feature fails, error code = %d", error ); + } + +#else + d->mSettings->setValue( d->toString( feature ), status ); +#endif +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbfeaturemanager_p.cpp --- a/src/hbcore/utils/hbfeaturemanager_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,111 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbfeaturemanager_p.h" - -#include - -HbFeatureManager::HbFeatureManager() -{ -#if defined(Q_WS_S60) - TRAPD( err, mRepo = CRepository::NewL( HBFM_CREPO_ID ) ); - if( err ) { - qWarning( "HbFeatureManager construction fails, error code = %d", err ); - } - // Default values defined in cenrep file. -#else - mSettings = new QSettings( "Nokia", "Hb feature manager" ); - // Set default values: - if( !mSettings->contains( toString( TextMeasurement ) ) ) { - mSettings->setValue( toString( TextMeasurement ), 0 ); - } - if( !mSettings->contains( toString( TheTestUtility ) ) ) { - mSettings->setValue( toString( TheTestUtility ), 0 ); - } -#endif // Q_WS_S60 -} - -HbFeatureManager *HbFeatureManager::instance() -{ - static HbFeatureManager theManager; - return &theManager; -} - - -HbFeatureManager::~HbFeatureManager() -{ -#if defined(Q_WS_S60) - delete mRepo; -#else - delete mSettings; -#endif // Q_WS_S60 -} - -int HbFeatureManager::featureStatus( HbFeature feature ) -{ -#if defined(Q_WS_S60) - if (!mRepo) { - return 0; - } - TUint32 aKey = (TUint32)feature; - TInt aValue = 0; - TInt error = mRepo->Get( aKey, aValue ); - if( error != KErrNone ) { - qWarning( "HbFeatureManager getting the feature fails, error code = %d", error ); - } else { - return (int)aValue; - } - -#else - if( mSettings->contains( toString( feature ) ) ) { - return mSettings->value( toString( feature ) ).toInt(); - } -#endif - return 0; -} - - -void HbFeatureManager::setFeatureStatus( HbFeature feature, int status ) -{ -#if defined(Q_WS_S60) - if (!mRepo) { - return; - } - TUint32 aKey = (TUint32)feature; - TInt aValue = (TInt)status; - TInt error = mRepo->Set( aKey, aValue ); - if( error != KErrNone ) { - qWarning( "HbFeatureManager setting the feature fails, error code = %d", error ); - } - -#else - mSettings->setValue( toString( feature ), status ); -#endif -} - -QString HbFeatureManager::toString( HbFeature feature ) -{ - return QString( "HbFeature_" ) + QString::number( ( int )feature ); -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbfeaturemanager_p.h --- a/src/hbcore/utils/hbfeaturemanager_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,76 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbCore module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - - -#ifndef HBFEATUREMANAGER_P_H -#define HBFEATUREMANAGER_P_H - -#include - -#if defined(Q_WS_S60) - -#include - -const TUid HBFM_CREPO_ID = {0x2002C304}; - -#else - -class QSettings; - -#endif // Q_WS_S60 - - -class HB_CORE_PRIVATE_EXPORT HbFeatureManager -{ - -public: - - typedef enum { - TextMeasurement = 0x1, - TheTestUtility = 0x2, - LanguageSwitch = 0x4 - } HbFeature; - - - static HbFeatureManager *instance(); - ~HbFeatureManager(); - - int featureStatus( HbFeature feature ); - void setFeatureStatus( HbFeature feature, int status ); - -private: - HbFeatureManager(); - - QString toString( HbFeature feature ); - -#if defined(Q_WS_S60) - CRepository *mRepo; -#else - QSettings *mSettings; -#endif // Q_WS_S60 - -}; - -#endif // HBFEATUREMANAGER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbfeaturemanager_r.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/utils/hbfeaturemanager_r.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,59 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + + +#ifndef HBFEATUREMANAGER_R_H +#define HBFEATUREMANAGER_R_H + +#include + +class HbFeatureManagerPrivate; + +class HB_CORE_RESTRICTED_EXPORT HbFeatureManager +{ + +public: + + enum Feature { + TextMeasurement = 0x1, + TheTestUtility = 0x2, + LanguageSwitch = 0x4 + }; + + + static HbFeatureManager *instance(); + ~HbFeatureManager(); + + int featureStatus( Feature feature ); + void setFeatureStatus( Feature feature, int status ); + +private: + Q_DISABLE_COPY(HbFeatureManager) + HbFeatureManager(); + + HbFeatureManagerPrivate *const d; +}; + +#endif // HBFEATUREMANAGER_R_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbfontspec.cpp --- a/src/hbcore/utils/hbfontspec.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbfontspec.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ #include /*! - @stable + @stable @hbcore \class HbFontSpec \brief HbFontSpec is used to request a system font. @@ -108,11 +108,12 @@ ~HbFontSpecPrivate(); qreal textHeight() const; - QFont font() const; + QFont font(); public: // data HbFontSpec::Role mRole; mutable qreal mTextHeight; + QString mFontName; }; /*! @@ -120,7 +121,8 @@ */ HbFontSpecPrivate::HbFontSpecPrivate() : mRole(HbFontSpec::Undefined), - mTextHeight(-1.0f) + mTextHeight(-1.0f), + mFontName("") { } @@ -142,58 +144,68 @@ #ifdef HB_BOOTSTRAPPED return 0; #else - if ( (mRole != HbFontSpec::Undefined) && (mTextHeight < 0) ) { + if ((mRole != HbFontSpec::Undefined) && (mTextHeight < 0)) { qreal parameterValue; QString parameterName; - switch (mRole){ - case HbFontSpec::Primary: - parameterName = "hb-param-text-height-primary"; - break; - case HbFontSpec::Secondary: - parameterName = "hb-param-text-height-secondary"; - break; - case HbFontSpec::Title: - parameterName = "hb-param-text-height-title"; - break; - case HbFontSpec::PrimarySmall: - parameterName = "hb-param-text-height-tiny"; - break; - case HbFontSpec::Digital: - default: // Usage of Secondary as the default system typeface - parameterName = "hb-param-text-height-secondary"; - break; + switch (mRole) { + case HbFontSpec::Primary: + parameterName = "hb-param-text-height-primary"; + break; + case HbFontSpec::Secondary: + parameterName = "hb-param-text-height-secondary"; + break; + case HbFontSpec::Title: + parameterName = "hb-param-text-height-title"; + break; + case HbFontSpec::PrimarySmall: + parameterName = "hb-param-text-height-tiny"; + break; + case HbFontSpec::Digital: + default: // Usage of Secondary as the default system typeface + parameterName = "hb-param-text-height-secondary"; + break; } - HbInstance::instance()->style()->parameter( parameterName, parameterValue ); + HbInstance::instance()->style()->parameter(parameterName, parameterValue); mTextHeight = parameterValue; } - return mTextHeight; + return mTextHeight; #endif } /*! \internal */ -QFont HbFontSpecPrivate::font() const +QFont HbFontSpecPrivate::font() { #ifdef HB_BOOTSTRAPPED return QFont(); #else - if ( mRole == HbFontSpec::Undefined ) { + if (mRole == HbFontSpec::Undefined && mFontName.isEmpty()) { return QFont(); } - QString typefaceFamily; - int weight; + QString typefaceFamily(mFontName); + int weight(QFont::Normal); HbTypefaceInfo *tInfo = HbInstancePrivate::d_ptr()->typefaceInfo(); // Non-owning pointer + if (mRole != HbFontSpec::Undefined) { tInfo->roleToTypeface(mRole, typefaceFamily, weight); + mFontName = typefaceFamily; + } else if (!tInfo->containsFamily(typefaceFamily)) { + QString aliasFamily; + if (tInfo->tryGetFamilyFromAliasName(typefaceFamily, aliasFamily, weight)) { + typefaceFamily = aliasFamily; + } + } else { + weight = tInfo->getWeight(typefaceFamily); + } QFont font(typefaceFamily); font.setWeight(weight); // Sets default size if text height is not set explicitly. qreal height = textHeight(); - int downSizedSize = tInfo->textHeightToSizeInPixels(typefaceFamily, weight, height); + int downSizedSize = tInfo->textHeightToSizeInPixels(typefaceFamily, weight, height); font.setPixelSize(downSizedSize); return font; @@ -212,11 +224,16 @@ /*! Constructs a new font spec with the given font \a role. */ -HbFontSpec::HbFontSpec(HbFontSpec::Role role) +HbFontSpec::HbFontSpec(HbFontSpec::Role role) : d(new HbFontSpecPrivate()) { d->mRole = role; } +HbFontSpec::HbFontSpec(const QString fontName) + : d(new HbFontSpecPrivate()) +{ + d->mFontName = fontName; +} /*! Copy constructs a new font spec using the \a other font spec. @@ -307,9 +324,9 @@ Returns true if this fontSpec is equal to \a other fontSpec; otherwise returns false. */ bool HbFontSpec::operator==(const HbFontSpec &other) const -{ +{ return ((d->mRole == other.d->mRole) - && qFuzzyCompare(d->textHeight(), other.d->textHeight())); + && qFuzzyCompare(d->textHeight(), other.d->textHeight())); } /*! @@ -329,7 +346,7 @@ */ qreal HbFontSpec::textHeight() const { - return d->textHeight(); + return d->textHeight(); } /*! @@ -351,4 +368,13 @@ d->mTextHeight = textHeight; } +void HbFontSpec::setTypefaceFamily(QString fontName) +{ + d->mFontName = fontName; +} + +QString HbFontSpec::typefaceFamily() const +{ + return d->mFontName; +} // End of File diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbfontspec.h --- a/src/hbcore/utils/hbfontspec.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbfontspec.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,8 +40,7 @@ Q_ENUMS(Role) public: - enum Role - { + enum Role { Undefined = 0, Primary, Secondary, @@ -54,6 +53,7 @@ explicit HbFontSpec(HbFontSpec::Role role); HbFontSpec(const HbFontSpec &other); + HbFontSpec(const QString fontName); HbFontSpec &operator=(const HbFontSpec &other); ~HbFontSpec(); @@ -72,6 +72,8 @@ bool operator==(const HbFontSpec &other) const; bool operator!=(const HbFontSpec &other) const; + QString typefaceFamily() const; + void setTypefaceFamily(QString fontName); private: HbFontSpecPrivate *d; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbforegroundwatcher.cpp --- a/src/hbcore/utils/hbforegroundwatcher.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbforegroundwatcher.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,6 +30,7 @@ #include #include #include "hbsleepmodelistener_p.h" +#include "hbmainwindow_p.h" #ifdef HB_EFFECTS_OPENVG #include #endif @@ -39,14 +40,17 @@ #include "hbthemecommon_p.h" /*! - @proto - @hbcore \class HbForegroundWatcher \brief Listens for Symbian foreground-background notifications via CCoeEnv. + Note that this class cannot be used to safely determine if the application is + in foreground or not. For example there may not be a foreground-gained + notification when the application is starting and we always assume that the + application is started to foreground. Therefore use this class only to get + notifications about loosing/gaining foreground after app startup. + \internal - */ /*! @@ -73,7 +77,6 @@ This signal is emitted when lights are switched off and the app is in foreground. */ - HbForegroundWatcher *HbForegroundWatcher::instance() { static HbForegroundWatcher *watcher = new HbForegroundWatcher(qApp); @@ -84,16 +87,9 @@ : QObject(parent), mForeground(true), mLights(true), mSensorListener(0) { connect(QApplication::instance(), SIGNAL(aboutToQuit()), SLOT(handleAboutToQuit())); -#ifdef Q_OS_SYMBIAN - mStaticEnv = CCoeEnv::Static(); - if (mStaticEnv) { - TRAP_IGNORE(mStaticEnv->AddForegroundObserverL(*this)); - } else { - qWarning("HbForegroundWatcher: CoeEnv not available"); - } -#endif QApplication::instance()->installEventFilter(this); HbSleepModeListener::instance(); // make sure the instance is created + mSleepModeTimer.setSingleShot(true); connect(&mSleepModeTimer, SIGNAL(timeout()), this, SLOT(handleSensors())); } @@ -112,7 +108,7 @@ if (THEME_SERVER_NAME == HbMemoryUtils::getCleanAppName()) { return; } - + if (!mForeground) { emit foregroundGained(); if (!hbInstance->allMainWindows().isEmpty()) { @@ -120,6 +116,12 @@ if (!signalsBlocked()) { HbEffectInternal::resumeEffects(); } +#ifdef Q_OS_SYMBIAN + HbMainWindow *mWindow = HbInstance::instance()->allMainWindows().first(); + if (mWindow) { + HbMainWindowPrivate::d_ptr(mWindow)->updateForegroundOrientationPSKey(); + } +#endif //Q_OS_SYMBIAN } mForeground = true; } @@ -135,7 +137,7 @@ if (THEME_SERVER_NAME == HbMemoryUtils::getCleanAppName()) { return; } - + if (mForeground) { emit foregroundLost(); if (!hbInstance->allMainWindows().isEmpty()) { @@ -204,13 +206,9 @@ mLights = true; handleSensors(); } else if (event->type() == QEvent::ApplicationActivate && !mForeground) { -#ifndef Q_OS_SYMBIAN HandleGainingForeground(); -#endif } else if (event->type() == QEvent::ApplicationDeactivate && mForeground) { -#ifndef Q_OS_SYMBIAN HandleLosingForeground(); -#endif } return QObject::eventFilter(obj, event); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbforegroundwatcher_p.h --- a/src/hbcore/utils/hbforegroundwatcher_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbforegroundwatcher_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,7 @@ class HB_CORE_PRIVATE_EXPORT HbForegroundWatcher : public QObject #ifdef Q_OS_SYMBIAN -, public MCoeForegroundObserver + , public MCoeForegroundObserver #endif { Q_OBJECT @@ -49,7 +49,7 @@ public: static HbForegroundWatcher *instance(); void setSensorListener(HbSensorListener *sensorListener); - + signals: void foregroundGained(); void foregroundLost(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbiniparser.cpp --- a/src/hbcore/utils/hbiniparser.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbiniparser.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -37,57 +37,57 @@ HbIniParser::~HbIniParser() { } - + /* The main function that populates the map data. currently the data is case sensitive and all api behave that way. */ bool HbIniParser::read(QIODevice *file) { - if(!file->isOpen()) + if (!file->isOpen()) { return false; - + } + QByteArray line; - + HbIniGroup groupData; QString groupName; - - while(!file->atEnd()) { - line=file->readLine().trimmed(); - if (line.isEmpty() || line.at(0) == '#') { - continue; + + while (!file->atEnd()) { + line = file->readLine().trimmed(); + if (line.isEmpty() || line.at(0) == '#') { + continue; } - + if (line.at(0) == '[') { // found a group //add old group data - if(!groupName.isEmpty()) { - mData.insert(groupName,groupData); + if (!groupName.isEmpty()) { + mData.insert(groupName, groupData); groupData.clear(); } - - groupName = line.mid (1, line.indexOf(']') - 1); + + groupName = line.mid(1, line.indexOf(']') - 1); if (groupName.isEmpty()) { return false; //error in file - } - } - else { - QByteArray key,value; + } + } else { + QByteArray key, value; int equalPosition = line.indexOf('='); if (equalPosition > 0) { - key = line.left (equalPosition).trimmed(); - line.remove(0,equalPosition+1); + key = line.left(equalPosition).trimmed(); + line.remove(0, equalPosition + 1); value = line.trimmed(); - groupData.insert(key,value); + groupData.insert(key, value); } - } + } } - if(!groupName.isEmpty()) { - mData.insert(groupName,groupData); + if (!groupName.isEmpty()) { + mData.insert(groupName, groupData); groupData.clear(); } return true; } - + bool HbIniParser::setCurrentGroup(const QString &name) { if (mData.contains(name)) { @@ -101,10 +101,10 @@ { return mCurrentGroup; } - -const QString HbIniParser::value(const QString &groupName,const QString &key) const + +const QString HbIniParser::value(const QString &groupName, const QString &key) const { - if(!mData.contains(groupName)){ + if (!mData.contains(groupName)) { return QString(); } return mData.value(groupName).value(key); @@ -112,11 +112,11 @@ const QString HbIniParser::value(const QString &key) const { - if(mCurrentGroup.isEmpty()) { + if (mCurrentGroup.isEmpty()) { return QString(); } return mData.value(mCurrentGroup).value(key); -} +} QStringList HbIniParser::groups() const { diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbiniparser_p.h --- a/src/hbcore/utils/hbiniparser_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbiniparser_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,25 +32,25 @@ #include #include -class HB_AUTOTEST_EXPORT HbIniParser +class HB_AUTOTEST_EXPORT HbIniParser { public: HbIniParser(); ~HbIniParser(); - + bool read(QIODevice *file); - + QStringList groups() const; bool setCurrentGroup(const QString &name); QString currentGroup(); - - const QString value(const QString &groupName,const QString &key) const; - const QString value(const QString &key) const; - + + const QString value(const QString &groupName, const QString &key) const; + const QString value(const QString &key) const; + private: - QString mCurrentGroup; - typedef QMap HbIniGroup; - QMap mData; + QString mCurrentGroup; + typedef QMap HbIniGroup; + QMap mData; }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hboogmwatcher.cpp --- a/src/hbcore/utils/hboogmwatcher.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hboogmwatcher.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -58,15 +58,20 @@ as possible in order to increase the amount of free graphics memory. */ +static bool oogmWatcherDeleted = false; + /*! Returns the global HbOogmWatcher instance. */ HbOogmWatcher *HbOogmWatcher::instance() { + if (oogmWatcherDeleted) { + return 0; + } static HbOogmWatcher *watcher = new HbOogmWatcher(qApp); return watcher; } - + HbOogmWatcher::HbOogmWatcher(QObject *parent) : QObject(parent), d_ptr(new HbOogmWatcherPrivate) { @@ -78,6 +83,7 @@ HbOogmWatcher::~HbOogmWatcher() { delete d_ptr; + oogmWatcherDeleted = true; } /*! @@ -96,10 +102,10 @@ void HbOogmWatcherPrivate::graphicsMemoryLow() { qWarning("HbOogmWatcher::graphicsMemoryLow()"); - if (mRenderMode == EHWRendering) { + if (mRenderMode == EHWRendering) { mRenderMode = ESWRendering; HbIconLoader::global()->switchRenderingMode(mRenderMode); - } + } #ifdef HB_EFFECTS_OPENVG // Destroy the cached pixmaps of effects. This is also necessary // to make the OpenVG filter effect caching working properly. (if @@ -111,7 +117,7 @@ // Drop the underlying pixmap data (if possible) for all HbIconItems that // are not currently visible. int n = 0; - foreach (HbIconItem *iconItem, mIconItems) { + foreach(HbIconItem * iconItem, mIconItems) { if (!iconItem->isVisible()) { HbIconItemPrivate::d_ptr(iconItem)->clearStoredIconContent(); ++n; @@ -127,10 +133,10 @@ void HbOogmWatcherPrivate::graphicsMemoryGood() { qWarning("HbOogmWatcher::graphicsMemoryGood()"); - if (mRenderMode == ESWRendering) { + if (mRenderMode == ESWRendering) { mRenderMode = EHWRendering; HbIconLoader::global()->switchRenderingMode(mRenderMode); - } + } emit q_ptr->graphicsMemoryGood(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hboogmwatcher_p.h --- a/src/hbcore/utils/hboogmwatcher_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hboogmwatcher_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,7 +49,7 @@ void iconCleanupDone(int count); private: - HbOogmWatcherPrivate * const d_ptr; + HbOogmWatcherPrivate *const d_ptr; Q_DECLARE_PRIVATE_D(d_ptr, HbOogmWatcher) HbOogmWatcher(QObject *parent = 0); }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hboogmwatcher_sym_p.h --- a/src/hbcore/utils/hboogmwatcher_sym_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hboogmwatcher_sym_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -46,7 +46,9 @@ void graphicsMemoryLow(); void graphicsMemoryGood(); - static HbOogmWatcherPrivate *d_ptr(HbOogmWatcher *w) { return w->d_ptr; } + static HbOogmWatcherPrivate *d_ptr(HbOogmWatcher *w) { + return w->d_ptr; + } HbOogmWatcher *q_ptr; QList mIconItems; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbscreenmode_p.cpp --- a/src/hbcore/utils/hbscreenmode_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbscreenmode_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,42 +23,39 @@ ** ****************************************************************************/ +#include "hbscreenmode_p.h" #include #include -#include "hbscreenmode_p.h" - -// ======== MEMBER FUNCTIONS ======== - -class HbScreenModePrivate +class HbScreenModePrivate { public: HbScreenModePrivate(); - -public: + +public: QSize mSize; QSizeF mTwipsSize; int mRotation; // in degrees. How the device would be moved to see/go into this mode QString mStyleName; - }; +}; HbScreenModePrivate::HbScreenModePrivate() : - mSize(-1,-1), - mTwipsSize(-1.0F,-1.0F), + mSize(-1, -1), + mTwipsSize(-1.0F, -1.0F), mRotation(0) -{ +{ } /*! \class HbScreenMode \brief Information for a single screen including screen pixel size, rotation, physical size - A single screen mode represents a physical operation mode of a display. Separate modes may be + A single screen mode represents a physical operation mode of a display. Separate modes may be distinguished by a rotation, an opening or closing of a cover, or touch enabled or not - - This class should be considered as a abstraction of the underlying operating system's way of reporting - its information. - + + This class should be considered as a abstraction of the underlying operating system's way of reporting + its information. + */ // ======== MEMBER FUNCTIONS ======== @@ -67,7 +64,7 @@ Construct a screen mode with invalid information */ HbScreenMode::HbScreenMode() -: d_ptr(new HbScreenModePrivate()) + : d_ptr(new HbScreenModePrivate()) { } @@ -75,7 +72,7 @@ Copy constructor */ HbScreenMode::HbScreenMode(const HbScreenMode &mode) -: d_ptr(new HbScreenModePrivate()) + : d_ptr(new HbScreenModePrivate()) { *d_ptr = *mode.d_ptr; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbscreenmode_p.h --- a/src/hbcore/utils/hbscreenmode_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbscreenmode_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,14 +32,14 @@ class HbScreenModePrivate; -class HbScreenMode +class HbScreenMode { public: HbScreenMode(); HbScreenMode(const HbScreenMode &mode); HbScreenMode &operator=(const HbScreenMode &other); - + ~HbScreenMode(); void setName(const QString &name); @@ -48,10 +48,10 @@ void setPixelWidth(int width); void setPixelHeight(int height); -private: - HbScreenModePrivate * const d_ptr; +private: + HbScreenModePrivate *const d_ptr; Q_DECLARE_PRIVATE_D(d_ptr, HbScreenMode) - }; +}; #endif // HBSCREENMODE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbsleepmodelistener_p.cpp --- a/src/hbcore/utils/hbsleepmodelistener_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbsleepmodelistener_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,17 +23,16 @@ ** ****************************************************************************/ +#include "hbsleepmodelistener_p.h" +#include "hbsleepmodelistener_p_p.h" #include #include -#include "hbsleepmodelistener_p.h" -#include "hbsleepmodelistener_p_p.h" - #if defined(Q_OS_SYMBIAN) #include #include -#include "hbcorepskeys_p.h" +#include "hbcorepskeys_r.h" // app uid of sleepmode application const TUid KSleepModeProperty = {0x101F7A01}; @@ -52,7 +51,7 @@ } CSleepModeListenerPrivate::CSleepModeListenerPrivate() - :CActive( EPriorityNormal ) + : CActive(EPriorityNormal), lastStatus(0), lastStatusValid(false) { User::LeaveIfError(sleepModeState.Attach(KSleepModeProperty, KSleepModeOn)); CActiveScheduler::Add(this); @@ -70,26 +69,30 @@ TInt err = InitializeStatusArray(currentStatus); if (err == KErrNone) { TInt arraySize = sizeof(THWRMStatusInfo) * KHWRMLightMaxTargets; - TPtr8 arrayPtr((TUint8*)¤tStatus[0], arraySize, arraySize); + TPtr8 arrayPtr((TUint8 *)¤tStatus[0], arraySize, arraySize); err = sleepModeState.Get(arrayPtr); if (err == KErrNone) { TInt index = currentStatus.FindInOrder(KHWRMLightFirstTarget, FindByTarget); if (index >= 0 && index < KHWRMLightMaxTargets) { status = static_cast(currentStatus[index].iStatus); - RProcess process; - //If prosess is something else than themeserver - if (process.SecureId().iId != KHbPsOrientationCategoryUid.iUid) { - QList mainWindowList = hbInstance->allMainWindows(); - for (int i = 0; i < mainWindowList.count(); ++i) { - if (status == CHWRMLight::ELightOff) { - mainWindowList[i]->broadcastEvent(HbEvent::SleepModeEnter); - } else { - mainWindowList[i]->broadcastEvent(HbEvent::SleepModeExit); + if (!lastStatusValid || lastStatus != status) { + lastStatusValid = true; + lastStatus = status; + RProcess process; + // If process is something else than themeserver + if (process.SecureId().iId != KHbPsHardwareCoarseOrientationCategoryUid.iUid) { + QList mainWindowList = hbInstance->allMainWindows(); + for (int i = 0; i < mainWindowList.count(); ++i) { + if (status == CHWRMLight::ELightOff) { + mainWindowList[i]->broadcastEvent(HbEvent::SleepModeEnter); + } else { + mainWindowList[i]->broadcastEvent(HbEvent::SleepModeExit); + } } + } else { + HbEvent event(status == CHWRMLight::ELightOff ? HbEvent::SleepModeEnter : HbEvent::SleepModeExit); + QCoreApplication::sendEvent(qApp, &event); } - } else { - HbEvent event(status == CHWRMLight::ELightOff ? HbEvent::SleepModeEnter : HbEvent::SleepModeExit); - QCoreApplication::sendEvent(qApp, &event); } } } @@ -105,11 +108,11 @@ } TInt CSleepModeListenerPrivate::InitializeStatusArray( - RLightStatusArray& aArray) const + RLightStatusArray &aArray) const { TInt err = KErrNone; TInt currentTarget(KHWRMLightFirstTarget); - for( TInt i = 0; i < KHWRMLightMaxTargets; ++i) { + for (TInt i = 0; i < KHWRMLightMaxTargets; ++i) { THWRMStatusInfo info; info.iTarget = currentTarget; info.iStatus = CHWRMLight::ELightStatusUnknown; @@ -125,16 +128,16 @@ return err; } -TInt CSleepModeListenerPrivate::FindByTarget(const TInt* aTarget, - const THWRMStatusInfo& aItem) - { +TInt CSleepModeListenerPrivate::FindByTarget(const TInt *aTarget, + const THWRMStatusInfo &aItem) +{ if (*aTarget < aItem.iTarget) { return -1; - } else if ( *aTarget > aItem.iTarget ) { + } else if (*aTarget > aItem.iTarget) { return 1; } return 0; - } +} #else @@ -153,7 +156,7 @@ /*! Returns static instance */ -HbSleepModeListener* HbSleepModeListener::instance() +HbSleepModeListener *HbSleepModeListener::instance() { static HbSleepModeListener theInstance; return &theInstance; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbsleepmodelistener_p.h --- a/src/hbcore/utils/hbsleepmodelistener_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbsleepmodelistener_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,14 +26,12 @@ #ifndef HBSLEEPMODELISTENER_P_H #define HBSLEEPMODELISTENER_P_H -#if defined(Q_OS_SYMBIAN) - -class CSleepModeListenerPrivate; +#include +#if defined(Q_OS_SYMBIAN) +class CSleepModeListenerPrivate; #else - class HbSleepModeListenerPrivate; - #endif class HB_CORE_PRIVATE_EXPORT HbSleepModeListener diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbsleepmodelistener_p_p.h --- a/src/hbcore/utils/hbsleepmodelistener_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbsleepmodelistener_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,14 +36,13 @@ /** * Data structure used to handle light status information. */ -struct THWRMStatusInfo - { +struct THWRMStatusInfo { // Light target. TInt iTarget; // Status of the target. TInt iStatus; - }; +}; /** * Defines THWRMStatusInfo array. @@ -59,10 +58,13 @@ void RunL(); void DoCancel(); - TInt InitializeStatusArray(RLightStatusArray& aArray) const; + TInt InitializeStatusArray(RLightStatusArray &aArray) const; + + static TInt FindByTarget(const TInt *aTarget, const THWRMStatusInfo &aItem); - static TInt FindByTarget(const TInt* aTarget, const THWRMStatusInfo& aItem); private: + TInt lastStatus; + bool lastStatusValid; RProperty sleepModeState; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtextmeasurementutility_p.cpp --- a/src/hbcore/utils/hbtextmeasurementutility_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtextmeasurementutility_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,7 @@ #include "hbwidgetbase.h" #include "hbfontspec.h" #include "hbinstance.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #include #include @@ -292,9 +292,9 @@ QTimer::singleShot(after, this, SLOT(doMeasureItems())); } else { // Synchronous - QCoreApplication::processEvents(); - QCoreApplication::processEvents(); - QCoreApplication::processEvents(); + QCoreApplication::sendPostedEvents(); + QCoreApplication::sendPostedEvents(); + QCoreApplication::sendPostedEvents(); doMeasureItems(); } } @@ -309,7 +309,7 @@ #else QList mainWindows = hbInstance->allMainWindows(); foreach (HbMainWindow* mainWindow, mainWindows ) { - QGraphicsScene* scene = mainWindow->scene(); + QGraphicsScene* scene = mainWindow->scene(); //krazy:exclude=qclasses QList sceneItems = scene->items(); foreach (QGraphicsItem* sceneItem, sceneItems ) { if ( sceneItem->isWidget() ) { @@ -383,7 +383,14 @@ dir.mkpath(filePath); } - filePath.append(domainName); + // Make sure there are no illegal characters in "domainName" + QString tempName = domainName; + tempName.remove(QRegExp("[^a-zA-Z0-9]")); + if (tempName.isEmpty()) { + tempName = "unknown"; + } + + filePath.append(tempName); filePath.append('_'); filePath.append(profile.name()); filePath.append('_'); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbthetestutility_p.cpp --- a/src/hbcore/utils/hbthetestutility_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbthetestutility_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -50,7 +50,7 @@ const QString KDriveEPath("E:\\data\\log\\"); const QString KDriveCPath("C:\\data\\log\\"); const QString KTheConfigureFile("TheTestUtility.txt"); // todo: proper name for configuration file - +const QString KUnixPath("HbTestUtility"); class HbTheTestUtilityPrivate { @@ -103,7 +103,11 @@ #elif defined (Q_OS_WIN32) return doCheckConfigFile(KDriveCPath); #else - return false; // only Symbian and Windows are supported + QString path(QDir::homePath()); + path.append(QDir::separator()); + path.append(KUnixPath); + path.append(QDir::separator()); + return doCheckConfigFile(path); #endif } @@ -171,7 +175,7 @@ QObject *HbTheTestUtilityPrivate::receiver(const QString& name) { - QGraphicsScene* scene = mMainWindow->scene(); + QGraphicsScene* scene = mMainWindow->scene(); //krazy:exclude=qclasses QList sceneItems = scene->items(); foreach (QGraphicsItem* sceneItem, sceneItems ) { if (sceneItem->isWidget()) { @@ -261,9 +265,7 @@ */ void HbTheTestUtility::invokeSlots(const int button) { -#if defined (Q_OS_LINUX) || defined(Q_OS_MAC) - QString filePath(QDir::tempPath()); -#else +#if defined (Q_OS_SYMBIAN) QString filePath; if (d->useF) { filePath = "F:\\data\\log\\"; @@ -272,6 +274,13 @@ } else { filePath = "C:\\data\\log\\"; } +#elif defined (Q_OS_WIN) + QString filePath("C:\\data\\log\\"); +#else + QString filePath(QDir::homePath()); + filePath.append(QDir::separator()); + filePath.append(KUnixPath); + filePath.append(QDir::separator()); #endif filePath = QDir::toNativeSeparators(filePath); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbthetestwidget_p.cpp --- a/src/hbcore/utils/hbthetestwidget_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbthetestwidget_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,7 +26,7 @@ #include "hbthetestwidget_p.h" #include "hbinstance.h" #include "hbnamespace_p.h" -#include +#include "hbapplication.h" #include "hbtoolbutton_p.h" #include "hbstyleoptiontoolbutton_p.h" #include "hbcolorscheme.h" @@ -50,6 +50,7 @@ #include #include #include +#include #include #include // for qWarning @@ -68,6 +69,11 @@ // how much must button be dragged before it is actually moved const int KThreshold = 16; +const QString KDriveFPath("F:\\data\\log\\"); +const QString KDriveEPath("E:\\data\\log\\"); +const QString KDriveCPath("C:\\data\\log\\"); +const QString KTheAppLaunchConfigureFile("app_launch_config.txt"); + HbTheTestButton::HbTheTestButton(QGraphicsItem *parent) : HbToolButton(parent), mPressedDown(false) @@ -322,11 +328,8 @@ HbTextMeasurementUtility *measureUtility = HbTextMeasurementUtility::instance(); if ( measureUtility->locTestMode() ) { HbDeviceProfile profile = HbDeviceProfile::profile(d->mMainWindow); - if (!HbApplication::applicationName().isEmpty()) { - measureUtility->writeReport(profile, HbApplication::applicationName()); - } else { - measureUtility->writeReport(profile, "unknown_application"); - } + QFileInfo info(QCoreApplication::applicationFilePath()); + measureUtility->writeReport(profile, info.baseName()); measureUtility->reset(); } else { showWarning("Localization metrics run-time flag disabled!"); @@ -361,6 +364,7 @@ void HbTheTestWidget::showThemeServerMemoryInfo() { +#ifdef Q_OS_SYMBIAN HbDialog *dialog = new HbDialog(); dialog->setAttribute(Qt::WA_DeleteOnClose); @@ -390,13 +394,72 @@ dialog->setContentWidget(textItem); dialog->show(); +#endif } void HbTheTestWidget::createSharedMemoryReport() const { +#ifdef Q_OS_SYMBIAN #ifdef HB_THEME_SERVER_MEMORY_REPORT HbThemeClient::global()->createMemoryReport(); #endif +#endif // Q_OS_SYMBIAN +} + +void HbTheTestWidget::launchThemeChanger() +{ + QProcess::startDetached("hbthemechanger.exe"); +} + +void HbTheTestWidget::launchApplications() +{ + // Find config file + QString filePath = findAppLaunchConfigFile(); + + QStringList commandLines; + + if (!filePath.isEmpty()) { + // Try to read file + QFile file(filePath); + if (file.open(QIODevice::ReadOnly)) { + QString line; + + while (!file.atEnd()) { + QByteArray dirtyLine = file.readLine(); + line = QString(dirtyLine).trimmed(); + // Skip empty lines and comment lines + if (line.isEmpty() || line.at(0) == '#') { + continue; + } + commandLines.append(line); + } + } + } + + for (int i=0; iScreenDevice()->SizeInPixels(); -// TDisplayMode displayMode = CCoeEnv::Static()->ScreenDevice()->DisplayMode(); + QPixmap screenPixmap = QPixmap::grabWindow( + QApplication::activeWindow()->winId()); //krazy:exclude=qclasses -// CFbsBitmap *bitmap = new (ELeave) CFbsBitmap(); -// User::LeaveIfError(bitmap->Create(screenSize, displayMode)); - -// CCoeEnv::Static()->ScreenDevice()->CopyScreenToBitmap(bitmap); -// QPixmap screenPixmap = QPixmap::fromSymbianCFbsBitmap(bitmap); -//#else - QPixmap screenPixmap = QPixmap::grabWindow( - QApplication::activeWindow()->winId()); -//#endif QString format = "png"; screenPixmap.save(filePath.toLatin1(), format.toLatin1()); setVisible(true); @@ -475,4 +528,25 @@ dialog->show(); } +QString HbTheTestWidget::findAppLaunchConfigFile() +{ + QString filePath; +#if defined (Q_OS_SYMBIAN) + if (QFile::exists(KDriveFPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveFPath + KTheAppLaunchConfigureFile; + } else if (QFile::exists(KDriveEPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveEPath + KTheAppLaunchConfigureFile; + } else if (QFile::exists(KDriveCPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveCPath + KTheAppLaunchConfigureFile; + } +#elif defined (Q_OS_WIN32) + if (QFile::exists(KDriveCPath + KTheAppLaunchConfigureFile)) { + filePath = KDriveCPath + KTheAppLaunchConfigureFile; + } + // only Symbian and Windows are supported +#endif + + return filePath; +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbthetestwidget_p.h --- a/src/hbcore/utils/hbthetestwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbthetestwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -66,7 +66,7 @@ public: ~HbTheTestWidget(); - HbTheTestWidget(HbMainWindow *mainWindow, QGraphicsItem *parent = 0); + explicit HbTheTestWidget(HbMainWindow *mainWindow, QGraphicsItem *parent = 0); HbTheTestButton *button1(); HbTheTestButton *button2(); @@ -82,6 +82,8 @@ void showThemeServerMemoryInfo(); void screenCapture(); // not working on HW void createSharedMemoryReport() const; + void launchThemeChanger(); + void launchApplications(); // Reads exe names and parameters in config file protected: QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; @@ -92,6 +94,7 @@ private: void showWarning(QString text); + QString findAppLaunchConfigFile(); private: HbTheTestWidgetPrivate *d; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtimer.cpp --- a/src/hbcore/utils/hbtimer.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtimer.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,19 +39,20 @@ { public: HbTimerAnim(HbTimerEntry *entry) : mEntry(entry), mDuration(entry->interval()) { } - int duration() const { return mDuration; } + int duration() const { + return mDuration; + } void updateCurrentTime(int) { } - void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) - { - if (oldState != QAbstractAnimation::Stopped && newState == QAbstractAnimation::Stopped && mEntry) { - mEntry->timerFired(); - mEntry->mAnim = 0; // to prevent confusing unregisterEntry() and double deletion - HbTimer::instance()->unregisterEntry(mEntry); - if (mEntry->mDeleteWhenFinishedNormally) { - delete mEntry; - } + void updateState(QAbstractAnimation::State newState, QAbstractAnimation::State oldState) { + if (oldState != QAbstractAnimation::Stopped && newState == QAbstractAnimation::Stopped && mEntry) { + mEntry->timerFired(); + mEntry->mAnim = 0; // to prevent confusing unregisterEntry() and double deletion + HbTimer::instance()->unregisterEntry(mEntry); + if (mEntry->mDeleteWhenFinishedNormally) { + delete mEntry; } } + } HbTimerEntry *mEntry; int mDuration; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtimer_p.h --- a/src/hbcore/utils/hbtimer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtimer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -52,7 +52,7 @@ class HB_AUTOTEST_EXPORT HbTimerSignalEntry : public QObject, public HbTimerEntry { Q_OBJECT - + public: HbTimerSignalEntry(int interval); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtypefaceinfo.cpp --- a/src/hbcore/utils/hbtypefaceinfo.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtypefaceinfo.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -45,8 +45,8 @@ HbTypefaceInfoPrivate() : initialized(false) {} ~HbTypefaceInfoPrivate(); void initialize(); - bool containsRole( HbFontSpec::Role role, int &index ); - bool containsFamily( const QString& typefaceFamily, int &index ); + bool containsRole(HbFontSpec::Role role, int &index) const; + bool containsFamily(const QString &typefaceFamily, int &index) const; public: // data bool initialized; @@ -65,7 +65,6 @@ mTypefaceVector = HbThemeClient::global()->typefaceInfo(); if( !mTypefaceVector ) { - qWarning() << "HbTypefaceInfo, no theme server connection - working in fallback mode"; HbTypefaceInfoDatabase *heapDatabase = HbTypefaceInfoDatabase::instance( HbMemoryManager::HeapMemory ); mTypefaceVector = HbMemoryUtils::getAddress(HbMemoryManager::HeapMemory, heapDatabase->typefaceInfoVectorOffset()); @@ -103,14 +102,15 @@ delete d; } -bool HbTypefaceInfoPrivate::containsRole( HbFontSpec::Role role, int &index ) +bool HbTypefaceInfoPrivate::containsRole(HbFontSpec::Role role, int &index) const { if( ! initialized ) { qWarning( "HbTypefaceInfoPrivate in not initialized, line %d", __LINE__ ); return false; } for( int i = 0; i < mTypefaceVector->size(); i++ ) { - if( mTypefaceVector->at(i).mRoleEnum == role ) { + if (mTypefaceVector->at(i).mRoleEnum == role && + mTypefaceVector->at(i).mIsAlias == false) { index = i; return true; } @@ -119,22 +119,51 @@ } -bool HbTypefaceInfoPrivate::containsFamily( const QString& typefaceFamily, int &index ) +bool HbTypefaceInfoPrivate::containsFamily(const QString &typefaceFamily, int &index) const { if( ! initialized ) { qWarning( "HbTypefaceInfoPrivate in not initialized, line %d", __LINE__ ); return false; } for( int i = 0; i < mTypefaceVector->size(); i++ ) { - if( mTypefaceVector->at(i).mFamily == typefaceFamily ) { + if (!typefaceFamily.compare(mTypefaceVector->at(i).mFamily, Qt::CaseInsensitive)) { index = i; return true; } } return false; } - - +bool HbTypefaceInfo::containsFamily(const QString &typefaceFamily) const +{ + int dummy; + return d->containsFamily(typefaceFamily, dummy); +} +bool HbTypefaceInfo::tryGetFamilyFromAliasName( + const QString &aliasFamily, + QString &typefaceFamily, + int &weight) const +{ + for (int i = 0; i < d->mTypefaceVector->size(); i++) { + if (d->mTypefaceVector->at(i).mIsAlias == true && + !aliasFamily.compare(d->mTypefaceVector->at(i).mAliasedFamily, Qt::CaseInsensitive)) { + typefaceFamily = d->mTypefaceVector->at(i).mFamily ; + weight = d->mTypefaceVector->at(i).mIsBold ? QFont::Bold : QFont::Normal; + return true; + } + } + return false; +} +int HbTypefaceInfo::getWeight(const QString &typefaceFamily) const +{ + int index, weight; + if (d->containsFamily( typefaceFamily, index)) { + weight = d->mTypefaceVector->at(index).mIsBold ? QFont::Bold : QFont::Normal; + } + else { + weight = QFont::Normal; + } + return weight; +} void HbTypefaceInfo::roleToTypeface(HbFontSpec::Role role, QString& typefaceFamily, int& weight) const { int index; @@ -143,10 +172,10 @@ if (!validRole) { role = HbFontSpec::Undefined; validRole = d->containsRole( role, index ); - } if( !validRole ) { - qWarning( "HbTypefaceInfo: cannot find corresponding font role, line %d", __LINE__ ); + qWarning( "HbTypefaceInfo: cannot find corresponding font role %d, line %d", role, __LINE__ ); return; + } } typefaceFamily = d->mTypefaceVector->at( index ).mFamily; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtypefaceinfo_p.h --- a/src/hbcore/utils/hbtypefaceinfo_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtypefaceinfo_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -42,6 +42,9 @@ void roleToTypeface(HbFontSpec::Role role, QString &typefaceFamily, int &weight) const; int textHeightToSizeInPixels(const QString &typefaceFamily, int weight, qreal textHeight) const; + bool tryGetFamilyFromAliasName(const QString &aliasFamily, QString &typefaceFamily, int &weight) const; + bool containsFamily(const QString& typefaceFamily) const; + int getWeight(const QString& typefaceFamily) const; private: mutable HbTypefaceInfoPrivate *d; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtypefaceinfodatabase_p.cpp --- a/src/hbcore/utils/hbtypefaceinfodatabase_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtypefaceinfodatabase_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -50,11 +50,12 @@ #define TITLE_STRING "title" #define DIGITAL_STRING "digital" #define UNDEFINED_STRING "undefined" +#define ALIAS_STRING "alias" #define TYPEFACE_METRICS_FILE_STEM "typeface_metrics_" -#define LARGEST_SIZE 100 +static const int LARGEST_SIZE = 100; // Following must be greater than 0 -#define SMALLEST_SIZE 1 +static const int SMALLEST_SIZE = 1; @@ -91,6 +92,15 @@ return encoded; } +static bool isAliasRole(const QString &roleName) +{ + bool alias(false); // return value + QString name = roleName.toLower(); + if (name == ALIAS_STRING) { + alias = true; + } + return alias; +} /*! Returns path to a writable location that should be used as a base storage folder for dynamic metric creation. @@ -165,19 +175,25 @@ } else { QString role; - QString family; + QString family, aliasFamily; bool isBold; - while (parser->readMapping( role, family, isBold)) { + while (parser->readMapping( role, family, aliasFamily, isBold)) { HbTypefaceInfoItem item( mType ); HbFontSpec::Role roleEnum; if (encodeRole(role, roleEnum)){ item.mRoleEnum = roleEnum; item.mFamily = family; item.mIsBold = isBold; + item.mIsAlias = false; mTypefaceInfoVector->append( item ); } - else { - // role might be an alias. Not required functionality. Ignore + else if (isAliasRole(role)) { + item.mRoleEnum = HbFontSpec::Undefined; + item.mFamily = aliasFamily; + item.mAliasedFamily = family; + item.mIsBold = isBold; + item.mIsAlias = true; + mTypefaceInfoVector->append( item ); } } @@ -189,7 +205,7 @@ if( item->mRoleEnum == HbFontSpec::Secondary ) { secondaryFontspec = item; } - if( item->mRoleEnum == HbFontSpec::Undefined ) { + if (item->mRoleEnum == HbFontSpec::Undefined && item->mIsAlias == false) { undefinedFontspec = item; } } @@ -226,7 +242,8 @@ -bool HbTypefaceInfoDatabase::readTypefaceMetricsFile( HbTypefaceXmlParser *parser, HbTypefaceInfoItem *typeFaceInfoItem ) +bool HbTypefaceInfoDatabase::readTypefaceMetricsFile( HbTypefaceXmlParser *parser, + HbTypefaceInfoItem *typeFaceInfoItem ) { int numPoints(0); @@ -254,7 +271,8 @@ delete file; #ifdef HBTYPEFACEINFO_DEBUG_ENABLE - qDebug("HbDownsizeInfo::readTypefaceMetricsFile: typeface metric filename: %s", typefaceMetricsFileName.toAscii().constData()); + qDebug("HbDownsizeInfo::readTypefaceMetricsFile: typeface metric filename: %s", + typefaceMetricsFileName.toAscii().constData()); #endif parser->setFilePath(typefaceMetricsFileName); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtypefaceinfodatabase_p.h --- a/src/hbcore/utils/hbtypefaceinfodatabase_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtypefaceinfodatabase_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,6 +36,8 @@ HbFontSpec::Role mRoleEnum; HbString mFamily; bool mIsBold; + bool mIsAlias; + HbString mAliasedFamily; struct HbTypefaceMeasureInfoStruct { @@ -48,8 +50,9 @@ int mLowestExtent; int mHighestExtent; + // Initialize lowest extent to something big enough and highest extent to zero. HbTypefaceInfoItem(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) - : mFamily(type), mDownSizeTable(type) + : mFamily(type), mAliasedFamily(type), mDownSizeTable(type), mLowestExtent(10000), mHighestExtent(0) { } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtypefacexmlparser.cpp --- a/src/hbcore/utils/hbtypefacexmlparser.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtypefacexmlparser.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -44,6 +44,7 @@ #define TYPEFACE_BASELINE_ATT "baseline" #define TYPEFACE_LANGUAGE_ATT "language" #define TYPEFACE_COUNTRY_ATT "country" +#define TYPEFACE_ALIASFAMILY_ATT "aliasfamily" #define TYPEFACE_ATT_VAL_BOLD "bold" @@ -205,7 +206,7 @@ // Construct the locale with the typeface locale info if (!language.isEmpty()) { if (!country.isEmpty()) { - typefaceLocaleName = language + "_" + country; + typefaceLocaleName = language + '_' + country; systemLocaleName = systemLocale.name(); } else { @@ -285,7 +286,7 @@ \param bold true if typeface is to be used bold by default \return false iff there was an error. Output parameters not defined */ -bool HbTypefaceXmlParser::readMapping(QString& role, QString& family, bool& bold) +bool HbTypefaceXmlParser::readMapping(QString &role, QString &family, QString &aliasFamily, bool &bold) { bool atEnd(false); bool success(false); @@ -302,7 +303,7 @@ } else if (isStartElement()) { if (name() == TYPEFACE_MAPPING) { - success = readMapItem(role, family, bold); + success = readMapItem(role, family, aliasFamily, bold); } } @@ -317,7 +318,7 @@ /* * Parses information inside one field. */ -bool HbTypefaceXmlParser::readMapItem(QString& role, QString& family, bool& isBold) +bool HbTypefaceXmlParser::readMapItem(QString &role, QString &family, QString &aliasFamily, bool &isBold) { Q_ASSERT(isStartElement() && name() == TYPEFACE_MAPPING); isBold = false; @@ -346,6 +347,9 @@ if (attr.value().toString() == TYPEFACE_ATT_VAL_BOLD) isBold = true; } + else if (attrName == TYPEFACE_ALIASFAMILY_ATT) { + aliasFamily = attr.value().toString(); + } else { qDebug("Unrecognized attribute"); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbtypefacexmlparser_p.h --- a/src/hbcore/utils/hbtypefacexmlparser_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbtypefacexmlparser_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -62,14 +62,14 @@ void setFilePath(const QString &path); bool init(); StartElement readToStartElement(); - bool readMapping(QString &role, QString &family, bool &isBold); + bool readMapping(QString &role, QString &family, QString &aliasFamily, bool &isBold); bool readMetric(int &textHeight, int &size, int &baseline); const QString metricsTypefaceFamily() const; bool readAndPositionTypefaceSet(); void close(); private: - bool readMapItem(QString &role, QString &family, bool &isBold); + bool readMapItem(QString &role, QString &family, QString &aliasFamily, bool &isBold); bool readMetricItem(int &textHeight, int &size, int &baseline); bool matchLanguageAndCountry() const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbwidgetloader.cpp --- a/src/hbcore/utils/hbwidgetloader.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbwidgetloader.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,9 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#ifndef HB_BIN_CSS +#define HB_USETHEMESERVER +#endif #include "hbwidgetloader_p.h" #include "hbwidgetloadersyntax_p.h" @@ -29,7 +32,9 @@ #include "hbinstance.h" #include "hbtheme_p.h" +#ifdef HB_USETHEMESERVER #include "hbthemeclient_p.h" +#endif #include #include @@ -51,7 +56,7 @@ #define hbInstance (HbInstance::instance()) -// cache at the client side to store the mesh items. +// cache at the client side to store the anchor items. // key used here is the filename+layoutname+sectionname. typedef QHash ClientHashForLayoutDefs; @@ -63,11 +68,11 @@ Q_GLOBAL_STATIC(QStringList, filesNotPresent) // Layout caching -static HbWidgetLoader::LayoutDefinition *staticCacheLayout = NULL; -static QString staticCacheFileName = QString(); -static QString staticCacheName = QString(); -static QString staticCacheSection = QString(); -static QDateTime staticCacheModified = QDateTime(); +static HbWidgetLoader::LayoutDefinition *staticCacheLayout = 0; +static QString staticCacheFileName; +static QString staticCacheName; +static QString staticCacheSection; +static QDateTime staticCacheModified; class HbWidgetLoaderPrivate { @@ -141,14 +146,14 @@ /*! Loads and processes a WidgetML file. - If the widget already has a layout assumes it's HbMeshLayout. - If the widget doesn't have a layout creates HbMeshLayout and sets it to widget. + If the widget already has a layout assumes it's HbAnchorLayout. + If the widget doesn't have a layout creates HbAnchorLayout and sets it to widget. Creates the anchor edge attachments based on WidgetML. \param fileName file to be processed. \param name the name of the layout to be loaded. \param section space separated route to section, that you want to load. - \param storage specifies where to store the mesh items. + \param storage specifies where to store the anchor items. \return true if file was loaded and processed successfully. */ bool HbWidgetLoader::load( @@ -237,6 +242,12 @@ delete mActions; } +#ifdef HB_BIN_CSS +void HbWidgetLoaderPrivate::setWidget( HbWidget* widget ) +{ + Q_UNUSED(widget) +} +#else /*! \internal */ @@ -246,6 +257,7 @@ mActions->mWidget = widget; mActions->mCurrentProfile = HbDeviceProfile::profile(widget); } +#endif /*! \internal @@ -256,7 +268,7 @@ const QString §ion, HbWidgetLoader::LayoutDefinition *&layoutDef ) { - // check in the client side cache if the vector of meshitems is present. + // check in the client side cache if the vector of anchor items is present. QString key (fileName + name + section); if (clientLayoutDefsCache()->contains(key)){ // present in the client cache. @@ -280,10 +292,12 @@ } // get the shared layout definition address. +#ifdef HB_USETHEMESERVER layoutDef = HbThemeClient::global()->getSharedLayoutDefs(fileName, name, section); if (layoutDef) { clientLayoutDefsCache()->insert(key, layoutDef); } +#endif return true; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbwidgetloader_p.h --- a/src/hbcore/utils/hbwidgetloader_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbwidgetloader_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,6 +28,7 @@ #include #include +#include #include #include "hbstring_p.h" #include "hbvector_p.h" @@ -44,25 +45,39 @@ { public: - struct MeshItem + struct AnchorItem { - HbString src; - HbString dst; + HbString srcId; + HbString dstId; Hb::Edge srcEdge; Hb::Edge dstEdge; - HbXmlLengthValue::Type spacingType; - qreal spacingVal; - HbString spacingText; - HbString spacer; - MeshItem(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) - : src(type), dst(type), spacingText(type), spacer(type) {} + + HbXmlLengthValue::Type minType; + float minVal; + HbString minText; + + HbXmlLengthValue::Type prefType; + float prefVal; + HbString prefText; + + HbXmlLengthValue::Type maxType; + float maxVal; + HbString maxText; + + int sizepolicy; + int direction; + + HbString anchorId; + + AnchorItem(HbMemoryManager::MemoryType type = HbMemoryManager::HeapMemory) + : srcId(type), dstId(type), minText(type), prefText(type), maxText(type), anchorId(type) {} }; struct LayoutDefinition { HbMemoryManager::MemoryType type; - HbVector meshItems; + HbVector anchorItems; LayoutDefinition(HbMemoryManager::MemoryType memtype) - : type(memtype), meshItems(memtype) + : type(memtype), anchorItems(memtype) { } }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbwidgetloaderactions_p.cpp --- a/src/hbcore/utils/hbwidgetloaderactions_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbwidgetloaderactions_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -38,7 +38,7 @@ /*! \internal */ -HbWidgetLoaderActions::HbWidgetLoaderActions() +HbWidgetLoaderActions::HbWidgetLoaderActions() : HbXmlLoaderBaseActions(), mWidget(0), mLayout(0) { } @@ -50,24 +50,25 @@ { } +#ifndef HB_BIN_CSS /*! \internal */ -bool HbWidgetLoaderActions::createMeshLayout( const QString &widget ) +bool HbWidgetLoaderActions::createAnchorLayout( const QString &widget, bool modify ) { Q_UNUSED( widget ); - HbMeshLayout *layout = static_cast(mWidget->layout()); + Q_UNUSED( modify ); + HbAnchorLayout *layout = static_cast(mWidget->layout()); if (!layout) { - layout = new HbMeshLayout(); + layout = new HbAnchorLayout(); mWidget->setLayout(layout); } else { // Reset layout's state while (layout->count()) { layout->removeAt(0); } - layout->clearAnchors(); - layout->clearSpacingOverrides(); - layout->clearItemIds(); + layout->removeAnchors(); + layout->removeMappings(); } mLayout = layout; return true; @@ -76,47 +77,71 @@ /*! \internal */ -bool HbWidgetLoaderActions::addMeshLayoutEdge( const QString &src, Hb::Edge srcEdge, - const QString &dst, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, const QString &spacer ) +bool HbWidgetLoaderActions::addAnchorLayoutItem( + const QString &src, + const QString &srcId, + Hb::Edge srcEdge, + const QString &dst, + const QString &dstId, + Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ) { - bool ok = true; - if ( !spacer.isEmpty() ) { - // spacer is added - // divide original mesh definition into two. src->dst becomes src->spacer->dst - if ( src.isEmpty() ) { - // if the starting item is layout - // "layout --(spacing)--> item" - // becomes - // "layout --(spacing)--> spacer --(0)--> item" - ok &= addMeshLayoutEdge( src, srcEdge, spacer, srcEdge, spacing, QString() ); - HbXmlLengthValue val(0, HbXmlLengthValue::Pixel); - ok &= addMeshLayoutEdge( spacer, getAnchorOppositeEdge(srcEdge), dst, dstEdge, val, QString() ); + // widgetml is purely id based. + Q_UNUSED(src); + Q_UNUSED(dst); + + HbAnchor* anchor = new HbAnchor( srcId, srcEdge, dstId, dstEdge ); + + if ( minLength.mType != HbXmlLengthValue::None ) { + qreal minVal(0); + if ( !toPixels(minLength, minVal) ) { + delete anchor; + return false; } else { - // between two items, or if end item is layout - // "item1 --(spacing)--> item2" - // becomes - // "item1 --(spacing)--> spacer --(0)--> item2" - ok &= addMeshLayoutEdge( src, srcEdge, spacer, getAnchorOppositeEdge(srcEdge), spacing, QString() ); - HbXmlLengthValue val(0, HbXmlLengthValue::Pixel); - ok &= addMeshLayoutEdge( spacer, srcEdge, dst, dstEdge, val, QString() ); - } - if ( ok & !mWidget->layoutPrimitive( spacer ) ) { - static_cast(HbWidgetBasePrivate::d_ptr(mWidget)) - ->createSpacerItem(spacer); - } - } else { - qreal spacingPx=0.0; - if (spacing.mType != HbXmlLengthValue::None ) { - ok = toPixels(spacing, spacingPx); - } // else default to zero. - if ( ok ) { - mLayout->setAnchor(src, srcEdge, dst, dstEdge, spacingPx); + anchor->setMinimumLength( minVal ); } } - return ok; + + if ( prefLength.mType != HbXmlLengthValue::None ) { + qreal prefVal(0); + if ( !toPixels(prefLength, prefVal) ) { + delete anchor; + return false; + } else { + anchor->setPreferredLength( prefVal ); + } + } + + if ( maxLength.mType != HbXmlLengthValue::None ) { + qreal maxVal(0); + if ( !toPixels(maxLength, maxVal) ) { + delete anchor; + return false; + } else { + anchor->setMaximumLength( maxVal ); + } + } + + if ( policy ) { + anchor->setSizePolicy( *policy ); + } + + if ( dir ) { + anchor->setDirection( *dir ); + } + + if ( !anchorId.isEmpty() ) { + anchor->setAnchorId( anchorId ); + } + + return mLayout->setAnchor( anchor ); } - +#endif /* \class HbWidgetLoaderMemoryActions \internal @@ -140,32 +165,54 @@ /*! \internal */ -bool HbWidgetLoaderMemoryActions::createMeshLayout( const QString &widget ) +bool HbWidgetLoaderMemoryActions::createAnchorLayout( const QString &widget, bool modify ) { Q_UNUSED(widget); - mLayoutDef->meshItems.clear(); + Q_UNUSED(modify); + mLayoutDef->anchorItems.clear(); return true; } /*! \internal */ -bool HbWidgetLoaderMemoryActions::addMeshLayoutEdge( const QString &src, Hb::Edge srcEdge, - const QString &dst, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, const QString &spacer ) -{ - HbWidgetLoader::MeshItem item(mLayoutDef->type); - item.src = src; - item.dst = dst; - item.srcEdge = srcEdge; +bool HbWidgetLoaderMemoryActions::addAnchorLayoutItem( + const QString &src, + const QString &srcId, + Hb::Edge srcEdge, + const QString &dst, + const QString &dstId, + Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ) +{ + // widgetml is purely id based. + Q_UNUSED(src); + Q_UNUSED(dst); + + HbWidgetLoader::AnchorItem item(mLayoutDef->type); + item.srcId = srcId; + item.dstId = dstId; + item.srcEdge = srcEdge; item.dstEdge = dstEdge; - item.spacingType = spacing.mType; - item.spacingVal = spacing.mValue; - item.spacingText = spacing.mString; - item.spacer = spacer; - - mLayoutDef->meshItems.append(item); + item.minType = minLength.mType; + item.minVal = minLength.mValue; + item.minText = minLength.mString; + item.prefType = prefLength.mType; + item.prefVal = prefLength.mValue; + item.prefText = prefLength.mString; + item.maxType = maxLength.mType; + item.maxVal = maxLength.mValue; + item.maxText = maxLength.mString; + item.sizepolicy = policy ? *policy : -1; + item.direction = dir ? *dir : -1; + item.anchorId = anchorId; + mLayoutDef->anchorItems.append(item); return true; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbwidgetloaderactions_p.h --- a/src/hbcore/utils/hbwidgetloaderactions_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbwidgetloaderactions_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include "hbwidgetloader_p.h" #include "hbwidgetloaderactions_p.h" @@ -41,9 +41,9 @@ // Uncomment the following in order to get additional debug prints //#define HB_DOCUMENTLOADER_DEBUG - + #ifndef HB_DOCUMENTLOADER_DEBUG -#define HB_DOCUMENTLOADER_PRINT(a) +#define HB_DOCUMENTLOADER_PRINT(a) #else #include #define HB_DOCUMENTLOADER_PRINT(a) qDebug() << QString(a); @@ -56,18 +56,29 @@ virtual ~HbWidgetLoaderActions(); void setWidget( HbWidget *widget ); - - bool createMeshLayout( const QString &widget ); - bool addMeshLayoutEdge( const QString &src, Hb::Edge srcEdge, - const QString &dst, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, const QString &spacer = QString() ); +#ifndef HB_BIN_CSS + bool createAnchorLayout( const QString &widget, bool modify ); + bool addAnchorLayoutItem( + const QString &src, + const QString &srcId, + Hb::Edge srcEdge, + const QString &dst, + const QString &dstId, + Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ); +#endif public: Q_DISABLE_COPY(HbWidgetLoaderActions) HbWidget *mWidget; private: - HbMeshLayout *mLayout; + HbAnchorLayout *mLayout; }; class HbWidgetLoaderMemoryActions : public HbXmlLoaderAbstractActions @@ -75,11 +86,21 @@ public: HbWidgetLoaderMemoryActions(); virtual ~HbWidgetLoaderMemoryActions(); - - bool createMeshLayout( const QString &widget ); - bool addMeshLayoutEdge( const QString &src, Hb::Edge srcEdge, - const QString &dst, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, const QString &spacer = QString() ); + + bool createAnchorLayout( const QString &widget, bool modify ); + bool addAnchorLayoutItem( + const QString &src, + const QString &srcId, + Hb::Edge srcEdge, + const QString &dst, + const QString &dstId, + Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ); public: Q_DISABLE_COPY(HbWidgetLoaderMemoryActions) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbwidgetloadersyntax_p.cpp --- a/src/hbcore/utils/hbwidgetloadersyntax_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbwidgetloadersyntax_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -49,7 +49,7 @@ // Widget loader version number #define VERSION_MAJOR 0 -#define VERSION_MINOR 2 +#define VERSION_MINOR 3 #define MIN_SUPPORTED_VERSION_MAJOR 0 #define MIN_SUPPORTED_VERSION_MINOR 1 @@ -115,7 +115,7 @@ QString ver_str = attribute( ATTR_VERSION ); ver_str.toDouble( &ok ); - QStringList ver = ver_str.split( "." ); + QStringList ver = ver_str.split( '.' ); if( ( !ok ) || ( ver.size() != 2 ) ) { @@ -157,13 +157,14 @@ const QString layout_name = attribute( ATTR_NAME ); bool result = false; - if( layout_type == lexemValue(LAYOUT_MESH) ) { + if( layout_type == lexemValue(LAYOUT_ANCHOR) || + layout_type == lexemValue(LAYOUT_MESH) ) { if( layout_name == mLayoutName ) { - mCurrentLayoutType = LAYOUT_MESH_TARGET; + mCurrentLayoutType = LAYOUT_ANCHOR; mLayoutFound = true; - result = mActions->createMeshLayout( QString() ); + result = mActions->createAnchorLayout( QString(), false ); } else { - mCurrentLayoutType = LAYOUT_MESH_ALIEN; + mCurrentLayoutType = LAYOUT_ALIEN; result = true; } } else { @@ -180,36 +181,18 @@ { bool result = false; switch( mCurrentLayoutType ) { - case LAYOUT_MESH_ALIEN: + case LAYOUT_ALIEN: { - HB_DOCUMENTLOADER_PRINT( "GENERAL LAYOUT START ITEM: ALIEN MESH ITEM" ); + HB_DOCUMENTLOADER_PRINT( "GENERAL LAYOUT START ITEM: ALIEN" ); result = true; break; } - case LAYOUT_MESH_TARGET: + case LAYOUT_ANCHOR: { - HB_DOCUMENTLOADER_PRINT( "GENERAL LAYOUT START ITEM: TARGET MESH ITEM" ); - if( mReader.name() == lexemValue(ML_MESHITEM) ) { - result = true; - - const QString src = attribute( ML_SRC_NAME ); - const QString dst = attribute( ML_DST_NAME ); - const QString srcEdgeStr = attribute( ML_SRC_EDGE ); - const QString dstEdgeStr = attribute( ML_DST_EDGE ); - const QString spacing = attribute( ML_SPACING ); - const QString spacer = attribute( ML_SPACER ); - - HbXmlLengthValue spacingVal; - if ( !spacing.isEmpty() ) { - result = toLengthValue(spacing, spacingVal); - } - Hb::Edge srcEdge, dstEdge; - result &= getAnchorEdge( srcEdgeStr, srcEdge ); - result &= getAnchorEdge( dstEdgeStr, dstEdge ); - if (result) { - result = mActions->addMeshLayoutEdge( src, srcEdge, dst, dstEdge, spacingVal, spacer ); - } - + HB_DOCUMENTLOADER_PRINT( "GENERAL LAYOUT START ITEM: TARGET ANCHOR ITEM" ); + if( mReader.name() == lexemValue(AL_ANCHOR) || + mReader.name() == lexemValue(ML_MESHITEM) ) { + result = readAnchorLayoutStartItem(true); } break; } @@ -263,14 +246,35 @@ bool retVal(true); // Construct layout from layout definition - retVal = mActions->createMeshLayout(QString()); - for (int i = 0; retVal && i < layoutDef->meshItems.count(); i++){ - const HbWidgetLoader::MeshItem &item = layoutDef->meshItems.at(i); - HbXmlLengthValue spacingVal; - spacingVal.mType = item.spacingType; - spacingVal.mValue = item.spacingVal; - spacingVal.mString = item.spacingText; - retVal = mActions->addMeshLayoutEdge( item.src, item.srcEdge, item.dst, item.dstEdge, spacingVal, item.spacer ); + retVal = mActions->createAnchorLayout(QString(), false); + for (int i = 0; retVal && i < layoutDef->anchorItems.count(); i++){ + const HbWidgetLoader::AnchorItem &item = layoutDef->anchorItems.at(i); + HbXmlLengthValue minLength, prefLength, maxLength; + minLength.mType = item.minType; + minLength.mValue = item.minVal; + minLength.mString = item.minText; + prefLength.mType = item.prefType; + prefLength.mValue = item.prefVal; + prefLength.mString = item.prefText; + maxLength.mType = item.maxType; + maxLength.mValue = item.maxVal; + maxLength.mString = item.maxText; + QSizePolicy::Policy sizepolicy; + QSizePolicy::Policy *sizepolicy_p = 0; + if ( item.sizepolicy != -1 ) { + sizepolicy = (QSizePolicy::Policy)item.sizepolicy; + sizepolicy_p = &sizepolicy; + } + HbAnchor::Direction direction; + HbAnchor::Direction *direction_p = 0; + if ( item.direction != -1 ) { + direction = (HbAnchor::Direction)item.direction; + direction_p = &direction; + } + + retVal = mActions->addAnchorLayoutItem( + QString(), item.srcId, item.srcEdge, QString(), item.dstId, item.dstEdge, + minLength, prefLength, maxLength, sizepolicy_p, direction_p, item.anchorId ); } return retVal; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbwsiniparser_p.cpp --- a/src/hbcore/utils/hbwsiniparser_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbwsiniparser_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,16 +23,14 @@ ** ****************************************************************************/ +#include "hbwsiniparser_p.h" #include #include #include #include -#include "hbwsiniparser_p.h" +#define WSINI_PARSE_ENTRY(keyword, func) { keyword, &HbWsiniParser::call_##func } -// ======== MEMBER FUNCTIONS ======== - -#define WSINI_PARSE_ENTRY(keyword, func) { keyword, &HbWsiniParser::call_##func } const HbWsiniParser::ParserEntry HbWsiniParser::mParseTable[] = { WSINI_PARSE_ENTRY("S60_HWSTATE_KEYCODE", hardwareStateKeycode), //S60_HWSTATE_KEYCODEn @@ -51,14 +49,23 @@ a wsini file is put in the directory c:\hb\data, then that wsini will simulate the behavior on a Symbian device. */ -void HbWsiniParser::parseModes(QMap &modes) +void HbWsiniParser::parseModes(QMap &modes, const QString &wsIniFile) { HbWsiniParser parser(modes); #if defined(Q_WS_S60) + Q_UNUSED(wsIniFile); parser.parseFile("z:\\system\\data\\wsini.ini"); -#elif defined(Q_OS_WIN32) - parser.parseFile("c:/hb/data/wsini.ini"); -#endif +#else //!Q_WS_S60 + // For unit testing + if (!wsIniFile.isEmpty()) { + parser.parseFile(wsIniFile); + } else { +#if defined(Q_OS_WIN32) + // In windows try to parse file from the hard-coded location + parser.parseFile("c:/hb/data/wsini.ini"); +#endif //Q_OS_WIN32 + } +#endif //!Q_WS_S60 } HbWsiniParser::HbWsiniParser(QMap &modes) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbwsiniparser_p.h --- a/src/hbcore/utils/hbwsiniparser_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbwsiniparser_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ class HbWsiniParser { public: - static void parseModes(QMap &modes); + static void parseModes(QMap &modes, const QString &wsIniFile); private: HbWsiniParser(QMap &modes); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderabstractactions_p.cpp --- a/src/hbcore/utils/hbxmlloaderabstractactions_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderabstractactions_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -82,13 +82,6 @@ return RETURNVALUE; } -bool HbXmlLoaderAbstractActions::pushSpacerItem( const QString &name, const QString &widget ) -{ - Q_UNUSED(name); - Q_UNUSED(widget); - return RETURNVALUE; -} - bool HbXmlLoaderAbstractActions::pushConnect( const QString &srcName, const QString &signalName, @@ -180,57 +173,62 @@ return RETURNVALUE; } -bool HbXmlLoaderAbstractActions::createAnchorLayout( const QString &widget ) +bool HbXmlLoaderAbstractActions::createAnchorLayout( const QString &widget, bool modify ) { Q_UNUSED(widget); + Q_UNUSED(modify); return RETURNVALUE; } -bool HbXmlLoaderAbstractActions::addAnchorLayoutEdge( +bool HbXmlLoaderAbstractActions::addAnchorLayoutItem( const QString &src, + const QString &srcId, Hb::Edge srcEdge, const QString &dst, + const QString &dstId, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, - const QString &spacer ) + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ) { Q_UNUSED(src); + Q_UNUSED(srcId); Q_UNUSED(srcEdge); Q_UNUSED(dst); + Q_UNUSED(dstId); Q_UNUSED(dstEdge); - Q_UNUSED(spacing); - Q_UNUSED(spacer); + Q_UNUSED(minLength); + Q_UNUSED(prefLength); + Q_UNUSED(maxLength); + Q_UNUSED(policy); + Q_UNUSED(dir); + Q_UNUSED(anchorId); + return RETURNVALUE; +} + +bool HbXmlLoaderAbstractActions::setAnchorLayoutMapping( + const QString &item, + const QString &id, + bool remove) +{ + Q_UNUSED(item); + Q_UNUSED(id); + Q_UNUSED(remove); return RETURNVALUE; } -bool HbXmlLoaderAbstractActions::createMeshLayout( const QString &widget ) -{ - Q_UNUSED(widget); - return RETURNVALUE; -} - -bool HbXmlLoaderAbstractActions::addMeshLayoutEdge( - const QString &src, - Hb::Edge srcEdge, - const QString &dst, - Hb::Edge dstEdge, +bool HbXmlLoaderAbstractActions::createGridLayout( + const QString &widget, const HbXmlLengthValue &spacing, - const QString &spacer ) -{ - Q_UNUSED(src); - Q_UNUSED(srcEdge); - Q_UNUSED(dst); - Q_UNUSED(dstEdge); - Q_UNUSED(spacing); - Q_UNUSED(spacer); - return RETURNVALUE; -} - -bool HbXmlLoaderAbstractActions::createGridLayout( const QString &widget, const HbXmlLengthValue &spacing ) + bool modify ) { Q_UNUSED(widget); Q_UNUSED(spacing); + Q_UNUSED(modify); return RETURNVALUE; } @@ -309,11 +307,13 @@ bool HbXmlLoaderAbstractActions::createLinearLayout( const QString &widget, Qt::Orientation *orientation, - const HbXmlLengthValue &spacing ) + const HbXmlLengthValue &spacing, + bool modify ) { Q_UNUSED(widget); Q_UNUSED(orientation); Q_UNUSED(spacing); + Q_UNUSED(modify); return RETURNVALUE; } @@ -353,9 +353,10 @@ Q_UNUSED(bottom); return RETURNVALUE; } -bool HbXmlLoaderAbstractActions::createStackedLayout( const QString &widget ) +bool HbXmlLoaderAbstractActions::createStackedLayout( const QString &widget, bool modify ) { Q_UNUSED(widget); + Q_UNUSED(modify); return RETURNVALUE; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderabstractactions_p.h --- a/src/hbcore/utils/hbxmlloaderabstractactions_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderabstractactions_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,6 +31,7 @@ #include #include +#include #include #include @@ -67,7 +68,6 @@ const QString &name, const QString &role, const QString &plugin ); - virtual bool pushSpacerItem( const QString &name, const QString &widget ); virtual bool pushConnect( const QString &srcName, const QString &signalName, @@ -99,25 +99,26 @@ bool fixed); virtual bool setToolTip( const HbXmlVariable &tooltip ); - virtual bool createAnchorLayout( const QString &widget ); - virtual bool addAnchorLayoutEdge( + virtual bool createAnchorLayout( const QString &widget, bool modify ); + virtual bool addAnchorLayoutItem( const QString &src, + const QString &srcId, Hb::Edge srcEdge, const QString &dst, + const QString &dstId, Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ); + virtual bool setAnchorLayoutMapping( const QString &item, const QString &id, bool remove); + + virtual bool createGridLayout( + const QString &widget, const HbXmlLengthValue &spacing, - const QString &spacer = QString() ); - - virtual bool createMeshLayout( const QString &widget ); - virtual bool addMeshLayoutEdge( - const QString &src, - Hb::Edge srcEdge, - const QString &dst, - Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, - const QString &spacer = QString() ); - - virtual bool createGridLayout( const QString &widget, const HbXmlLengthValue &spacing ); + bool modify ); virtual bool addGridLayoutCell( const QString &src, int row, @@ -151,7 +152,8 @@ virtual bool createLinearLayout( const QString &widget, Qt::Orientation *orientation, - const HbXmlLengthValue &spacing ); + const HbXmlLengthValue &spacing, + bool modify ); virtual bool addLinearLayoutItem( const QString &itemname, int *index, @@ -168,7 +170,7 @@ const HbXmlLengthValue &right, const HbXmlLengthValue &bottom ); - virtual bool createStackedLayout( const QString &widget ); + virtual bool createStackedLayout( const QString &widget, bool modify ); virtual bool addStackedLayoutItem( const QString &itemname, int *index ); virtual bool createNullLayout( const QString &widget ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderabstractsyntax_p.cpp --- a/src/hbcore/utils/hbxmlloaderabstractsyntax_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderabstractsyntax_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -72,6 +72,7 @@ "textpaneheight", // ...Deprecated... ATTR_TEXTPANEHEIGHT "locid", // ATTR_LOCID + "action", // ATTR_ACTION "hbdocument", // TYPE_DOCUMENT "hbwidget", // TYPE_HBWIDGET @@ -104,20 +105,16 @@ "fontspec", // TYPE_FONTSPEC "anchor", // LAYOUT_ANCHOR - "mesh", // LAYOUT_MESH - "", // LAYOUT_MESH_TARGET - "", // LAYOUT_MESH_ALIEN + "mesh", // ...deprecated... LAYOUT_MESH "grid", // LAYOUT_GRID "linear", // LAYOUT_LINEAR "stacked", // LAYOUT_STACK "null", // LAYOUT_NULL + "", // LAYOUT_ALIEN "stringlist", // CONTAINER_STRINGLIST "null", // CONTAINER_NULL - "TRUE", // VALUE_BOOL_TRUE - "FALSE", // VALUE_BOOL_FALSE - "un", // UNIT_UNIT "px", // UNIT_PIXEL "mm", // UNIT_MILLIMETER @@ -130,19 +127,25 @@ "anchoritem", // AL_ANCHOR "src", // AL_SRC_NAME + "srcId", // AL_SRC_ID "srcEdge", // AL_SRC_EDGE "dst", // AL_DST_NAME + "dstId", // AL_DST_ID "dstEdge", // AL_DST_EDGE + "minLength", // AL_MIN_LENGTH + "prefLength", // AL_PREF_LENGTH + "maxLength", // AL_MAX_LENGTH + "sizepolicy", // AL_SIZEPOLICY + "direction", // AL_DIRECTION + "anchorId", // AL_ANCHOR_ID "spacing", // AL_SPACING "spacer", // AL_SPACER - "meshitem", // ML_MESHITEM - "src", // ML_SRC_NAME - "srcEdge", // ML_SRC_EDGE - "dst", // ML_DST_NAME - "dstEdge", // ML_DST_EDGE - "spacing", // ML_SPACING - "spacer", // ML_SPACER + "anchormapping", // AL_MAPPING + "item", // AL_MAPPING_ITEM + "id", // AL_MAPPING_ID + + "meshitem", // ...deprecated... ML_MESHITEM "griditem", // GL_GRIDCELL "itemname", // GL_ITEMNAME @@ -186,7 +189,7 @@ case HbXmlLengthValue::Unit: case HbXmlLengthValue::Millimeter: { - double f_value = (double)value.mValue; + double f_value = (double)value.mValue; //krazy:exclude=typedefs stream << f_value; break; } @@ -213,7 +216,7 @@ case HbXmlLengthValue::Unit: case HbXmlLengthValue::Millimeter: { - double f_value; + double f_value; //krazy:exclude=typedefs stream >> f_value; value.mValue = f_value; break; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderabstractsyntax_p.h --- a/src/hbcore/utils/hbxmlloaderabstractsyntax_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderabstractsyntax_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -61,7 +61,6 @@ ActionPushDocument, ActionPushObject, ActionPushWidget, - ActionPushSpacerItem, ActionPushConnect, ActionPushProperty, ActionPushRef, @@ -72,9 +71,8 @@ ActionSetSizeHint, ActionSetToolTip, ActionCreateAnchorLayout, - ActionAddAnchorLayoutEdge, - ActionCreateMeshLayout, - ActionAddMeshLayoutEdge, + ActionAddAnchorLayoutItem, + ActionSetAnchorLayoutMapping, ActionCreateGridLayout, ActionAddGridLayoutCell, ActionSetGridLayoutRowProperties, @@ -95,7 +93,7 @@ ElementType type; void *data; }; -}; +} class HbXmlLoaderAbstractActions; @@ -200,11 +198,14 @@ // Deprecated. ATTR_TEXTPANEHEIGHT, ATTR_LOCID, + ATTR_ACTION, TYPE_DOCUMENT, TYPE_HBWIDGET, TYPE_OBJECT, TYPE_WIDGET, + + // Deprecated. TYPE_SPACERITEM, TYPE_CONNECT, TYPE_LAYOUT, @@ -233,19 +234,15 @@ LAYOUT_ANCHOR, LAYOUT_MESH, - LAYOUT_MESH_TARGET, - LAYOUT_MESH_ALIEN, LAYOUT_GRID, LAYOUT_LINEAR, LAYOUT_STACK, LAYOUT_NULL, + LAYOUT_ALIEN, CONTAINER_STRINGLIST, CONTAINER_NULL, - VALUE_BOOL_TRUE, - VALUE_BOOL_FALSE, - UNIT_UNIT, UNIT_PIXEL, UNIT_MILLIMETER, @@ -258,19 +255,25 @@ AL_ANCHOR, AL_SRC_NAME, + AL_SRC_ID, AL_SRC_EDGE, AL_DST_NAME, + AL_DST_ID, AL_DST_EDGE, + AL_MIN_LENGTH, + AL_PREF_LENGTH, + AL_MAX_LENGTH, + AL_SIZEPOLICY, + AL_DIRECTION, + AL_ANCHOR_ID, AL_SPACING, AL_SPACER, + + AL_MAPPING, + AL_MAPPING_ITEM, + AL_MAPPING_ID, ML_MESHITEM, - ML_SRC_NAME, - ML_SRC_EDGE, - ML_DST_NAME, - ML_DST_EDGE, - ML_SPACING, - ML_SPACER, GL_GRIDCELL, GL_ITEMNAME, diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbaseactions_p.cpp --- a/src/hbcore/utils/hbxmlloaderbaseactions_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbaseactions_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -57,11 +57,11 @@ QList result; while (objects.size()) { ObjectMapItem item = objects.takeLast(); - if (item.first.data()) { - result.append(item.first.data()); + if (item.mObject.data()) { + result.append(item.mObject.data()); } } - + mTopObjectMap.clear(); return result; } @@ -70,9 +70,9 @@ { QGraphicsWidget *result = 0; - ObjectMap::iterator it = mObjectMap.find(name); - if (it != mObjectMap.end() && it.value().second == HbXml::WIDGET ) { - result = static_cast(it.value().first.data()); + ObjectMap::const_iterator it = mObjectMap.find(name); + if (it != mObjectMap.end() && it.value().mType == HbXml::WIDGET ) { + result = static_cast(it.value().mObject.data()); } return result; @@ -82,7 +82,7 @@ QObject* HbXmlLoaderBaseActions::findObject( const QString &name ) { if( mObjectMap.contains(name) ) { - return mObjectMap.value(name).first.data(); + return mObjectMap.value(name).mObject.data(); } return 0; } @@ -141,20 +141,22 @@ mStack.clear(); // Create mTopObjectMap - for (ObjectMap::const_iterator it = mObjectMap.constBegin(); - it != mObjectMap.constEnd(); - ++it ) { - QObject *object = it.value().first.data(); - - if (object && it.value().second == HbXml::WIDGET) { - QGraphicsWidget *asWidget = static_cast(object); - if (!asWidget->parentItem() && !asWidget->parent()) { + for (ObjectMap::iterator it = mObjectMap.begin(); + it != mObjectMap.end(); + ++it ) { + QObject *object = it.value().mObject.data(); + if ( it.value().mOwned ) { + if (object && it.value().mType == HbXml::WIDGET) { + QGraphicsWidget *asWidget = static_cast(object); + if (!asWidget->parentItem() && !asWidget->parent()) { + mTopObjectMap.insert(it.key(), it.value()); + } + } else if (object && !object->parent()) { mTopObjectMap.insert(it.key(), it.value()); + } else { + // not added - owned by another object. } - } else if (object && !object->parent()) { - mTopObjectMap.insert(it.key(), it.value()); - } else { - // not added - owned by another object. + it.value().mOwned = false; } } } @@ -173,39 +175,39 @@ const bool nameNotEmpty = name.size() != 0; bool doLookUp = true; ObjectMapItem current; - current.first = 0; - current.second = HbXml::OBJECT; + current.mObject = 0; + current.mType = HbXml::OBJECT; if (nameNotEmpty) { - ObjectMap::iterator it = mObjectMap.find(name); + ObjectMap::const_iterator it = mObjectMap.find(name); if (it != mObjectMap.end()) { current = it.value(); - if (!current.first) { + if (!current.mObject) { mObjectMap.remove(name); } // CHECK DISABLED FOR NOW. /* - if (current.first && !type.isEmpty()) { + if (current.mObject && !type.isEmpty()) { const QByteArray array = type.toUtf8(); - if (!current.first->inherits(array.data())) { + if (!current.mObject->inherits(array.data())) { HB_DOCUMENTLOADER_PRINT( QString( "Existing object requested with invalid type" ) ); // We have object already in mObjectMap, but it does not fulfill // all needs. So object look up has failed. doLookUp = false; - current.first = 0; + current.mObject = 0; } } */ } } - if (doLookUp && !current.first) { + if (doLookUp && !current.mObject) { QObject *obj = createObject(type, name, plugin); if (obj) { - current.first = obj; - current.second = qobject_cast(obj) ? HbXml::WIDGET : HbXml::OBJECT; + current.mObject = obj; + current.mType = qobject_cast(obj) ? HbXml::WIDGET : HbXml::OBJECT; } if (nameNotEmpty) { mObjectMap.insert(name, current); @@ -215,15 +217,6 @@ return current; } -QGraphicsLayoutItem *HbXmlLoaderBaseActions::findSpacerItemFromStackTop() const -{ - QGraphicsLayoutItem *current = 0; - if ( mStack.at(mStack.size()-1).type == HbXml::SPACERITEM ) { - current = static_cast(mStack.at(mStack.size()-1).data); - } - return current; -} - QObject *HbXmlLoaderBaseActions::findFromStack(bool *isWidgetElement) const { QObject *current = 0; @@ -266,32 +259,23 @@ bool HbXmlLoaderBaseActions::setObjectTree( QList roots ) { reset(); - - for( int i = 0; i < roots.size(); i++ ) { - QObject *obj = roots.at(i); - ObjectMapItem item; - item.first = obj; - item.second = qobject_cast(obj) ? HbXml::WIDGET : HbXml::OBJECT; - mTopObjectMap.insert( roots.at(i)->objectName(), item ); - } - addToObjectMap( roots ); - return true; } void HbXmlLoaderBaseActions::addToObjectMap( QList objects ) { - for( int i = 0; i < objects.size(); i++ ) { + for ( int i = 0; i < objects.size(); i++ ) { QObject *obj = objects.at(i); QGraphicsWidget *widget = qobject_cast(obj); ObjectMapItem item; - item.first = obj; - item.second = widget ? HbXml::WIDGET : HbXml::OBJECT; + item.mObject = obj; + item.mType = widget ? HbXml::WIDGET : HbXml::OBJECT; + item.mOwned = false; mObjectMap.insert( obj->objectName(), item ); - if( widget ) { + if ( widget ) { addToObjectMap( widget->childItems() ); } else { addToObjectMap( obj->children() ); @@ -301,12 +285,13 @@ void HbXmlLoaderBaseActions::addToObjectMap( QList objects ) { - for( int i = 0; i < objects.size(); i++ ) { - if( objects.at(i)->isWidget() ) { + for ( int i = 0; i < objects.size(); i++ ) { + if ( objects.at(i)->isWidget() ) { QGraphicsWidget *widget = static_cast( objects.at(i) ); ObjectMapItem item; - item.first = widget; - item.second = HbXml::WIDGET; + item.mObject = widget; + item.mType = HbXml::WIDGET; + item.mOwned = false; mObjectMap.insert( widget->objectName(), item ); addToObjectMap( widget->childItems() ); } @@ -348,7 +333,7 @@ return edge; } - +#ifndef HB_BIN_CSS bool HbXmlLoaderBaseActions::toPixels(const HbXmlLengthValue &lengthVal, qreal& result) const { bool retVal(true); @@ -373,5 +358,6 @@ } return retVal; } +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbaseactions_p.h --- a/src/hbcore/utils/hbxmlloaderbaseactions_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbaseactions_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,7 +54,14 @@ { public: - typedef QPair, HbXml::ElementType> ObjectMapItem; + struct ObjectMapItem + { + ObjectMapItem() : mObject(0), mType(HbXml::UNKNOWN), mOwned(true) {}; + + QPointer mObject; + HbXml::ElementType mType; + bool mOwned; + }; typedef QMap ObjectMap; public: @@ -82,7 +89,6 @@ ObjectMapItem lookUp(const QString& type, const QString &name, const QString &plugin = QString()); QObject *findFromStack(bool *isWidgetElement = 0) const; - QGraphicsLayoutItem *findSpacerItemFromStackTop() const; void addToObjectMap(QList objects); void addToObjectMap(QList objects); @@ -101,7 +107,9 @@ private: Q_DISABLE_COPY(HbXmlLoaderBaseActions) public: +#ifndef HB_BIN_CSS HbDeviceProfile mCurrentProfile; +#endif }; #endif // HBXMLLOADERBASEACTIONS_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbasesyntax_p.cpp --- a/src/hbcore/utils/hbxmlloaderbasesyntax_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbasesyntax_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,6 +25,7 @@ #include "hbxmlloaderbasesyntax_p.h" +#include #include /* @@ -40,6 +41,7 @@ HbXmlLoaderBaseSyntax::~HbXmlLoaderBaseSyntax() { + qDeleteAll(mCurrentContainer); } bool HbXmlLoaderBaseSyntax::load( QIODevice *device, const QString §ion ) @@ -309,8 +311,9 @@ { HB_DOCUMENTLOADER_PRINT( "TOP_STATE ERROR" ); result = false; - mTopState = TS_EXIT; + mActions->cleanUp(); mActions->deleteAll(); + exit = true; break; } case TS_EXIT: @@ -480,6 +483,127 @@ return false; } +bool HbXmlLoaderBaseSyntax::readAnchorLayoutStartItem(bool idBased) +{ + bool result = true; + + HbXmlLengthValue minVal, prefVal, maxVal; + QSizePolicy::Policy sizepolicyVal; + QSizePolicy::Policy *sizepolicyValP = 0; + HbAnchor::Direction directionVal; + HbAnchor::Direction *directionValP = 0; + QString anchorId; + + const QString src = attribute( AL_SRC_NAME ); + QString srcId = attribute( AL_SRC_ID ); + if ( src.isNull() && srcId.isNull() ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO SRC NOR SRCID SPECIFIED" ) ); + result = false; + } else if ( !src.isNull() && !srcId.isNull() ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: BOTH SRC AND SRCID SPECIFIED" ) ); + result = false; + } else if ( idBased && srcId.isNull() ) { + srcId = src; + } + + const QString dst = attribute( AL_DST_NAME ); + QString dstId = attribute( AL_DST_ID ); + if ( dst.isNull() && dstId.isNull() ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO DST NOR DSTID SPECIFIED" ) ); + result = false; + } else if ( !dst.isNull() && !dstId.isNull() ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: BOTH DST AND DSTID SPECIFIED" ) ); + result = false; + } else if ( idBased && dstId.isNull() ) { + dstId = dst; + } + + const QString srcEdgeStr = attribute( AL_SRC_EDGE ); + const QString dstEdgeStr = attribute( AL_DST_EDGE ); + + Hb::Edge srcEdge, dstEdge; + result &= toAnchorEdge( srcEdgeStr, srcEdge ); + result &= toAnchorEdge( dstEdgeStr, dstEdge ); + + // Check the convenience notation first. + QString spacing = attribute( AL_SPACING ); + if ( result && !spacing.isEmpty() ) { + directionVal = HbAnchor::Positive; + directionValP = &directionVal; + if (spacing.at(0) == '-') { + directionVal = HbAnchor::Negative; + spacing = spacing.mid(1); + } + sizepolicyVal = QSizePolicy::Fixed; + sizepolicyValP = &sizepolicyVal; + result = toLengthValue( spacing, prefVal ); + } + + const QString direction = attribute( AL_DIRECTION ); + if ( result && !direction.isNull() ) { + // intentionally overriding possible previously set value + directionValP = &directionVal; + result = toAnchorDir( direction, directionVal ); + } + + const QString spacer = attribute( AL_SPACER ); + if ( result && !spacer.isEmpty() ) { + // intentionally overriding possible previously set value + sizepolicyVal = QSizePolicy::Preferred; + sizepolicyValP = &sizepolicyVal; + anchorId = spacer; + if (prefVal.mType != HbXmlLengthValue::None) { + // previously set by "spacing" + minVal = prefVal; + } else { + prefVal.mType = HbXmlLengthValue::PlainNumber; + prefVal.mValue = 0; + } + if ( !directionValP ) { + // direction not yet set, use heuristics + bool srcIsLayout = src.isEmpty() && srcId.isEmpty(); + bool negativeEdge = srcEdge == Hb::LeftEdge || srcEdge == Hb::TopEdge; + directionVal = ( (!srcIsLayout && negativeEdge) || (srcIsLayout && !negativeEdge) ) + ? HbAnchor::Negative + : HbAnchor::Positive; + directionValP = &directionVal; + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: ANCHOR DIRECTION SET BY HEURISTICS" ) ); + } + } + + const QString minLength = attribute( AL_MIN_LENGTH ); + const QString prefLength = attribute( AL_PREF_LENGTH ); + const QString maxLength = attribute( AL_MAX_LENGTH ); + const QString sizepolicy = attribute( AL_SIZEPOLICY ); + + const QString anchorIdTemp = attribute( AL_ANCHOR_ID ); + if ( !anchorIdTemp.isNull() ) { + // intentionally overriding possible previously set value + anchorId = anchorIdTemp; + } + + if ( result && !minLength.isNull() ) { + // intentionally overriding possible previously set value + result = toLengthValue( minLength, minVal ); + } + if ( result && !prefLength.isNull() ) { + // intentionally overriding possible previously set value + result = toLengthValue( prefLength, prefVal ); + } + if ( result && !maxLength.isNull() ) { + result = toLengthValue( maxLength, maxVal ); + } + if ( result && !sizepolicy.isNull() ) { + // intentionally overriding possible previously set value + sizepolicyValP = &sizepolicyVal; + result = toSizePolicy( sizepolicy, sizepolicyVal ); + } + if ( result ) { + result = mActions->addAnchorLayoutItem( src, srcId, srcEdge, dst, dstId, dstEdge, minVal, prefVal, maxVal, sizepolicyValP, directionValP, anchorId ); + } + return result; +} + bool HbXmlLoaderBaseSyntax::readLayoutEndItem() { HB_DOCUMENTLOADER_PRINT( "GENERAL LAYOUT END ITEM" ); @@ -671,23 +795,72 @@ return mReader.attributes().value( lexemValue(lexem) ).toString(); } -bool HbXmlLoaderBaseSyntax::getAnchorEdge( const QString &edgeString, Hb::Edge &edge ) const +bool HbXmlLoaderBaseSyntax::toBool( const QString &boolString, bool &value ) const { bool retVal(true); - if( edgeString=="TOP" ) { + if (!boolString.compare("TRUE", Qt::CaseInsensitive)) { + value = true; + } else if (!boolString.compare("FALSE", Qt::CaseInsensitive)) { + value = false; + } else { + retVal = false; + } + return retVal; +} + +bool HbXmlLoaderBaseSyntax::toAnchorEdge( const QString &edgeString, Hb::Edge &edge ) const +{ + bool retVal(true); + if( !edgeString.compare("TOP", Qt::CaseInsensitive) ) { edge = Hb::TopEdge; - } else if( edgeString=="BOTTOM" ) { + } else if( !edgeString.compare("BOTTOM", Qt::CaseInsensitive) ) { edge = Hb::BottomEdge; - } else if( edgeString=="LEFT" ) { + } else if( !edgeString.compare("LEFT", Qt::CaseInsensitive) ) { edge = Hb::LeftEdge; - } else if( edgeString=="RIGHT" ) { + } else if( !edgeString.compare("RIGHT", Qt::CaseInsensitive) ) { edge = Hb::RightEdge; - } else if( edgeString=="CENTERH" ) { + } else if( !edgeString.compare("CENTERH", Qt::CaseInsensitive) ) { edge = Hb::CenterHEdge; - } else if( edgeString=="CENTERV" ) { + } else if( !edgeString.compare("CENTERV", Qt::CaseInsensitive) ) { edge = Hb::CenterVEdge; } else { retVal = false; } return retVal; } + +bool HbXmlLoaderBaseSyntax::toAnchorDir( const QString &dirString, HbAnchor::Direction &dir ) const +{ + bool retVal(true); + if( !dirString.compare("NEGATIVE", Qt::CaseInsensitive) ) { + dir = HbAnchor::Negative; + } else if( !dirString.compare("POSITIVE", Qt::CaseInsensitive) ) { + dir = HbAnchor::Positive; + } else { + retVal = false; + } + return retVal; +} + +bool HbXmlLoaderBaseSyntax::toSizePolicy( const QString& policyS, QSizePolicy::Policy &policy ) const +{ + if ( policyS.isEmpty() ) { + return false; + } + + const QMetaObject *meta = &QSizePolicy::staticMetaObject; + const int enumIndex = meta->indexOfEnumerator("Policy"); + Q_ASSERT( enumIndex != -1 ); + QMetaEnum metaEnum = meta->enumerator(enumIndex); + const QByteArray byteArray = policyS.toUtf8(); + const int policyI = metaEnum.keyToValue(byteArray.data()); + + if ( policyI == -1 ) { + return false; + } + + policy = (QSizePolicy::Policy)policyI; + + return true; +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbasesyntax_p.h --- a/src/hbcore/utils/hbxmlloaderbasesyntax_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbasesyntax_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -88,12 +88,16 @@ virtual bool readGeneralStartItem(); virtual bool readGeneralEndItem(); virtual bool readLayoutStartItem(); + virtual bool readAnchorLayoutStartItem(bool idBased); virtual bool readLayoutEndItem(); virtual bool readContainerStartItem(); virtual bool readContainerEndItem(); protected : - bool getAnchorEdge( const QString &edgeString, Hb::Edge &edge ) const; + bool toBool( const QString &boolString, bool &value ) const; + bool toAnchorEdge( const QString &edgeString, Hb::Edge &edge ) const; + bool toAnchorDir( const QString &dirString, HbAnchor::Direction &dir ) const; + bool toSizePolicy( const QString& policyS, QSizePolicy::Policy &policy ) const; bool loadDevice(QIODevice *device, const QString §ion); protected: diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbinaryactions_p.cpp --- a/src/hbcore/utils/hbxmlloaderbinaryactions_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbinaryactions_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -94,12 +94,6 @@ return true; } -bool HbXmlLoaderBinaryActions::pushSpacerItem( const QString &name, const QString &widget ) -{ - mOut << (quint8)HbXml::ActionPushSpacerItem << name << widget; - return true; -} - bool HbXmlLoaderBinaryActions::pushConnect( const QString &srcName, const QString &signalName, @@ -198,46 +192,61 @@ return true; } -bool HbXmlLoaderBinaryActions::createAnchorLayout( const QString &widget ) +bool HbXmlLoaderBinaryActions::createAnchorLayout( const QString &widget, bool modify ) { - mOut << (quint8)HbXml::ActionCreateAnchorLayout << widget; + mOut << (quint8)HbXml::ActionCreateAnchorLayout << widget << modify; return true; } -bool HbXmlLoaderBinaryActions::addAnchorLayoutEdge( +bool HbXmlLoaderBinaryActions::addAnchorLayoutItem( const QString &src, - Hb::Edge srcEdge, + const QString &srcId, + Hb::Edge srcEdge, const QString &dst, + const QString &dstId, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, - const QString &spacer ) + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ) { - mOut << (quint8)HbXml::ActionAddAnchorLayoutEdge << src << (quint8)srcEdge << dst << (quint8)dstEdge << spacing << spacer; + mOut << (quint8)HbXml::ActionAddAnchorLayoutItem; + mOut << src << srcId << (quint8)srcEdge; + mOut << dst << dstId << (quint8)dstEdge; + mOut << minLength << prefLength << maxLength; + if (policy) { + mOut << true << (quint8)*policy; + } else { + mOut << false; + } + if (dir) { + mOut << true << (quint8)*dir; + } else { + mOut << false; + } + mOut << anchorId; + return true; +} + +bool HbXmlLoaderBinaryActions::setAnchorLayoutMapping( + const QString &item, + const QString &id, + bool remove) +{ + mOut << (quint8)HbXml::ActionSetAnchorLayoutMapping; + mOut << item << id << remove; return true; } -bool HbXmlLoaderBinaryActions::createMeshLayout( const QString &widget ) +bool HbXmlLoaderBinaryActions::createGridLayout( + const QString &widget, + const HbXmlLengthValue &spacing, + bool modify ) { - mOut << (quint8)HbXml::ActionCreateMeshLayout << widget; - return true; -} - -bool HbXmlLoaderBinaryActions::addMeshLayoutEdge( - const QString &src, - Hb::Edge srcEdge, - const QString &dst, - Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, - const QString &spacer ) -{ - mOut << (quint8)HbXml::ActionAddMeshLayoutEdge << src << (quint8)srcEdge << dst << (quint8)dstEdge << spacing << spacer; - return true; -} - -bool HbXmlLoaderBinaryActions::createGridLayout( const QString &widget, const HbXmlLengthValue &spacing ) -{ - mOut << (quint8)HbXml::ActionCreateGridLayout << widget << spacing; + mOut << (quint8)HbXml::ActionCreateGridLayout << widget << spacing << modify; return true; } @@ -332,7 +341,8 @@ bool HbXmlLoaderBinaryActions::createLinearLayout( const QString &widget, Qt::Orientation *orientation, - const HbXmlLengthValue &spacing ) + const HbXmlLengthValue &spacing, + bool modify ) { mOut << (quint8)HbXml::ActionCreateLinearLayout << widget; if ( orientation ) { @@ -340,7 +350,7 @@ } else { mOut << false; } - mOut << spacing; + mOut << spacing << modify; return true; } @@ -398,9 +408,9 @@ mOut << (quint8)HbXml::ActionSetLayoutContentsMargins << left << top << right << bottom; return true; } -bool HbXmlLoaderBinaryActions::createStackedLayout( const QString &widget ) +bool HbXmlLoaderBinaryActions::createStackedLayout( const QString &widget, bool modify ) { - mOut << (quint8)HbXml::ActionCreateStackedLayout << widget; + mOut << (quint8)HbXml::ActionCreateStackedLayout << widget << modify; return true; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbinaryactions_p.h --- a/src/hbcore/utils/hbxmlloaderbinaryactions_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbinaryactions_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -63,7 +63,6 @@ const QString &name, const QString &role, const QString &plugin ); - bool pushSpacerItem( const QString &name, const QString &widget ); bool pushConnect( const QString &srcName, const QString &signalName, @@ -95,25 +94,29 @@ bool fixed); bool setToolTip( const HbXmlVariable &tooltip ); - bool createAnchorLayout( const QString &widget ); - bool addAnchorLayoutEdge( + bool createAnchorLayout( const QString &widget, bool modify ); + bool addAnchorLayoutItem( const QString &src, + const QString &srcId, Hb::Edge srcEdge, const QString &dst, + const QString &dstId, Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, + HbAnchor::Direction *dir, + const QString &anchorId ); + bool setAnchorLayoutMapping( + const QString &item, + const QString &id, + bool remove); + + bool createGridLayout( + const QString &widget, const HbXmlLengthValue &spacing, - const QString &spacer = QString() ); - - bool createMeshLayout( const QString &widget ); - bool addMeshLayoutEdge( - const QString &src, - Hb::Edge srcEdge, - const QString &dst, - Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, - const QString &spacer = QString() ); - - bool createGridLayout( const QString &widget, const HbXmlLengthValue &spacing ); + bool modify ); bool addGridLayoutCell( const QString &src, int row, @@ -147,7 +150,8 @@ bool createLinearLayout( const QString &widget, Qt::Orientation *orientation, - const HbXmlLengthValue &spacing ); + const HbXmlLengthValue &spacing, + bool modify ); bool addLinearLayoutItem( const QString &itemname, int *index, @@ -164,7 +168,7 @@ const HbXmlLengthValue &right, const HbXmlLengthValue &bottom ); - bool createStackedLayout( const QString &widget ); + bool createStackedLayout( const QString &widget, bool modify ); bool addStackedLayoutItem( const QString &itemname, int *index ); bool createNullLayout( const QString &widget ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbinarysyntax_p.cpp --- a/src/hbcore/utils/hbxmlloaderbinarysyntax_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbinarysyntax_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -143,7 +143,6 @@ case HbXml::ActionPushDocument: result = parsePushDocument(); break; case HbXml::ActionPushObject: result = parsePushObject(); break; case HbXml::ActionPushWidget: result = parsePushWidget(); break; - case HbXml::ActionPushSpacerItem: result = parsePushSpacerItem(); break; case HbXml::ActionPushConnect: result = parsePushConnect(); break; case HbXml::ActionPushProperty: result = parsePushProperty(); break; case HbXml::ActionPushRef: result = parsePushRef(); break; @@ -154,9 +153,8 @@ case HbXml::ActionSetSizeHint: result = parseSetSizeHint(); break; case HbXml::ActionSetToolTip: result = parseSetToolTip(); break; case HbXml::ActionCreateAnchorLayout: result = parseCreateAnchorLayout(); break; - case HbXml::ActionAddAnchorLayoutEdge: result = parseAddAnchorLayoutEdge(); break; - case HbXml::ActionCreateMeshLayout: result = parseCreateMeshLayout(); break; - case HbXml::ActionAddMeshLayoutEdge: result = parseAddMeshLayoutEdge(); break; + case HbXml::ActionAddAnchorLayoutItem: result = parseAddAnchorLayoutItem(); break; + case HbXml::ActionSetAnchorLayoutMapping: result = parseSetAnchorLayoutMapping(); break; case HbXml::ActionCreateGridLayout: result = parseCreateGridLayout(); break; case HbXml::ActionAddGridLayoutCell: result = parseAddGridLayoutCell(); break; case HbXml::ActionSetGridLayoutRowProperties: result = parseSetGridLayoutRowProperties(); break; @@ -267,13 +265,6 @@ return mActions->pushWidget(type, name, role, plugin); } -bool HbXmlLoaderBinarySyntax::parsePushSpacerItem() -{ - QString name, widget; - mIn >> name >> widget; - return mActions->pushSpacerItem(name, widget); -} - bool HbXmlLoaderBinarySyntax::parsePushConnect() { QString srcName, signalName, dstName, slotName; @@ -287,7 +278,10 @@ HbXmlVariable buffer; mIn >> propertyName >> buffer; bool res = mActions->pushProperty(propertyName, buffer); - delete propertyName; + if ( !res ) { + qDebug() << "HbXmlLoaderBinarySyntax, failed at pushProperty " << propertyName; + } + delete[] propertyName; return res; } @@ -310,10 +304,10 @@ container.append(variable); } - bool res = mActions->pushContainer(propertyName, (HbXmlLoaderAbstractSyntax::DocumentLexems)type, container); - delete propertyName; + delete[] propertyName; + qDeleteAll(container); return res; } @@ -388,41 +382,65 @@ bool HbXmlLoaderBinarySyntax::parseCreateAnchorLayout() { QString widget; - mIn >> widget; - return mActions->createAnchorLayout(widget); -} - -bool HbXmlLoaderBinarySyntax::parseAddAnchorLayoutEdge() -{ - QString src, dst, spacer; - quint8 srcEdge, dstEdge; - HbXmlLengthValue spacing; - mIn >> src >> srcEdge >> dst >> dstEdge >> spacing >> spacer; - return mActions->addAnchorLayoutEdge(src, (Hb::Edge)srcEdge, dst, (Hb::Edge)dstEdge, spacing, spacer); + bool modify; + mIn >> widget >> modify; + return mActions->createAnchorLayout(widget, modify); } -bool HbXmlLoaderBinarySyntax::parseCreateMeshLayout() +bool HbXmlLoaderBinarySyntax::parseAddAnchorLayoutItem() { - QString widget; - mIn >> widget; - return mActions->createMeshLayout(widget); + QString src, srcId, dst, dstId, anchorId; + Hb::Edge srcEdge, dstEdge; + HbXmlLengthValue minLength, prefLength, maxLength; + QSizePolicy::Policy policy; + QSizePolicy::Policy *policy_p = 0; + HbAnchor::Direction dir; + HbAnchor::Direction *dir_p = 0; + + bool temp; + quint8 tempEnum; + + mIn >> src >> srcId >> tempEnum; + srcEdge = (Hb::Edge)tempEnum; + + mIn >> dst >> dstId >> tempEnum; + dstEdge = (Hb::Edge)tempEnum; + + mIn >> minLength >> prefLength >> maxLength; + + // Optional parameters + mIn >> temp; + if ( temp ) { + mIn >> tempEnum; + policy = (QSizePolicy::Policy)tempEnum; + policy_p = &policy; + } + mIn >> temp; + if ( temp ) { + mIn >> tempEnum; + dir = (HbAnchor::Direction)tempEnum; + dir_p = &dir; + } + mIn >> anchorId; + + return mActions->addAnchorLayoutItem( src, srcId, srcEdge, dst, dstId, dstEdge, minLength, prefLength, maxLength, policy_p, dir_p, anchorId ); } -bool HbXmlLoaderBinarySyntax::parseAddMeshLayoutEdge() +bool HbXmlLoaderBinarySyntax::parseSetAnchorLayoutMapping() { - QString src, dst, spacer; - quint8 srcEdge, dstEdge; - HbXmlLengthValue spacing; - mIn >> src >> srcEdge >> dst >> dstEdge >> spacing >> spacer; - return mActions->addMeshLayoutEdge(src, (Hb::Edge)srcEdge, dst, (Hb::Edge)dstEdge, spacing, spacer); + QString item, id; + bool remove; + mIn >> item >> id >> remove; + return mActions->setAnchorLayoutMapping(item, id, remove); } bool HbXmlLoaderBinarySyntax::parseCreateGridLayout() { QString widget; HbXmlLengthValue spacing; - mIn >> widget >> spacing; - return mActions->createGridLayout(widget, spacing); + bool modify; + mIn >> widget >> spacing >> modify; + return mActions->createGridLayout(widget, spacing, modify); } bool HbXmlLoaderBinarySyntax::parseAddGridLayoutCell() @@ -553,6 +571,7 @@ Qt::Orientation orientation; Qt::Orientation *orientation_p = 0; HbXmlLengthValue spacing; + bool modify; mIn >> widget; // Optional parameter @@ -564,9 +583,9 @@ orientation = (Qt::Orientation)tempEnum; orientation_p = &orientation; } - mIn >> spacing; + mIn >> spacing >> modify; - return mActions->createLinearLayout(widget, orientation_p, spacing); + return mActions->createLinearLayout(widget, orientation_p, spacing, modify); } bool HbXmlLoaderBinarySyntax::parseAddLinearLayoutItem() @@ -640,8 +659,9 @@ bool HbXmlLoaderBinarySyntax::parseCreateStackedLayout() { QString widget; - mIn >> widget; - return mActions->createStackedLayout(widget); + bool modify; + mIn >> widget >> modify; + return mActions->createStackedLayout(widget, modify); } bool HbXmlLoaderBinarySyntax::parseAddStackedLayoutItem() diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/hbxmlloaderbinarysyntax_p.h --- a/src/hbcore/utils/hbxmlloaderbinarysyntax_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/hbxmlloaderbinarysyntax_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -54,7 +54,6 @@ bool parsePushDocument(); bool parsePushObject(); bool parsePushWidget(); - bool parsePushSpacerItem(); bool parsePushConnect(); bool parsePushProperty(); bool parsePushRef(); @@ -65,9 +64,8 @@ bool parseSetSizeHint(); bool parseSetToolTip(); bool parseCreateAnchorLayout(); - bool parseAddAnchorLayoutEdge(); - bool parseCreateMeshLayout(); - bool parseAddMeshLayoutEdge(); + bool parseAddAnchorLayoutItem(); + bool parseSetAnchorLayoutMapping(); bool parseCreateGridLayout(); bool parseAddGridLayoutCell(); bool parseSetGridLayoutRowProperties(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/utils/utils.pri --- a/src/hbcore/utils/utils.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/utils/utils.pri Thu Jul 22 16:36:53 2010 +0100 @@ -31,13 +31,14 @@ PUBLIC_HEADERS += $$PWD/hbdeviceprofile.h PUBLIC_HEADERS += $$PWD/hbsmileytheme.h +RESTRICTED_HEADERS += $$PWD/hbfeaturemanager_r.h + PRIVATE_HEADERS += $$PWD/hbdeviceprofile_p.h PRIVATE_HEADERS += $$PWD/hbtypefaceinfo_p.h PRIVATE_HEADERS += $$PWD/hbtypefaceinfodatabase_p.h PRIVATE_HEADERS += $$PWD/hbdeviceprofiledatabase_p.h PRIVATE_HEADERS += $$PWD/hbdeviceprofilemanager_p.h PRIVATE_HEADERS += $$PWD/hbdeviceprofilereader_p.h -PRIVATE_HEADERS += $$PWD/hbextendeddeviceprofile_p.h PRIVATE_HEADERS += $$PWD/hbiniparser_p.h PRIVATE_HEADERS += $$PWD/hbtextmeasurementutility_p.h PRIVATE_HEADERS += $$PWD/hbthetestwidget_p.h @@ -50,11 +51,9 @@ PRIVATE_HEADERS += $$PWD/hbwidgetloader_p.h PRIVATE_HEADERS += $$PWD/hbforegroundwatcher_p.h PRIVATE_HEADERS += $$PWD/hboogmwatcher_p.h -PRIVATE_HEADERS += $$PWD/hbfeaturemanager_p.h PRIVATE_HEADERS += $$PWD/hbsleepmodelistener_p.h PRIVATE_HEADERS += $$PWD/hbsleepmodelistener_p_p.h - symbian { PRIVATE_HEADERS += $$PWD/hboogmwatcher_sym_p.h } else { @@ -77,7 +76,6 @@ SOURCES += $$PWD/hbdeviceprofiledatabase_p.cpp SOURCES += $$PWD/hbdeviceprofilemanager_p.cpp SOURCES += $$PWD/hbdeviceprofilereader_p.cpp -SOURCES += $$PWD/hbextendeddeviceprofile_p.cpp SOURCES += $$PWD/hbfontspec.cpp SOURCES += $$PWD/hbiniparser.cpp SOURCES += $$PWD/hbtextmeasurementutility_p.cpp @@ -108,6 +106,6 @@ SOURCES += $$PWD/hbtimer.cpp SOURCES += $$PWD/hbsmileytheme.cpp SOURCES += $$PWD/hbsmileythemeparser_p.cpp -SOURCES += $$PWD/hbfeaturemanager_p.cpp +SOURCES += $$PWD/hbfeaturemanager.cpp SOURCES += $$PWD/hbsleepmodelistener_p.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/vkbhosts/hbabstractvkbhost.cpp --- a/src/hbcore/vkbhosts/hbabstractvkbhost.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/vkbhosts/hbabstractvkbhost.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,6 +32,8 @@ #include "hbmainwindow.h" #include "hbpopup.h" #include "hbview.h" +#include "hbwidgetfeedback.h" +#include "hbinstance.h" #include @@ -41,6 +43,120 @@ const qreal HbContainerBorderMargin = 20.0; const qreal HbHeightVerticalFactor = 0.5; const qreal HbHeightHorizFactor = 0.7; +const QString KHandWritingName("Handwriting"); +// see hbpopup.cpp for this +extern const char* KPositionManagedByVKB; + +/// @cond + +HbVkbHostContainerWidget::HbVkbHostContainerWidget(QObject *containterWidget) + : mContainerWidget(containterWidget) +{ +} + +// sets container widgets position to new position. +void HbVkbHostContainerWidget::setPos(QPointF newPosition) +{ + if (mContainerWidget) { + QGraphicsObject *graphicsObject = qobject_cast(mContainerWidget); + if (graphicsObject) { + graphicsObject->setPos(newPosition); + return; + } + + QWidget *qWidget = qobject_cast(mContainerWidget); + if (qWidget) { +#ifdef Q_WS_WIN + QPoint finalPosition = newPosition.toPoint(); + finalPosition -= qWidget->geometry().topLeft() - qWidget->frameGeometry().topLeft(); + qWidget->move(finalPosition); +#else + qWidget->move(newPosition.toPoint()); +#endif + return; + } + } +} + +// returns the global position, if container widget is a QGraphicsObject, it returns +// scene position. In case the widget is QWidget it returns global co-ordinates +QPointF HbVkbHostContainerWidget::pos() +{ + if (mContainerWidget) { + QGraphicsObject *graphicsObject = qobject_cast(mContainerWidget); + if (graphicsObject) { + return graphicsObject->pos();; + } + + QWidget *qWidget = qobject_cast(mContainerWidget); + if (qWidget) { + return qWidget->mapToGlobal(QPoint(0, 0)); + } + } + + return QPointF(0, 0); +} + +// returns the bounding rect in global co-ordinate, if container widget is a QGraphicsObject +// it returns in scene co-ordinate, incase widget is QWidget it returns in global co-ordinate +QRectF HbVkbHostContainerWidget::sceneBoundingRect() +{ + if (mContainerWidget) { + QGraphicsObject *graphicsObject = qobject_cast(mContainerWidget); + if (graphicsObject) { + return graphicsObject->sceneBoundingRect();; + } + + QWidget *qWidget = qobject_cast(mContainerWidget); + if (qWidget) { + return QRectF(qWidget->mapToGlobal(QPoint(0, 0)), qWidget->size()); + } + } + + return QRectF(0, 0, 0, 0); +} + +// connect container specific signals here. +void HbVkbHostContainerWidget::connectSignals(QObject *receiver) +{ + if (qobject_cast (mContainerWidget)) { + QObject::connect(mContainerWidget, SIGNAL(yChanged()), + receiver, SLOT(ensureCursorVisibility())); + } + + HbPopup *popup = qobject_cast(mContainerWidget); + if (popup) { + QObject::connect(popup, SIGNAL(aboutToHide()), receiver, SLOT(containerAboutToClose())); + } + + HbView *view = qobject_cast(mContainerWidget); + if (view) { + QObject::connect(view->mainWindow(), SIGNAL(currentViewChanged(HbView *)), + receiver, SLOT(currentViewChanged(HbView *))); + } +} + +// disconnect container specific signals here. +void HbVkbHostContainerWidget::disconnectSignals(QObject *receiver) +{ + if (qobject_cast (mContainerWidget)) { + QObject::disconnect(mContainerWidget, SIGNAL(yChanged()), + receiver, SLOT(ensureCursorVisibility())); + } + + HbPopup *popup = qobject_cast(mContainerWidget); + if (popup) { + QObject::disconnect(popup, SIGNAL(aboutToHide()), receiver, SLOT(containerAboutToClose())); + } + + HbPopup *view = qobject_cast(mContainerWidget); + if (view) { + QObject::disconnect(view->mainWindow(), SIGNAL(currentViewChanged(HbView *)), + receiver, SLOT(currentViewChanged(HbView *))); + } +} + +/// @endcond /*! \proto @@ -52,28 +168,33 @@ /// @cond -HbAbstractVkbHostPrivate::HbAbstractVkbHostPrivate(HbAbstractVkbHost *myHost, QGraphicsWidget *containerWidget) -: q_ptr(myHost), -mCallback(0), -mKeypad(0), -mContainerWidget(containerWidget), -mTimeLine(HbAnimationTime), -mKeypadStatus(HbVkbHost::HbVkbStatusClosed), -mKeypadOperationOngoing(false), -mOriginalContainerPosition(QPointF(0,0)), -mContainerMovementStartingPoint(QPointF(0, 0)), -mContainerMovementVector(QPointF(0, 0)), -mKeypadMovementStartingPoint(QPointF(0, 0)), -mKeypadMovementVector(QPointF(0, 0)), -mInputMethod(0), -mKeypadStatusBeforeOrientationChange(HbVkbHost::HbVkbStatusClosed) +HbAbstractVkbHostPrivate::HbAbstractVkbHostPrivate(HbAbstractVkbHost *myHost, QObject *containerWidget) + : q_ptr(myHost), + mCallback(0), + mKeypad(0), + mContainerWidget(new HbVkbHostContainerWidget(containerWidget)), + mTimeLine(HbAnimationTime), + mKeypadStatus(HbVkbHost::HbVkbStatusClosed), + mKeypadOperationOngoing(false), + mOriginalContainerPosition(QPointF(0, 0)), + mContainerMovementStartingPoint(QPointF(0, 0)), + mContainerMovementVector(QPointF(0, 0)), + mKeypadMovementStartingPoint(QPointF(0, 0)), + mKeypadMovementVector(QPointF(0, 0)), + mInputMethod(0), + mKeypadStatusBeforeOrientationChange(HbVkbHost::HbVkbStatusClosed) { mTimeLine.setUpdateInterval(16); } +HbAbstractVkbHostPrivate::~HbAbstractVkbHostPrivate() +{ + delete mContainerWidget; +} + void HbAbstractVkbHostPrivate::prepareAnimationsCommon() { - if (mContainerWidget && mKeypad) { + if (mContainerWidget->widgetObject() && mKeypad) { // If the keyboard is not already open, remember the original position. // That is where the container will eventually be returned to. if (mKeypadStatus == HbVkbHost::HbVkbStatusClosed) { @@ -93,7 +214,7 @@ bool HbAbstractVkbHostPrivate::prepareContainerAnimation(HbVkbHost::HbVkbStatus status) { - if (!mKeypad || !mContainerWidget || !mInputMethod || !mInputMethod->focusObject()) { + if (!mKeypad || !mContainerWidget->widgetObject() || !mInputMethod || !mInputMethod->focusObject()) { return false; } @@ -190,20 +311,21 @@ { if (status == HbVkbHost::HbVkbStatusOpened) { if (mKeypadStatus == HbVkbHost::HbVkbStatusClosed) { - // Set up keyboard open animation. - mKeypadMovementStartingPoint.setY(mScreenSize.height()); - mKeypadMovementVector.setY(-mKeypad->size().height()); - if (!disableCursorShift()) { - // Initialize keypad position - mKeypad->setPos(mKeypadMovementStartingPoint); - } - return true; - } else if (mKeypadStatus == HbVkbHost::HbVkbStatusMinimized && mCallback) { - mKeypadMovementVector.setY(-(mKeypad->size().height() - mCallback->minimizedKeyboardSize().height())); - return true; - } + // Set up keyboard open animation. + mKeypadMovementStartingPoint.setY(mScreenSize.height()); + mKeypadMovementVector.setY(-mKeypad->size().height()); + if (!disableCursorShift()) { + // Initialize keypad position + mKeypad->setPos(mKeypadMovementStartingPoint); + } + return true; + } else if (mKeypadStatus == HbVkbHost::HbVkbStatusMinimized && mCallback) { + mKeypadMovementVector.setY(-(mKeypad->size().height() - mCallback->minimizedKeyboardSize().height())); + return true; + } } else if (status == HbVkbHost::HbVkbStatusMinimized && mCallback) { mKeypadMovementVector = QPointF(0, mKeypad->size().height() - mCallback->minimizedKeyboardSize().height()); + return true; } else { // It is going to be closed. mKeypadMovementVector = QPointF(0, mKeypad->size().height()); @@ -233,50 +355,34 @@ void HbAbstractVkbHostPrivate::connectSignals() { - if (mContainerWidget) { - q_ptr->connect(mContainerWidget, SIGNAL(yChanged()), q_ptr, SLOT(ensureCursorVisibility())); - } + mContainerWidget->connectSignals(q_ptr); - HbWidget *hbWidget = qobject_cast(mContainerWidget); - if (hbWidget) { - HbMainWindow* mainWindow = hbWidget->mainWindow(); - if (mainWindow) { - q_ptr->connect(mainWindow, SIGNAL(aboutToChangeOrientation()), q_ptr, SLOT(orientationAboutToChange())); - q_ptr->connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation))); - } - } - - HbPopup *popup = qobject_cast(mContainerWidget); - if (popup) { - q_ptr->connect(popup, SIGNAL(aboutToHide()), q_ptr, SLOT(containerAboutToClose())); + // global signal not specific to any containter widget, can be connected now. + HbMainWindow *mainWindow = this->mainWindow(); + if (mainWindow) { + q_ptr->connect(mainWindow, SIGNAL(aboutToChangeOrientation()), q_ptr, SLOT(orientationAboutToChange())); + q_ptr->connect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation))); + q_ptr->connect(mainWindow, SIGNAL(currentViewChanged(HbView *)), q_ptr, SLOT(currentViewChanged(HbView *))); } } void HbAbstractVkbHostPrivate::disconnectSignals() { - if (mContainerWidget) { - q_ptr->disconnect(mContainerWidget, SIGNAL(yChanged()), q_ptr, SLOT(ensureCursorVisibility())); - } + mContainerWidget->disconnectSignals(q_ptr); - HbWidget *hbWidget = qobject_cast(mContainerWidget); - if (hbWidget) { - HbMainWindow* mainWindow = hbWidget->mainWindow(); - if (mainWindow) { - q_ptr->disconnect(mainWindow, SIGNAL(aboutToChangeOrientation()), q_ptr, SLOT(orientationAboutToChange())); - q_ptr->disconnect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation))); - } - } - - HbPopup *popup = qobject_cast(mContainerWidget); - if (popup) { - q_ptr->disconnect(popup, SIGNAL(aboutToHide()), q_ptr, SLOT(containerAboutToClose())); + // global signal not specific to any containter widget, can be connected now. + HbMainWindow *mainWindow = this->mainWindow(); + if (mainWindow) { + q_ptr->disconnect(mainWindow, SIGNAL(aboutToChangeOrientation()), q_ptr, SLOT(orientationAboutToChange())); + q_ptr->disconnect(mainWindow, SIGNAL(orientationChanged(Qt::Orientation)), q_ptr, SLOT(orientationChanged(Qt::Orientation))); + q_ptr->disconnect(mainWindow, SIGNAL(currentViewChanged(HbView *)), q_ptr, SLOT(currentViewChanged(HbView *))); } } void HbAbstractVkbHostPrivate::openKeypad() -{ - if (mContainerWidget) { - HbMainWindow* mainWin = mainWindow(); +{ + if (mContainerWidget->widgetObject()) { + HbMainWindow *mainWin = mainWindow(); if (mainWin && mKeypad) { if (mKeypad->scene() != mainWin->scene()) { // Add keypad to scene if it is not already in there. @@ -318,7 +424,7 @@ { if (mCallback && mKeypadStatus != HbVkbHost::HbVkbStatusMinimized) { mCallback->aboutToClose(q_ptr); - if (mContainerWidget) { + if (mContainerWidget->widgetObject()) { if (prepareAnimations(HbVkbHost::HbVkbStatusMinimized)) { mKeypadStatus = HbVkbHost::HbVkbStatusMinimized; mTimeLine.start(); @@ -330,7 +436,7 @@ void HbAbstractVkbHostPrivate::openKeypadWithoutAnimation() { HbMainWindow *mainWin = mainWindow(); - if (mKeypadStatus!= HbVkbHost::HbVkbStatusOpened && mKeypad && mContainerWidget && mainWin) { + if (mKeypadStatus != HbVkbHost::HbVkbStatusOpened && mKeypad && mContainerWidget->widgetObject() && mainWin) { if (mKeypad->scene() != mainWin->scene()) { // Add item to scene if it is not already in there. mainWin->scene()->addItem(mKeypad); @@ -344,7 +450,7 @@ if (!disableCursorShift()) { // Move the container widget to keep the focused line visible. mContainerWidget->setPos(mContainerWidget->pos() + mContainerMovementVector); - + // Move the keypad mKeypad->setPos(mKeypadMovementStartingPoint + mKeypadMovementVector); } @@ -360,18 +466,18 @@ // No need of any animation as this minimized keypad is very small to be a candidate for an // animation. HbMainWindow *mainWin = mainWindow(); - if (mainWin && mKeypad && mContainerWidget) { + if (mainWin && mKeypad && mContainerWidget->widgetObject()) { if (mKeypad->scene() != mainWin->scene()) { // Add item to scene if it is not already in there. mainWin->scene()->addItem(mKeypad); } if (mKeypadStatus != HbVkbHost::HbVkbStatusMinimized) { - mCallback->aboutToOpen(q_ptr); + mCallback->aboutToOpen(q_ptr); q_ptr->resizeKeyboard(); // Make sure that the keyboard doesn't exceed given boundaries. } - if (prepareAnimations(HbVkbHost::HbVkbStatusMinimized)) { + if (prepareAnimations(HbVkbHost::HbVkbStatusMinimized)) { if (!disableCursorShift()) { mKeypad->setPos(0.0, mScreenSize.height() - mCallback->minimizedKeyboardSize().height()); } @@ -391,6 +497,7 @@ if (!disableCursorShift()) { // Return the container widget to original position. mContainerWidget->setPos(mOriginalContainerPosition); + mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, false ); } // Hide the keypad @@ -404,7 +511,7 @@ { HbMainWindow *mainWin = mainWindow(); if (mKeypadStatus != HbVkbHost::HbVkbStatusMinimized && mKeypad && mainWin) { - mCallback->aboutToClose(q_ptr); + mCallback->aboutToClose(q_ptr); if (mKeypad->scene() != mainWin->scene()) { // Add item to scene if it is not already in there. mainWin->scene()->addItem(mKeypad); @@ -428,6 +535,7 @@ if (!disableCursorShift()) { mContainerWidget->setPos(mOriginalContainerPosition); + mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, false ); } if (mKeypad) { @@ -445,12 +553,19 @@ HbMainWindow *HbAbstractVkbHostPrivate::mainWindow() const { - HbWidget *hbWidget = qobject_cast(mContainerWidget); + HbWidget *hbWidget = qobject_cast(mContainerWidget->widgetObject()); if (hbWidget) { return hbWidget->mainWindow(); } - return qobject_cast(qApp->activeWindow()); + // below is the case when we have a pure vanilla application. + // there should be one hbmainwindow to show all the widgets. + if (hbInstance->allMainWindows().size()) { + return hbInstance->allMainWindows().at(0); + } + + // no mainwindow. + return 0; } QSizeF HbAbstractVkbHostPrivate::screenSize() const @@ -459,7 +574,7 @@ QSizeF result = static_cast(HbDeviceProfile::profile(mainWin).logicalSize()); // do some sanity checking for the size got from device profile - if( result.isNull() || result.width() < 200 || result.height() < 200 ) { + if (result.isNull() || result.width() < 200 || result.height() < 200) { qWarning("VkbHost error: size from device profile is faulty, using fallback!"); if (mainWin) { if (mainWin->orientation() == Qt::Horizontal) { @@ -475,16 +590,18 @@ return result; } -bool HbAbstractVkbHostPrivate::disableCursorShift() { +bool HbAbstractVkbHostPrivate::disableCursorShift() +{ if (!mInputMethod || mainWindow()) { return false; } - if ( (mainWindow()->orientation() == Qt::Horizontal) - && (mInputMethod->inputState().inputMode() == HbInputModeHwrChinese - || mInputMethod->inputState().inputMode() == HbInputModeHwrChineseFull) ) { + QByteArray baModes = HbInputSettingProxy::instance()->preferredInputMethodCustomData(Qt::Horizontal); + QString imName(baModes); + + if (mainWindow() && mainWindow()->orientation() == Qt::Horizontal && imName == KHandWritingName) { return true; } return false; @@ -505,6 +622,17 @@ connect(&d->mTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animValueChanged(qreal))); } +HbAbstractVkbHost::HbAbstractVkbHost(QWidget *containerWidget) : d_ptr(new HbAbstractVkbHostPrivate(this, containerWidget)) +{ + Q_D(HbAbstractVkbHost); + + setParent(containerWidget); + HbVkbHost::attachHost(this, containerWidget); + + connect(&d->mTimeLine, SIGNAL(finished()), this, SLOT(animationFinished())); + connect(&d->mTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animValueChanged(qreal))); +} + HbAbstractVkbHost::HbAbstractVkbHost(QGraphicsWidget *containerWidget) : d_ptr(new HbAbstractVkbHostPrivate(this, containerWidget)) { Q_D(HbAbstractVkbHost); @@ -516,19 +644,40 @@ connect(&d->mTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animValueChanged(qreal))); } -HbAbstractVkbHost::HbAbstractVkbHost(HbAbstractVkbHostPrivate *dd) : d_ptr(dd) +HbAbstractVkbHost::HbAbstractVkbHost(QGraphicsObject *containerWidget) : d_ptr(new HbAbstractVkbHostPrivate(this, containerWidget)) { Q_D(HbAbstractVkbHost); - setParent(d->mContainerWidget); - HbVkbHost::attachHost(this, d->mContainerWidget); + setParent(containerWidget); + HbVkbHost::attachHost(this, containerWidget); connect(&d->mTimeLine, SIGNAL(finished()), this, SLOT(animationFinished())); connect(&d->mTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animValueChanged(qreal))); } +HbAbstractVkbHost::HbAbstractVkbHost(HbAbstractVkbHostPrivate *dd) : d_ptr(dd) +{ + Q_D(HbAbstractVkbHost); + + setParent(d->mContainerWidget->widgetObject()); + HbVkbHost::attachHost(this, d->mContainerWidget->widgetObject()); + + connect(&d->mTimeLine, SIGNAL(finished()), this, SLOT(animationFinished())); + connect(&d->mTimeLine, SIGNAL(valueChanged(qreal)), this, SLOT(animValueChanged(qreal))); +} + + HbAbstractVkbHost::~HbAbstractVkbHost() { + if (d_ptr->mKeypad) { + d_ptr->mKeypad->hide(); + + if (d_ptr->mCallback) { + d_ptr->mCallback->keyboardClosed(this); + d_ptr->mCallback = 0; + } + } + emit keypadClosed(); delete d_ptr; } @@ -544,8 +693,7 @@ /*! \reimp */ - -void HbAbstractVkbHost::openKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner, bool animationAllowed) +void HbAbstractVkbHost::openKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner, bool animationAllowed) { Q_D(HbAbstractVkbHost); @@ -561,6 +709,7 @@ } if (!HbVkbHostBridge::instance()->connectHost(this)) { + // Do not set open call pending if orientation change is ongoing connect(HbVkbHostBridge::instance(), SIGNAL(stateTransitionCompleted()), this, SLOT(stateTransitionCompleted())); // The previous keyboard is still closing. Set the call pending and return. d->mPendingCall.vkb = vkb; @@ -586,12 +735,17 @@ emit aboutToOpen(); + if (d->mContainerWidget && d->mContainerWidget->widgetObject()) { + d->mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, true ); + } + if (animationAllowed) { d->openKeypad(); } else { d->openKeypadWithoutAnimation(); emit keypadOpened(); } + HbWidgetFeedback::triggered(qobject_cast(d->mKeypad), Hb::InstantPopupOpened); d->connectSignals(); d->mKeypadOperationOngoing = false; @@ -632,7 +786,7 @@ if (!d->disableCursorShift()) { // Move the container. - if (d->mContainerWidget) { + if (d->mContainerWidget->widgetObject()) { d->mContainerWidget->setPos(d->mContainerMovementStartingPoint + (d->mContainerMovementVector * value)); } @@ -654,7 +808,7 @@ { Q_D(HbAbstractVkbHost); - if (d->mContainerWidget && d->mKeypad && d->mCallback && d->mInputMethod) { + if (d->mContainerWidget->widgetObject() && d->mKeypad && d->mCallback && d->mInputMethod) { if (!d->disableCursorShift()) { // Make sure the container reached target position. d->mContainerWidget->setPos(d->mContainerMovementStartingPoint + d->mContainerMovementVector); @@ -668,7 +822,7 @@ if (d->mInputMethod->focusObject()) { // This is hopefully temporary... - QTextEdit *textEdit = qobject_cast(d->mInputMethod->focusObject()->object()); + QTextEdit *textEdit = qobject_cast(d->mInputMethod->focusObject()->object()); if (textEdit) { textEdit->ensureCursorVisible(); } @@ -686,6 +840,7 @@ d->mKeypad->hide(); // Return the container where it was. d->mContainerWidget->setPos(d->mOriginalContainerPosition); + d->mContainerWidget->widgetObject()->setProperty(KPositionManagedByVKB, false ); d->mCallback->keyboardClosed(this); emit keypadClosed(); HbVkbHostBridge::instance()->connectHost(0); @@ -701,7 +856,7 @@ Q_D(const HbAbstractVkbHost); HbMainWindow *mainWindow = d->mainWindow(); - if (d->mContainerWidget && mainWindow) { + if (d->mContainerWidget->widgetObject() && mainWindow) { QSizeF screenSize = d->screenSize(); if (mainWindow->orientation() == Qt::Horizontal) { @@ -723,7 +878,6 @@ { Q_D(HbAbstractVkbHost); d->mKeypadStatusBeforeOrientationChange = d->mKeypadStatus; - HbInputSettingProxy::instance()->notifyScreenOrientationChange(); } /*! @@ -733,13 +887,13 @@ */ void HbAbstractVkbHost::orientationChanged(Qt::Orientation orientation) { - HbInputSettingProxy::instance()->setScreenOrientation(orientation); + Q_UNUSED(orientation); } /*! \reimp */ -HbVirtualKeyboard* HbAbstractVkbHost::activeKeypad() const +HbVirtualKeyboard *HbAbstractVkbHost::activeKeypad() const { Q_D(const HbAbstractVkbHost); return d->mCallback; @@ -755,8 +909,8 @@ if ((d->mTimeLine.state() == QTimeLine::Running) || (d->mKeypadStatus == HbVkbStatusClosed) || (d->mKeypadStatus == HbVkbStatusMinimized) || - !d->mContainerWidget) { - return; + !d->mContainerWidget->widgetObject()) { + return; } // This will refresh the situation if needed. @@ -772,11 +926,15 @@ Q_D(const HbAbstractVkbHost); HbMainWindow *mainWindow = d->mainWindow(); - if (d->mContainerWidget && mainWindow) { + if (d->mContainerWidget->widgetObject() && mainWindow && d->mCallback) { QSizeF vpSize = d->screenSize(); QRectF viewport = QRectF(QPointF(0.0, 0.0), QPointF(vpSize.width(), vpSize.height())); - viewport.setHeight(viewport.height() - confirmedKeyboardSize().height()); + if (d->mKeypadStatus == HbVkbStatusMinimized) { + viewport.setHeight(viewport.height() - d->mCallback->minimizedKeyboardSize().height()); + } else { + viewport.setHeight(viewport.height() - confirmedKeyboardSize().height()); + } return viewport; } @@ -832,7 +990,8 @@ { Q_D(const HbAbstractVkbHost); - if (d->mKeypadStatus == HbVkbStatusOpened) { + if (d->mKeypadStatus == HbVkbStatusOpened || + d->mKeypadStatus == HbVkbStatusMinimized) { return activeViewRect(); } @@ -861,7 +1020,7 @@ /*! \reimp */ -void HbAbstractVkbHost::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner) +void HbAbstractVkbHost::openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner) { Q_D(HbAbstractVkbHost); d->mInputMethod = owner; @@ -904,14 +1063,15 @@ { Q_D(HbAbstractVkbHost); - if (view != d->mContainerWidget) { - if (d->mTimeLine.state() == QTimeLine::Running) { + if (view != d->mContainerWidget->widgetObject()) { + if (d->mTimeLine.state() == QTimeLine::Running) { d->cancelAnimationAndHideVkbWidget(); if (d->mCallback) { d->mCallback->keyboardClosed(this); - } + } } else if (d->mKeypadStatus != HbVkbStatusClosed) { d->closeKeypadWithoutAnimation(); + emit keypadClosed(); } } } @@ -921,16 +1081,16 @@ */ void HbAbstractVkbHost::refresh() { - Q_D(HbAbstractVkbHost); + Q_D(HbAbstractVkbHost); - if (d->mKeypadStatus == HbVkbHost::HbVkbStatusOpened && - d->mTimeLine.state() != QTimeLine::Running) { - d->prepareAnimationsCommon(); - if (d->prepareContainerAnimation(HbVkbHost::HbVkbStatusOpened)) { - // Container status needs to be updated. Run the animation. - d->mTimeLine.start(); - } - } + if (d->mKeypadStatus == HbVkbHost::HbVkbStatusOpened && + d->mTimeLine.state() != QTimeLine::Running) { + d->prepareAnimationsCommon(); + if (d->prepareContainerAnimation(HbVkbHost::HbVkbStatusOpened)) { + // Container status needs to be updated. Run the animation. + d->mTimeLine.start(); + } + } } /*! @@ -938,8 +1098,8 @@ */ bool HbAbstractVkbHost::stateTransitionOngoing() const { - Q_D(const HbAbstractVkbHost); - return (d->mTimeLine.state() == QTimeLine::Running); + Q_D(const HbAbstractVkbHost); + return (d->mTimeLine.state() == QTimeLine::Running); } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/vkbhosts/hbabstractvkbhost.h --- a/src/hbcore/vkbhosts/hbabstractvkbhost.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/vkbhosts/hbabstractvkbhost.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,24 +34,27 @@ class HbView; class HbAbstractVkbHostPrivate; class HbWidget; +class QGraphicsObject; class HB_CORE_EXPORT HbAbstractVkbHost : public HbVkbHost { Q_OBJECT public: - HbAbstractVkbHost(HbWidget* containerWidget); - HbAbstractVkbHost(QGraphicsWidget* containerWidget); + HbAbstractVkbHost(HbWidget *containerWidget); + HbAbstractVkbHost(QWidget *containerWidget); + HbAbstractVkbHost(QGraphicsWidget *containerWidget); + HbAbstractVkbHost(QGraphicsObject *containerWidget); ~HbAbstractVkbHost(); public: // From HbVkbHost - void openKeypad(HbVirtualKeyboard *vkb = 0, HbInputMethod* owner = 0, bool animationAllowed = true); - void openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod* owner); + void openKeypad(HbVirtualKeyboard *vkb = 0, HbInputMethod *owner = 0, bool animationAllowed = true); + void openMinimizedKeypad(HbVirtualKeyboard *vkb, HbInputMethod *owner); void closeKeypad(bool animationAllowed = true); void minimizeKeypad(bool animationAllowed = true); - HbVkbStatus keypadStatus() const; + HbVkbStatus keypadStatus() const; HbVirtualKeyboard *activeKeypad() const; - QRectF applicationArea() const; + QRectF applicationArea() const; QSizeF keyboardArea() const; HbVkbStatus keypadStatusBeforeOrientationChange() const; @@ -69,8 +72,8 @@ virtual void orientationAboutToChange(); virtual void orientationChanged(Qt::Orientation orientation); virtual void animValueChanged(qreal aValue); - virtual void animationFinished(); - virtual void currentViewChanged(HbView*); + virtual void animationFinished(); + virtual void currentViewChanged(HbView *); virtual void stateTransitionCompleted(); protected: @@ -78,7 +81,7 @@ HbAbstractVkbHost(HbAbstractVkbHostPrivate *dd); protected: - HbAbstractVkbHostPrivate* const d_ptr; + HbAbstractVkbHostPrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbAbstractVkbHost) diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/vkbhosts/hbabstractvkbhost_p.h --- a/src/hbcore/vkbhosts/hbabstractvkbhost_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/vkbhosts/hbabstractvkbhost_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,11 +44,30 @@ bool animationAllowed; }; + +// This class is to handle all the specific widget actions in an, +// abstract way, put all such widget specific code in below class. +class HbVkbHostContainerWidget +{ +public: + HbVkbHostContainerWidget(QObject *containterWidget); + void setPos(QPointF newPosition); + QPointF pos(); + QRectF sceneBoundingRect(); + QObject *widgetObject() { + return mContainerWidget; + } + void connectSignals(QObject *receiver); + void disconnectSignals(QObject *receiver); +private: + QPointer mContainerWidget; +}; + class HbAbstractVkbHostPrivate { public: - HbAbstractVkbHostPrivate(HbAbstractVkbHost *myVkbHost, QGraphicsWidget *containerWidget); - virtual ~HbAbstractVkbHostPrivate() {} + HbAbstractVkbHostPrivate(HbAbstractVkbHost *myVkbHost, QObject *containerWidget); + virtual ~HbAbstractVkbHostPrivate(); virtual void openKeypad(); virtual void closeKeypad(); @@ -73,9 +92,9 @@ public: HbAbstractVkbHost *q_ptr; - HbVirtualKeyboard *mCallback; + HbVirtualKeyboard *mCallback; QPointer mKeypad; - QPointer mContainerWidget; + HbVkbHostContainerWidget *mContainerWidget; QSizeF mScreenSize; QTimeLine mTimeLine; HbVkbHost::HbVkbStatus mKeypadStatus; diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/vkbhosts/hbshrinkingvkbhost.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/vkbhosts/hbshrinkingvkbhost.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,170 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#include "hbshrinkingvkbhost.h" +#include "hbabstractvkbhost_p.h" + +#include +#include + +#include "hbwidget.h" +#include "hbmainwindow.h" +#include "hbmainwindow_p.h" + +/*! +\proto +\class HbShrinkingVkbHost +\brief A virtual keyboard host that doesn't move the active mainwindow view but shrinks it. + +The default virtual keyboard host moves the editor container widget in order to keep the +cursor line visible. In some situations that doesn't work and the container should be shrunk +and relayouted instead. + +This virtual keyboard host does that. It works with editors that live inside in main window's +active view and shrinks the view instead of moving it around when the virtual keyboard comes up. +*/ + +/// @cond + +class HbShrinkingVkbHostPrivate : public HbAbstractVkbHostPrivate +{ + Q_DECLARE_PUBLIC(HbShrinkingVkbHost) + +public: + HbShrinkingVkbHostPrivate(HbAbstractVkbHost *myHost, HbWidget *widget); + bool prepareContainerAnimation(HbVkbHost::HbVkbStatus status); + void closeKeypad(); + void closeKeypadWithoutAnimation(); + void openKeypadWithoutAnimation(); + void minimizeKeypadWithoutAnimation(); + + void shrinkView(); + void resetViewSize(); + +public: + QSizeF mContainerOriginalSize; +}; + +HbShrinkingVkbHostPrivate::HbShrinkingVkbHostPrivate(HbAbstractVkbHost *myHost, HbWidget *widget) + : HbAbstractVkbHostPrivate(myHost, widget) +{ +} + +bool HbShrinkingVkbHostPrivate::prepareContainerAnimation(HbVkbHost::HbVkbStatus status) +{ + Q_UNUSED(status); + + // This host doesn't move the container, only the keypad. + return false; +} + +void HbShrinkingVkbHostPrivate::closeKeypad() +{ + resetViewSize(); + HbAbstractVkbHostPrivate::closeKeypad(); +} + +void HbShrinkingVkbHostPrivate::closeKeypadWithoutAnimation() +{ + resetViewSize(); + HbAbstractVkbHostPrivate::closeKeypadWithoutAnimation(); +} + +void HbShrinkingVkbHostPrivate::openKeypadWithoutAnimation() +{ + HbAbstractVkbHostPrivate::openKeypadWithoutAnimation(); + shrinkView(); +} + +void HbShrinkingVkbHostPrivate::minimizeKeypadWithoutAnimation() +{ + HbAbstractVkbHostPrivate::minimizeKeypadWithoutAnimation(); + shrinkView(); +} + +void HbShrinkingVkbHostPrivate::resetViewSize() +{ + HbMainWindow *mainWin = mainWindow(); + if (mainWin && mContainerOriginalSize.isValid()) { + HbMainWindowPrivate::d_ptr(mainWin)->setViewportSize(mContainerOriginalSize); + mContainerOriginalSize = QSizeF(); + } +} + +void HbShrinkingVkbHostPrivate::shrinkView() +{ + Q_Q(HbShrinkingVkbHost); + + HbMainWindow *mainWin = mainWindow(); + if (mainWin) { + if (!mContainerOriginalSize.isValid()) { + mContainerOriginalSize = HbMainWindowPrivate::d_ptr(mainWin)->viewPortSize(); + } + HbMainWindowPrivate::d_ptr(mainWin)->setViewportSize(q->applicationArea().size()); + } +} + +/// @endcond + +/*! +Constructs the object. +*/ +HbShrinkingVkbHost::HbShrinkingVkbHost(HbWidget *widget) : HbAbstractVkbHost(new HbShrinkingVkbHostPrivate(this, widget)) +{ + setParent(widget); +} + +/*! +Destructs the object. +*/ +HbShrinkingVkbHost::~HbShrinkingVkbHost() +{ +} + +/*! +\reimp +*/ +int HbShrinkingVkbHost::priority() const +{ + return 0; +} + +/*! +\reimp +*/ +void HbShrinkingVkbHost::animationFinished() +{ + Q_D(HbShrinkingVkbHost); + + + HbAbstractVkbHost::animationFinished(); + + if (d->mKeypadStatus == HbVkbHost::HbVkbStatusOpened || + d->mKeypadStatus == HbVkbHost::HbVkbStatusMinimized) { + d->shrinkView(); + } +} + +// End of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/vkbhosts/hbshrinkingvkbhost.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbcore/vkbhosts/hbshrinkingvkbhost.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,55 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbCore module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBSHRINKINGVKBHOST_H +#define HBSHRINKINGVKBHOST_H + +#include "hbabstractvkbhost.h" + +class HbWidget; +class HbShrinkingVkbHostPrivate; + +class HB_CORE_EXPORT HbShrinkingVkbHost : public HbAbstractVkbHost +{ + Q_OBJECT + +public: + explicit HbShrinkingVkbHost(HbWidget *target); + ~HbShrinkingVkbHost(); + + int priority() const; + +public slots: + void animationFinished(); + +private: + Q_DECLARE_PRIVATE_D(d_ptr, HbShrinkingVkbHost) + Q_DISABLE_COPY(HbShrinkingVkbHost) +}; + +#endif // HBSHRINKINGVKBHOST_H + +// End of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/vkbhosts/hbstaticvkbhost.cpp --- a/src/hbcore/vkbhosts/hbstaticvkbhost.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/vkbhosts/hbstaticvkbhost.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ \class HbStaticVkbHost \brief Static virtual keyboard host -The virtual keyboard host takes care of keyboard animations. +The virtual keyboard host takes care of keyboard animations. This version, unlike other vkb host implementations, only brings up the virtual keyboard but does not move the underlying view or reposition the editor in case it is fully or partially covered by the virtual keyboard. In other words, it does not gurantee that the editor cursor remains visible. @@ -59,7 +59,7 @@ }; HbStaticVkbHostPrivate::HbStaticVkbHostPrivate(HbAbstractVkbHost *myHost, HbWidget *widget) -: HbAbstractVkbHostPrivate(myHost, widget) + : HbAbstractVkbHostPrivate(myHost, widget) { } @@ -77,8 +77,8 @@ Constructs the object. */ HbStaticVkbHost::HbStaticVkbHost(HbWidget *widget) : HbAbstractVkbHost(new HbStaticVkbHostPrivate(this, widget)) -{ - setParent(widget); +{ + setParent(widget); } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbcore/vkbhosts/vkbhosts.pri --- a/src/hbcore/vkbhosts/vkbhosts.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbcore/vkbhosts/vkbhosts.pri Thu Jul 22 16:36:53 2010 +0100 @@ -32,7 +32,9 @@ PUBLIC_HEADERS += $$PWD/hbstaticvkbhost.h PUBLIC_HEADERS += $$PWD/hbabstractvkbhost.h +PUBLIC_HEADERS += $$PWD/hbshrinkingvkbhost.h SOURCES += $$PWD/hbabstractvkbhost.cpp SOURCES += $$PWD/hbstaticvkbhost.cpp +SOURCES += $$PWD/hbshrinkingvkbhost.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/hbfeedback.pro --- a/src/hbfeedback/hbfeedback.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/hbfeedback.pro Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,7 @@ CONVENIENCE_HEADERS += $${HB_BUILD_DIR}/include/hbfeedback/hbfeedback.h CONVENIENCE_HEADERS += $$files($${HB_BUILD_DIR}/include/hbfeedback/Hb*) -HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS +HEADERS += $$PUBLIC_HEADERS $$RESTRICTED_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS # dependencies hbAddLibrary(hbcore/HbCore) @@ -54,10 +54,13 @@ pubheaders.files = $$PUBLIC_HEADERS pubheaders.path = $${HB_INCLUDE_DIR}/hbfeedback + restheaders.files = $$RESTRICTED_HEADERS + restheaders.path = $${HB_INCLUDE_DIR}/hbfeedback/restricted + convheaders.files = $$CONVENIENCE_HEADERS convheaders.path = $${HB_INCLUDE_DIR}/hbfeedback - INSTALLS += target pubheaders convheaders + INSTALLS += target pubheaders restheaders convheaders win32:INSTALLS += dlltarget } diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbcontinuousfeedback.cpp --- a/src/hbfeedback/player/hbcontinuousfeedback.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbcontinuousfeedback.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -59,35 +59,27 @@ Continuous feedbacks are feedback effects that last as long as the user is touching the screen, for example when dragging a slider handle. Continuous feedback effects need to be started, updated - and stopped using methods HbFeedbackPlayer::startContinuousFeedback(), HbFeedbackPlayer::updateContinuousFeedback() - and HbFeedbackPlayer::cancelContinuousFeedback(). The effect intensity can be varied during the feedback. + and stopped using methods play() and stop(). */ -#define UPDATE_IF_ONGOING \ -HbFeedbackPlayer *player = HbFeedbackPlayer::instance(); \ -if(player && player->continuousFeedbackOngoing(d->cFeedbackId)) { \ - player->updateContinuousFeedback(d->cFeedbackId,*this); \ -} - - /*! \fn void HbContinuousFeedback::setContinuousEffect(HbFeedback::ContinuousEffect effect) - Sets the continuous feedback effect that determines what kind of continuous effects will - be played when calling HbFeedbackPlayer::startContinuousFeedback(). + Sets the continuous feedback effect that will be played by the feedback object. + \sa continuousEffect() */ void HbContinuousFeedback::setContinuousEffect(HbFeedback::ContinuousEffect effect) { d->cEffect = effect; - UPDATE_IF_ONGOING; } /*! \fn void HbFeedback::ContinuousEffect HbContinuousFeedback::continuousEffect() const - Returns the continuous effect of the continuous feedback object. Continuous effect represents the continuous - feedback effect that will be played when calling HbFeedbackPlayer::startContinuousFeedback(). + Returns the continuous effect of the continuous feedback object. + + \sa setContinuousEffect() */ HbFeedback::ContinuousEffect HbContinuousFeedback::continuousEffect() const @@ -98,9 +90,11 @@ /*! \fn int HbContinuousFeedback::timeout() const - The timeout value of the feedback in milliseconds. Continuous feedback is - automatically stopped if previously started continuous feedback has not been - updated within the timeout. + Returns the timeout value (in milliseconds) of the feedback object. Continuous feedback is + automatically stopped if it is not updated within the timeout (by subsequent calls to + play()). + + \sa setTimeout(), play() */ int HbContinuousFeedback::timeout() const { @@ -110,8 +104,10 @@ /*! \fn int HbContinuousFeedback::intensity() const - The intensity of the continuous feedback effect. Intensity can be varied between + Returns the intensity of the continuous feedback effect. Intensity can be varied between values HbFeedback::IntensityZero and HbFeedback::IntensityFull. + + \sa setIntensity() */ int HbContinuousFeedback::intensity() const { @@ -134,7 +130,7 @@ /*! Constructor. - \param effect continuous feedback to be played + \param effect continuous feedback effect to be played \param widget used to determine the window where continuous feedback is active. There can only be one ongoing continuous feedback per application window. */ @@ -153,43 +149,53 @@ } /*! - Sets the timeout value in milliseconds. Continuous feedback is automatically stopped - if the continuous feedback has not been updated within the timeout. + Sets the timeout value (in milliseconds) of the feedback object. Continuous feedback is + automatically stopped if it is not updated within the timeout (by subsequent calls to + play()). This is a safety mechanism to prevent situations in which the client fails to + explicitly stop() a continuous feedback effect. The default timeout value is + HbFeedback::StandardFeedbackTimeout. + + \sa timeout() */ void HbContinuousFeedback::setTimeout(int msecTimeout) { if (msecTimeout > 0) { d->cTimeout = msecTimeout; - UPDATE_IF_ONGOING; } } /*! Sets the intensity of the continuous feedback effect. The intensity can be varied between HbFeedback::IntensityZero and HbFeedback::IntensityFull. + + \sa intensity() */ void HbContinuousFeedback::setIntensity(int intensity) { if (intensity >= 0 && intensity <= HbFeedback::IntensityFull) { d->cIntensity = intensity; - UPDATE_IF_ONGOING; } } /*! - Plays the continuous feedback. + Starts/updates the continuous feedback. + The feedback effect will be played untill the timeout is reached or a call to stop() is made. + \sa stop() */ void HbContinuousFeedback::play() { - HbFeedbackPlayer* feedbackPlayer = HbFeedbackPlayer::instance(); - - if (feedbackPlayer) { - d->cFeedbackId = feedbackPlayer->startContinuousFeedback(*this); + HbFeedbackPlayer *feedbackPlayer = HbFeedbackPlayer::instance(); + if(feedbackPlayer) { + if( feedbackPlayer->continuousFeedbackOngoing(d->cFeedbackId)) { + feedbackPlayer->updateContinuousFeedback(d->cFeedbackId,*this); + } else { + d->cFeedbackId = feedbackPlayer->startContinuousFeedback(*this); + } } } /*! - Stops the continous feedback. + Stops the continuous feedback. */ void HbContinuousFeedback::stop() { diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbfeedbackplayer.cpp --- a/src/hbfeedback/player/hbfeedbackplayer.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbfeedbackplayer.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,6 @@ #include #include #include -#include "hbfeedbackplayer_stub_p.h" #ifdef FEEDBACK_TEST_EVENT #include "hbfeedbacktestevent_p.h" diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbfeedbackplayer_p.h --- a/src/hbfeedback/player/hbfeedbackplayer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbfeedbackplayer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBFEEDBACKPLAYER_H -#define HBFEEDBACKPLAYER_H +#ifndef HBFEEDBACKPLAYER_P_H +#define HBFEEDBACKPLAYER_P_H #include #include @@ -60,4 +60,4 @@ HbFeedbackPlayerPrivate* const d; }; -#endif // HBFEEDBACKPLAYER_H +#endif // HBFEEDBACKPLAYER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbfeedbackplayer_p_p.h --- a/src/hbfeedback/player/hbfeedbackplayer_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbfeedbackplayer_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBFEEDBACKPLAYERPRIVATE_H -#define HBFEEDBACKPLAYERPRIVATE_H +#ifndef HBFEEDBACKPLAYER_P_P_H +#define HBFEEDBACKPLAYER_P_P_H #include "hbfeedbackplayer_p.h" @@ -50,4 +50,4 @@ HbFeedbackSettings* feedbackSettings; }; -#endif // HBFEEDBACKPLAYERPRIVATE_H +#endif // HBFEEDBACKPLAYER_P_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbfeedbackplayer_stub_p.h --- a/src/hbfeedback/player/hbfeedbackplayer_stub_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbfeedbackplayer_stub_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBFEEDBACKBASEPLAYER_H -#define HBFEEDBACKBASEPLAYER_H +#ifndef HBFEEDBACKPLAYER_STUB_P_H +#define HBFEEDBACKPLAYER_STUB_P_H #include @@ -53,4 +53,4 @@ HbFeedbackBasePlayerPrivate* const d; }; -#endif // HBFEEDBACKBASEPLAYER_H +#endif // HBFEEDBACKPLAYER_STUB_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbfeedbackplayer_symbian.cpp --- a/src/hbfeedback/player/hbfeedbackplayer_symbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbfeedbackplayer_symbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -131,34 +131,34 @@ instantFeedbackSymbian = ETouchFeedbackSensitiveButton; break; case HbFeedback::BasicItem: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackBasicItem; break; case HbFeedback::SensitiveItem: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackSensitiveItem; break; case HbFeedback::BounceEffect: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackBounceEffect; break; case HbFeedback::PopupOpen: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackPopupOpen; break; case HbFeedback::PopupClose: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackPopupClose; break; case HbFeedback::BasicSlider: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackBasicSlider; break; case HbFeedback::SensitiveSlider: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackSensitiveSlider; break; case HbFeedback::StopFlick: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackStopFlick; break; case HbFeedback::Flick: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackFlick; break; case HbFeedback::Editor: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackEditor; break; case HbFeedback::TextSelection: instantFeedbackSymbian = ETouchFeedbackTextSelection; @@ -176,37 +176,41 @@ instantFeedbackSymbian = ETouchFeedbackCheckbox; break; case HbFeedback::MultipleCheckbox: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackMultipleCheckbox; break; case HbFeedback::SensitiveKeypad: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackSensitiveKeypad; break; case HbFeedback::BasicKeypad: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackBasicKeypad; break; case HbFeedback::MultitouchActivate: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackMultitouchActivate; break; case HbFeedback::RotateStep: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. - break; - case HbFeedback::ItemDrop: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. - break; - case HbFeedback::ItemMoveOver: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. - break; - case HbFeedback::ItemPick: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackRotateStep; break; case HbFeedback::ItemScroll: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. + instantFeedbackSymbian = ETouchFeedbackItemScroll; break; case HbFeedback::PopUp: instantFeedbackSymbian = ETouchFeedbackPopUp; break; + case HbFeedback::ItemDrop: + instantFeedbackSymbian = ETouchFeedbackItemDrop; + break; + case HbFeedback::ItemMoveOver: + instantFeedbackSymbian = ETouchFeedbackItemMoveOver; + break; + case HbFeedback::ItemPick: + instantFeedbackSymbian = ETouchFeedbackItemPick; + break; case HbFeedback::LongPress: - instantFeedbackSymbian = ETouchFeedbackBasic; // Effects changing in 10.1 are mapped to basic. +#ifdef HB_TOUCHFEEDBACK_TYPE_IS_LONGPRESS + instantFeedbackSymbian = ETouchFeedbackLongPress; +#else + instantFeedbackSymbian = ETouchFeedbackLongTap; +#endif break; default: break; @@ -247,15 +251,14 @@ case HbFeedback::ContinuousSlider: continuousFeedbackSymbian = ETouchContinuousSlider; break; + case HbFeedback::ContinuousPinch: + continuousFeedbackSymbian = ETouchContinuousPinch; + break; case HbFeedback::ContinuousInput: continuousFeedbackSymbian = ETouchContinuousInput; break; - // Effects coming in 10.1 are mapped to smooth temporarily. case HbFeedback::ContinuousPopup: - continuousFeedbackSymbian = ETouchContinuousSmooth; - break; - case HbFeedback::ContinuousPinch: - continuousFeedbackSymbian = ETouchContinuousSmooth; + continuousFeedbackSymbian = ETouchContinuousPopup; break; default: break; diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbfeedbackplayer_symbian_p.h --- a/src/hbfeedback/player/hbfeedbackplayer_symbian_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbfeedbackplayer_symbian_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBFEEDBACKBASEPLAYER_H -#define HBFEEDBACKBASEPLAYER_H +#ifndef HBFEEDBACKPLAYER_SYMBIAN_H +#define HBFEEDBACKPLAYER_SYMBIAN_H #include @@ -54,4 +54,4 @@ HbFeedbackBasePlayerPrivate* const d; }; -#endif // HBFEEDBACKBASEPLAYER_H +#endif // HBFEEDBACKPLAYER_SYMBIAN_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbfeedback/player/hbinstantfeedback.cpp --- a/src/hbfeedback/player/hbinstantfeedback.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbfeedback/player/hbinstantfeedback.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -55,7 +55,10 @@ /*! \fn void HbInstantFeedback::setInstantEffect(HbFeedback::InstantEffect effect) - Sets the instant effect to be be played when calling HbFeedbackPlayer::playInstantFeedback(). + Sets the instant effect of the feedback object. This effect will be played when calling + the play() function. + + \sa instantEffect() */ void HbInstantFeedback::setInstantEffect(HbFeedback::InstantEffect effect) @@ -66,8 +69,9 @@ /*! \fn void HbFeedback::InstantEffect HbInstantFeedback::instantEffect() const - Returns the instant effect of the instant feedback object. Instant effect represents the feedback - effect to be played when calling HbFeedbackPlayer::playInstantFeedback(). + Returns the instant effect of the instant feedback object. + + \sa setInstantEffect() */ HbFeedback::InstantEffect HbInstantFeedback::instantEffect() const @@ -78,7 +82,7 @@ /*! \fn bool HbInstantFeedback::isValid() const - Instant feedback is valid if a proper instant effect (not HbFeedback::None) has beed + Instant feedback is valid if a proper instant effect (not HbFeedback::None) has been defined for the feedback. */ @@ -108,7 +112,8 @@ /*! Constructor. - \param effect instant feedback to be played + \param effect the instant feedback effect of the feedback object. This effect will + be played when calling the play() function. */ HbInstantFeedback::HbInstantFeedback(HbFeedback::InstantEffect effect) : d(new HbInstantFeedbackPrivate) { @@ -124,7 +129,7 @@ } /*! - Plays the instant feedback effect. + Plays the feedback object's instant feedback effect. */ void HbInstantFeedback::play() { diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/hbinput.pro --- a/src/hbinput/hbinput.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/hbinput.pro Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,7 @@ CONVENIENCE_HEADERS += $${HB_BUILD_DIR}/include/hbinput/hbinput.h CONVENIENCE_HEADERS += $$files($${HB_BUILD_DIR}/include/hbinput/Hb*) -HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS +HEADERS += $$PUBLIC_HEADERS $$RESTRICTED_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS # dependencies hbAddLibrary(hbcore/HbCore) @@ -51,13 +51,13 @@ pubheaders.files = $$PUBLIC_HEADERS pubheaders.path = $${HB_INCLUDE_DIR}/hbinput - privheaders.files = $$PRIVATE_HEADERS - privheaders.path = $${HB_INCLUDE_DIR}/hbinput/private + restheaders.files = $$RESTRICTED_HEADERS + restheaders.path = $${HB_INCLUDE_DIR}/hbinput/restricted convheaders.files = $$CONVENIENCE_HEADERS convheaders.path = $${HB_INCLUDE_DIR}/hbinput - INSTALLS += target pubheaders privheaders convheaders + INSTALLS += target pubheaders restheaders convheaders win32:INSTALLS += dlltarget } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputbutton.cpp --- a/src/hbinput/inputwidgets/hbinputbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -51,8 +51,8 @@ }; HbInputButtonPrivate::HbInputButtonPrivate() - : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), - mPosition(0, 0), mSize(1, 1), mKeyCode(-1), mAutoRepeat(false) + : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), + mPosition(0, 0), mSize(1, 1), mKeyCode(-1), mAutoRepeat(false) { for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { mTexts.append(""); @@ -64,8 +64,8 @@ } HbInputButtonPrivate::HbInputButtonPrivate(int keyCode, const QPoint &position, const QSize &size) - : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), - mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(false) + : mType(HbInputButton::ButtonTypeNormal), mState(HbInputButton::ButtonStateReleased), + mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(false) { for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { mTexts.append(""); @@ -75,7 +75,8 @@ mIcons.append(HbIcon()); } - if (keyCode != HbInputButton::ButtonKeyCodeCharacter) { + if (keyCode != HbInputButton::ButtonKeyCodeCharacter && + keyCode != HbInputButton::ButtonKeyCodeSpace) { mType = HbInputButton::ButtonTypeFunction; } @@ -94,10 +95,10 @@ } HbInputButtonPrivate::HbInputButtonPrivate(HbInputButton::HbInputButtonType type, HbInputButton::HbInputButtonState state, - const QPoint &position, const QSize &size, int keyCode, bool autoRepeat, - const QList &texts, const QString &mappedCharacters, const QList &icons) - : mType(type), mState(state), mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(autoRepeat), - mMappedCharacters(mappedCharacters) + const QPoint &position, const QSize &size, int keyCode, bool autoRepeat, + const QList &texts, const QString &mappedCharacters, const QList &icons) + : mType(type), mState(state), mPosition(position), mSize(size), mKeyCode(keyCode), mAutoRepeat(autoRepeat), + mMappedCharacters(mappedCharacters) { for (int i = 0; i < HbInputButton::ButtonTextIndexCount; ++i) { if (i < texts.count()) { @@ -125,22 +126,30 @@ void HbInputButtonPrivate::setDefaultGraphics(int keyCode) { - if (keyCode == HbInputButton::ButtonKeyCodeDelete) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconDelete)); - } else if (keyCode == HbInputButton::ButtonKeyCodeShift) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconShift)); - } else if (keyCode == HbInputButton::ButtonKeyCodeSymbol) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconSymbol)); - } else if (keyCode == HbInputButton::ButtonKeyCodeEnter) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconEnter)); - } else if (keyCode == HbInputButton::ButtonKeyCodeSpace) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconSpace)); - } else if (keyCode == HbInputButton::ButtonKeyCodeAlphabet) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconAlphabet)); - } else if (keyCode == HbInputButton::ButtonKeyCodePageChange) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconPageChange)); - } else if (keyCode == HbInputButton::ButtonKeyCodeSmiley) { - mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconSmiley)); + switch(keyCode) { + case HbInputButton::ButtonKeyCodeDelete: + mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconDelete)); + break; + case HbInputButton::ButtonKeyCodeShift: + mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconShift)); + break; + case HbInputButton::ButtonKeyCodeSymbol: + mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconSymbol)); + break; + case HbInputButton::ButtonKeyCodeEnter: + mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconEnter)); + break; + case HbInputButton::ButtonKeyCodeSpace: + mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconSpace)); + break; + case HbInputButton::ButtonKeyCodeAlphabet: + mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconSymbol)); + break; + case HbInputButton::ButtonKeyCodeSmiley: + mIcons.replace(HbInputButton::ButtonTextIndexPrimary, HbIcon(HbInputButtonIconSmiley)); + break; + default: + break; } } @@ -150,7 +159,7 @@ Constructor */ HbInputButton::HbInputButton() - : d_ptr(new HbInputButtonPrivate) + : d_ptr(new HbInputButtonPrivate) { } @@ -163,7 +172,7 @@ size is button's size in grid cell units. */ HbInputButton::HbInputButton(int keyCode, const QPoint &position, const QSize &size) - : d_ptr(new HbInputButtonPrivate(keyCode, position, size)) + : d_ptr(new HbInputButtonPrivate(keyCode, position, size)) { } @@ -176,7 +185,7 @@ } /*! -Updates buttons type. +Updates button's type. \sa type */ @@ -188,7 +197,7 @@ } /*! -Returns buttons type. +Returns button's type. \sa setType */ @@ -200,7 +209,7 @@ } /*! -Updates buttons state. +Updates button's state. \sa state */ @@ -212,7 +221,7 @@ } /*! -Returns buttons state. +Returns button's state. \sa setState */ @@ -224,7 +233,7 @@ } /*! -Updates buttons position. +Updates button's position. position is button's position in grid cell units. @@ -238,7 +247,7 @@ } /*! -Returns buttons position. +Returns button's position. \sa setPosition */ @@ -250,7 +259,7 @@ } /*! -Updates buttons size. +Updates button's size. size is button's size in grid cell units. @@ -264,7 +273,7 @@ } /*! -Returns buttons size. +Returns button's size. \sa setSize */ @@ -276,7 +285,7 @@ } /*! -Updates buttons key code. +Updates button's key code. \sa keyCode */ @@ -288,7 +297,7 @@ } /*! -Returns buttons key code. +Returns button's key code. \sa setKeyCode */ @@ -300,7 +309,7 @@ } /*! -Updates buttons auto repeat status. +Updates button's auto repeat status. \sa autoRepeat */ @@ -312,7 +321,7 @@ } /*! -Returns buttons auto repeat status. +Returns button's auto repeat status. \sa setAutoRepeat */ @@ -340,11 +349,11 @@ } /*! -Updates all button texts. +Updates all button's texts. Button can have three different texts. Text position and size -will depend of other buttons texts and icons. If list contains +will depend on other buttons texts and icons. If list contains more strings, then the rest will be ignored. Icon with same index -than text will override the text. +as text will override the text. \sa text \sa texts @@ -357,7 +366,7 @@ if (i < texts.count()) { d->mTexts.replace(i, texts.at(i)); } else { - d->mTexts.replace(i, QString()); + d->mTexts[i].clear(); } } } @@ -380,7 +389,7 @@ } /*! -Returns all button texts. +Returns all button's texts. \sa setText \sa setTexts @@ -434,10 +443,10 @@ /*! Updates all button icons. -Button can have three different icons. Icon position -will depend of other buttons icons and texts. If list contains +Button can have three different icons. Icon position +will depend on other buttons icons and texts. If list contains more icons, then the rest will be ignored. Icon with same index -than text will override the text. +as text will override the text. \sa icon \sa icons @@ -472,7 +481,7 @@ } /*! -Returns all button icon. +Returns all button's icons. \sa setIcon \sa setIcons @@ -497,7 +506,7 @@ } /*! -Returns buttons bounding rectangle. +Returns button's bounding rectangle. \sa setBoundingRect */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputbutton.h --- a/src/hbinput/inputwidgets/hbinputbutton.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputbutton.h Thu Jul 22 16:36:53 2010 +0100 @@ -87,7 +87,7 @@ ButtonTypeNormal, ButtonTypeFunction, ButtonTypeLabel, - ButtonTypeCount + ButtonTypeCount }; enum HbInputButtonState { @@ -152,7 +152,7 @@ QRectF boundingRect() const; protected: - HbInputButtonPrivate * const d_ptr; + HbInputButtonPrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputButton) diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputbuttongroup.cpp --- a/src/hbinput/inputwidgets/hbinputbuttongroup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputbuttongroup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,13 +22,16 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputbuttongroup.h" +#include "hbinputbuttongroup_p.h" #include #include #include #include #include -#include +#include +#include #include #include @@ -38,10 +41,9 @@ #include #include #include +#include #include "hbframedrawerpool_p.h" -#include "hbinputbuttongroup.h" -#include "hbinputbuttongroup_p.h" #include "hbinputbutton.h" /// @cond @@ -92,9 +94,9 @@ const qreal HbTouchAreaSizeInUnits = 8; HbInputButtonGroupPrivate::HbInputButtonGroupPrivate() - : mUnitValue(0), mGridSize(1, 1), mButtonBorderSize(1.0), mEnabled(true), - mButtonPreviewEnabled(false), mCharacterSelectionPreviewEnabled(false), - mMultiTouchEnabled(true), mCharacterSelectionPreview(0), mBackground(0) + : mUnitValue(0), mGridSize(1, 1), mButtonBorderSize(1.0), mEnabled(true), + mButtonPreviewEnabled(false), mCharacterSelectionPreviewEnabled(false), + mMultiTouchEnabled(true), mCharacterSelectionPreview(0), mBackground(0) { for (int i = 0; i < HbTextLayoutCount; ++i) { mTextLayouts.append(0); @@ -109,16 +111,16 @@ HbFrameDrawerPool::release(drawer); } - foreach (HbInputButton *button, mButtonData) { + foreach(HbInputButton *button, mButtonData) { delete button; } mButtonData.clear(); - foreach (QTextLayout *layout, mTextLayouts) { + foreach(QTextLayout *layout, mTextLayouts) { delete layout; } - foreach (QTimer *timer, mLongPressTimers) { + foreach(QTimer *timer, mLongPressTimers) { delete timer; } @@ -156,6 +158,8 @@ if (drawer != mButtonDrawers.at(i)) { HbFrameDrawerPool::release(mButtonDrawers.at(i)); mButtonDrawers.replace(i, drawer); + } else { + HbFrameDrawerPool::release(drawer); } } else { mButtonDrawers.append(drawer); @@ -307,51 +311,67 @@ } } -void HbInputButtonGroupPrivate::showButtonPreview(HbInputButton * const item) +void HbInputButtonGroupPrivate::showButtonPreview(HbInputButton *const item) { Q_Q(HbInputButtonGroup); + // Button preview should be shown only for non-function buttons if preview + // is enabled for this button group. Space key is handled as a special case + // and no preview will be shown for that although it is not function button. int index = mButtonData.indexOf(item); - if (mButtonPreviewEnabled && item->type() != HbInputButton::ButtonTypeFunction && - !mButtonPreview.contains(index)) { - HbInputButtonGroup *group = new HbInputButtonGroup(QSize(1, 1), q); + if (mButtonPreviewEnabled && !mButtonPreview.contains(index) && + item->type() != HbInputButton::ButtonTypeFunction && + item->keyCode() != HbInputButton::ButtonKeyCodeSpace) { + + HbInputButtonGroup *group = new HbInputButtonGroup(QSize(1, 1)); mButtonPreview.insert(index, group); - QList buttons; - HbInputButton *previewItem = new HbInputButton(item->text(HbInputButton::ButtonTextIndexPrimary).at(0).unicode(), QPoint(0, 0)); + // Create preview button and add it to the new button group + QList buttons; + HbInputButton *previewItem = 0; + if (!item->icon(HbInputButton::ButtonIconIndexPrimary).isNull()) { + int keyCode = -1; + if (!item->text(HbInputButton::ButtonTextIndexPrimary).isEmpty()) { + keyCode = item->text(HbInputButton::ButtonTextIndexPrimary).at(0).unicode(); + } + previewItem = new HbInputButton(keyCode, QPoint(0, 0)); + previewItem->setIcon(item->icon(HbInputButton::ButtonIconIndexPrimary), HbInputButton::ButtonIconIndexPrimary); + } else if (!item->text(HbInputButton::ButtonTextIndexPrimary).isEmpty()) { + previewItem = new HbInputButton(item->text(HbInputButton::ButtonTextIndexPrimary).at(0).unicode(), QPoint(0, 0)); + previewItem->setText(item->text(HbInputButton::ButtonTextIndexPrimary), HbInputButton::ButtonTextIndexPrimary); + } previewItem->setType(HbInputButton::ButtonTypeLabel); - previewItem->setText(item->text(HbInputButton::ButtonTextIndexPrimary), HbInputButton::ButtonTextIndexPrimary); buttons.append(previewItem); group->setButtons(buttons); qreal cellWidth = q->boundingRect().width() / mGridSize.width(); qreal cellHeight = q->boundingRect().height() / mGridSize.height(); + // Calculate text size QFont font = HbFontSpec(HbFontSpec::Primary).font(); - font.setPixelSize(fontSize(ButtonTextTypeLabel)); + font.setPixelSize(int(fontSize(HbInputButtonGroup::ButtonTextTypeLabel))); QFontMetricsF fontMetrics(font); qreal textWidth = fontMetrics.width(item->text(HbInputButton::ButtonTextIndexPrimary)); + // Calculate preview size qreal width = textWidth + HbPreviewMarginInUnits * mUnitValue; - if (width < HbPreviewWidthInUnits * mUnitValue) { + if (!item->icon(HbInputButton::ButtonIconIndexPrimary).isNull()) { + width = item->boundingRect().width(); + } else if (width < HbPreviewWidthInUnits * mUnitValue) { width = HbPreviewWidthInUnits * mUnitValue; } qreal height = HbPreviewHeightInUnits * mUnitValue; - qreal x = (item->position().x() + 0.5 * item->size().width()) * cellWidth - 0.5 * width; + qreal x = q->scenePos().x() + (item->position().x() + 0.5 * item->size().width()) * cellWidth - 0.5 * width; if (x < 0) { x = 0; } else if (x + width > q->boundingRect().width()) { x = q->boundingRect().width() - width; } - qreal y = item->position().y() * cellHeight - height; + qreal y = q->scenePos().y() + item->position().y() * cellHeight - height; group->setGeometry(QRectF(x, y, width, height)); if (q->parentItem()) { group->setZValue(q->parentItem()->zValue() + 1); } - - QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; - effect->setBlurRadius(8); - group->setGraphicsEffect(effect); group->setButtonBorderSize(0); HbFrameDrawer *drawer = HbFrameDrawerPool::get(HbPreviewBackground, HbFrameDrawer::ThreePiecesHorizontal, QSizeF(width, height)); @@ -361,7 +381,7 @@ } } -void HbInputButtonGroupPrivate::hideButtonPreview(HbInputButton * const item) +void HbInputButtonGroupPrivate::hideButtonPreview(HbInputButton *const item) { int index = mButtonData.indexOf(item); if (mButtonPreview.contains(index)) { @@ -369,18 +389,29 @@ } } -void HbInputButtonGroupPrivate::showCharacterSelectionPreview(HbInputButton * const item) +void HbInputButtonGroupPrivate::showCharacterSelectionPreview(HbInputButton *const item) { Q_Q(HbInputButtonGroup); + // Character preview should be shown only for non-function buttons which contains more + // than one character if preview is enabled for this button group if (mCharacterSelectionPreviewEnabled && item->type() != HbInputButton::ButtonTypeFunction && item->mappedCharacters().count() > 1) { - + + if (item->type() == HbInputButton::ButtonTypeFunction) { + HbWidgetFeedback::triggered(q, Hb::InstantLongPressed, Hb::ModifierInputFunctionButton); + } + else { + HbWidgetFeedback::triggered(q, Hb::InstantLongPressed); + } + mProbabilities.clear(); q->cancelButtonPress(); - + + // Create and initialize character preview if (!mCharacterSelectionPreview) { mCharacterSelectionPreview = new HbDialog(); + HbInputRegionCollector::instance()->attach(mCharacterSelectionPreview); mCharacterSelectionPreview->setModal(true); mCharacterSelectionPreview->setBackgroundFaded(false); mCharacterSelectionPreview->setTimeout(HbPopup::NoTimeout); @@ -389,32 +420,32 @@ mCharacterSelectionPreview->setActive(false); qreal margin = HbPreviewMarginInUnits * mUnitValue * 0.5; mCharacterSelectionPreview->setContentsMargins(margin, 0, margin, 0); - QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; - effect->setBlurRadius(8); - mCharacterSelectionPreview->setGraphicsEffect(effect); } HbInputButtonGroup *group = new HbInputButtonGroup(QSize(item->mappedCharacters().count(), 1)); - QObject::connect(group, SIGNAL(buttonPressed(const QKeyEvent&)), q, SLOT(emitButtonPressed(const QKeyEvent&))); - QObject::connect(group, SIGNAL(buttonDoublePressed(const QKeyEvent&)), q, SLOT(emitButtonDoublePressed(const QKeyEvent&))); - QObject::connect(group, SIGNAL(buttonReleased(const QKeyEvent&)), q, SLOT(emitButtonReleased(const QKeyEvent&))); - QObject::connect(group, SIGNAL(buttonLongPressed(const QKeyEvent&)), q, SLOT(emitButtonLongPressed(const QKeyEvent&))); - QObject::connect(group, SIGNAL(pressedButtonChanged(const QKeyEvent&, const QKeyEvent&)), q, SLOT(emitPressedButtonChanged(const QKeyEvent&, const QKeyEvent&))); - + QObject::connect(group, SIGNAL(buttonPressed(const QKeyEvent &)), q, SLOT(emitButtonPressed(const QKeyEvent &))); + QObject::connect(group, SIGNAL(buttonDoublePressed(const QKeyEvent &)), q, SLOT(emitButtonDoublePressed(const QKeyEvent &))); + QObject::connect(group, SIGNAL(buttonReleased(const QKeyEvent &)), q, SLOT(emitButtonReleased(const QKeyEvent &))); + QObject::connect(group, SIGNAL(buttonLongPressed(const QKeyEvent &)), q, SLOT(emitButtonLongPressed(const QKeyEvent &))); + QObject::connect(group, SIGNAL(pressedButtonChanged(const QKeyEvent &, const QKeyEvent &)), q, SLOT(emitPressedButtonChanged(const QKeyEvent &, const QKeyEvent &))); + qreal cellWidth = q->boundingRect().width() / mGridSize.width(); qreal cellHeight = q->boundingRect().height() / mGridSize.height(); + // Calculate text size QFont font = HbFontSpec(HbFontSpec::Primary).font(); - font.setPixelSize(fontSize(ButtonTextTypeLabel)); + font.setPixelSize(int(fontSize(HbInputButtonGroup::ButtonTextTypeLabel))); QFontMetricsF fontMetrics(font); qreal textWidth = fontMetrics.width(item->mappedCharacters()); - qreal width = textWidth + HbPreviewMarginInUnits * mUnitValue * item->mappedCharacters().count(); + // Calculate preview size + qreal width = textWidth + HbPreviewMarginInUnits * mUnitValue * (item->mappedCharacters().count() - 1); qreal height = HbPreviewHeightInUnits * mUnitValue; qreal x = q->scenePos().x() + (item->position().x() + 0.5 * item->size().width()) * cellWidth; qreal y = q->scenePos().y() + item->position().y() * cellHeight; - QList buttons; + // Create character preview button and add it to the created button group + QList buttons; for (int i = 0; i < item->mappedCharacters().count(); ++i) { HbInputButton *previewItem = new HbInputButton(item->keyCode(), QPoint(i, 0)); previewItem->setType(HbInputButton::ButtonTypeLabel); @@ -424,7 +455,7 @@ group->setButtons(buttons); group->setButtonBorderSize(0); - mCharacterSelectionPreview->setPreferredSize(QSizeF(width, height)); + group->setPreferredSize(QSizeF(width, height)); mCharacterSelectionPreview->setPreferredPos(QPointF(x, y), HbPopup::BottomEdgeCenter); mCharacterSelectionPreview->setContentWidget(group); @@ -440,29 +471,35 @@ { Q_Q(HbInputButtonGroup); + // Ignore press events outside button group if (!(position.x() >= 0 && position.x() < q->boundingRect().width() && - position.y() >= 0 && position.y() < q->boundingRect().height())) { + position.y() >= 0 && position.y() < q->boundingRect().height())) { return; } int column = static_cast(position.x() / (q->boundingRect().width() / mGridSize.width())); int row = static_cast(position.y() / (q->boundingRect().height() / mGridSize.height())); - int index = mButtonGridPositions.value(QPair(column, row)); + int index = mButtonGridPositions.value(QPair(column, row), -1); if (index >= 0 && index < mButtonData.count()) { HbInputButton *item = mButtonData.at(index); - if ((item->state() != HbInputButton::ButtonStateReleased && - item->state() != HbInputButton::ButtonStateLatched) || + if ((item->state() != HbInputButton::ButtonStateReleased && + item->state() != HbInputButton::ButtonStateLatched) || (mCharacterSelectionPreview && mCharacterSelectionPreview->isVisible())) { if (item->state() == HbInputButton::ButtonStateDisabled) { startLongPress(index); } return; } - - HbWidgetFeedback::triggered(q, Hb::InstantPressed); + + if (item->type() == HbInputButton::ButtonTypeFunction) { + HbWidgetFeedback::triggered(q, Hb::InstantPressed, Hb::ModifierInputFunctionButton); + } + else { + HbWidgetFeedback::triggered(q, Hb::InstantPressed); + } item->setState(HbInputButton::ButtonStatePressed); updateGraphics(QSizeF(q->boundingRect().width(), q->boundingRect().height())); @@ -490,21 +527,22 @@ { Q_Q(HbInputButtonGroup); + // Ignore double press events outside button group if (!(position.x() >= 0 && position.x() < q->boundingRect().width() && - position.y() >= 0 && position.y() < q->boundingRect().height())) { + position.y() >= 0 && position.y() < q->boundingRect().height())) { return; } int column = static_cast(position.x() / (q->boundingRect().width() / mGridSize.width())); int row = static_cast(position.y() / (q->boundingRect().height() / mGridSize.height())); - int index = mButtonGridPositions.value(QPair(column, row)); + int index = mButtonGridPositions.value(QPair(column, row), -1); if (index >= 0 && index < mButtonData.count()) { HbInputButton *item = mButtonData.at(index); - if ((item->state() != HbInputButton::ButtonStateReleased && - item->state() != HbInputButton::ButtonStateLatched) || + if ((item->state() != HbInputButton::ButtonStateReleased && + item->state() != HbInputButton::ButtonStateLatched) || (mCharacterSelectionPreview && mCharacterSelectionPreview->isVisible())) { if (item->state() == HbInputButton::ButtonStateDisabled) { startLongPress(index); @@ -512,7 +550,12 @@ return; } - HbWidgetFeedback::triggered(q, Hb::InstantPressed); + if (item->type() == HbInputButton::ButtonTypeFunction) { + HbWidgetFeedback::triggered(q, Hb::InstantPressed, Hb::ModifierInputFunctionButton); + } + else { + HbWidgetFeedback::triggered(q, Hb::InstantPressed); + } item->setState(HbInputButton::ButtonStatePressed); updateGraphics(QSizeF(q->boundingRect().width(), q->boundingRect().height())); @@ -545,14 +588,15 @@ int newColumn = static_cast(newPosition.x() / (q->boundingRect().width() / mGridSize.width())); int newRow = static_cast(newPosition.y() / (q->boundingRect().height() / mGridSize.height())); - int oldIndex = mButtonGridPositions.value(QPair(oldColumn, oldRow)); - int newIndex = mButtonGridPositions.value(QPair(newColumn, newRow)); + int oldIndex = mButtonGridPositions.value(QPair(oldColumn, oldRow), -1); + int newIndex = mButtonGridPositions.value(QPair(newColumn, newRow), -1); + // Check if movement happens inside button group if (newPosition.x() >= 0 && newPosition.x() < q->boundingRect().width() && newPosition.y() >= 0 && newPosition.y() < q->boundingRect().height() && oldPosition.x() >= 0 && oldPosition.x() < q->boundingRect().width() && oldPosition.y() >= 0 && oldPosition.y() < q->boundingRect().height()) { - + if (oldIndex != newIndex) { releaseEvent(oldPosition, false); pressEvent(newPosition, false); @@ -573,6 +617,9 @@ q->emitPressedButtonChanged(releaseEvent, pressEvent); } } else { + // Move event came from outside button group so create new release and press events + // for old and new position. If one of the positions is inside button group + // a new event will get generated. releaseEvent(oldPosition, false); pressEvent(newPosition); } @@ -582,15 +629,16 @@ { Q_Q(HbInputButtonGroup); + // Ignore release events outside button group if (!(position.x() >= 0 && position.x() < q->boundingRect().width() && - position.y() >= 0 && position.y() < q->boundingRect().height())) { + position.y() >= 0 && position.y() < q->boundingRect().height())) { return; } int column = static_cast(position.x() / (q->boundingRect().width() / mGridSize.width())); int row = static_cast(position.y() / (q->boundingRect().height() / mGridSize.height())); - int index = mButtonGridPositions.value(QPair(column, row)); + int index = mButtonGridPositions.value(QPair(column, row), -1); if (index >= 0 && index < mButtonData.count()) { HbInputButton *item = mButtonData.at(index); @@ -601,7 +649,12 @@ return; } - HbWidgetFeedback::triggered(q, Hb::InstantReleased); + if (item->type() == HbInputButton::ButtonTypeFunction) { + HbWidgetFeedback::triggered(q, Hb::InstantReleased, Hb::ModifierInputFunctionButton); + } + else { + HbWidgetFeedback::triggered(q, Hb::InstantReleased); + } item->setState(HbInputButton::ButtonStateReleased); updateGraphics(QSizeF(q->boundingRect().width(), q->boundingRect().height())); @@ -615,9 +668,15 @@ hideButtonPreview(item); if (emitSignal) { - HbWidgetFeedback::triggered(q, Hb::InstantClicked); + if (item->type() == HbInputButton::ButtonTypeFunction) { + HbWidgetFeedback::triggered(q, Hb::InstantClicked, Hb::ModifierInputFunctionButton); + } + else { + HbWidgetFeedback::triggered(q, Hb::InstantClicked); + } int actionIndex = item->keyCode() - HbInputButton::ButtonKeyCodeCustom; if (actionIndex >= 0 && actionIndex < mCustomActions.count()) { + emit q->aboutToActivateCustomAction(mCustomActions.at(actionIndex)); mCustomActions.at(actionIndex)->activate(QAction::Trigger); } else { calculateButtonProbabilities(position); @@ -645,38 +704,52 @@ if (index >= 0 && index < mButtonData.count()) { HbInputButton *item = mButtonData.at(index); + // Handle autorepeating buttons if (item->autoRepeat() && (item->state() == HbInputButton::ButtonStatePressed || - item->state() == HbInputButton::ButtonStateLatched)) { + item->state() == HbInputButton::ButtonStateLatched)) { mLongPressButtons.append(index); mLongPressTimers.append(timer); timer->start(HbAutoRepeatTimeout); - HbWidgetFeedback::triggered(q, Hb::InstantKeyRepeated); + if (item->type() == HbInputButton::ButtonTypeFunction) { + HbWidgetFeedback::triggered(q, Hb::InstantKeyRepeated, Hb::ModifierInputFunctionButton); + } + else { + HbWidgetFeedback::triggered(q, Hb::InstantKeyRepeated); + } QString text; if (item->type() == HbInputButton::ButtonTypeLabel) { text = item->text(HbInputButton::ButtonTextIndexPrimary); } - QKeyEvent releaeEvent(QEvent::KeyRelease, item->keyCode(), Qt::NoModifier, text, true); + int keycode = item->keyCode(); + QKeyEvent releaeEvent(QEvent::KeyRelease, keycode, Qt::NoModifier, text, true); q->emitButtonReleased(releaeEvent); - QKeyEvent pressEvent(QEvent::KeyPress, item->keyCode(), Qt::NoModifier, text, true); + QKeyEvent pressEvent(QEvent::KeyPress, keycode, Qt::NoModifier, text, true); q->emitButtonPressed(pressEvent); } else { - if (mCharacterSelectionPreviewEnabled) { + // Buttons that doesn't support autorepeat can either show character preview + // or generate a long press + if (mCharacterSelectionPreviewEnabled && item->type() != HbInputButton::ButtonTypeFunction + && item->mappedCharacters().count() > 1) { showCharacterSelectionPreview(item); + } else { + if (item->type() == HbInputButton::ButtonTypeFunction) { + HbWidgetFeedback::triggered(q, Hb::InstantLongPressed, Hb::ModifierInputFunctionButton); + } + else { + HbWidgetFeedback::triggered(q, Hb::InstantLongPressed); + } + + QString text; + if (item->type() == HbInputButton::ButtonTypeLabel) { + text = item->text(HbInputButton::ButtonTextIndexPrimary); + } + QKeyEvent event(QEvent::KeyPress, item->keyCode(), Qt::NoModifier, text, true); + q->emitButtonLongPressed(event); } - - HbWidgetFeedback::triggered(q, Hb::InstantLongPressed); - delete timer; - - QString text; - if (item->type() == HbInputButton::ButtonTypeLabel) { - text = item->text(HbInputButton::ButtonTextIndexPrimary); - } - QKeyEvent event(QEvent::KeyPress, item->keyCode(), Qt::NoModifier, text, true); - q->emitButtonLongPressed(event); } } } @@ -693,8 +766,9 @@ QRectF touchArea = QRectF(position.x() - 0.5 * cellWidth, position.y() - 0.5 * cellHeight, HbTouchAreaSizeInUnits * mUnitValue, HbTouchAreaSizeInUnits * mUnitValue); + // Calculate probabilities based on the intersection area of "touch area" and button area qreal probabilities = 0; - foreach (HbInputButton *button, mButtonData) { + foreach(HbInputButton *button, mButtonData) { QRectF intersection = button->boundingRect().intersected(touchArea); if (intersection.isValid()) { @@ -723,9 +797,9 @@ int typeIndex = index % HbTextTypeCount / HbInputButton::ButtonStateCount; if (typeIndex == HbInputButton::ButtonTypeLabel) { - font.setPixelSize(fontSize(ButtonTextTypeLabel)); + font.setPixelSize(int(fontSize(HbInputButtonGroup::ButtonTextTypeLabel))); } else { - font.setPixelSize(fontSize(ButtonTextTypeSingle)); + font.setPixelSize(int(fontSize(HbInputButtonGroup::ButtonTextTypeSingle))); } mTextLayouts[index] = new QTextLayout(textContent.value(index), font); @@ -734,7 +808,7 @@ // Create text line for each button with primary text and correct type and state. Layout it // to correct position mTextLayouts.at(index)->beginLayout(); - foreach (HbInputButton *item, mButtonData) { + foreach(HbInputButton *item, mButtonData) { int layoutIndex = item->type() * HbInputButton::ButtonStateCount + item->state() + HbTextTypeCount; if (!mEnabled) { layoutIndex = item->type() * HbInputButton::ButtonStateCount + HbInputButton::ButtonStateDisabled + HbTextTypeCount; @@ -747,14 +821,14 @@ item->icon(HbInputButton::ButtonIconIndexSecondarySecondRow).isNull()) { qreal textWidth = fontMetrics.width(item->text(HbInputButton::ButtonTextIndexPrimary)); qreal textHeight = fontMetrics.height(); - + QTextLine line = mTextLayouts.at(index)->createLine(); - line.setNumColumns(1); + line.setNumColumns(item->text(HbInputButton::ButtonTextIndexPrimary).length()); if (typeIndex == HbInputButton::ButtonTypeLabel) { - layoutTextLine(ButtonTextTypeLabel, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); + layoutTextLine(HbInputButtonGroup::ButtonTextTypeLabel, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); } else { - layoutTextLine(ButtonTextTypeSingle, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); + layoutTextLine(HbInputButtonGroup::ButtonTextTypeSingle, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); } } } @@ -768,7 +842,7 @@ qreal cellHeight = size.height() / mGridSize.height(); QFont font = HbFontSpec(HbFontSpec::Primary).font(); - font.setPixelSize(fontSize(ButtonTextTypePrimary)); + font.setPixelSize(int(fontSize(HbInputButtonGroup::ButtonTextTypePrimary))); mTextLayouts[index] = new QTextLayout(textContent.value(index), font); QFontMetricsF fontMetrics(font); @@ -776,7 +850,7 @@ // Create text line for each button with primary text and correct type and state. Layout it // to correct position mTextLayouts.at(index)->beginLayout(); - foreach (HbInputButton *item, mButtonData) { + foreach(HbInputButton *item, mButtonData) { int layoutIndex = item->type() * HbInputButton::ButtonStateCount + item->state(); if (!mEnabled) { layoutIndex = item->type() * HbInputButton::ButtonStateCount + HbInputButton::ButtonStateDisabled; @@ -784,16 +858,16 @@ if (index == layoutIndex && !item->text(HbInputButton::ButtonTextIndexPrimary).isEmpty() && item->icon(HbInputButton::ButtonIconIndexPrimary).isNull() && !(item->text(HbInputButton::ButtonTextIndexSecondaryFirstRow).isEmpty() && - item->icon(HbInputButton::ButtonIconIndexSecondaryFirstRow).isNull() && - item->text(HbInputButton::ButtonTextIndexSecondarySecondRow).isEmpty() && - item->icon(HbInputButton::ButtonIconIndexSecondarySecondRow).isNull())) { + item->icon(HbInputButton::ButtonIconIndexSecondaryFirstRow).isNull() && + item->text(HbInputButton::ButtonTextIndexSecondarySecondRow).isEmpty() && + item->icon(HbInputButton::ButtonIconIndexSecondarySecondRow).isNull())) { qreal textWidth = fontMetrics.width(item->text(HbInputButton::ButtonTextIndexPrimary)); qreal textHeight = fontMetrics.height(); QTextLine line = mTextLayouts.at(index)->createLine(); - line.setNumColumns(1); + line.setNumColumns(item->text(HbInputButton::ButtonTextIndexPrimary).length()); - layoutTextLine(ButtonTextTypePrimary, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); + layoutTextLine(HbInputButtonGroup::ButtonTextTypePrimary, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); } } mTextLayouts.at(index)->endLayout(); @@ -802,11 +876,8 @@ void HbInputButtonGroupPrivate::createSecondaryTextLayout(int index, const QHash &textContent, const QSizeF &size) { - qreal cellWidth = size.width() / mGridSize.width(); - qreal cellHeight = size.height() / mGridSize.height(); - QFont font = HbFontSpec(HbFontSpec::Primary).font(); - font.setPixelSize(fontSize(ButtonTextTypeSecondaryFirstRow)); + font.setPixelSize(int(fontSize(HbInputButtonGroup::ButtonTextTypeSecondaryFirstRow))); mTextLayouts[index] = new QTextLayout(textContent.value(index), font); QFontMetricsF fontMetrics(font); @@ -814,60 +885,96 @@ // Create text line for each button with secondary first row or second row text and correct type and state. // Layout it to correct position mTextLayouts.at(index)->beginLayout(); - foreach (HbInputButton *item, mButtonData) { + foreach(HbInputButton *item, mButtonData) { int layoutIndex = item->type() * HbInputButton::ButtonStateCount + item->state() + HbTextTypeCount * 2; if (!mEnabled) { layoutIndex = item->type() * HbInputButton::ButtonStateCount + HbInputButton::ButtonStateDisabled + HbTextTypeCount * 2; } if (index == layoutIndex) { - if (!item->text(HbInputButton::ButtonTextIndexSecondaryFirstRow).isEmpty() && - item->icon(HbInputButton::ButtonIconIndexSecondaryFirstRow).isNull()) { - qreal textWidth = fontMetrics.width(item->text(HbInputButton::ButtonTextIndexSecondaryFirstRow)); - qreal textHeight = fontMetrics.height(); - - QTextLine line = mTextLayouts.at(index)->createLine(); - line.setNumColumns(1); - - layoutTextLine(ButtonTextTypeSecondaryFirstRow, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); - } + // Layout secondary text for first row + layoutSecondaryText(index, item, fontMetrics, size, + HbInputButton::ButtonTextIndexSecondaryFirstRow, + HbInputButton::ButtonIconIndexSecondaryFirstRow, + HbInputButton::ButtonTextIndexSecondarySecondRow, + HbInputButton::ButtonIconIndexSecondarySecondRow, + HbInputButtonGroup::ButtonTextTypeSecondaryFirstRow); + - if (!item->text(HbInputButton::ButtonTextIndexSecondarySecondRow).isEmpty() && - item->icon(HbInputButton::ButtonIconIndexSecondarySecondRow).isNull()) { - qreal textWidth = fontMetrics.width(item->text(HbInputButton::ButtonTextIndexSecondarySecondRow)); - qreal textHeight = fontMetrics.height(); - - QTextLine line = mTextLayouts.at(index)->createLine(); - line.setNumColumns(1); - - layoutTextLine(ButtonTextTypeSecondarySecondRow, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); - } + // Layout secondary text for second row + layoutSecondaryText(index, item, fontMetrics, size, + HbInputButton::ButtonTextIndexSecondarySecondRow, + HbInputButton::ButtonIconIndexSecondarySecondRow, + HbInputButton::ButtonTextIndexSecondaryFirstRow, + HbInputButton::ButtonIconIndexSecondaryFirstRow, + HbInputButtonGroup::ButtonTextTypeSecondarySecondRow); } } mTextLayouts.at(index)->endLayout(); mTextLayouts.at(index)->setCacheEnabled(true); } -void HbInputButtonGroupPrivate::layoutTextLine(HbInputButtonTextType textType, const HbInputButton *button, const QSizeF &cellSize, - QTextLine &textLine, const QSizeF &textSize) +void HbInputButtonGroupPrivate::layoutSecondaryText(int index, HbInputButton *item, QFontMetricsF &fontMetrics, const QSizeF &size, + HbInputButton::HbInputButtonTextIndex firstTextIndex, + HbInputButton::HbInputButtonIconIndex firstIconIndex, + HbInputButton::HbInputButtonTextIndex secondTextIndex, + HbInputButton::HbInputButtonIconIndex secondIconIndex, + HbInputButtonGroup::HbInputButtonTextType textType) +{ + qreal cellWidth = size.width() / mGridSize.width(); + qreal cellHeight = size.height() / mGridSize.height(); + + if (!item->text(firstTextIndex).isEmpty() && + item->icon(firstIconIndex).isNull()) { + qreal textWidth = fontMetrics.width(item->text(firstTextIndex)); + qreal textHeight = fontMetrics.height(); + + QTextLine line = mTextLayouts.at(index)->createLine(); + line.setNumColumns(item->text(firstTextIndex).length()); + + if (item->text(HbInputButton::ButtonTextIndexPrimary).isEmpty() && + item->icon(HbInputButton::ButtonIconIndexPrimary).isNull() && + item->text(secondTextIndex).isEmpty() && + item->icon(secondIconIndex).isNull()) { + layoutTextLine(HbInputButtonGroup::ButtonTextTypeSingle, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); + } else { + layoutTextLine(textType, item, QSizeF(cellWidth, cellHeight), line, QSizeF(textWidth, textHeight)); + } + } +} + +void HbInputButtonGroupPrivate::layoutTextLine(HbInputButtonGroup::HbInputButtonTextType textType, const HbInputButton *button, const QSizeF &cellSize, + QTextLine &textLine, const QSizeF &textSize) { qreal textPositionX = 0.0; qreal textPositionY = 0.0; - if (textType == ButtonTextTypeSingle || - textType == ButtonTextTypeLabel) { - textPositionX = (button->position().x() + 0.5 * button->size().width()) * cellSize.width() - 0.5 * textSize.width(); - textPositionY = (button->position().y() + 0.5 * button->size().height()) * cellSize.height() - 0.5 * textSize.height(); - } else if (textType == ButtonTextTypePrimary) { - textPositionX = button->position().x() * cellSize.width() + HbHorizontalMarginInUnits * mUnitValue + mButtonBorderSize; - textPositionY = (button->position().y() + 0.5 * button->size().height()) * cellSize.height() - 0.5 * textSize.height(); - } else if (textType == ButtonTextTypeSecondaryFirstRow) { - textPositionX = (button->position().x() + button->size().width()) * cellSize.width() - - textSize.width() - HbHorizontalMarginInUnits * mUnitValue - mButtonBorderSize; - textPositionY = (button->position().y() + button->size().height()) * cellSize.height() - - textSize.height() - HbVerticalMarginInUnits * mUnitValue - mButtonBorderSize; - } else if (textType == ButtonTextTypeSecondarySecondRow) { - textPositionX = (button->position().x() + button->size().width()) * cellSize.width() - - textSize.width() - HbHorizontalMarginInUnits * mUnitValue - mButtonBorderSize; - textPositionY = button->position().y() * cellSize.height() + HbVerticalMarginInUnits * mUnitValue + mButtonBorderSize; + + switch(textType) { + case HbInputButtonGroup::ButtonTextTypeSingle: + case HbInputButtonGroup::ButtonTextTypeLabel: + textPositionX = (button->position().x() + 0.5 * button->size().width()) * cellSize.width() - 0.5 * textSize.width(); + textPositionY = (button->position().y() + 0.5 * button->size().height()) * cellSize.height() - 0.5 * textSize.height(); + break; + + case HbInputButtonGroup::ButtonTextTypePrimary: + textPositionX = button->position().x() * cellSize.width() + HbHorizontalMarginInUnits * mUnitValue + mButtonBorderSize; + textPositionY = (button->position().y() + 0.5 * button->size().height()) * cellSize.height() - 0.5 * textSize.height(); + break; + + case HbInputButtonGroup::ButtonTextTypeSecondaryFirstRow: + textPositionX = (button->position().x() + button->size().width()) * cellSize.width() - + textSize.width() - HbHorizontalMarginInUnits * mUnitValue - mButtonBorderSize; + textPositionY = (button->position().y() + button->size().height()) * cellSize.height() - + textSize.height() - HbVerticalMarginInUnits * mUnitValue - mButtonBorderSize; + break; + + case HbInputButtonGroup::ButtonTextTypeSecondarySecondRow: + textPositionX = (button->position().x() + button->size().width()) * cellSize.width() - + textSize.width() - HbHorizontalMarginInUnits * mUnitValue - mButtonBorderSize; + textPositionY = button->position().y() * cellSize.height() + HbVerticalMarginInUnits * mUnitValue + mButtonBorderSize; + break; + + default: + break; } textLine.setPosition(QPointF(textPositionX, textPositionY)); } @@ -930,19 +1037,25 @@ return QString(""); } -qreal HbInputButtonGroupPrivate::fontSize(HbInputButtonTextType textType) +qreal HbInputButtonGroupPrivate::fontSize(HbInputButtonGroup::HbInputButtonTextType textType) { - if (textType == ButtonTextTypeSingle) { - return HbTextSizeInUnits * mUnitValue; - } else if (textType == ButtonTextTypePrimary) { - return HbPrimaryTextSizeInUnits * mUnitValue; - } else if (textType == ButtonTextTypeSecondaryFirstRow || - textType == ButtonTextTypeSecondarySecondRow) { - return HbSecondaryTextSizeInUnits * mUnitValue; - } else if (textType == ButtonTextTypeLabel) { - return HbLabelTextSizeInUnits * mUnitValue; + switch(textType) { + case HbInputButtonGroup::ButtonTextTypeSingle: + return HbTextSizeInUnits * mUnitValue; + + case HbInputButtonGroup::ButtonTextTypePrimary: + return HbPrimaryTextSizeInUnits * mUnitValue; + + case HbInputButtonGroup::ButtonTextTypeSecondaryFirstRow: + case HbInputButtonGroup::ButtonTextTypeSecondarySecondRow: + return HbSecondaryTextSizeInUnits * mUnitValue; + + case HbInputButtonGroup::ButtonTextTypeLabel: + return HbLabelTextSizeInUnits * mUnitValue; + + default: + return 0; } - return 0; } void HbInputButtonGroupPrivate::startLongPress(int index) @@ -967,13 +1080,22 @@ } } +void HbInputButtonGroupPrivate::_q_customActionDestroyed(QObject *object) +{ + Q_Q(HbInputButtonGroup); + + HbAction *action = static_cast(object); + mCustomActions.removeAll(action); + q->updateCustomButtons(); +} + /// @endcond /*! Constructor */ HbInputButtonGroup::HbInputButtonGroup(QGraphicsItem *parent) - : HbWidget(*new HbInputButtonGroupPrivate, parent) + : HbWidget(*new HbInputButtonGroupPrivate, parent) { Q_D(HbInputButtonGroup); @@ -986,7 +1108,7 @@ Constructor */ HbInputButtonGroup::HbInputButtonGroup(HbInputButtonGroupPrivate &dd, QGraphicsItem *parent) - : HbWidget(dd, parent) + : HbWidget(dd, parent) { Q_D(HbInputButtonGroup); @@ -999,14 +1121,14 @@ Constructor */ HbInputButtonGroup::HbInputButtonGroup(const QSize &size, QGraphicsItem *parent) - : HbWidget(*new HbInputButtonGroupPrivate, parent) + : HbWidget(*new HbInputButtonGroupPrivate, parent) { Q_D(HbInputButtonGroup); d->mUnitValue = HbDeviceProfile::profile(mainWindow()).unitValue(); setAcceptedMouseButtons(Qt::LeftButton); - + setGridSize(size); } @@ -1014,14 +1136,14 @@ Constructor */ HbInputButtonGroup::HbInputButtonGroup(HbInputButtonGroupPrivate &dd, const QSize &size, QGraphicsItem *parent) - : HbWidget(dd, parent) + : HbWidget(dd, parent) { Q_D(HbInputButtonGroup); d->mUnitValue = HbDeviceProfile::profile(mainWindow()).unitValue(); setAcceptedMouseButtons(Qt::LeftButton); - + setGridSize(size); } @@ -1070,17 +1192,17 @@ /*! Sets the button data and updates button group based on the new data. -Takes ownership of the button items. Button items that are not in the new list +Takes ownership of the button items. Button items that are not in the new list will be destroyed. \sa buttons \sa button */ -void HbInputButtonGroup::setButtons(const QList &data) +void HbInputButtonGroup::setButtons(const QList &data) { Q_D(HbInputButtonGroup); - foreach (HbInputButton *button, d->mButtonData) { + foreach(HbInputButton *button, d->mButtonData) { if (!data.contains(button)) { delete button; } @@ -1118,7 +1240,9 @@ d->mButtonData.removeAt(index); } } else { - d->mButtonData.append(data); + if (data) { + d->mButtonData.append(data); + } } setButtons(d->mButtonData); } @@ -1136,7 +1260,10 @@ { Q_D(HbInputButtonGroup); - int index = d->mButtonGridPositions.value(QPair(column, row)); + int index = -1; + if (d->mButtonGridPositions.contains(QPair(column, row))) { + index = d->mButtonGridPositions.value(QPair(column, row), -1); + } setButton(data, index); } @@ -1161,7 +1288,7 @@ break; } } - + setButton(data, index); } @@ -1172,7 +1299,7 @@ \sa setButtons \sa setButton */ -QList HbInputButtonGroup::buttons() const +QList HbInputButtonGroup::buttons() const { Q_D(const HbInputButtonGroup); @@ -1206,8 +1333,11 @@ HbInputButton *HbInputButtonGroup::button(int column, int row) const { Q_D(const HbInputButtonGroup); - - int index = d->mButtonGridPositions.value(QPair(column, row)); + + int index = -1; + if (d->mButtonGridPositions.contains(QPair(column, row))) { + index = d->mButtonGridPositions.value(QPair(column, row), -1); + } return button(index); } @@ -1222,7 +1352,7 @@ { Q_D(const HbInputButtonGroup); - foreach (HbInputButton *button, d->mButtonData) { + foreach(HbInputButton *button, d->mButtonData) { if (button->keyCode() == keyCode) { return button; } @@ -1237,16 +1367,18 @@ \sa customButtonActions */ -void HbInputButtonGroup::setCustomButtonActions(const QList &actions) +void HbInputButtonGroup::setCustomButtonActions(const QList &actions) { Q_D(HbInputButtonGroup); disconnect(this, SLOT(updateCustomButtons())); + disconnect(this, SLOT(_q_customActionDestroyed(QObject *))); d->mCustomActions = actions; - foreach (HbAction *action, d->mCustomActions) { + foreach(HbAction *action, d->mCustomActions) { connect(action, SIGNAL(changed()), this, SLOT(updateCustomButtons())); + connect(action, SIGNAL(destroyed(QObject *)), this, SLOT(_q_customActionDestroyed(QObject *))); } d->updateCustomActions(); @@ -1261,7 +1393,7 @@ \sa setCustomButtonActions */ -QList HbInputButtonGroup::customButtonActions() const +QList HbInputButtonGroup::customButtonActions() const { Q_D(const HbInputButtonGroup); @@ -1377,7 +1509,7 @@ bool HbInputButtonGroup::isMultiTouchEnabled() const { Q_D(const HbInputButtonGroup); - + return d->mMultiTouchEnabled; } @@ -1394,6 +1526,16 @@ } /*! +Returns font size for given text type +*/ +qreal HbInputButtonGroup::fontSize(HbInputButtonTextType textType) +{ + Q_D(HbInputButtonGroup); + + return d->fontSize(textType); +} + +/*! Returns all possible buttons the user could have intended to press for the last registered touch along with their corresponding probabilities. */ @@ -1434,13 +1576,14 @@ /*! Draws the button group. */ -void HbInputButtonGroup::paint(QPainter* painter, const QStyleOptionGraphicsItem *option, QWidget *widget) +void HbInputButtonGroup::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); Q_UNUSED(widget); Q_D(HbInputButtonGroup); + // Draw button group background if (d->mBackground) { d->mBackground->paint(painter, QRectF(0, 0, boundingRect().width(), boundingRect().height())); } @@ -1451,6 +1594,7 @@ for (int i = 0; i < d->mButtonData.count(); ++i) { HbInputButton *item = d->mButtonData.at(i); + // Draw button backgrounds if (d->mButtonDrawers.at(i)) { qreal x = item->position().x() * cellWidth + d->mButtonBorderSize; qreal y = item->position().y() * cellHeight + d->mButtonBorderSize; @@ -1459,10 +1603,11 @@ painter->save(); painter->translate(x, y); - d->mButtonDrawers.at(i)->paint(painter, QRectF(0, 0, width, height)); + d->mButtonDrawers.at(i)->paint(painter, QRectF(0, 0, width, height)); painter->restore(); } + // Draw primary icons if (!item->icon(HbInputButton::ButtonIconIndexPrimary).isNull()) { qreal x = item->position().x() * cellWidth; qreal y = item->position().y() * cellHeight; @@ -1481,11 +1626,12 @@ item->icon(HbInputButton::ButtonIconIndexPrimary).paint(painter, QRectF(x, y, width, height)); } + // Draw secondary icons on first row if (!item->icon(HbInputButton::ButtonIconIndexSecondaryFirstRow).isNull()) { qreal x = (item->position().x() + item->size().width()) * cellWidth - - HbSecondaryIconSizeInUnits * d->mUnitValue - HbHorizontalMarginInUnits * d->mUnitValue - d->mButtonBorderSize; + HbSecondaryIconSizeInUnits * d->mUnitValue - HbHorizontalMarginInUnits * d->mUnitValue - d->mButtonBorderSize; qreal y = (item->position().y() + item->size().height()) * cellHeight - - HbSecondaryIconSizeInUnits * d->mUnitValue - HbVerticalMarginInUnits * d->mUnitValue - d->mButtonBorderSize; + HbSecondaryIconSizeInUnits * d->mUnitValue - HbVerticalMarginInUnits * d->mUnitValue - d->mButtonBorderSize; qreal width = HbSecondaryIconSizeInUnits * d->mUnitValue; qreal height = HbSecondaryIconSizeInUnits * d->mUnitValue; @@ -1493,9 +1639,10 @@ item->icon(HbInputButton::ButtonIconIndexSecondaryFirstRow).paint(painter, QRectF(x, y, width, height), Qt::KeepAspectRatio, alignment); } + // Draw secondary icons on second row if (!item->icon(HbInputButton::ButtonIconIndexSecondarySecondRow).isNull()) { qreal x = (item->position().x() + item->size().width()) * cellWidth - - HbSecondaryIconSizeInUnits * d->mUnitValue - HbHorizontalMarginInUnits * d->mUnitValue - d->mButtonBorderSize; + HbSecondaryIconSizeInUnits * d->mUnitValue - HbHorizontalMarginInUnits * d->mUnitValue - d->mButtonBorderSize; qreal y = item->position().y() * cellHeight + HbVerticalMarginInUnits * d->mUnitValue + d->mButtonBorderSize; qreal width = HbSecondaryIconSizeInUnits * d->mUnitValue; qreal height = HbSecondaryIconSizeInUnits * d->mUnitValue; @@ -1506,6 +1653,7 @@ } + // Draw button texts for (int i = 0; i < HbTextLayoutCount; ++i) { painter->save(); painter->setPen(d->mColors.at(i % HbTextTypeCount)); @@ -1531,47 +1679,70 @@ return false; } - if (event->type() == QEvent::TouchBegin) { - QTouchEvent *touchEvent = static_cast(event); - foreach (QTouchEvent::TouchPoint point, touchEvent->touchPoints()) { - if (!point.isPrimary() && d->mMultiTouchEnabled) { - d->pressEvent(point.pos()); + switch(event->type()) { + case QEvent::TouchBegin: { + QTouchEvent *touchEvent = static_cast(event); + foreach(const QTouchEvent::TouchPoint &point, touchEvent->touchPoints()) { + if (!point.isPrimary() && d->mMultiTouchEnabled) { + d->pressEvent(point.pos()); + } } + break; } - } else if (event->type() == QEvent::TouchUpdate) { - QTouchEvent *touchEvent = static_cast(event); - foreach (QTouchEvent::TouchPoint point, touchEvent->touchPoints()) { - if (!point.isPrimary() && d->mMultiTouchEnabled) { - if (point.state() & Qt::TouchPointPressed) { - d->pressEvent(point.pos()); - } else if (point.state() & Qt::TouchPointMoved) { - d->moveEvent(point.lastPos(), point.pos()); - } else if (point.state() & Qt::TouchPointReleased) { + + case QEvent::TouchUpdate: { + QTouchEvent *touchEvent = static_cast(event); + foreach(const QTouchEvent::TouchPoint &point, touchEvent->touchPoints()) { + if (!point.isPrimary() && d->mMultiTouchEnabled) { + if (point.state() & Qt::TouchPointPressed) { + d->pressEvent(point.pos()); + } else if (point.state() & Qt::TouchPointMoved) { + d->moveEvent(point.lastPos(), point.pos()); + } else if (point.state() & Qt::TouchPointReleased) { + d->releaseEvent(point.pos()); + } + } + } + break; + } + + case QEvent::TouchEnd: { + QTouchEvent *touchEvent = static_cast(event); + foreach(const QTouchEvent::TouchPoint &point, touchEvent->touchPoints()) { + if (!point.isPrimary() && d->mMultiTouchEnabled) { d->releaseEvent(point.pos()); } } + break; } - } else if (event->type() == QEvent::TouchEnd) { - QTouchEvent *touchEvent = static_cast(event); - foreach (QTouchEvent::TouchPoint point, touchEvent->touchPoints()) { - if (!point.isPrimary() && d->mMultiTouchEnabled) { - d->releaseEvent(point.pos()); - } + + case QEvent::GraphicsSceneMousePress: { + QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); + d->pressEvent(mouseEvent->pos()); + break; + } + + case QEvent::GraphicsSceneMouseDoubleClick: { + QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); + d->doublePressEvent(mouseEvent->pos()); + break; } - } else if (event->type() == QEvent::GraphicsSceneMousePress) { - QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); - d->pressEvent(mouseEvent->pos()); - } else if (event->type() == QEvent::GraphicsSceneMouseDoubleClick) { - QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); - d->doublePressEvent(mouseEvent->pos()); - } else if (event->type() == QEvent::GraphicsSceneMouseMove) { - QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); - d->moveEvent(mouseEvent->lastPos(), mouseEvent->pos()); - } else if (event->type() == QEvent::GraphicsSceneMouseRelease) { - QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); - d->releaseEvent(mouseEvent->pos()); - } else { - return HbWidget::event(event); + + case QEvent::GraphicsSceneMouseMove: { + QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); + d->moveEvent(mouseEvent->lastPos(), mouseEvent->pos()); + break; + } + + case QEvent::GraphicsSceneMouseRelease: { + QGraphicsSceneMouseEvent *mouseEvent = static_cast(event); + d->releaseEvent(mouseEvent->pos()); + cancelButtonPress(); + break; + } + + default: + return HbWidget::event(event); } return true; } @@ -1601,13 +1772,13 @@ void HbInputButtonGroup::changeEvent(QEvent *event) { Q_D(HbInputButtonGroup); - + if (event->type() == HbEvent::ThemeChanged) { if (d->mBackground) { d->mBackground->themeChanged(); } - foreach (HbFrameDrawer *drawer, d->mButtonDrawers) { + foreach(HbFrameDrawer *drawer, d->mButtonDrawers) { drawer->themeChanged(); } @@ -1714,18 +1885,19 @@ ungrabMouse(); - for (int i = 0; i < d->mButtonData.count(); ++i) { - if (d->mButtonData.at(i)->state() == HbInputButton::ButtonStatePressed) { - d->mButtonData.at(i)->setState(HbInputButton::ButtonStateReleased); - } - d->hideButtonPreview(d->mButtonData.at(i)); + // Cancel long press timers + d->mLongPressButtons.clear(); + foreach (QTimer *timer, d->mLongPressTimers) { + delete timer; + } + d->mLongPressTimers.clear(); - if (d->mLongPressButtons.contains(i)) { - int listIndex = d->mLongPressButtons.indexOf(i); - delete d->mLongPressTimers.at(listIndex); - d->mLongPressTimers.removeAt(listIndex); - d->mLongPressButtons.removeAt(listIndex); + // Release all buttons and close previews + foreach (HbInputButton *button, d->mButtonData) { + if (button->state() == HbInputButton::ButtonStatePressed) { + button->setState(HbInputButton::ButtonStateReleased); } + d->hideButtonPreview(button); } if (d->mCharacterSelectionPreview) { d->mCharacterSelectionPreview->hide(); @@ -1761,4 +1933,6 @@ update(); } +#include "moc_hbinputbuttongroup.cpp" + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputbuttongroup.h --- a/src/hbinput/inputwidgets/hbinputbuttongroup.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputbuttongroup.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,8 +37,17 @@ class HB_INPUT_EXPORT HbInputButtonGroup : public HbWidget { Q_OBJECT + Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled) public: + enum HbInputButtonTextType { + ButtonTextTypeSingle, + ButtonTextTypePrimary, + ButtonTextTypeSecondaryFirstRow, + ButtonTextTypeSecondarySecondRow, + ButtonTextTypeLabel + }; + explicit HbInputButtonGroup(QGraphicsItem *parent = 0); explicit HbInputButtonGroup(const QSize &size, QGraphicsItem *parent = 0); ~HbInputButtonGroup(); @@ -46,17 +55,17 @@ void setGridSize(const QSize &size); QSize gridSize() const; - void setButtons(const QList &data); + void setButtons(const QList &data); void setButton(HbInputButton *data, int index); void setButton(HbInputButton *data, int column, int row); void setButton(HbInputButton *data, HbInputButton::HbInputButtonKeyCode keyCode); - QList buttons() const; + QList buttons() const; HbInputButton *button(int index) const; HbInputButton *button(int column, int row) const; HbInputButton *button(HbInputButton::HbInputButtonKeyCode keyCode) const; - void setCustomButtonActions(const QList &actions); - QList customButtonActions() const; + void setCustomButtonActions(const QList &actions); + QList customButtonActions() const; void setButtonBorderSize(qreal borderSize); qreal buttonBorderSize() const; @@ -71,22 +80,26 @@ void setBackground(HbFrameDrawer *background); + qreal fontSize(HbInputButtonTextType textType); + QList buttonProbabilities() const; - + public: // From QGraphicsItem void setEnabled(bool enabled); bool isEnabled() const; - + public: // From QGraphicsLayoutItem void setGeometry(const QRectF &rect); protected: // From QGraphicsItem - void paint(QPainter* painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); bool sceneEvent(QEvent *event); void changeEvent(QEvent *event); void showEvent(QShowEvent *event); void hideEvent(QHideEvent *event); - int type() const { return Hb::ItemType_InputButtonGroup; } + int type() const { + return Hb::ItemType_InputButtonGroup; + } protected: HbInputButtonGroup(HbInputButtonGroupPrivate &dd, QGraphicsItem *parent = 0); @@ -108,6 +121,7 @@ void buttonReleased(const QKeyEvent &event); void buttonLongPressed(const QKeyEvent &event); void pressedButtonChanged(const QKeyEvent &releaseEvent, const QKeyEvent &pressEvent); + void aboutToActivateCustomAction(HbAction *custAction); private slots: void longPressEvent(); @@ -116,6 +130,7 @@ private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputButtonGroup) Q_DISABLE_COPY(HbInputButtonGroup) + Q_PRIVATE_SLOT(d_func(), void _q_customActionDestroyed(QObject *)) }; #endif // HB_INPUT_BUTTON_GROUP_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputbuttongroup_p.h --- a/src/hbinput/inputwidgets/hbinputbuttongroup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputbuttongroup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,20 +31,15 @@ #include "hbinputbuttongroup.h" #include "hbinputbutton.h" +class HbDialog; +class QTextLine; +class QTextLayout; + class HB_INPUT_PRIVATE_EXPORT HbInputButtonGroupPrivate : public HbWidgetPrivate { Q_DECLARE_PUBLIC(HbInputButtonGroup) public: - - enum HbInputButtonTextType { - ButtonTextTypeSingle, - ButtonTextTypePrimary, - ButtonTextTypeSecondaryFirstRow, - ButtonTextTypeSecondarySecondRow, - ButtonTextTypeLabel - }; - HbInputButtonGroupPrivate(); ~HbInputButtonGroupPrivate(); @@ -54,9 +49,9 @@ virtual void updateButtonGrid(const QSizeF &size); virtual void updateColorArray(); - virtual void showButtonPreview(HbInputButton * const item); - virtual void hideButtonPreview(HbInputButton * const item); - virtual void showCharacterSelectionPreview(HbInputButton * const item); + virtual void showButtonPreview(HbInputButton *const item); + virtual void hideButtonPreview(HbInputButton *const item); + virtual void showCharacterSelectionPreview(HbInputButton *const item); virtual void pressEvent(const QPointF &position, bool emitSignal = true); virtual void doublePressEvent(const QPointF &position, bool emitSignal = true); @@ -66,40 +61,49 @@ virtual void calculateButtonProbabilities(const QPointF &position); + void _q_customActionDestroyed(QObject *object); + protected: virtual void createPrimarySingleTextLayout(int index, const QHash &textContent, const QSizeF &size); virtual void createPrimaryTextLayout(int index, const QHash &textContent, const QSizeF &size); virtual void createSecondaryTextLayout(int index, const QHash &textContentt, const QSizeF &size); - virtual void layoutTextLine(HbInputButtonTextType textType, const HbInputButton *button, const QSizeF &cellSize, + virtual void layoutSecondaryText(int index, HbInputButton *item, QFontMetricsF &fontMetrics, const QSizeF &size, + HbInputButton::HbInputButtonTextIndex firstTextIndex, + HbInputButton::HbInputButtonIconIndex firstIconIndex, + HbInputButton::HbInputButtonTextIndex secondTextIndex, + HbInputButton::HbInputButtonIconIndex secondIconIndex, + HbInputButtonGroup::HbInputButtonTextType textType); + + virtual void layoutTextLine(HbInputButtonGroup::HbInputButtonTextType textType, const HbInputButton *button, const QSizeF &cellSize, QTextLine &textLine, const QSizeF &textSize); virtual QString buttonGraphics(HbInputButton::HbInputButtonType type, HbInputButton::HbInputButtonState state); virtual QString buttonColor(HbInputButton::HbInputButtonType type, HbInputButton::HbInputButtonState state); - virtual qreal fontSize(HbInputButtonTextType textType); + virtual qreal fontSize(HbInputButtonGroup::HbInputButtonTextType textType); void startLongPress(int index); void cancelLongPress(int index); public: qreal mUnitValue; - QList mButtonDrawers; - QList mTextLayouts; + QList mButtonDrawers; + QList mTextLayouts; QList mColors; - QList mLongPressTimers; + QList mLongPressTimers; QList mLongPressButtons; QSize mGridSize; - QList mButtonData; + QList mButtonData; QList mUsedCustomButtons; - QList mCustomActions; + QList mCustomActions; QHash, int> mButtonGridPositions; qreal mButtonBorderSize; bool mEnabled; bool mButtonPreviewEnabled; bool mCharacterSelectionPreviewEnabled; bool mMultiTouchEnabled; - QHash mButtonPreview; + QHash mButtonPreview; HbDialog *mCharacterSelectionPreview; HbFrameDrawer *mBackground; QList mProbabilities; diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputcandidatelist.cpp --- a/src/hbinput/inputwidgets/hbinputcandidatelist.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputcandidatelist.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,14 +22,10 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputcandidatelist.h" #include #include - -#if QT_VERSION >= 0x040600 -#include -#endif - #include #include #include @@ -41,8 +37,7 @@ #include #include #include - -#include "hbinputcandidatelist.h" +#include #include "hbdialog_p.h" @@ -57,31 +52,35 @@ class HbCandidateListPrivate : public HbDialogPrivate { - Q_DECLARE_PUBLIC(HbCandidateList) + Q_DECLARE_PUBLIC(HbCandidateList) public: - HbCandidateListPrivate(HbInputMethod* input); + HbCandidateListPrivate(HbInputMethod *input); ~HbCandidateListPrivate(); void calculateAndSetSize(qreal maxWidth); void initFrameIcon(); public: - HbListWidget* mList; - HbInputMethod* mInput; + HbListWidget *mList; + HbInputMethod *mInput; int numRows; int numCandidates; int longestStringWidth; HbFrameItem *mFrameBackground; + HbListWidgetItem *mSpellQueryItem; bool mCandidateCommitted; + bool mSpellQueryOpenIsPending; }; -HbCandidateListPrivate::HbCandidateListPrivate(HbInputMethod* input) +HbCandidateListPrivate::HbCandidateListPrivate(HbInputMethod *input) : mInput(input), numRows(HbCandListDefaultNumRows), numCandidates(0), longestStringWidth(0), mFrameBackground(0), - mCandidateCommitted(false) + mSpellQueryItem(0), + mCandidateCommitted(false), + mSpellQueryOpenIsPending(false) { Q_Q(HbCandidateList); @@ -97,10 +96,10 @@ { Q_Q(HbCandidateList); - mFrameBackground = static_cast( q->primitive( HbStyle::P_Popup_background )); + mFrameBackground = static_cast(q->primitive(HbStyle::P_Popup_background)); - if( mFrameBackground == 0 ) { - mFrameBackground = static_cast( q->style()->createPrimitive(( HbStyle::Primitive )( HbStyle::P_Popup_background ), q )); + if (mFrameBackground == 0) { + mFrameBackground = static_cast(q->style()->createPrimitive((HbStyle::Primitive)(HbStyle::P_Popup_background), q)); } } @@ -128,7 +127,11 @@ finalWidth = finalWidth + l + r ; finalHeight = (qreal)numLines * oneLineHeight + 5.0 + t + b; - if(finalHeight > HbDeviceProfile::current().logicalSize().height() - 30) { + if (mSpellQueryItem) { + finalHeight += oneLineHeight ; // for spell button + } + + if (finalHeight > HbDeviceProfile::current().logicalSize().height() - 30) { finalHeight = HbDeviceProfile::current().logicalSize().height() - 30; } @@ -158,11 +161,13 @@ @param input The input method that uses this widget. @param parent parent of the widget. */ -HbCandidateList::HbCandidateList(HbInputMethod* input, QGraphicsItem* parent) +HbCandidateList::HbCandidateList(HbInputMethod *input, QGraphicsItem *parent) : HbDialog(*new HbCandidateListPrivate(input), parent) { Q_D(HbCandidateList); + HbInputRegionCollector::instance()->attach(this); + d->setPriority(HbPopupPrivate::VirtualKeyboard + 1); // Should be shown on top of virtual keyboard. d->initFrameIcon(); @@ -170,15 +175,10 @@ setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); - // enable drop shadow for the preview pane - QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; - effect->setBlurRadius(8); - setGraphicsEffect(effect); - setTimeout(NoTimeout); setAttribute(Qt::WA_InputMethodEnabled, false); - connect(d->mList, SIGNAL(activated(HbListWidgetItem*)), this, SLOT(itemActivated(HbListWidgetItem*))); - connect(d->mList, SIGNAL(longPressed(HbListWidgetItem*, const QPointF&)), this, SLOT(itemActivated(HbListWidgetItem*))); + connect(d->mList, SIGNAL(activated(HbListWidgetItem *)), this, SLOT(itemActivated(HbListWidgetItem *))); + connect(d->mList, SIGNAL(longPressed(HbListWidgetItem *, const QPointF &)), this, SLOT(itemActivated(HbListWidgetItem *))); setBackgroundFaded(false); } @@ -192,13 +192,14 @@ /*! Populates the candidate list with text strings given as parameter. - -@param */ -void HbCandidateList::populateList(const QStringList& candidates) +void HbCandidateList::populateList(const QStringList &candidates, bool addSpellQuery) { Q_D(HbCandidateList); - + // Only for the first time when we launch candidate list its not setting a layout, + // Mostly the problem is form Qt side, for the time being to resolve issue related to candidate list + // making visible property true. + setVisible(true); setContentWidget(d->mList); d->setPriority(HbPopupPrivate::VirtualKeyboard + 1); // Should be shown on top of virtual keyboard. @@ -207,7 +208,7 @@ int longestwidth = 0; int finalWidth = 250; for (int i = 0; i < candidates.count(); i++) { - HbListWidgetItem* item = new HbListWidgetItem(); + HbListWidgetItem *item = new HbListWidgetItem(); item->setText(candidates[i]); d->mList->addItem(item); @@ -219,6 +220,18 @@ } } + d->mSpellQueryItem = 0; + if (addSpellQuery) { + d->mSpellQueryItem = new HbListWidgetItem(); + d->mSpellQueryItem->setText(tr("Spell")); + d->mList->addItem(d->mSpellQueryItem); + QFontMetrics fontMetrics(d->mList->fontSpec().font()); + finalWidth = fontMetrics.width(tr("Spell")); + if (finalWidth > longestwidth) { + longestwidth = finalWidth; + } + } + d->mList->setMinimumWidth(HbCandListMinWidth); d->numCandidates = candidates.count(); d->longestStringWidth = longestwidth; @@ -233,7 +246,7 @@ /*! Inherited from HbDialog. */ -void HbCandidateList::keyPressEvent(QKeyEvent* event) +void HbCandidateList::keyPressEvent(QKeyEvent *event) { Q_D(HbCandidateList); @@ -264,10 +277,13 @@ */ void HbCandidateList::itemActivated(HbListWidgetItem *item) { - Q_UNUSED(item); Q_D(HbCandidateList); - if (!d->mCandidateCommitted) { - emit candidateSelected(0, currentCandidate()); + if (!d->mCandidateCommitted) { + if (d->mSpellQueryItem != item) { + emit candidateSelected(0, currentCandidate()); + } else if (d->mSpellQueryItem) { + d->mSpellQueryOpenIsPending = true; + } d->mCandidateCommitted = true; } hide(); @@ -279,7 +295,11 @@ QString HbCandidateList::currentCandidate() { Q_D(HbCandidateList); - return d->mList->currentItem()->text(); + if (d->mList->currentItem()) { + return d->mList->currentItem()->text(); + } + + return QString(); } /*! @@ -296,11 +316,19 @@ /*! this event handler is called, for Hide events, is delivered after the widget has been hidden. */ -void HbCandidateList::hideEvent(QHideEvent * event) +void HbCandidateList::hideEvent(QHideEvent *event) { Q_D(HbCandidateList); d->mCandidateCommitted = false; HbDialog::hideEvent(event); + // If we try to open spell query in itemActivated, first spell query tries to + // open, and then candidatel list is closed. This creates problems if we + // quickly double click on the Spell button. So open spell query only after candidate + // list is closed. + if (d->mSpellQueryOpenIsPending) { + d->mSpellQueryOpenIsPending = false; + emit launchSpellQueryDialog(); + } } void HbCandidateList::updatePrimitives() @@ -345,7 +373,7 @@ return true; } } else { - if (bottomRect.height() > HbAutoComplPopupMinAllowedHeight) { + if (bottomRect.height() > HbAutoComplPopupMinAllowedHeight) { qreal finalHeight = (size().height() < bottomRect.height() ? size().height() : bottomRect.height()); bottomRect.setHeight(finalHeight); resize(bottomRect.width(), bottomRect.height()); diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputcandidatelist.h --- a/src/hbinput/inputwidgets/hbinputcandidatelist.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputcandidatelist.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HB_CANDIDATE_LIST_H -#define HB_CANDIDATE_LIST_H +#ifndef HB_INPUT_CANDIDATE_LIST_H +#define HB_INPUT_CANDIDATE_LIST_H #include @@ -41,10 +41,10 @@ Q_OBJECT public: - explicit HbCandidateList(HbInputMethod* input, QGraphicsItem* parent = 0); + explicit HbCandidateList(HbInputMethod *input, QGraphicsItem *parent = 0); virtual ~HbCandidateList(); - void populateList(const QStringList& candidates); + void populateList(const QStringList &candidates, bool addSpellQuery = false); QString currentCandidate(); void setNumberOfVisibleLines(int numLines); bool setSizeAndPositionForAutoCompletion(HbVkbHost *vkbHost); @@ -52,11 +52,12 @@ signals: void candidatePopupCancelled(); void candidateSelected(int key, const QString &candidate); + void launchSpellQueryDialog(); protected: - void closeEvent(QCloseEvent* event); - void keyPressEvent(QKeyEvent* event); - void hideEvent(QHideEvent * event); + void closeEvent(QCloseEvent *event); + void keyPressEvent(QKeyEvent *event); + void hideEvent(QHideEvent *event); void updatePrimitives(); public slots: @@ -67,6 +68,6 @@ Q_DISABLE_COPY(HbCandidateList) }; -#endif // HB_CANDIDATE_LIST_H +#endif // HB_INPUT_CANDIDATE_LIST_H // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputcheckboxlist.cpp --- a/src/hbinput/inputwidgets/hbinputcheckboxlist.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputcheckboxlist.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,13 +22,13 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputcheckboxlist_p.h" #include #include #include #include - -#include "hbinputcheckboxlist_p.h" +#include "hbwidget_p.h" /// @cond @@ -44,7 +44,7 @@ Constructs checkbox list */ HbInputCheckBoxList::HbInputCheckBoxList(QGraphicsItem *parent) - : HbDataFormViewItem(parent), d_ptr(new HbInputCheckBoxListPrivate()) + : HbDataFormViewItem(parent), d_ptr(new HbInputCheckBoxListPrivate()) { } @@ -59,21 +59,21 @@ /*! Returns a new copy of this object */ -HbAbstractViewItem* HbInputCheckBoxList::createItem() +HbAbstractViewItem *HbInputCheckBoxList::createItem() { return new HbInputCheckBoxList(*this); } /*! \reimp -Returns true if \a model index is supported, otherwise returns false. +Returns true if \a index is supported, otherwise returns false. */ bool HbInputCheckBoxList::canSetModelIndex(const QModelIndex &index) const { - HbDataFormModelItem::DataItemType itemType = + HbDataFormModelItem::DataItemType itemType = static_cast(index.data(HbDataFormModelItem::ItemTypeRole).toInt()); - if(itemType == HbDataFormModelItem::CustomItemBase) { + if (itemType == HbDataFormModelItem::CustomItemBase) { return true; } else { return false; @@ -87,8 +87,8 @@ { Q_D(HbInputCheckBoxList); QModelIndex itemIndex = modelIndex(); - HbDataFormModelItem *modelItem = static_cast( - static_cast(itemView()->model())->itemFromIndex(itemIndex)); + HbDataFormModelItem *modelItem = static_cast( + static_cast(itemView()->model())->itemFromIndex(itemIndex)); QList selectedValues = modelItem->contentWidgetData(QString("selectedItems")).toList(); selectedValues.replace(index.row(), !selectedValues.at(index.row()).toBool()); @@ -100,26 +100,30 @@ } else { d->mListWidget->setCurrentIndex(viewItem->modelIndex(), QItemSelectionModel::Deselect); } - } +} /*! Creates a widget for showing checkbox list */ -HbWidget* HbInputCheckBoxList::createCustomWidget() +HbWidget *HbInputCheckBoxList::createCustomWidget() { Q_D(HbInputCheckBoxList); QModelIndex itemIndex = modelIndex(); - HbDataFormModelItem *modelItem = static_cast( - static_cast(itemView()->model())->itemFromIndex(itemIndex)); + HbDataFormModelItem *modelItem = static_cast( + static_cast(itemView()->model())->itemFromIndex(itemIndex)); d->mListWidget = new HbListWidget(); d->mListWidget->setSelectionMode(HbAbstractItemView::MultiSelection); d->mListWidget->contentWidget()->setContentsMargins(10, 10, 10, 10); - d->mListWidget->setBackgroundItem(HbStyle::P_DataItem_background); + // get listwidget's widget private ptr + HbWidgetPrivate *priv = static_cast(HbWidgetBasePrivate::d_ptr(d->mListWidget)); + priv->setBackgroundItem(HbStyle::P_DataItem_background); + d->mListWidget->setScrollDirections(0); + QStringList items = modelItem->contentWidgetData(QString("items")).toStringList(); - foreach(QString itemName, items) { + foreach(const QString &itemName, items) { HbListWidgetItem *item = new HbListWidgetItem(); item->setData(QVariant(itemName), Qt::DisplayRole); d->mListWidget->addItem(item); @@ -138,14 +142,14 @@ connect(d->mListWidget, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &))); - return d->mListWidget; + return d->mListWidget; } /*! Copy constructor for private use. */ HbInputCheckBoxList::HbInputCheckBoxList(const HbInputCheckBoxList &other) - : HbDataFormViewItem(other), d_ptr(new HbInputCheckBoxListPrivate()) + : HbDataFormViewItem(other), d_ptr(new HbInputCheckBoxListPrivate()) { } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputcheckboxlist_p.h --- a/src/hbinput/inputwidgets/hbinputcheckboxlist_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputcheckboxlist_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,16 +38,16 @@ explicit HbInputCheckBoxList(QGraphicsItem *parent = 0); ~HbInputCheckBoxList(); - HbAbstractViewItem* createItem(); + HbAbstractViewItem *createItem(); bool canSetModelIndex(const QModelIndex &index) const; public slots: void itemActivated(const QModelIndex &index); protected: - HbWidget* createCustomWidget(); + HbWidget *createCustomWidget(); - HbInputCheckBoxListPrivate * const d_ptr; + HbInputCheckBoxListPrivate *const d_ptr; private: HbInputCheckBoxList(const HbInputCheckBoxList &other); diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputcommondialogs.cpp --- a/src/hbinput/inputwidgets/hbinputcommondialogs.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputcommondialogs.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputcommondialogs.h" + #include #include @@ -31,8 +33,7 @@ #include #include #include - -#include "hbinputcommondialogs.h" +#include /// @cond @@ -51,35 +52,33 @@ */ HbInputLanguage HbInputCommonDialogs::showLanguageSelectionDialog(QLocale::Language selectedLanguage, const QList languageList) { - HbSelectionDialog* langDialog = new HbSelectionDialog(); + HbSelectionDialog *langDialog = new HbSelectionDialog(); langDialog->setObjectName("Language dialog"); -#if QT_VERSION >= 0x040600 // Make sure the language dialog never steals focus. langDialog->setFlag(QGraphicsItem::ItemIsPanel, true); langDialog->setActive(false); -#endif - HbInputSettingProxy* settings = HbInputSettingProxy::instance(); + HbInputSettingProxy *settings = HbInputSettingProxy::instance(); HbInputLanguage currentLang = settings->globalInputLanguage(); QList languages; if (languageList.count() == 0) { HbInputUtils::listSupportedInputLanguages(languages); } else { - languages=languageList; + languages = languageList; } - - qStableSort(languages.begin(), languages.end(), caseInsensitiveLessThanForHbInputLanguage); - QList listItems; - HbListWidgetItem* item = 0; - foreach( HbInputLanguage language, languages ) { - QString langName = language.localisedName(); + + qStableSort(languages.begin(), languages.end(), caseInsensitiveLessThanForHbInputLanguage); + QList listItems; + HbListWidgetItem *item = 0; + foreach(HbInputLanguage language, languages) { + QString langName = language.localisedName(); if (langName.length() == 0) { langName = QString("Unknown"); } item = new HbListWidgetItem(); item->setText(langName); - if (language == currentLang ) { + if (language == currentLang) { QList selected; selected.append(listItems.count()); langDialog->setSelectedItems(selected); @@ -97,12 +96,13 @@ langDialog->setDismissPolicy(HbPopup::NoDismiss); langDialog->setModal(true); //langDialog->exec(); TODO + HbInputRegionCollector::instance()->attach(langDialog); //TODO: needed to check from action which button was pressed (ok, cancel) //HbAction* action = langDialog->exec(); if (langDialog->selectedItems().count()) { int selection = langDialog->selectedItems().at(0).toInt(); HbInputLanguage result; - if(languages.at(selection).language() == QLocale::Chinese) { + if (languages.at(selection).language() == QLocale::Chinese) { result = languages.at(selection); } else { result = languages.at(selection).language(); @@ -122,26 +122,24 @@ { Q_UNUSED(language); - HbSelectionDialog* methodDialog = new HbSelectionDialog(); + HbSelectionDialog *methodDialog = new HbSelectionDialog(); methodDialog->setObjectName("Input method dialog"); -#if QT_VERSION >= 0x040600 // Make sure the language dialog never steals focus. methodDialog->setFlag(QGraphicsItem::ItemIsPanel, true); methodDialog->setActive(false); -#endif QList customList = HbInputMethod::listCustomInputMethods(); - QList listItems; - HbListWidgetItem* item = new HbListWidgetItem(); + QList listItems; + HbListWidgetItem *item = new HbListWidgetItem(); QString methodName("Default"); item->setText(methodName); listItems.append(item); //for (int i=0; isetDismissPolicy(HbPopup::NoDismiss); methodDialog->setModal(true); //methodDialog->exec(); TODO + HbInputRegionCollector::instance()->attach(methodDialog); //TODO: needed to check from action which button was pressed (ok, cancel) //HbAction* action = langDialog->exec(); @@ -161,9 +160,9 @@ if (methodDialog->selectedItems().count()) { int selection = methodDialog->selectedItems().first().toInt(); if (selection == 0) { - result.setDefault(); + result.setDefault(); } else { - result = customList[selection-1]; + result = customList[selection-1]; } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputcommondialogs.h --- a/src/hbinput/inputwidgets/hbinputcommondialogs.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputcommondialogs.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,14 +26,16 @@ #ifndef HB_INPUT_COMMON_DIALOGS_H #define HB_INPUT_COMMON_DIALOGS_H +#include +#include +#include + class HbInputLanguage; -#include -#include class HB_INPUT_EXPORT HbInputCommonDialogs { public: - static HbInputLanguage showLanguageSelectionDialog(const QLocale::Language selectedLanguage, const QList languageList=QList()); + static HbInputLanguage showLanguageSelectionDialog(const QLocale::Language selectedLanguage, const QList languageList = QList()); static HbInputMethodDescriptor showCustomInputMethodSelectionDialog(const HbInputLanguage &language); }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputexactwordpopup.cpp --- a/src/hbinput/inputwidgets/hbinputexactwordpopup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputexactwordpopup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,10 +28,8 @@ #include #include #include -#if QT_VERSION >= 0x040600 -#include -#endif +#include #include "hbdeviceprofile.h" #include "hbdialog.h" #include "hblabel.h" @@ -41,11 +39,9 @@ #include "hbinputsettingproxy.h" #include "hbframeitem.h" #include "hbframedrawer.h" -#include "hbcolorscheme.h" #include "hbdialog_p.h" -const QSizeF HbExactWordPopupSize(10,10); -const QPointF HbExactWordPopupStartupDisplay(12, 33); +const qreal HbExactWordPopupHeight = 50.0; class HbExactWordPopupPrivate : public HbDialogPrivate { @@ -59,45 +55,36 @@ public: HbLabel *mText; - HbStyleOptionLabel *mOption; - HbIconItem *iconPrim; HbFrameItem *mPopupBackground; }; -HbExactWordPopupPrivate::HbExactWordPopupPrivate(){ - mText = 0; - mOption = 0; - iconPrim = 0; +HbExactWordPopupPrivate::HbExactWordPopupPrivate() + : mText(0), mPopupBackground(0) +{ } -HbExactWordPopupPrivate::~HbExactWordPopupPrivate(){ - delete mOption; - mOption = 0; +HbExactWordPopupPrivate::~HbExactWordPopupPrivate() +{ } void HbExactWordPopupPrivate::initBackground() { Q_Q(HbExactWordPopup); - mPopupBackground = static_cast(q->primitive( HbStyle::P_Popup_background)); + mPopupBackground = static_cast(q->primitive(HbStyle::P_Popup_background)); - if( mPopupBackground == 0 ) { + if (!mPopupBackground) { mPopupBackground = static_cast(q->style()->createPrimitive((HbStyle::Primitive)(HbStyle::P_Popup_background), q)); } - if ( mPopupBackground->frameDrawer().isNull()) { - HbFrameDrawer* fd = new HbFrameDrawer("qtg_fr_popup_secondary", HbFrameDrawer::NinePieces); + if (mPopupBackground->frameDrawer().isNull()) { + HbFrameDrawer *fd = new HbFrameDrawer("qtg_fr_popup_secondary", HbFrameDrawer::NinePieces); mPopupBackground->setFrameDrawer(fd); } - - // the size of the layout in the base class has been set to 0, reset it by passing an invalid size to setMinimumSize - if(mainLayout) { - mainLayout->setMinimumSize(-1, -1); - } - } -HbExactWordPopup* HbExactWordPopup::instance( HbExactWordPopupIndicator indicatorArrow ) { +HbExactWordPopup* HbExactWordPopup::instance(HbExactWordPopupIndicator indicatorArrow) +{ static QPointer exactWordPopup; if (!exactWordPopup) { // HbExactWordPopup is owned by the scene @@ -110,51 +97,33 @@ Constructor. \param parent An optional parameter. */ -HbExactWordPopup::HbExactWordPopup(QGraphicsWidget *parent, HbExactWordPopupIndicator indicatorArrow ) : - HbDialog(*new HbExactWordPopupPrivate(), parent) +HbExactWordPopup::HbExactWordPopup(QGraphicsWidget *parent, HbExactWordPopupIndicator indicatorArrow) + : HbDialog(*new HbExactWordPopupPrivate(), parent) { Q_D(HbExactWordPopup); - d->mText = new HbLabel(this); + HbInputRegionCollector::instance()->attach(this); + + d->mText = new HbLabel(); d->mText->setAlignment(Qt::AlignCenter); + d->mText->setFontSpec(HbFontSpec(HbFontSpec::Primary)); + d->mText->setContentsMargins(0, 0, 0, 0); - d->setPriority(HbPopupPrivate::VirtualKeyboard + 1); // Should be shown on top of virtual keyboard. + setContentWidget(d->mText); d->initBackground(); setTimeout(HbPopup::NoTimeout); setBackgroundFaded(false); - setVisible(false); setDismissPolicy(HbPopup::TapInside); setFocusPolicy(Qt::ClickFocus); - setContentWidget(d->mText); setModal(false); + setContentsMargins(0, 0, 0, 0); -#if QT_VERSION >= 0x040600 - // Make sure the excat word popup never steals focus. + // Make sure the exact word popup never steals focus. setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); - // enable drop shadow for the preview pane - QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; - effect->setBlurRadius(8); - setGraphicsEffect(effect); -#endif - - d->mOption = new HbStyleOptionLabel(); - if(d->mOption != 0 ) { - d->mOption->text = QString(" "); - d->mOption->boundingRect = QRectF(HbExactWordPopupStartupDisplay,HbExactWordPopupSize); - // for hardware keypad, we need to show the arrow to indicate the word - // and in virtual keypad this is not needed, so set the image accordingly - setIndicatorArrow( indicatorArrow ); - d->mOption->alignment = Qt::AlignCenter; - } - - d->iconPrim = static_cast(primitive(HbStyle::P_Label_icon)); - if(d->iconPrim == 0) { - d->iconPrim = static_cast(style()->createPrimitive((HbStyle::Primitive)(HbStyle::P_Label_icon), this)); - } - style()->updatePrimitive(d->iconPrim, (HbStyle::Primitive)(HbStyle::P_Label_icon), d->mOption); + setIndicatorArrow(indicatorArrow); } /*! @@ -178,9 +147,6 @@ { Q_D(HbExactWordPopup); d->mText->setPlainText(newText); - - QRectF ps=QRectF(QPointF(0,0), d->mText->preferredSize()).adjusted(-9,-9,9,9); - resize(ps.size()); } /*! @@ -190,37 +156,17 @@ */ void HbExactWordPopup::showText(QPointF pos) { - // the popup should know at this stage in which main window/scene it's been launched at. - int screenWidth = 0; - if ( mainWindow() ) { - screenWidth = HbDeviceProfile::profile(this).logicalSize().width(); - } else { - // this is the fall-back if the main window is not know - can be removed when popup - // is not relying on the primary window anymore. - screenWidth = HbDeviceProfile::profile(mainWindow()).logicalSize().width(); - } + Q_D(HbExactWordPopup); + + QFontMetrics fontMetrics(HbFontSpec(HbFontSpec::Primary).font()); + qreal width = fontMetrics.width(text()); - const QRectF br = boundingRect(); - const qreal brCenter = br.width()/2; - pos.setX(pos.x()-brCenter); - // fix x position to keep tooltip visible - const qreal requiredWidth = pos.x()+br.width(); - if (requiredWidth > screenWidth) { - pos.setX(pos.x()-(requiredWidth-screenWidth)); - } else if (0 > pos.x()) { - pos.setX(0); - } - pos.setY(pos.y()-br.height()); + d->mText->setMinimumWidth(width); + d->mText->setMaximumWidth(width); + + pos.setY(pos.y() - HbExactWordPopupHeight); setPos(pos); - QSizeF mySize = size(); - mySize.setHeight(HbExactWordPopupSize.height()); - resize(mySize); - - Q_D(HbExactWordPopup); - d->mOption->boundingRect = QRectF(rect().center().x() - (HbExactWordPopupSize.width()/2),rect().bottom(),HbExactWordPopupSize.width(),HbExactWordPopupSize.height()); - style()->updatePrimitive(d->iconPrim, (HbStyle::Primitive)(HbStyle::P_Label_icon), d->mOption); - show(); } @@ -249,27 +195,22 @@ void HbExactWordPopup::updatePrimitives() { - Q_D( HbExactWordPopup ); + Q_D(HbExactWordPopup); d->mPopupBackground->frameDrawer().setFrameType(HbFrameDrawer::NinePieces); d->mPopupBackground->frameDrawer().setFrameGraphicsName("qtg_fr_popup_secondary"); d->mPopupBackground->setGeometry(boundingRect()); - - QColor col = HbColorScheme::color( "qtc_editor_normal" ); //popupforeground - if (col.isValid()) { - d->mText->setTextColor(col); - } } // this method is called whenever there is a switch of keypad usage from h/w to virtual // h/w keypad needs an indicator, whereas virtual does not, hence set the image appropriately. -void HbExactWordPopup::setIndicatorArrow( HbExactWordPopupIndicator indicatorArrow ) +void HbExactWordPopup::setIndicatorArrow(HbExactWordPopupIndicator indicatorArrow) { - Q_D( HbExactWordPopup ); + Q_D(HbExactWordPopup); if (indicatorArrow == HbNoIndicatorArrow) { - d->mOption->icon = (QString("")); + d->mText->setIcon(HbIcon()); } else { - d->mOption->icon = (QString("qtg_graf_inpu_swipe")); + d->mText->setIcon(HbIcon("qtg_graf_inpu_swipe")); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputexactwordpopup.h --- a/src/hbinput/inputwidgets/hbinputexactwordpopup.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputexactwordpopup.h Thu Jul 22 16:36:53 2010 +0100 @@ -21,10 +21,10 @@ ** If you have questions regarding the use of this file, please contact ** Nokia at developer.feedback@nokia.com. ** -****************************************************************************/ +****************************************************************************/ -#ifndef HBEXACTWORDPOPUP_H -#define HBEXACTWORDPOPUP_H +#ifndef HB_INPUT_EXACT_WORD_POPUP_H +#define HB_INPUT_EXACT_WORD_POPUP_H #include #include @@ -36,15 +36,17 @@ Q_OBJECT public: - enum HbExactWordPopupIndicator{ + enum HbExactWordPopupIndicator { HbNoIndicatorArrow, HbIndicatorArrow }; - static HbExactWordPopup* instance(HbExactWordPopupIndicator indicatorArrow = HbNoIndicatorArrow); + static HbExactWordPopup *instance(HbExactWordPopupIndicator indicatorArrow = HbNoIndicatorArrow); QString text(); - int type() const {return Type;} + int type() const { + return Type; + } public slots: void setText(const QString &text); @@ -65,5 +67,5 @@ Q_DISABLE_COPY(HbExactWordPopup) }; -#endif // HBEXACTWORDPOPUP_H +#endif // HB_INPUT_EXACT_WORD_POPUP_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputhwtoolcluster.cpp --- a/src/hbinput/inputwidgets/hbinputhwtoolcluster.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputhwtoolcluster.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,7 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputhwtoolcluster.h" #include @@ -36,7 +37,6 @@ #include #include "hbinputvkbwidget_p.h" -#include "hbinputhwtoolcluster.h" #include "hbinputmodeindicator.h" const QString HbCustomButtonObjName = "Mini VKB custom button "; @@ -81,9 +81,9 @@ /*! Constructs the object. */ -HbHwToolCluster::HbHwToolCluster(HbInputMethod* owner, - QGraphicsItem* parent) - : HbInputVkbWidget(*new HbHwToolClusterPrivate, parent) +HbHwToolCluster::HbHwToolCluster(HbInputMethod *owner, + QGraphicsItem *parent) + : HbInputVkbWidget(*new HbHwToolClusterPrivate, parent) { if (0 == owner) { return; @@ -136,7 +136,7 @@ qreal height = size.height() - HbCloseHandleHeight; qreal width = size.width() / (qreal)HbMiniVirtualKeypadNumberOfColumn; - for (int i=0; i < HbMiniVirtualKeypadNumberOfColumn ;i++) { + for (int i = 0; i < HbMiniVirtualKeypadNumberOfColumn ; i++) { d->mButtonLayout->setColumnFixedWidth(i, width); } //There is only one row @@ -157,7 +157,7 @@ ret = d->mCurrentHost->keyboardArea(); //Since this is a mini VKB, it has a lesser size than the available //area for the keypad. - ret.setHeight(ret.height()/HbMiniVirtualKeypadReductionFactor); + ret.setHeight(ret.height() / HbMiniVirtualKeypadReductionFactor); return ret; } @@ -172,7 +172,7 @@ Q_D(HbHwToolCluster); HbInputMethodDescriptor method - = HbInputCommonDialogs::showCustomInputMethodSelectionDialog(HbInputSettingProxy::instance()->globalInputLanguage()); + = HbInputCommonDialogs::showCustomInputMethodSelectionDialog(HbInputSettingProxy::instance()->globalInputLanguage()); if (!method.isEmpty() && d->mOwner) { d->mOwner->activateInputMethod(method); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputhwtoolcluster.h --- a/src/hbinput/inputwidgets/hbinputhwtoolcluster.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputhwtoolcluster.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef _HBINPUT_HW_TOOL_CLUSTER_H -#define _HBINPUT_HW_TOOL_CLUSTER_H +#ifndef HB_INPUT_HW_TOOL_CLUSTER_H +#define HB_INPUT_HW_TOOL_CLUSTER_H #include "hbinputvkbwidget.h" @@ -37,7 +37,7 @@ Q_OBJECT public: - HbHwToolCluster(HbInputMethod* owner, QGraphicsItem* parent = NULL); + explicit HbHwToolCluster(HbInputMethod *owner, QGraphicsItem *parent = NULL); ~HbHwToolCluster(); public: // From HbVirtualKeyboard @@ -46,7 +46,7 @@ QSizeF preferredKeyboardSize(); void createLayout(); void setupToolCluster(); - + public slots: void showMethodDialog(); void showLanguageDialog(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputmethodselectionlist.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbinput/inputwidgets/hbinputmethodselectionlist.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,216 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbInput module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hbinputmethodselectionlist.h" + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "hbdialog_p.h" + +/// @cond + +class HbInputMethodSelectionListPrivate : public HbDialogPrivate +{ + Q_DECLARE_PUBLIC(HbInputMethodSelectionList) + +public: + HbInputMethodSelectionListPrivate(); + + void createSelectionList(); + +public: + HbListWidget *mList; + QList mMethodIndices; + +}; + +HbInputMethodSelectionListPrivate::HbInputMethodSelectionListPrivate() + : mList(0) +{ +} + +void HbInputMethodSelectionListPrivate::createSelectionList() +{ + Q_Q(HbInputMethodSelectionList); + + mList = new HbListWidget(); + mList->setSelectionMode(HbAbstractItemView::SingleSelection); + mList->setItemRecycling(false); + + HbInputSettingProxy *proxy = HbInputSettingProxy::instance(); + HbInputMethodDescriptor descriptor = proxy->preferredInputMethod(); + QByteArray customData = proxy->preferredInputMethodCustomData(q->mainWindow()->orientation()); + + QList methodList = HbInputMethod::listCustomInputMethods(q->mainWindow()->orientation(), proxy->globalInputLanguage()); + methodList.insert(0, HbInputMethod::defaultInputMethod(q->mainWindow()->orientation())); + + int selectedIndex = -1; + int index = -1; + for (int i = 0; i < methodList.count(); ++i) { + // If descriptor contains multiple display names, it supports multiple input methods + // which should be added one by one to the list + QStringList displayNames = methodList.at(i).displayNames(); + if (!displayNames.isEmpty()) { + QList icons = methodList.at(i).icons(); + for (int j = 0; j < displayNames.count(); ++j) { + HbListWidgetItem* item = new HbListWidgetItem(); + QString displayName = displayNames.at(j); + item->setText(displayName); + if (j < icons.count()) { + item->setIcon(icons.at(j)); + } else { + item->setIcon(methodList.at(i).icon()); + } + mList->addItem(item); + mMethodIndices.append(i); + ++index; + + if (descriptor.pluginNameAndPath() == methodList.at(i).pluginNameAndPath() && + QString::fromUtf8(customData) == displayName) { + selectedIndex = index; + } + } + } else { + // Descriptor contains information about one input method + HbListWidgetItem* item = new HbListWidgetItem(); + QString displayName = methodList.at(i).displayName(); + item->setText(displayName); + item->setIcon(methodList.at(i).icon()); + mList->addItem(item); + mMethodIndices.append(i); + ++index; + + if (descriptor.pluginNameAndPath() == methodList.at(i).pluginNameAndPath() && + descriptor.displayName() == displayName ) { + selectedIndex = index; + } + } + } + + // Default input method doesn't have valid plugin name, so set the index directly + if (descriptor.isDefault() || descriptor.pluginNameAndPath().isEmpty()) { + selectedIndex = 0; + } + + HbAbstractViewItem *viewItem = mList->viewItem(selectedIndex); + if (viewItem) { + mList->setCurrentIndex(viewItem->modelIndex(), QItemSelectionModel::Select); + } +} + +/// @endcond + +/*! +Constructs input method selection list +*/ +HbInputMethodSelectionList::HbInputMethodSelectionList(QGraphicsWidget* parent) + : HbDialog(*new HbInputMethodSelectionListPrivate(), parent) +{ + Q_D(HbInputMethodSelectionList); + HbInputRegionCollector::instance()->attach(this); + + HbStyle style; + qreal listWidth(300); + style.parameter(QString("expr(var(hb-param-screen-short-edge)-(2*var(hb-param-margin-gene-screen)))"), listWidth); + qreal margin(5); + style.parameter(QString("hb-param-margin-gene-popup"), margin); + + QGraphicsLinearLayout *layout = new QGraphicsLinearLayout(); + layout->setContentsMargins(margin, margin, margin, margin); + + // set default values for popup + setTimeout(HbDialog::NoTimeout); + setBackgroundFaded(false); + setDismissPolicy(TapOutside); + setPreferredWidth(listWidth); + setModal(true); + + // Make sure input method selection list never steals focus. + setFlag(QGraphicsItem::ItemIsPanel, true); + setActive(false); + + d->createSelectionList(); + + layout->addItem(d->mList); + QGraphicsWidget *content = new QGraphicsWidget(this); + content->setLayout(layout); + setContentWidget(content); + + connect(d->mList, SIGNAL(activated(HbListWidgetItem*)), this, SLOT(activateSelectedMethod(HbListWidgetItem*))); + connect(d->mList, SIGNAL(longPressed(HbListWidgetItem*, const QPointF&)), this, SLOT(activateSelectedMethod(HbListWidgetItem*))); +} + +/*! +Destructs the object. +*/ +HbInputMethodSelectionList::~HbInputMethodSelectionList() +{ +} + +/*! +Called when input method is selected from the list. Signal inputMethodSelected +is emitted with selected input method as parameter. +*/ +void HbInputMethodSelectionList::activateSelectedMethod(HbListWidgetItem *item) +{ + Q_D(HbInputMethodSelectionList); + + int index = d->mMethodIndices.at(d->mList->row(item)); + QByteArray customData; + + HbInputMethodDescriptor selectedMethod; + + if (index == 0) { + selectedMethod = HbInputMethod::defaultInputMethod(mainWindow()->orientation()); + + if (!selectedMethod.displayNames().isEmpty()) { + customData = selectedMethod.displayNames().at(d->mList->row(item)).toUtf8(); + } + } else { + HbInputSettingProxy *proxy = HbInputSettingProxy::instance(); + QList customList = HbInputMethod::listCustomInputMethods(mainWindow()->orientation(), proxy->globalInputLanguage()); + selectedMethod = customList.at(index - 1); + + int firstItemIndex = d->mMethodIndices.indexOf(index); + + if (!selectedMethod.displayNames().isEmpty()) { + customData = selectedMethod.displayNames().at(d->mList->row(item) - firstItemIndex).toUtf8(); + } + } + + close(); + + emit inputMethodSelected(selectedMethod, customData); +} + +// End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputmethodselectionlist.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbinput/inputwidgets/hbinputmethodselectionlist.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,57 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbInput module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HB_INPUT_METHOD_SELECTION_LIST_H +#define HB_INPUT_METHOD_SELECTION_LIST_H + +#include +#include + +class HbInputMethodSelectionListPrivate; +class HbListWidgetItem; +class HbInputMethodDescriptor; + +class HB_INPUT_EXPORT HbInputMethodSelectionList : public HbDialog +{ + Q_OBJECT + +public: + HbInputMethodSelectionList(QGraphicsWidget* parent = 0); + virtual ~HbInputMethodSelectionList(); + +public slots: + void activateSelectedMethod(HbListWidgetItem *item); + +signals: + void inputMethodSelected(const HbInputMethodDescriptor &descriptor, const QByteArray &customData); + +private: + Q_DECLARE_PRIVATE_D(d_ptr, HbInputMethodSelectionList) + Q_DISABLE_COPY(HbInputMethodSelectionList) +}; + +#endif // HB_INPUT_METHOD_SELECTION_LIST_H + +// End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputmodeindicator.cpp --- a/src/hbinput/inputwidgets/hbinputmodeindicator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputmodeindicator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,13 +22,13 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include #include #include #include #include #include -#include #include #include @@ -36,19 +36,19 @@ class HbInputModeIndicatorPrivate { -public: +public: HbInputModeIndicatorPrivate(HbInputButton *button); ~HbInputModeIndicatorPrivate(); void updatePrediction(); -public: +public: HbInputButton *mButtonItem; QPointer mFocusObject; }; HbInputModeIndicatorPrivate::HbInputModeIndicatorPrivate(HbInputButton *button) - : mButtonItem(button), mFocusObject(0) + : mButtonItem(button), mFocusObject(0) { if (HbInputMethod::activeInputMethod()) { mFocusObject = HbInputMethod::activeInputMethod()->focusObject(); @@ -72,7 +72,7 @@ if (HbInputSettingProxy::instance()->predictiveInputStatusForActiveKeyboard() && mFocusObject && mFocusObject->editorInterface().isPredictionAllowed()) { icon = HbIcon(predictionOnIcon); - } else { + } else { icon = HbIcon(predictionOffIcon); } icon.setColor(color); @@ -99,7 +99,7 @@ { mPrivate = new HbInputModeIndicatorPrivate(button); if (mPrivate->mFocusObject) { - connect (&mPrivate->mFocusObject->editorInterface(), SIGNAL(modified()), this, SLOT(updateIndicator())); + connect(&mPrivate->mFocusObject->editorInterface(), SIGNAL(modified()), this, SLOT(updateIndicator())); } connect(HbInputSettingProxy::instance(), SIGNAL(predictiveInputStateChanged(HbKeyboardSettingFlags, bool)), this, SLOT(updatePredictionStatus(HbKeyboardSettingFlags, bool))); @@ -123,7 +123,7 @@ if (HbInputMethod::activeInputMethod()) { mPrivate->mFocusObject = HbInputMethod::activeInputMethod()->focusObject(); if (mPrivate->mFocusObject) { - connect( &mPrivate->mFocusObject->editorInterface(), SIGNAL(modified()), this, SLOT(updateIndicator())); + connect(&mPrivate->mFocusObject->editorInterface(), SIGNAL(modified()), this, SLOT(updateIndicator())); } else { return; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputmodeindicator.h --- a/src/hbinput/inputwidgets/hbinputmodeindicator.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputmodeindicator.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,7 @@ { Q_OBJECT public: - HbInputModeIndicator(HbInputButton *button, QGraphicsWidget *parent = 0); + explicit HbInputModeIndicator(HbInputButton *button, QGraphicsWidget *parent = 0); virtual ~HbInputModeIndicator(); public slots: @@ -46,7 +46,7 @@ private: Q_DISABLE_COPY(HbInputModeIndicator) - HbInputModeIndicatorPrivate* mPrivate; + HbInputModeIndicatorPrivate *mPrivate; }; #endif // HB_INPUT_MODE_INDICATOR_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputqwertytouchkeyboard_p.h --- a/src/hbinput/inputwidgets/hbinputqwertytouchkeyboard_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputqwertytouchkeyboard_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,7 +44,7 @@ class HB_INPUT_PRIVATE_EXPORT HbQwertyKeyboardPrivate : public HbInputVkbWidgetPrivate { - Q_DECLARE_PUBLIC(HbQwertyKeyboard) + Q_DECLARE_PUBLIC(HbQwertyKeyboard) public: @@ -58,8 +58,8 @@ void initializeKeyboard(bool refreshButtonText); void initializeNumericKeyboard(); bool showPreview(int keycode); - void setButtonObjectName(HbTouchKeypadButton& button, int row, int column, Qt::Key specialKey); - void launchPreviewPane(const QStringList& list); + void setButtonObjectName(HbTouchKeypadButton &button, int row, int column, Qt::Key specialKey); + void launchPreviewPane(const QStringList &list); void applyEditorConstraints(); void setRockerPosition(); @@ -71,11 +71,11 @@ int indexForKeycode(int keyCode); int keyCode(int buttonId); int keyCode(HbTouchKeypadButton *button); - void getAllowedSctCharcters(QString & allowedSctCharacters); + void getAllowedSctCharcters(QString &allowedSctCharacters); void updateButtonsTextAndMappers(); public: - QList mButtons; - QList mKeypadButtonOption; + QList mButtons; + QList mKeypadButtonOption; int mCtrlBtnIndex; int mPressedButtonIndex; diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputscreenshotwidget.cpp --- a/src/hbinput/inputwidgets/hbinputscreenshotwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputscreenshotwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,17 +22,18 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputscreenshotwidget.h" + #include #include #include #include +#include #include "hbframedrawerpool_p.h" -#include "hbinputscreenshotwidget.h" #include "hbinputvkbwidget.h" - /*! @proto @hbinput @@ -64,7 +65,7 @@ }; HbInputScreenshotWidgetPrivate::HbInputScreenshotWidgetPrivate() - : mIconDrawer(0), mCloseHandleHeight(0), mCloseHandleWidth(0) + : mIconDrawer(0), mCloseHandleHeight(0), mCloseHandleWidth(0) { } @@ -79,30 +80,29 @@ /*! Costructs the object. */ -HbInputScreenshotWidget::HbInputScreenshotWidget(QGraphicsItem* parent) +HbInputScreenshotWidget::HbInputScreenshotWidget(QGraphicsItem *parent) : HbWidget(*new HbInputScreenshotWidgetPrivate, parent) { Q_D(HbInputScreenshotWidget); d->q_ptr = this; + HbInputRegionCollector::instance()->attach(this); - setPos(QPointF(0,0)); + setPos(QPointF(0, 0)); #ifdef HB_EFFECTS HbEffect::disable(this); #endif // HB_EFFECTS -#if QT_VERSION >= 0x040600 // Make sure the keypad never steals focus. setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); -#endif } /*! Destructs the object. */ HbInputScreenshotWidget::~HbInputScreenshotWidget() -{ +{ } void HbInputScreenshotWidget::setScreenshot(QPixmap &pixmap) @@ -124,7 +124,7 @@ /*! handles mouse press event. */ -void HbInputScreenshotWidget::mousePressEvent(QGraphicsSceneMouseEvent* event) +void HbInputScreenshotWidget::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); } @@ -132,7 +132,7 @@ /*! Handles mouse release event. */ -void HbInputScreenshotWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) +void HbInputScreenshotWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event); } @@ -140,13 +140,13 @@ /*! The paint method. Draws the widget. */ -void HbInputScreenshotWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) +void HbInputScreenshotWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); Q_UNUSED(widget); Q_D(HbInputScreenshotWidget); - if (!d->mPixmap.isNull()){ + if (!d->mPixmap.isNull()) { QRectF rect = boundingRect(); painter->save(); @@ -158,7 +158,7 @@ painter->save(); painter->translate(0, d->mCloseHandleHeight); - painter->drawPixmap(0, 0, d->mPixmap); + painter->drawPixmap(0, 0, d->mPixmap); painter->restore(); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputscreenshotwidget.h --- a/src/hbinput/inputwidgets/hbinputscreenshotwidget.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputscreenshotwidget.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,11 +44,13 @@ void setScreenshot(QPixmap &pixmap); protected: // From QGraphicsItem - virtual QPainterPath shape () const; - virtual void mousePressEvent(QGraphicsSceneMouseEvent* event); - virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent* event); - virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); - virtual int type() const { return Hb::ItemType_InputVkbWidget; } + virtual QPainterPath shape() const; + virtual void mousePressEvent(QGraphicsSceneMouseEvent *event); + virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual int type() const { + return Hb::ItemType_InputVkbWidget; + } private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputScreenshotWidget) diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsctkeyboard.cpp --- a/src/hbinput/inputwidgets/hbinputsctkeyboard.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsctkeyboard.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputsctkeyboard.h" +#include "hbinputsctkeyboard_p.h" #include @@ -33,20 +35,17 @@ #include #include -#include "hbinputsctkeyboard.h" -#include "hbinputsctkeyboard_p.h" #include "hbinputbuttongroup.h" #include "hbinputbutton.h" -const qreal HbPortraitKeyboardHeightInUnits = 46.8; +const qreal HbPortraitKeyboardHeightInUnits = 45.9; const qreal HbPortraitKeyboardWidthInUnits = 53.8; -const qreal HbLandscapeKeyboardHeightInUnits = 34.6; +const qreal HbLandscapeKeyboardHeightInUnits = 33.7; const qreal HbLandscapeKeyboardWidthInUnits = 95.5; const int HbSctPortraitNumberOfRows = 5; const int HbSctPortraitNumberOfColumns = 5; -const int HbPortraitButtonKeyCodeTable[HbSctPortraitNumberOfRows * HbSctPortraitNumberOfColumns] = -{ +const int HbPortraitButtonKeyCodeTable[HbSctPortraitNumberOfRows *HbSctPortraitNumberOfColumns] = { HbInputButton::ButtonKeyCodeCharacter, HbInputButton::ButtonKeyCodeCharacter, HbInputButton::ButtonKeyCodeCharacter, @@ -76,8 +75,7 @@ const int HbSctLandscapeNumberOfRows = 4; const int HbSctLandscapeNumberOfColumns = 10; -const int HbLandscapeButtonKeyCodeTable[HbSctLandscapeNumberOfRows * HbSctLandscapeNumberOfColumns] = -{ +const int HbLandscapeButtonKeyCodeTable[HbSctLandscapeNumberOfRows *HbSctLandscapeNumberOfColumns] = { HbInputButton::ButtonKeyCodeCharacter, HbInputButton::ButtonKeyCodeCharacter, HbInputButton::ButtonKeyCodeCharacter, @@ -119,6 +117,17 @@ HbInputButton::ButtonKeyCodeCustom }; +const int HbSctSpaceMarker = 0xE118; +const int HbSctEnterMarker = 0xE125; + +#if defined(Q_OS_SYMBIAN) +const QChar HbSctSpaceGlyph = 0xF800; +const QChar HbSctEnterGlyph = 0xF801; +#else +const QChar HbSctSpaceGlyph = ' '; +const QChar HbSctEnterGlyph = ' '; +#endif + /*! @proto @hbinput @@ -132,8 +141,8 @@ */ HbSctKeyboardPrivate::HbSctKeyboardPrivate() - : mType(HbKeyboardSctPortrait), mColumns(0), mRows(0), - mCharacterButtons(0), mPages(0), mActivePage(0) + : mType(HbKeyboardSctPortrait), mColumns(0), mRows(0), + mCharacterButtons(0), mPages(0), mActivePage(0) { } @@ -151,7 +160,7 @@ mType = HbKeyboardSctLandscape; } - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { mColumns = HbSctPortraitNumberOfColumns; mRows = HbSctPortraitNumberOfRows; @@ -165,11 +174,11 @@ buttonGroup->setGridSize(QSize(mColumns, mRows)); int key = 0; - QList buttons; + QList buttons; for (int i = 0; i < mColumns * mRows; ++i) { HbInputButton *item = new HbInputButton(keyCode(i), QPoint(key % mColumns, key / mColumns)); buttons.append(item); - + if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { ++mCharacterButtons; } else if (keyCode(i) == HbInputButton::ButtonKeyCodeSpace) { @@ -177,22 +186,27 @@ ++key; } else if (keyCode(i) == HbInputButton::ButtonKeyCodeDelete && mType == HbKeyboardSctPortrait) { + // Portrait SCT has different delete icon from the default one item->setIcon(HbIcon(HbInputButtonIconDelete2), HbInputButton::ButtonIconIndexPrimary); - } else if (keyCode(i) == HbInputButton::ButtonKeyCodePageChange && - mType == HbKeyboardSctPortrait) { - item->setIcon(HbIcon(HbInputButtonIconPageChange2), HbInputButton::ButtonIconIndexPrimary); + } else if (keyCode(i) == HbInputButton::ButtonKeyCodeAlphabet) { + // Button that is used to return to normal keypad should be shown as latched + item->setState(HbInputButton::ButtonStateLatched); + if (mType == HbKeyboardSctPortrait) { + // Portrait SCT has different symbol icon from the default one + item->setIcon(HbIcon(HbInputButtonIconSymbol2), HbInputButton::ButtonIconIndexPrimary); + } } ++key; } buttonGroup->setButtons(buttons); - QObject::connect(buttonGroup, SIGNAL(buttonPressed(const QKeyEvent&)), q, SLOT(sendKeyPressEvent(const QKeyEvent&))); - QObject::connect(buttonGroup, SIGNAL(buttonDoublePressed(const QKeyEvent&)), q, SLOT(sendKeyDoublePressEvent(const QKeyEvent&))); - QObject::connect(buttonGroup, SIGNAL(buttonReleased(const QKeyEvent&)), q, SLOT(sendKeyReleaseEvent(const QKeyEvent&))); - QObject::connect(buttonGroup, SIGNAL(buttonLongPressed(const QKeyEvent&)), q, SLOT(sendLongPressEvent(const QKeyEvent&))); - QObject::connect(buttonGroup, SIGNAL(pressedButtonChanged(const QKeyEvent&, const QKeyEvent&)), q, SLOT(sendKeyChangeEvent(const QKeyEvent&, const QKeyEvent&))); + QObject::connect(buttonGroup, SIGNAL(buttonPressed(const QKeyEvent &)), q, SLOT(sendKeyPressEvent(const QKeyEvent &))); + QObject::connect(buttonGroup, SIGNAL(buttonDoublePressed(const QKeyEvent &)), q, SLOT(sendKeyDoublePressEvent(const QKeyEvent &))); + QObject::connect(buttonGroup, SIGNAL(buttonReleased(const QKeyEvent &)), q, SLOT(sendKeyReleaseEvent(const QKeyEvent &))); + QObject::connect(buttonGroup, SIGNAL(buttonLongPressed(const QKeyEvent &)), q, SLOT(sendLongPressEvent(const QKeyEvent &))); + QObject::connect(buttonGroup, SIGNAL(pressedButtonChanged(const QKeyEvent &, const QKeyEvent &)), q, SLOT(sendKeyChangeEvent(const QKeyEvent &, const QKeyEvent &))); } - + QObject::connect(q, SIGNAL(flickEvent(HbInputVkbWidget::HbFlickDirection)), buttonGroup, SLOT(cancelButtonPress())); } @@ -214,9 +228,9 @@ return; } - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { - QList buttons = buttonGroup->buttons(); + QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { HbInputButton *item = buttons.at(i); @@ -236,6 +250,15 @@ } else if (item->state() == HbInputButton::ButtonStateDisabled) { state = HbInputButton::ButtonStateReleased; } + } else if (keyCode(i) == HbInputButton::ButtonKeyCodeAlphabet) { + state = HbInputButton::ButtonStateLatched; + } else if (keyCode(i) == HbInputButton::ButtonKeyCodeSpace) { + bool allowed = focusedObject->characterAllowedInEditor(QChar(' ')); + if (!allowed) { + state = HbInputButton::ButtonStateDisabled; + } else if (item->state() == HbInputButton::ButtonStateDisabled) { + state = HbInputButton::ButtonStateReleased; + } } item->setState(state); } @@ -257,16 +280,23 @@ mFlickAnimation = true; } - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { int key = mActivePage * mCharacterButtons; - QList buttons = buttonGroup->buttons(); + QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { HbInputButton *item = buttons.at(i); if (keyboardMap && key < keyboardMap->keys.count()) { - item->setKeyCode(keyboardMap->keys.at(key)->keycode.unicode()); + // Replace space and enter markers with correct keycodes + if (keyboardMap->keys.at(key)->keycode.unicode() == HbSctSpaceMarker) { + item->setKeyCode(HbInputButton::ButtonKeyCodeSpace); + } else if (keyboardMap->keys.at(key)->keycode.unicode() == HbSctEnterMarker) { + item->setKeyCode(HbInputButton::ButtonKeyCodeEnter); + } else { + item->setKeyCode(keyboardMap->keys.at(key)->keycode.unicode()); + } } else { item->setKeyCode(-1); } @@ -280,23 +310,34 @@ { Q_Q(HbSctKeyboard); - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { int key = mActivePage * mCharacterButtons; - QList buttons = buttonGroup->buttons(); + QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { HbInputButton *item = buttons.at(i); const HbKeyboardMap *keyboardMap = mKeymap->keyboard(q->keyboardType()); - if (keyboardMap && key < keyboardMap->keys.count()) { + if (keyboardMap && key < keyboardMap->keys.count() && keyboardMap->keys.at(key)->characters(HbModifierNone) != QString("")) { QString keydata = keyboardMap->keys.at(key)->characters(HbModifierNone); - item->setText(keydata.at(0), HbInputButton::ButtonTextIndexPrimary); + // Replace space and enter markers with correct glyphs. + // These only exist in symbian fonts, so if we are not using symbian, use blank. + if (keydata.at(0) == HbSctSpaceMarker) { + item->setText(HbSctSpaceGlyph, HbInputButton::ButtonTextIndexPrimary); + } else if (keydata.at(0) == HbSctEnterMarker) { + item->setText(HbSctEnterGlyph, HbInputButton::ButtonTextIndexPrimary); + } else { + item->setText(keydata.at(0), HbInputButton::ButtonTextIndexPrimary); + } } else { item->setText("", HbInputButton::ButtonTextIndexPrimary); } ++key; + } else if (keyCode(i) == HbInputButton::ButtonKeyCodePageChange) { + HbInputButton *item = buttons.at(i); + item->setText(QString::number(mActivePage+1) + '/' + QString::number(mPages), HbInputButton::ButtonTextIndexSecondaryFirstRow); } } buttonGroup->setButtons(buttons); @@ -310,13 +351,13 @@ setKeymap. */ HbSctKeyboard::HbSctKeyboard(HbInputMethod *owner, const HbKeymap *keymap, QGraphicsItem *parent) - : HbInputVkbWidget(*new HbSctKeyboardPrivate, parent) + : HbInputVkbWidget(*new HbSctKeyboardPrivate, parent) { if (!owner) { return; } Q_D(HbSctKeyboard); - d->mOwner = owner; + d->mOwner = owner; setKeymap(keymap); const HbKeyboardMap *keyboardMap = keymap->keyboard(keyboardType()); @@ -341,14 +382,14 @@ setKeymap. */ HbSctKeyboard::HbSctKeyboard(HbSctKeyboardPrivate &dd, HbInputMethod *owner, - const HbKeymap *keymap, QGraphicsItem* parent) - : HbInputVkbWidget(dd, parent) + const HbKeymap *keymap, QGraphicsItem *parent) + : HbInputVkbWidget(dd, parent) { if (!owner) { return; } Q_D(HbSctKeyboard); - d->mOwner = owner; + d->mOwner = owner; setKeymap(keymap); const HbKeyboardMap *keyboardMap = keymap->keyboard(keyboardType()); @@ -422,9 +463,9 @@ */ void HbSctKeyboard::updateButtonPreviewStatus(bool status) { - HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); if (buttonGroup) { - buttonGroup->setButtonPreviewEnabled(status); + buttonGroup->setButtonPreviewEnabled(status); } } @@ -437,9 +478,9 @@ if (flickDirection == HbInputVkbWidget::HbFlickDirectionRight || flickDirection == HbInputVkbWidget::HbFlickDirectionLeft) { - int direction = -1; + int direction = 1; if (flickDirection == HbInputVkbWidget::HbFlickDirectionRight) { - direction = 1; + direction = -1; } d->mActivePage = (d->mActivePage + direction) % d->mPages; @@ -468,12 +509,10 @@ */ void HbSctKeyboard::sendKeyReleaseEvent(const QKeyEvent &event) { - Q_D(HbSctKeyboard); - if (event.key() == HbInputButton::ButtonKeyCodePageChange) { - changePage(HbInputVkbWidget::HbFlickDirectionRight); + changePage(HbInputVkbWidget::HbFlickDirectionLeft); } else if (event.key() == HbInputButton::ButtonKeyCodeSmiley) { - showSmileyPicker(d->mRows, d->mColumns); + showSmileyPicker(); } else { HbInputVkbWidget::sendKeyReleaseEvent(event); } @@ -485,7 +524,7 @@ */ void HbSctKeyboard::sendKeyChangeEvent(const QKeyEvent &releaseEvent, const QKeyEvent &pressEvent) { - if (pressEvent.key() != HbInputButton::ButtonKeyCodePageChange && + if (pressEvent.key() != HbInputButton::ButtonKeyCodePageChange && pressEvent.key() != HbInputButton::ButtonKeyCodeSmiley) { HbInputVkbWidget::sendKeyChangeEvent(releaseEvent, pressEvent); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsctkeyboard.h --- a/src/hbinput/inputwidgets/hbinputsctkeyboard.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsctkeyboard.h Thu Jul 22 16:36:53 2010 +0100 @@ -53,7 +53,7 @@ void sendKeyChangeEvent(const QKeyEvent &pressEvent, const QKeyEvent &releaseEvent); protected: - HbSctKeyboard(HbSctKeyboardPrivate &dd, HbInputMethod *owner, const HbKeymap *keymap, QGraphicsItem* parent); + HbSctKeyboard(HbSctKeyboardPrivate &dd, HbInputMethod *owner, const HbKeymap *keymap, QGraphicsItem *parent); private slots: void updateButtonPreviewStatus(bool status); diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsctlandscape_p.h --- a/src/hbinput/inputwidgets/hbinputsctlandscape_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsctlandscape_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -59,7 +59,7 @@ void getSpecialCharacters(); - void setSctButtons(const QString& characters); + void setSctButtons(const QString &characters); void setAsFunctionButton(int index, const HbIcon &icon, const QString &text); void latchRangeButton(int buttonId); diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsettinglist.cpp --- a/src/hbinput/inputwidgets/hbinputsettinglist.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsettinglist.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,13 +22,12 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputsettinglist.h" #include #include -#if QT_VERSION >= 0x040600 -#include -#endif +#include #include #include #include @@ -37,20 +36,29 @@ #include #include #include -#include "hbinputsettinglist.h" +#include +#include + #include "hbdialog_p.h" const QString settingsIcon("qtg_mono_settings"); const QString inputMethodIcon("qtg_mono_virtual_input"); +const qreal HbSelectionListMarginInUnits = 0.8; +const qreal HbSelectionListLandscapeAlignInUnits = 9.4; + /// @cond class HbInputSettingListPrivate : public HbDialogPrivate { + Q_DECLARE_PUBLIC(HbInputSettingList) + public: HbInputSettingListPrivate(); + ~HbInputSettingListPrivate(); qreal languageNameWidth(); + void showInputMethodSelectionList(); public: HbPushButton *mLanguageButton; @@ -59,13 +67,19 @@ HbInputLanguage mPrimaryLanguage; HbInputLanguage mSecondaryLanguage; QList mPredictionValues; + HbInputMethodSelectionList *mInputMethodSelectionList; }; HbInputSettingListPrivate::HbInputSettingListPrivate() - : mLanguageButton(0), mPredictionButton(0), mOptionList(0) + : mLanguageButton(0), mPredictionButton(0), mOptionList(0), mInputMethodSelectionList(0) { } +HbInputSettingListPrivate::~HbInputSettingListPrivate() +{ + delete mInputMethodSelectionList; +} + qreal HbInputSettingListPrivate::languageNameWidth() { qreal nameWidth(0); @@ -73,7 +87,7 @@ HbInputUtils::listSupportedInputLanguages(languages); QFontMetrics fontMetrics(mLanguageButton->font()); - foreach (HbInputLanguage language, languages) { + foreach(HbInputLanguage language, languages) { qreal width = fontMetrics.width(language.localisedName()); if (width > nameWidth) { nameWidth = width; @@ -83,19 +97,51 @@ return nameWidth; } +void HbInputSettingListPrivate::showInputMethodSelectionList() +{ + Q_Q(HbInputSettingList); + + delete mInputMethodSelectionList; + mInputMethodSelectionList = new HbInputMethodSelectionList(); + mInputMethodSelectionList->setObjectName("Input method selection list"); + + qreal unitValue = HbDeviceProfile::profile(q->mainWindow()).unitValue(); + + QPointF position(q->scenePos().x() + q->size().width(), + mOptionList->scenePos().y() - HbSelectionListMarginInUnits * unitValue); + + if (q->mainWindow()->orientation() == Qt::Horizontal) { + position.setX(position.x() - HbSelectionListLandscapeAlignInUnits * unitValue); + } + + mInputMethodSelectionList->setPreferredPos(position, HbPopup::BottomRightCorner); + + QObject::connect(mInputMethodSelectionList, SIGNAL(inputMethodSelected(const HbInputMethodDescriptor &, const QByteArray &)), + q, SLOT(closeSettings(const HbInputMethodDescriptor &, const QByteArray &))); + mInputMethodSelectionList->show(); +} + /// @endcond /*! Constructs input setting list */ -HbInputSettingList::HbInputSettingList(QGraphicsWidget* parent) - : HbDialog(*new HbInputSettingListPrivate(), parent) +HbInputSettingList::HbInputSettingList(QGraphicsWidget *parent) + : HbDialog(*new HbInputSettingListPrivate(), parent) { Q_D(HbInputSettingList); + HbInputRegionCollector::instance()->attach(this); + + // Get correct size from style parameters + HbStyle style; + qreal listWidth(300); + style.parameter(QString("expr(var(hb-param-screen-short-edge)-(2*var(hb-param-margin-gene-screen)))"), listWidth); + qreal margin(5); + style.parameter(QString("hb-param-margin-gene-popup"), margin); QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(Qt::Vertical); QGraphicsGridLayout *gridLayout = new QGraphicsGridLayout(); - + HbLabel *languageLabel = new HbLabel(tr("Language"), this); languageLabel->setFontSpec(HbFontSpec(HbFontSpec::Primary)); d->mLanguageButton = new HbPushButton(QString(), this); @@ -113,24 +159,27 @@ d->mOptionList->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); d->mOptionList->setObjectName("Input options list"); d->mOptionList->addItem(HbIcon(settingsIcon), tr("Input settings")); - d->mOptionList->setPreferredWidth(300); + d->mOptionList->setContentsMargins(0, 0, 0, 0); + d->mOptionList->setPreferredWidth(listWidth - 2 * margin); gridLayout->addItem(languageLabel, 0, 0); gridLayout->addItem(d->mLanguageButton, 0, 1); gridLayout->addItem(predictionLabel, 1, 0); gridLayout->addItem(d->mPredictionButton, 1, 1); + gridLayout->setContentsMargins(0, 0, 0, 0); - qreal buttonWidth = 30 + d->languageNameWidth(); - gridLayout->setColumnFixedWidth(0, 300 - buttonWidth); - gridLayout->setColumnFixedWidth(1, buttonWidth); - - qreal buttonHeight = buttonWidth * 0.4; - gridLayout->setRowFixedHeight(0, buttonHeight); - gridLayout->setRowFixedHeight(1, buttonHeight); + // Width for language button is based on the width of language name string and button margins + qreal buttonMargin(20); + style.parameter(QString("expr(var(hb-param-margin-gene-left)+var(hb-param-margin-gene-right))"), buttonMargin); + gridLayout->setColumnFixedWidth(1, buttonMargin + d->languageNameWidth()); mainLayout->addItem(gridLayout); mainLayout->addItem(d->mOptionList); - setLayout(mainLayout); + mainLayout->setContentsMargins(0, 0, 0, 0); + QGraphicsWidget *content = new QGraphicsWidget(this); + content->setContentsMargins(0, 0, 0, 0); + content->setLayout(mainLayout); + setContentWidget(content); d->mPredictionValues.append(tr("Off")); d->mPredictionValues.append(tr("On")); @@ -139,28 +188,24 @@ setTimeout(HbDialog::NoTimeout); setBackgroundFaded(false); setDismissPolicy(TapOutside); + setContentsMargins(margin, margin, margin, margin); + setPreferredWidth(listWidth); -#if QT_VERSION >= 0x040600 - // Make sure the custom button list never steals focus. + // Make sure the input settings list never steals focus. setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); - // enable drop shadow for the setting list -// Effect deletion is crashing -> Effect temporarily removed -// QGraphicsDropShadowEffect *effect = new QGraphicsDropShadowEffect; -// effect->setBlurRadius(8); -// setGraphicsEffect(effect); -#endif - connect(d->mLanguageButton, SIGNAL(clicked(bool)), this, SLOT(languageButtonClicked())); connect(d->mPredictionButton, SIGNAL(clicked(bool)), this, SLOT(predictionButtonClicked())); - connect(d->mOptionList, SIGNAL(activated(HbListWidgetItem*)), this, SLOT(listItemActivated(HbListWidgetItem*))); - connect(d->mOptionList, SIGNAL(longPressed(HbListWidgetItem*, const QPointF&)), this, SLOT(listItemActivated(HbListWidgetItem*))); + connect(d->mOptionList, SIGNAL(activated(HbListWidgetItem *)), this, SLOT(listItemActivated(HbListWidgetItem *))); + connect(d->mOptionList, SIGNAL(longPressed(HbListWidgetItem *, const QPointF &)), this, SLOT(listItemActivated(HbListWidgetItem *))); HbInputSettingProxy *settings = HbInputSettingProxy::instance(); connect(settings, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), this, SLOT(primaryLanguageChanged(const HbInputLanguage &))); connect(settings, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), this, SLOT(secondaryLanguageChanged(const HbInputLanguage &))); connect(settings, SIGNAL(predictiveInputStateChanged(HbKeyboardSettingFlags, bool)), this, SLOT(predictionStatusChanged(HbKeyboardSettingFlags, bool))); + + connect(this, SIGNAL(aboutToClose()), this, SLOT(aboutToClose())); } /*! @@ -184,7 +229,7 @@ d->mLanguageButton->setText(d->mPrimaryLanguage.localisedName()); d->mPredictionButton->setText(d->mPredictionValues.at(settings->predictiveInputStatusForActiveKeyboard())); - QList customList = HbInputMethod::listCustomInputMethods(); + QList customList = HbInputMethod::listCustomInputMethods(mainWindow()->orientation(), d->mPrimaryLanguage); bool showInputMethod = true; if (customList.count() < 1) { showInputMethod = false; @@ -218,29 +263,41 @@ } /*! +Closes input method selection if settings is closed +*/ +void HbInputSettingList::aboutToClose() +{ + Q_D(HbInputSettingList); + + if (d->mInputMethodSelectionList) { + d->mInputMethodSelectionList->close(); + } +} + +/*! Swaps current primary and secondary languages */ void HbInputSettingList::languageButtonClicked() { Q_D(HbInputSettingList); - HbInputSettingProxy *settings = HbInputSettingProxy::instance(); + HbInputSettingProxy *settings = HbInputSettingProxy::instance(); HbPredictionFactory *predFactory = HbPredictionFactory::instance(); if (d->mSecondaryLanguage == HbInputLanguage()) { emit inputSettingsButtonClicked(); } else { - HbInputLanguage language = d->mPrimaryLanguage; - bool oldPLangSupportsPrediction = (predFactory->predictionEngineForLanguage(language) != NULL); + HbInputLanguage language = d->mPrimaryLanguage; + bool oldPLangSupportsPrediction = (predFactory->predictionEngineForLanguage(language) != NULL); d->mPrimaryLanguage = d->mSecondaryLanguage; d->mSecondaryLanguage = language; HbInputSettingProxy::instance()->setGlobalInputLanguage(d->mPrimaryLanguage); - bool langSupportsPrediction = (predFactory->predictionEngineForLanguage(d->mPrimaryLanguage) != NULL); + bool langSupportsPrediction = (predFactory->predictionEngineForLanguage(d->mPrimaryLanguage) != NULL); HbInputSettingProxy::instance()->setGlobalSecondaryInputLanguage(d->mSecondaryLanguage); - - if( oldPLangSupportsPrediction != langSupportsPrediction) { + + if (oldPLangSupportsPrediction != langSupportsPrediction) { settings->setPredictiveInputStatusForActiveKeyboard(langSupportsPrediction); - } + } } close(); @@ -265,11 +322,10 @@ if (d->mOptionList->row(item) == d->mOptionList->count() - 1) { emit inputSettingsButtonClicked(); + close(); } else { - emit inputMethodsButtonClicked(); + d->showInputMethodSelectionList(); } - - close(); } /*! @@ -306,4 +362,13 @@ d->mPredictionButton->setText(d->mPredictionValues.at(status)); } +/*! +Closes settings and emits inputMethodSelected signal with given parameter +*/ +void HbInputSettingList::closeSettings(const HbInputMethodDescriptor &descriptor, const QByteArray &customData) +{ + close(); + emit inputMethodSelected(descriptor, customData); +} + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsettinglist.h --- a/src/hbinput/inputwidgets/hbinputsettinglist.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsettinglist.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,13 +32,14 @@ class HbInputSettingListPrivate; class HbListWidgetItem; class HbInputLanguage; +class HbInputMethodDescriptor; class HB_INPUT_EXPORT HbInputSettingList : public HbDialog { Q_OBJECT public: - HbInputSettingList(QGraphicsWidget* parent = 0); + HbInputSettingList(QGraphicsWidget *parent = 0); virtual ~HbInputSettingList(); public: @@ -47,20 +48,23 @@ void setPredictionSelectionEnabled(bool disabled); public slots: + void aboutToClose(); void languageButtonClicked(); void predictionButtonClicked(); void listItemActivated(HbListWidgetItem *item); void primaryLanguageChanged(const HbInputLanguage &newLanguage); void secondaryLanguageChanged(const HbInputLanguage &newLanguage); void predictionStatusChanged(HbKeyboardSettingFlags keyboardType, bool newStatus); + void closeSettings(const HbInputMethodDescriptor &descriptor, const QByteArray &customData); signals: void inputMethodsButtonClicked(); void inputSettingsButtonClicked(); + void inputMethodSelected(const HbInputMethodDescriptor &descriptor, const QByteArray &customData); private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputSettingList) - Q_DISABLE_COPY(HbInputSettingList) + Q_DISABLE_COPY(HbInputSettingList) }; #endif // HB_INPUT_SETTING_LIST_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsettingwidget.cpp --- a/src/hbinput/inputwidgets/hbinputsettingwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsettingwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,15 +22,22 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputsettingwidget.h" #include #include #include #include #include +#include +#include +#include +#include +#include -#include "hbinputsettingwidget.h" #include "hbinputcheckboxlist_p.h" +#include "hbinputsettingproxy_p.h" +#include const QString statusOff = QObject::tr("Off"); const QString statusOn = QObject::tr("On"); @@ -38,6 +45,66 @@ const QString exactTyping = QObject::tr("Exact typing"); /// @cond +// input modes name for chinese +const QString KPinyinName("Pinyin"); +const QString KStrokeName("Stroke"); +const QString KZhuyinName("Zhuyin"); +const QString KCangjieNormalName("CangjieNormal"); +const QString KCangjieEasyName("CangjieEasy"); +const QString KCangjieAdvancedName("CangjieAdvanced"); +const QString KHwrName("Handwriting"); +const QString KHwrVerySlowName("VerySlow"); +const QString KHwrSlowName("Slow"); +const QString KHwrNormalName("Normal"); +const QString KHwrFastName("Fast"); +const QString KHwrVeryFastName("VeryFast"); + +// strings used for represent cangjie +const QString KCangjieGeneralName("Cangjie"); +const QString KEasy("Easy"); +const QString KNormal("Normal"); +const QString KAdvanced("Advanced"); + +// input modes value for chinese +const int KChineseInputModeNone = -1; +const int KPinyinMode = 0; +const int KStrokeMode = 1; +const int KZhuyinMode = 2; +const int KCangjieNormalMode = 3; +const int KCangjieEasyMode = 4; +const int KCangjieAdvancedMode = 5; +const int KHwrMode = 6; + +// define chinese input plugin name +#ifdef Q_OS_WIN +const QString KCnHwrPluginName("HbChineseHwrd.dll"); +#else +#ifdef Q_OS_SYMBIAN +const QString KCnHwrPluginName("HbChineseHwr.qtplugin"); +#else +const QString KCnHwrPluginName("HbChineseHwr.dll"); +#endif +#endif + +#ifdef Q_OS_WIN +const QString KCnVItutPluginName("HbChineseVItutd.dll"); +#else +#ifdef Q_OS_SYMBIAN +const QString KCnVItutPluginName("HbChineseVItut.qtplugin"); +#else +const QString KCnVItutPluginName("HbChineseVItut.dll"); +#endif +#endif + +#ifdef Q_OS_WIN +const QString KCnVkbPluginName("HbChineseVkbd.dll"); +#else +#ifdef Q_OS_SYMBIAN +const QString KCnVkbPluginName("HbChineseVkb.qtplugin"); +#else +const QString KCnVkbPluginName("HbChineseVkb.dll"); +#endif +#endif class HbInputSettingWidgetPrivate { @@ -52,7 +119,15 @@ int languageToIndex(const HbInputLanguage &language, const QList &languageList); HbInputLanguage indexToLanguage(int index, const QList &languageList); void createSecondaryLanguageList(); + void updateContentWidgetData(); + int inputModeToIndex(const int &inputMode, const QList &inputModeList); + int indexToInputmode(int index, const QList &inputModeList); + void createChineseSettingGroup(HbDataFormModel *model); + QInputContextPlugin *pluginInstance(const QString &pluginFileName) const; + HbInputMethodDescriptor findInputMethodDescriptor(const QString &inputMethodString); + void setInputMethodVar(Qt::Orientation orientation, QString &inputMethodString, QByteArray &num); + QByteArray createHwrSpeedData(QByteArray preferredCustomData, int index); public: HbDataForm *mForm; HbDataFormModelItem *mPrimaryLanguageItem; @@ -76,17 +151,50 @@ HbTypingCorrectionLevel mTypingCorrectionLevel; HbPrimaryCandidateMode mPrimaryCandidateMode; HbInputSettingWidget *q_ptr; + HbDataFormModel *mModel; + + // member variables for chinese + HbDataFormModelItem *mLanguageGroup; + HbDataFormModelItem *mChineseInputGroup; + HbDataFormModelItem *mPortraitInputMethodItem; + HbDataFormModelItem *mLandscapeInputMethodItem; + HbDataFormModelItem *mHwrSpeedItem; + HbDataFormModelItem *mCangjieItem; + int mCnPortraitInputMode; + int mCnLandscapeInputMode; + int mCnCangjieInputMode; + + int mHwrSpeed; + QList mCnPortraitInputModeList; + QList mCnLandscapeInputModeList; + QList mCangjieInputModeList; + QStringList mCnPortraitInputModeNames; + QStringList mCnLandscapeInputModeNames; + QStringList mCnCangjieInputModeNames; + QStringList mHwrSpeedNames; }; /*! Constructs setting widget */ HbInputSettingWidgetPrivate::HbInputSettingWidgetPrivate(HbDataForm *dataForm) - : mForm(dataForm), mPrimaryLanguageItem(NULL), - mSecondaryLanguageItem(NULL), mKeypressTimeoutItem(NULL), - mCharacterPreviewItem(NULL), mPredictionItem(NULL), - mAutoCompletionItem(NULL), mCorrectionLevelItem(NULL), - mPrimaryCandidateItem(NULL), q_ptr(NULL) + : mForm(dataForm), + mPrimaryLanguageItem(0), + mSecondaryLanguageItem(0), + mKeypressTimeoutItem(0), + mCharacterPreviewItem(0), + mPredictionItem(0), + mAutoCompletionItem(0), + mCorrectionLevelItem(0), + mPrimaryCandidateItem(0), + q_ptr(0), + mModel(0), + mLanguageGroup(0), + mChineseInputGroup(0), + mPortraitInputMethodItem(0), + mLandscapeInputMethodItem(0), + mHwrSpeedItem(0), + mCangjieItem(0) { } @@ -109,8 +217,208 @@ HbInputUtils::listSupportedInputLanguages(mPrimaryLanguages); createSecondaryLanguageList(); + // if the model is already constructed we do not need to recreate the setting items + if (!mModel) { + createSettingItems(); + } else { + // simply update the settings dependant content widget data of all the items + updateContentWidgetData(); + //make sure that the items are not expanded + QModelIndex index = mModel->indexFromItem(mSecondaryLanguageItem->parent()); + mForm->setExpanded(index, false); + index = mModel->indexFromItem(mKeypressTimeoutItem->parent()); + mForm->setExpanded(index, false); + index = mModel->indexFromItem(mPredictionItem->parent()); + mForm->setExpanded(index, false); + } +} - createSettingItems(); +void HbInputSettingWidgetPrivate::createChineseSettingGroup(HbDataFormModel *model) +{ + Q_Q(HbInputSettingWidget); + int imMode = KChineseInputModeNone; + QByteArray ba = HbInputSettingProxy::instance()->preferredInputMethodCustomData(Qt::Vertical); + QString portraitCustomData(ba); + QString imName = portraitCustomData.split(" ").at(0); + HbInputLanguage lang = HbInputSettingProxy::instance()->globalInputLanguage(); + + if (imName == KPinyinName) { + imMode = KPinyinMode; + } else if (imName == KStrokeName) { + imMode = KStrokeMode; + } else if (imName == KZhuyinName) { + imMode = KZhuyinMode; + } else if (imName == KHwrName) { + imMode = KHwrMode; + } else { + if (lang.variant() == QLocale::China) { + imMode = KPinyinMode; + } else if (lang.variant() == QLocale::HongKong) { + imMode = KStrokeMode; + } else if (lang.variant() == QLocale::Taiwan) { + imMode = KZhuyinMode; + } + } + + mCnPortraitInputMode = imMode; + + ba = HbInputSettingProxy::instance()->preferredInputMethodCustomData(Qt::Horizontal); + QString landscapeCustomData(ba); + imName = landscapeCustomData.split(" ").at(0); + + mCnCangjieInputMode = KCangjieNormalMode; + if (imName == KPinyinName) { + mCnLandscapeInputMode = KPinyinMode; + } else if (imName == KStrokeName) { + mCnLandscapeInputMode = KStrokeMode; + } else if (imName == KZhuyinName) { + mCnLandscapeInputMode = KZhuyinMode; + } else if (imName == KCangjieNormalName) { + mCnLandscapeInputMode = KCangjieNormalMode; + mCnCangjieInputMode = KCangjieNormalMode; + } else if (imName == KCangjieEasyName) { + mCnLandscapeInputMode = KCangjieNormalMode; + mCnCangjieInputMode = KCangjieEasyMode; + } else if (imName == KCangjieAdvancedName) { + mCnLandscapeInputMode = KCangjieNormalMode; + mCnCangjieInputMode = KCangjieAdvancedMode; + } else if (imName == KHwrName) { + mCnLandscapeInputMode = KHwrMode; + } else { + if (lang.variant() == QLocale::China) { + mCnLandscapeInputMode = KPinyinMode; + } else if (lang.variant() == QLocale::HongKong) { + mCnLandscapeInputMode = KStrokeMode; + } else if (lang.variant() == QLocale::Taiwan) { + mCnLandscapeInputMode = KZhuyinMode; + } + } + + Qt::Orientation orientation = HbInputSettingProxy::instance()->screenOrientation(); + ba = HbInputSettingProxy::instance()->preferredInputMethodCustomData(orientation); + QString customData(ba); + if (customData.split(" ").count() > 1) { + imName = customData.split(" ").at(1); + if (imName == KHwrVerySlowName) { + mHwrSpeed = 0; + } else if (imName == KHwrSlowName) { + mHwrSpeed = 1; + } else if (imName == KHwrNormalName) { + mHwrSpeed = 2; + } else if (imName == KHwrFastName) { + mHwrSpeed = 3; + } else if (imName == KHwrVeryFastName) { + mHwrSpeed = 4; + } else { + mHwrSpeed = 2; + } + } else { + mHwrSpeed = 2; + } + + mHwrSpeedNames.clear(); + mCnPortraitInputModeList.clear(); + mCnLandscapeInputModeList.clear(); + mCnPortraitInputModeNames.clear(); + mCnLandscapeInputModeNames.clear(); + mCnCangjieInputModeNames.clear(); + + mHwrSpeedNames << "Very slow" << "Slow" << "Normal" << "Fast" << "Very Fast"; + if (mPrimaryInputLanguage == HbInputLanguage(QLocale::Chinese, QLocale::China)) { + mCnPortraitInputModeList << KPinyinMode << KStrokeMode << KHwrMode; + mCnLandscapeInputModeList << KPinyinMode << KStrokeMode << KHwrMode; + mCnPortraitInputModeNames << KPinyinName << KStrokeName << KHwrName; + mCnLandscapeInputModeNames << KPinyinName << KStrokeName << KHwrName; + } else if (mPrimaryInputLanguage == HbInputLanguage(QLocale::Chinese, QLocale::HongKong)) { + mCnPortraitInputModeList << KStrokeMode << KHwrMode; + mCnLandscapeInputModeList << KStrokeMode << KCangjieNormalMode << KHwrMode; + mCangjieInputModeList << KCangjieEasyMode << KCangjieNormalMode << KCangjieAdvancedMode; + mCnPortraitInputModeNames << KStrokeName << KHwrName; + mCnLandscapeInputModeNames << KStrokeName << KCangjieGeneralName << KHwrName; + mCnCangjieInputModeNames << KEasy << KNormal << KAdvanced; + } else if (mPrimaryInputLanguage == HbInputLanguage(QLocale::Chinese, QLocale::Taiwan)) { + mCnPortraitInputModeList << KZhuyinMode << KHwrMode; + mCnLandscapeInputModeList << KZhuyinMode << KHwrMode; + mCnPortraitInputModeNames << KZhuyinName << KHwrName; + mCnLandscapeInputModeNames << KZhuyinName << KHwrName; + } + + if (!mChineseInputGroup) { + mChineseInputGroup = model->appendDataFormGroup(QObject::tr("Chinese Input")); + mPortraitInputMethodItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Portrait mode input method")); + mChineseInputGroup->appendChild(mPortraitInputMethodItem); + mPortraitInputMethodItem->setContentWidgetData(QString("items"), mCnPortraitInputModeNames); + int imIdx = inputModeToIndex(mCnPortraitInputMode, mCnPortraitInputModeList); + QVariant varPor; + varPor.setValue(imIdx); + mPortraitInputMethodItem->setContentWidgetData(QString("currentIndex"), varPor); + mPortraitInputMethodItem->setContentWidgetData(QString("objectName"), QString("portrait_input_method")); + mForm->addConnection(mPortraitInputMethodItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setPortraitInputMethod(int))); + + mLandscapeInputMethodItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Landscape mode input method")); + mChineseInputGroup->appendChild(mLandscapeInputMethodItem); + mLandscapeInputMethodItem->setContentWidgetData(QString("items"), mCnLandscapeInputModeNames); + int imIdx_lan = inputModeToIndex(mCnLandscapeInputMode, mCnLandscapeInputModeList); + QVariant varLan; + varLan.setValue(imIdx_lan); + mLandscapeInputMethodItem->setContentWidgetData(QString("currentIndex"), varLan); + mLandscapeInputMethodItem->setContentWidgetData(QString("objectName"), QString("landscape_input_method")); + mForm->addConnection(mLandscapeInputMethodItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setLandscapeInputMethod(int))); + + mHwrSpeedItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Handwriting speed")); + mChineseInputGroup->appendChild(mHwrSpeedItem); + mHwrSpeedItem->setContentWidgetData(QString("items"), mHwrSpeedNames); + int hwr = mHwrSpeed; + mHwrSpeedItem->setContentWidgetData(QString("currentIndex"), hwr); + mHwrSpeedItem->setContentWidgetData(QString("objectName"), QString("handwriting_speed")); + mForm->addConnection(mHwrSpeedItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setHwrSpeed(int))); + } + + if (mPrimaryInputLanguage == HbInputLanguage(QLocale::Chinese, QLocale::HongKong)) { + mCangjieItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Cangjie mode")); + mChineseInputGroup->appendChild(mCangjieItem); + mCangjieItem->setContentWidgetData(QString("items"), mCnCangjieInputModeNames); + int cangjieIdx = inputModeToIndex(mCnCangjieInputMode, mCangjieInputModeList); + QVariant varCang; + varCang.setValue(cangjieIdx); + mCangjieItem->setContentWidgetData(QString("currentIndex"), varCang); + mCangjieItem->setContentWidgetData(QString("objectName"), QString("cangjie_mode")); + mForm->addConnection(mCangjieItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setCangjieMode(int))); + } +} + +void HbInputSettingWidgetPrivate::updateContentWidgetData() +{ + // current primary language + mPrimaryLanguageItem->setContentWidgetData(QString("currentIndex"), languageToIndex(mPrimaryInputLanguage, mPrimaryLanguages)); + + mSecondaryLanguageItem->setContentWidgetData(QString("currentIndex"), languageToIndex(mSecondaryInputLanguage, mSecondaryLanguages)); + // key press timeout + mKeypressTimeoutItem->setContentWidgetData(QString("sliderPosition"), mKeypressTimeout); + if (mCharacterPreviewEnabled) { + mCharacterPreviewItem->setContentWidgetData(QString("text"), statusOn); + mCharacterPreviewItem->setContentWidgetData(QString("additionalText"), statusOff); + } else { + mCharacterPreviewItem->setContentWidgetData(QString("text"), statusOff); + mCharacterPreviewItem->setContentWidgetData(QString("additionalText"), statusOn); + } + QList predictionEnabled; + predictionEnabled << mPredictionStatusForQwerty << mPredictionStatusForITUT; + mPredictionItem->setContentWidgetData(QString("selectedItems"), predictionEnabled); + + QList autocompletionEnabled; + autocompletionEnabled << mAutocompletionForQwerty << mAutocompletionForITUT; + mAutoCompletionItem->setContentWidgetData(QString("selectedItems"), autocompletionEnabled); + + mCorrectionLevelItem->setContentWidgetData(QString("selected"), mTypingCorrectionLevel); + + if (mPrimaryCandidateMode == HbPrimaryCandidateModeBestPrediction) { + mPrimaryCandidateItem->setContentWidgetData(QString("text"), bestPrediction); + mPrimaryCandidateItem->setContentWidgetData(QString("additionalText"), exactTyping); + } else { + mPrimaryCandidateItem->setContentWidgetData(QString("text"), exactTyping); + mPrimaryCandidateItem->setContentWidgetData(QString("additionalText"), bestPrediction); + } } /*! @@ -120,17 +428,17 @@ { Q_Q(HbInputSettingWidget); - HbDataFormModel *model = new HbDataFormModel(); + mModel = new HbDataFormModel(); HbInputCheckBoxList *customPrototype = new HbInputCheckBoxList(mForm); - QList prototypes = mForm->itemPrototypes(); + QList prototypes = mForm->itemPrototypes(); prototypes.append(customPrototype); mForm->setItemPrototypes(prototypes); - HbDataFormModelItem *languageGroup = model->appendDataFormGroup(QObject::tr("Language")); + mLanguageGroup = mModel->appendDataFormGroup(QObject::tr("Language")); mPrimaryLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Primary Writing language")); - languageGroup->appendChild(mPrimaryLanguageItem); + mLanguageGroup->appendChild(mPrimaryLanguageItem); QStringList writingLanguageItems; fillLanguageList(writingLanguageItems, mPrimaryLanguages); mPrimaryLanguageItem->setContentWidgetData(QString("items"), writingLanguageItems); @@ -138,16 +446,17 @@ mPrimaryLanguageItem->setContentWidgetData(QString("objectName"), QString("primary_writing_language")); mForm->addConnection(mPrimaryLanguageItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setPrimaryLanguage(int))); - mSecondaryLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Secondary Writing language")); - languageGroup->appendChild(mSecondaryLanguageItem); - QStringList secondaryLanguageItems; - fillLanguageList(secondaryLanguageItems, mSecondaryLanguages, QObject::tr("None")); - mSecondaryLanguageItem->setContentWidgetData(QString("items"), secondaryLanguageItems); - mSecondaryLanguageItem->setContentWidgetData(QString("currentIndex"), languageToIndex(mSecondaryInputLanguage, mSecondaryLanguages)); - mSecondaryLanguageItem->setContentWidgetData(QString("objectName"), QString("secondary_writing_language")); - mForm->addConnection(mSecondaryLanguageItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setSecondaryLanguage(int))); - - HbDataFormModelItem *keyboardGroup = model->appendDataFormGroup(QObject::tr("Keyboard")); + if (mPrimaryInputLanguage.language() != QLocale::Chinese) { + mSecondaryLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Secondary Writing language")); + mLanguageGroup->appendChild(mSecondaryLanguageItem); + QStringList secondaryLanguageItems; + fillLanguageList(secondaryLanguageItems, mSecondaryLanguages, QObject::tr("None")); + mSecondaryLanguageItem->setContentWidgetData(QString("items"), secondaryLanguageItems); + mSecondaryLanguageItem->setContentWidgetData(QString("currentIndex"), languageToIndex(mSecondaryInputLanguage, mSecondaryLanguages)); + mSecondaryLanguageItem->setContentWidgetData(QString("objectName"), QString("secondary_writing_language")); + mForm->addConnection(mSecondaryLanguageItem, SIGNAL(currentIndexChanged(int)), q, SLOT(setSecondaryLanguage(int))); + } + HbDataFormModelItem *keyboardGroup = mModel->appendDataFormGroup(QObject::tr("Keyboard")); mKeypressTimeoutItem = new HbDataFormModelItem(HbDataFormModelItem::SliderItem, QObject::tr("Keypress Timeout")); keyboardGroup->appendChild(mKeypressTimeoutItem); @@ -167,9 +476,8 @@ mCharacterPreviewItem->setContentWidgetData(QString("additionalText"), statusOn); } mCharacterPreviewItem->setContentWidgetData(QString("objectName"), QString("character_bubble")); - mForm->addConnection(mCharacterPreviewItem, SIGNAL(clicked(bool)), q, SLOT(setCharacterPreviewState())); - HbDataFormModelItem *textInputGroup = model->appendDataFormGroup(QObject::tr("Intelligent Text Input")); + HbDataFormModelItem *textInputGroup = mModel->appendDataFormGroup(QObject::tr("Intelligent Text Input")); HbDataFormModelItem::DataItemType checkboxList = static_cast(HbDataFormModelItem::CustomItemBase); @@ -199,7 +507,7 @@ mCorrectionLevelItem = new HbDataFormModelItem(HbDataFormModelItem::RadioButtonListItem, QObject::tr("Typing Correction")); textInputGroup->appendChild(mCorrectionLevelItem); QStringList correctionLevels; - correctionLevels << QObject::tr("Low") << QObject::tr("Medium") << QObject::tr("High"); + correctionLevels << QObject::tr("Off") << QObject::tr("Medium") << QObject::tr("High"); mCorrectionLevelItem->setContentWidgetData(QString("items"), correctionLevels); mCorrectionLevelItem->setContentWidgetData(QString("selected"), mTypingCorrectionLevel); mCorrectionLevelItem->setContentWidgetData(QString("objectName"), QString("typing_correction")); @@ -215,9 +523,12 @@ mPrimaryCandidateItem->setContentWidgetData(QString("additionalText"), bestPrediction); } mPrimaryCandidateItem->setContentWidgetData(QString("objectName"), QString("primary_candidate")); - mForm->addConnection(mPrimaryCandidateItem, SIGNAL(clicked(bool)), q, SLOT(setPrimaryCandidateMode())); - mForm->setModel(model); + if (mPrimaryInputLanguage.language() == QLocale::Chinese) { + createChineseSettingGroup(mModel); + } + mForm->setModel(mModel); + QObject::connect(mModel, SIGNAL(dataChanged(QModelIndex, QModelIndex)), q, SLOT(dataChange(QModelIndex, QModelIndex))); } /*! @@ -225,7 +536,7 @@ */ void HbInputSettingWidgetPrivate::fillLanguageList(QStringList &list, QList &languageList, const QString &replace) { - foreach(HbInputLanguage language, languageList) { + foreach(HbInputLanguage language, languageList) { QString langName = language.localisedName(); if (langName.length() == 0) { langName = replace; @@ -278,13 +589,178 @@ } } +/*! +Returns index of the given inputmode at the inputmode list +*/ +int HbInputSettingWidgetPrivate::inputModeToIndex(const int &inputMode, const QList &inputModeList) +{ + for (int i = 0; i < inputModeList.count(); ++i) { + if (inputModeList.at(i) == inputMode) { + return i; + } + } + return -1; +} + +/*! +Returns inputmode in the given index at the inputmode list +*/ +int HbInputSettingWidgetPrivate::indexToInputmode(int index, const QList &inputModeList) +{ + if (index >= 0 && index < inputModeList.count()) { + return inputModeList.at(index); + } else { + return KChineseInputModeNone; + } +} + +QInputContextPlugin *HbInputSettingWidgetPrivate::pluginInstance(const QString &pluginFileName) const +{ + if (QLibrary::isLibrary(pluginFileName)) { + QPluginLoader loader(pluginFileName); + QObject *plugin = loader.instance(); + if (plugin) { + return qobject_cast(plugin); + } + } + + return 0; +} + +HbInputMethodDescriptor HbInputSettingWidgetPrivate::findInputMethodDescriptor(const QString &inputMethodString) +{ + HbInputMethodDescriptor descriptor; + // Query plugin paths and scan the folders. + QStringList folders = HbInputSettingProxy::instance()->inputMethodPluginPaths(); + foreach(const QString &folder, folders) { + QDir dir(folder); + for (unsigned int i = 0; i < dir.count(); i++) { + QString path = QString(dir.absolutePath()); + if (path.right(1) != "\\" && path.right(1) != "/") { + path += QDir::separator(); + } + path += inputMethodString; + QInputContextPlugin *inputContextPlugin = pluginInstance(path); + if (inputContextPlugin) { + descriptor.setPluginNameAndPath(dir.absolutePath() + QDir::separator() + inputMethodString); + + // For each found plugin, check if there is already a list item for it. + // If not, then add one. + QStringList contextKeys = inputContextPlugin->keys(); + foreach(QString key, contextKeys) { + descriptor.setKey(key); + descriptor.setDisplayName(inputContextPlugin->displayName(key)); + } + break; + } + } + } + return descriptor; +} + +void HbInputSettingWidgetPrivate::setInputMethodVar(Qt::Orientation orientation, QString &inputMethodString, QByteArray &customData) +{ + int inputMode = KChineseInputModeNone; + if (orientation == Qt::Vertical) { + inputMode = mCnPortraitInputMode; + } else if (orientation == Qt::Horizontal) { + inputMode = mCnLandscapeInputMode; + } else { + return; + } + + switch (inputMode) { + case KPinyinMode: { + orientation == Qt::Vertical ? inputMethodString = KCnVItutPluginName : inputMethodString = KCnVkbPluginName; + customData.append(KPinyinName.toLatin1().data()); + } + break; + case KStrokeMode: { + orientation == Qt::Vertical ? inputMethodString = KCnVItutPluginName : inputMethodString = KCnVkbPluginName; + customData.append(KStrokeName.toLatin1().data()); + } + break; + case KZhuyinMode: { + orientation == Qt::Vertical ? inputMethodString = KCnVItutPluginName : inputMethodString = KCnVkbPluginName; + customData.append(KZhuyinName.toLatin1().data()); + } + break; + case KHwrMode: { + inputMethodString = KCnHwrPluginName; + customData.append(KHwrName.toLatin1().data()); + } + break; + case KCangjieNormalMode: { + inputMethodString = KCnVkbPluginName; + customData.append(KCangjieNormalName.toLatin1().data()); + } + break; + case KCangjieEasyMode: { + inputMethodString = KCnVkbPluginName; + customData.append(KCangjieEasyName.toLatin1().data()); + } + break; + case KCangjieAdvancedMode: { + inputMethodString = KCnVkbPluginName; + customData.append(KCangjieAdvancedName.toLatin1().data()); + } + break; + default: + break; + } + + QByteArray preferredCustomData = HbInputSettingProxy::instance()->preferredInputMethodCustomData(orientation); + QString imName(preferredCustomData); + QStringList temp = imName.split(" "); + if (temp.count() > 1) { + customData.append(" "); + customData.append(temp.at(1).toLatin1().data()); + } else { + customData.append(" "); + customData.append(KHwrNormalName.toLatin1().data()); + } + customData.append((char)0); + return; +} + +QByteArray HbInputSettingWidgetPrivate::createHwrSpeedData(QByteArray preferredCustomData, int index) +{ + QString imName(preferredCustomData); + QStringList temp = imName.split(" "); + + QByteArray customData; + customData.append(temp.at(0).toLatin1().data()); + customData.append(" "); + switch (index) { + case 0: + customData.append(KHwrVerySlowName.toLatin1().data()); + break; + case 1: + customData.append(KHwrSlowName.toLatin1().data()); + break; + case 2: + customData.append(KHwrNormalName.toLatin1().data()); + break; + case 3: + customData.append(KHwrFastName.toLatin1().data()); + break; + case 4: + customData.append(KHwrVeryFastName.toLatin1().data()); + break; + default: + break; + } + customData.append((char)0); + return customData; +} + /// @endcond /*! Constructs input setting widget */ -HbInputSettingWidget::HbInputSettingWidget(HbDataForm *dataForm, QGraphicsWidget* parent) - : QObject(parent), d_ptr(new HbInputSettingWidgetPrivate(dataForm)) +HbInputSettingWidget::HbInputSettingWidget(HbDataForm *dataForm, QGraphicsWidget *parent) + : QObject(parent), d_ptr(new HbInputSettingWidgetPrivate(dataForm)) { Q_D(HbInputSettingWidget); d->q_ptr = this; @@ -357,7 +833,7 @@ d->mPredictionStatusForITUT = newState; changed = true; } else if (keyboardType & HbKeyboardSettingQwerty && - d->mPredictionStatusForQwerty != newState) { + d->mPredictionStatusForQwerty != newState) { d->mPredictionStatusForQwerty = newState; changed = true; } @@ -414,7 +890,7 @@ d->mAutocompletionForITUT = newState; changed = true; } else if (keyboardType & HbKeyboardSettingQwerty && - d->mAutocompletionForQwerty != newState) { + d->mAutocompletionForQwerty != newState) { d->mAutocompletionForQwerty = newState; changed = true; } @@ -465,30 +941,61 @@ { Q_D(HbInputSettingWidget); - HbInputSettingProxy *settings = HbInputSettingProxy::instance(); + HbInputSettingProxy *settings = HbInputSettingProxy::instance(); HbPredictionFactory *predFactory = HbPredictionFactory::instance(); - bool oldPLangSupportsPrediction = (predFactory->predictionEngineForLanguage(d->mPrimaryInputLanguage) != NULL); + bool oldPLangSupportsPrediction = (predFactory->predictionEngineForLanguage(d->mPrimaryInputLanguage) != NULL); d->mPrimaryInputLanguage = d->indexToLanguage(index, d->mPrimaryLanguages); HbInputSettingProxy::instance()->setGlobalInputLanguage(d->mPrimaryInputLanguage); - bool langSupportsPrediction = (predFactory->predictionEngineForLanguage(d->mPrimaryInputLanguage) != NULL); - if( oldPLangSupportsPrediction != langSupportsPrediction) { - if(settings->predictiveInputStatus(HbKeyboardSetting12key) != langSupportsPrediction) { - settings->setPredictiveInputStatus(HbKeyboardSetting12key, langSupportsPrediction); - } - if (settings->predictiveInputStatus(HbKeyboardSettingQwerty) != langSupportsPrediction) { - settings->setPredictiveInputStatus(HbKeyboardSettingQwerty, langSupportsPrediction); - } - } + bool langSupportsPrediction = (predFactory->predictionEngineForLanguage(d->mPrimaryInputLanguage) != NULL); + if (oldPLangSupportsPrediction != langSupportsPrediction) { + if (settings->predictiveInputStatus(HbKeyboardSetting12key) != langSupportsPrediction) { + settings->setPredictiveInputStatus(HbKeyboardSetting12key, langSupportsPrediction); + } + if (settings->predictiveInputStatus(HbKeyboardSettingQwerty) != langSupportsPrediction) { + settings->setPredictiveInputStatus(HbKeyboardSettingQwerty, langSupportsPrediction); + } + } - HbInputLanguage secondaryLanguage = d->mSecondaryInputLanguage; - // Update secondary language list - d->createSecondaryLanguageList(); - QStringList secondaryLanguageItems; - d->fillLanguageList(secondaryLanguageItems, d->mSecondaryLanguages, tr("None")); - d->mSecondaryLanguageItem->setContentWidgetData(QString("items"), secondaryLanguageItems); + if (d->mPrimaryInputLanguage.language() != QLocale::Chinese) { + HbInputLanguage secondaryLanguage = d->mSecondaryInputLanguage; + // Update secondary language list + d->createSecondaryLanguageList(); + QStringList secondaryLanguageItems; + d->fillLanguageList(secondaryLanguageItems, d->mSecondaryLanguages, tr("None")); + if (d->mSecondaryLanguageItem) { + d->mSecondaryLanguageItem->setContentWidgetData(QString("items"), secondaryLanguageItems); + if (d->mPrimaryInputLanguage != secondaryLanguage) { + d->mSecondaryLanguageItem->setContentWidgetData(QString("currentIndex"), d->languageToIndex(secondaryLanguage, d->mSecondaryLanguages)); + } + } else { + d->mSecondaryLanguageItem = new HbDataFormModelItem(HbDataFormModelItem::ComboBoxItem, QObject::tr("Secondary Writing language")); + d->mLanguageGroup->appendChild(d->mSecondaryLanguageItem); + d->mSecondaryLanguageItem->setContentWidgetData(QString("items"), secondaryLanguageItems); + d->mSecondaryLanguageItem->setContentWidgetData(QString("currentIndex"), d->languageToIndex(secondaryLanguage, d->mSecondaryLanguages)); + d->mSecondaryLanguageItem->setContentWidgetData(QString("objectName"), QString("secondary_writing_language")); + d->mForm->addConnection(d->mSecondaryLanguageItem, SIGNAL(currentIndexChanged(int)), this, SLOT(setSecondaryLanguage(int))); + } - if (d->mPrimaryInputLanguage != secondaryLanguage) { - d->mSecondaryLanguageItem->setContentWidgetData(QString("currentIndex"), d->languageToIndex(secondaryLanguage, d->mSecondaryLanguages)); + HbDataFormModel *model = qobject_cast(d->mForm->model()); + if (d->mChineseInputGroup) { + model->removeItem(d->mChineseInputGroup); + d->mChineseInputGroup = NULL; + } + } else { + HbDataFormModel *model = qobject_cast(d->mForm->model()); + if (d->mChineseInputGroup) { + model->removeItem(d->mChineseInputGroup); + d->mChineseInputGroup = NULL; + } + + if (d->mSecondaryLanguageItem) { + model->removeItem(d->mSecondaryLanguageItem); + d->mSecondaryLanguageItem = NULL; + } + + resetChineseInputMode(); + d->createChineseSettingGroup(model); + d->mForm->setModel(model); } } @@ -583,4 +1090,140 @@ HbInputSettingProxy::instance()->setPrimaryCandidateMode(d->mPrimaryCandidateMode); } +/*! +Saves the portrait input method +*/ +void HbInputSettingWidget::setPortraitInputMethod(int index) +{ + Q_D(HbInputSettingWidget); + d->mCnPortraitInputMode = d->indexToInputmode(index, d->mCnPortraitInputModeList); + QString inputMethodString; + QByteArray customData; + d->setInputMethodVar(Qt::Vertical, inputMethodString, customData); + + const HbInputMethodDescriptor descriptor = d->findInputMethodDescriptor(inputMethodString); + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Vertical, (const HbInputMethodDescriptor &)descriptor, customData); +} + +/*! +Saves the landscape input method +*/ +void HbInputSettingWidget::setLandscapeInputMethod(int index) +{ + Q_D(HbInputSettingWidget); + d->mCnLandscapeInputMode = d->indexToInputmode(index, d->mCnLandscapeInputModeList); + QString inputMethodString; + QByteArray customData; + d->setInputMethodVar(Qt::Horizontal, inputMethodString, customData); + + const HbInputMethodDescriptor descriptor = d->findInputMethodDescriptor(inputMethodString); + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, descriptor, customData); +} + +/*! +Saves the cangjie input mode +*/ +void HbInputSettingWidget::setCangjieMode(int index) +{ + Q_D(HbInputSettingWidget); + d->mCnCangjieInputMode = d->indexToInputmode(index, d->mCangjieInputModeList); + d->mCnLandscapeInputMode = d->mCnCangjieInputMode; + + QString inputMethodString; + QByteArray customData; + d->setInputMethodVar(Qt::Horizontal, inputMethodString, customData); + + const HbInputMethodDescriptor descriptor = d->findInputMethodDescriptor(inputMethodString); + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, descriptor, customData); +} + + +/*! +Saves the handwriting speed +*/ +void HbInputSettingWidget::setHwrSpeed(int index) +{ + Q_D(HbInputSettingWidget); + Qt::Orientation currentOrientation = HbInputSettingProxy::instance()->screenOrientation(); + QByteArray portraitCustomData = HbInputSettingProxy::instance()->preferredInputMethodCustomData(Qt::Vertical); + QByteArray landscapeCustomData = HbInputSettingProxy::instance()->preferredInputMethodCustomData(Qt::Horizontal); + HbInputMethodDescriptor portraitDes = HbInputSettingProxy::instance()->preferredInputMethod(Qt::Vertical); + HbInputMethodDescriptor landscapeDes = HbInputSettingProxy::instance()->preferredInputMethod(Qt::Horizontal); + QByteArray portraitHwrspeed = d->createHwrSpeedData(portraitCustomData, index); + QByteArray landscapeHwrspeed = d->createHwrSpeedData(landscapeCustomData, index); + + if (currentOrientation == Qt::Vertical) { + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, landscapeDes, landscapeHwrspeed); + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Vertical, portraitDes, portraitHwrspeed); + + } if (currentOrientation == Qt::Horizontal) { + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Vertical, portraitDes, portraitHwrspeed); + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, landscapeDes, landscapeHwrspeed); + } +} + +/*! +Saves the portrait input method +*/ +void HbInputSettingWidget::resetChineseInputMode() +{ + Q_D(HbInputSettingWidget); + HbInputLanguage lang = HbInputSettingProxy::instance()->globalInputLanguage(); + + if (lang.variant() == QLocale::China) { + d->mCnPortraitInputMode = KPinyinMode; + d->mCnLandscapeInputMode = KPinyinMode; + } else if (lang.variant() == QLocale::HongKong) { + d->mCnPortraitInputMode = KStrokeMode; + d->mCnLandscapeInputMode = KStrokeMode; + } else if (lang.variant() == QLocale::Taiwan) { + d->mCnPortraitInputMode = KZhuyinMode; + d->mCnLandscapeInputMode = KZhuyinMode; + } + + QString portraitInputMethodString; + QString landscapeInputMethodString; + QByteArray portraitCustomData; + QByteArray landscapeCustomData; + d->setInputMethodVar(Qt::Vertical, portraitInputMethodString, portraitCustomData); + d->setInputMethodVar(Qt::Horizontal, landscapeInputMethodString, landscapeCustomData); + + const HbInputMethodDescriptor portraitDescriptor = d->findInputMethodDescriptor(portraitInputMethodString); + const HbInputMethodDescriptor landscapeDescriptor = d->findInputMethodDescriptor(landscapeInputMethodString); + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Vertical, (const HbInputMethodDescriptor &)portraitDescriptor, portraitCustomData); + HbInputSettingProxy::instance()->setPreferredInputMethod(Qt::Horizontal, (const HbInputMethodDescriptor &)landscapeDescriptor, landscapeCustomData); +} + +/* + This slot is called when ever data in the form model is changed +*/ +void HbInputSettingWidget::dataChange(const QModelIndex &startIn, const QModelIndex &endIn) +{ + Q_D(HbInputSettingWidget); + Q_UNUSED(endIn); + HbDataFormModelItem *item = d->mModel->itemFromIndex(startIn); + if(item == d->mPrimaryCandidateItem) { + setPrimaryCandidateMode(); + } else if(item == d->mCharacterPreviewItem) { + setCharacterPreviewState(); + } +} + +/* + Resets the widget and disconnects the signals connected to the settings proxy +*/ + +void HbInputSettingWidget::resetWidget() +{ + HbInputSettingProxy *settings = HbInputSettingProxy::instance(); + disconnect(settings, SIGNAL(globalInputLanguageChanged(const HbInputLanguage &)), this, SLOT(updateGlobalInputLanguage(const HbInputLanguage &))); + disconnect(settings, SIGNAL(globalSecondaryInputLanguageChanged(const HbInputLanguage &)), this, SLOT(updateGlobalSecondaryInputLanguage(const HbInputLanguage &))); + disconnect(settings, SIGNAL(predictiveInputStateChanged(HbKeyboardSettingFlags, bool)), this, SLOT(updatePredictiveInputState(HbKeyboardSettingFlags, bool))); + disconnect(settings, SIGNAL(characterPreviewStateForQwertyChanged(bool)), this, SLOT(updateCharacterPreviewStateForQwerty(bool))); + disconnect(settings, SIGNAL(keypressTimeoutChanged(int)), this, SLOT(updateKeypressTimeout(int))); + disconnect(settings, SIGNAL(autocompletionStateChanged(HbKeyboardSettingFlags, bool)), this, SLOT(updateAutocompletionState(HbKeyboardSettingFlags, bool))); + disconnect(settings, SIGNAL(typingCorrectionLevelChanged(HbTypingCorrectionLevel)), this, SLOT(updateTypingCorrectionLevel(HbTypingCorrectionLevel))); + disconnect(settings, SIGNAL(primaryCandidateModeChanged(HbPrimaryCandidateMode)), this, SLOT(updatePrimaryCandidateMode(HbPrimaryCandidateMode))); +} + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsettingwidget.h --- a/src/hbinput/inputwidgets/hbinputsettingwidget.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsettingwidget.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,10 +41,13 @@ Q_OBJECT public: - explicit HbInputSettingWidget(HbDataForm *dataForm, QGraphicsWidget* parent = 0); + explicit HbInputSettingWidget(HbDataForm *dataForm, QGraphicsWidget *parent = 0); virtual ~HbInputSettingWidget(); void initializeWidget(); + + void resetWidget(); + void resetChineseInputMode(); public slots: void updateGlobalInputLanguage(const HbInputLanguage &newLanguage); @@ -64,9 +67,14 @@ void setAutocompletionState(const QModelIndex &index); void setCorrectionLevel(int index); void setPrimaryCandidateMode(); + void dataChange(const QModelIndex &startIn, const QModelIndex &endIn); + void setPortraitInputMethod(int index); + void setLandscapeInputMethod(int index); + void setHwrSpeed(int index); + void setCangjieMode(int index); protected: - HbInputSettingWidgetPrivate * const d_ptr; + HbInputSettingWidgetPrivate *const d_ptr; private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputSettingWidget) diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsmileypicker.cpp --- a/src/hbinput/inputwidgets/hbinputsmileypicker.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsmileypicker.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,7 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputsmileypicker.h" #include #include @@ -35,8 +36,12 @@ #include #include #include +#include -#include "hbinputsmileypicker.h" +const int HbLandscapeRows = 3; +const int HbLandscapeColumns = 7; +const int HbPortraitRows = 4; +const int HbPortraitColumns = 5; /// @cond @@ -48,8 +53,8 @@ HbInputSmileyPickerPrivate(int rows, int columns); ~HbInputSmileyPickerPrivate(); - void getSmilies(const QStringList& smileys); - void _q_activated(const QModelIndex& index); + void getSmilies(const QStringList &smileys); + void _q_activated(const QModelIndex &index); // member variables. HbGridView *mView; @@ -57,16 +62,16 @@ }; HbInputSmileyPickerPrivate::HbInputSmileyPickerPrivate(int rows, int columns) -:mView(0), mModel(0) + : mView(0), mModel(0) { + Q_UNUSED(rows); + Q_UNUSED(columns); Q_Q(HbInputSmileyPicker); // we should make sure that it comes above vkb setPriority(HbPopupPrivate::VirtualKeyboard + 1); // create a view and set the rows and columns. mView = new HbGridView(q); - mView->setRowCount(rows); - mView->setColumnCount(columns); mView->setScrollDirections(Qt::Horizontal); mView->setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded); mModel = new QStandardItemModel(q); @@ -77,24 +82,24 @@ { } -void HbInputSmileyPickerPrivate::getSmilies(const QStringList& smileys) +void HbInputSmileyPickerPrivate::getSmilies(const QStringList &smileys) { mModel->clear(); - QStandardItem* item = 0; - foreach (QString smiley, smileys) { + QStandardItem *item = 0; + foreach(const QString &smiley, smileys) { item = new QStandardItem(); item->setData(HbIcon(smiley), Qt::DecorationRole); mModel->appendRow(item); } } -void HbInputSmileyPickerPrivate::_q_activated(const QModelIndex& index) +void HbInputSmileyPickerPrivate::_q_activated(const QModelIndex &index) { Q_Q(HbInputSmileyPicker); if (!hidingInProgress) { HbIcon smileyIcon = index.model()->data(index, Qt::DecorationRole).value(); emit q->selected(smileyIcon.iconName()); - q->hide(); + q->close(); } } @@ -116,12 +121,23 @@ : HbDialog(*new HbInputSmileyPickerPrivate(rows, columns), parent) { Q_D(HbInputSmileyPicker); + HbInputRegionCollector::instance()->attach(this); -#if QT_VERSION >= 0x040600 // Make sure the smiley picker never steals focus. setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); -#endif + + if (!rows || !columns) { + if (mainWindow()->orientation() == Qt::Horizontal) { + rows = HbLandscapeRows; + columns = HbLandscapeColumns; + } else { + rows = HbPortraitRows; + columns = HbPortraitColumns; + } + } + d->mView->setRowCount(rows); + d->mView->setColumnCount(columns); // set dialog properties setFocusPolicy(Qt::ClickFocus); @@ -129,12 +145,13 @@ setBackgroundFaded(false); setTimeout(NoTimeout); setContentWidget(d->mView); + d->mView->setLongPressEnabled(false); // extract smilies. d->getSmilies(smileys); // connect signals - connect(d->mView, SIGNAL(activated(QModelIndex )), this, SLOT(_q_activated(QModelIndex ))); + connect(d->mView, SIGNAL(activated(QModelIndex)), this, SLOT(_q_activated(QModelIndex))); } /*! @@ -145,11 +162,11 @@ } /*! -This a virtual functions in QGraphicsWidget. It is called whenever the smiley picker widgets is shown. -Here in this function we are are scrolling to a position where we can see +This a virtual functions in QGraphicsWidget. It is called whenever the smiley picker widgets is shown. +Here in this function we are are scrolling to a position where we can see first row and column */ -void HbInputSmileyPicker::showEvent( QShowEvent * event ) +void HbInputSmileyPicker::showEvent(QShowEvent *event) { Q_D(HbInputSmileyPicker); QStandardItem *item = d->mModel->item(0); diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputsmileypicker.h --- a/src/hbinput/inputwidgets/hbinputsmileypicker.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputsmileypicker.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,7 +38,7 @@ HbInputSmileyPicker(int rows, int columns, QGraphicsItem *parent = 0, QStringList smileys = QStringList()); ~HbInputSmileyPicker(); - void showEvent( QShowEvent *event ); + void showEvent(QShowEvent *event); signals: void selected(QString smileyText); @@ -46,7 +46,7 @@ private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputSmileyPicker) Q_DISABLE_COPY(HbInputSmileyPicker) - Q_PRIVATE_SLOT(d_func(), void _q_activated(const QModelIndex & )) + Q_PRIVATE_SLOT(d_func(), void _q_activated(const QModelIndex &)) }; #endif // HB_INPUT_SMILEYPICKER_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputvirtualrocker.cpp --- a/src/hbinput/inputwidgets/hbinputvirtualrocker.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputvirtualrocker.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputvirtualrocker.h" + #include #include #include @@ -33,7 +35,6 @@ #include #include "hbinputvkbwidget.h" -#include "hbinputvirtualrocker.h" /// @cond @@ -42,77 +43,62 @@ const qreal HbRockerDimOpacity = 1.0; const qreal HbRockerNormalOpacity = 1.0; const qreal HbRockerWidth = 50.0; -const int HbIconWidth = 30; -const int HbPointerWidth = 15; - +const qreal HbNormalSizeInUnits = 5; +const qreal HbPressedSizeInUnits = 9.5; +const qreal HbActivatedSizeInUnits = 9.5; class HbInputVirtualRockerPrivate { public: - explicit HbInputVirtualRockerPrivate(HbInputVirtualRocker *rocker, HbInputVkbWidget* parent = 0); + explicit HbInputVirtualRockerPrivate(HbInputVirtualRocker *rocker); ~HbInputVirtualRockerPrivate(); int rockerEventRepeats(qreal distance); - void setCenter(); public: HbInputVirtualRocker *q_ptr; - HbIcon* mIconNormal; + HbIcon mIconNormal; + HbIcon mIconPressed; + HbIcon mIconActivated; HbInputVirtualRocker::RockerSelectionMode mShifted; QPointF mLastPoint; - QPointF mCenterPosition; - QPointF mPointerPosition; QPointF mMousePressPoint; - HbInputVkbWidget* mKeyboard; bool mPressed; }; -HbInputVirtualRockerPrivate::HbInputVirtualRockerPrivate(HbInputVirtualRocker *rocker, HbInputVkbWidget* parent) - : q_ptr(rocker), - mIconNormal(0), - mShifted(HbInputVirtualRocker::RockerSelectionModeOff), - mLastPoint(0.0,0.0), - mCenterPosition(0.0,0.0), - mMousePressPoint(0.0,0.0), - mKeyboard(parent), - mPressed(false) -{ - mIconNormal = new HbIcon("qtg_graf_trackpoint_normal" ); - mIconNormal->setSize( QSizeF( HbIconWidth, HbIconWidth )); +HbInputVirtualRockerPrivate::HbInputVirtualRockerPrivate(HbInputVirtualRocker *rocker) + : q_ptr(rocker), + mShifted(HbInputVirtualRocker::RockerSelectionModeOff), + mLastPoint(0.0, 0.0), + mMousePressPoint(0.0, 0.0), + mPressed(false) +{ + mIconNormal = HbIcon("qtg_graf_trackpoint_normal" ); + mIconPressed = HbIcon("qtg_graf_trackpoint_pressed" ); + mIconActivated = HbIcon("qtg_graf_trackpoint_activated" ); - q_ptr->grabGesture(Qt::SwipeGesture); + q_ptr->grabGesture(Qt::SwipeGesture); q_ptr->grabGesture(Qt::TapGesture); q_ptr->grabGesture(Qt::PanGesture); } HbInputVirtualRockerPrivate::~HbInputVirtualRockerPrivate() { - delete mIconNormal; } int HbInputVirtualRockerPrivate::rockerEventRepeats(qreal distance) { // cursor move multiplier for cursor moving signals, depending on the rocker move speed int repeats = 1; - if (distance > 30){ + if (distance > 30) { repeats = 30; } else if (distance > 20) { repeats = 10; - } else if(distance > 10) { + } else if (distance > 10) { repeats = 2; } return repeats; } -void HbInputVirtualRockerPrivate::setCenter() -{ - if(mCenterPosition.isNull()){ - mCenterPosition.setX(q_ptr->pos().x()+HbRockerWidth/2); - mCenterPosition.setY(q_ptr->pos().y()+HbRockerWidth/2); - } - mPointerPosition.setX((HbRockerWidth - HbPointerWidth)/2); - mPointerPosition.setY((HbRockerWidth - HbPointerWidth)/2); -} - /// @endcond /*! @@ -146,24 +132,33 @@ */ /*! +\deprecated HbInputVirtualRocker::HbInputVirtualRocker(HbInputVkbWidget*) + is deprecated. + Constructs the object. */ -HbInputVirtualRocker::HbInputVirtualRocker(HbInputVkbWidget* parent) - : HbWidget(parent), d_ptr(new HbInputVirtualRockerPrivate(this, parent)) +HbInputVirtualRocker::HbInputVirtualRocker(HbInputVkbWidget *parent) + : HbWidget(parent), d_ptr(new HbInputVirtualRockerPrivate(this)) { setOpacity(HbRockerDimOpacity); } /*! +\deprecated HbInputVirtualRocker::HbInputVirtualRocker(HbInputVirtualRockerPrivate&, QGraphicsWidget*) + is deprecated. + Constructs the object. */ -HbInputVirtualRocker::HbInputVirtualRocker(HbInputVirtualRockerPrivate &dd, QGraphicsWidget* parent) +HbInputVirtualRocker::HbInputVirtualRocker(HbInputVirtualRockerPrivate &dd, QGraphicsWidget *parent) : HbWidget(parent), d_ptr(&dd) { setOpacity(HbRockerDimOpacity); } /*! +\deprecated HbInputVirtualRocker::~HbInputVirtualRocker() + is deprecated. + Destroys the widget. */ HbInputVirtualRocker::~HbInputVirtualRocker() @@ -172,26 +167,23 @@ } /*! - \reimp - \sa QGraphicsWidget. +\deprecated HbInputVirtualRocker::mousePressEvent(QGraphicsSceneMouseEvent*) + is deprecated. */ -void HbInputVirtualRocker::mousePressEvent(QGraphicsSceneMouseEvent* event) +void HbInputVirtualRocker::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_D(HbInputVirtualRocker); QPointF position = event->pos(); - QPointF delta = position - QPointF(HbRockerWidth/2, HbRockerWidth/2); + QPointF delta = position - QPointF(HbRockerWidth / 2, HbRockerWidth / 2); - qreal squareDistance = delta.y()*delta.y() + delta.x()*delta.x(); - qreal squareRadius = HbRockerWidth*HbRockerWidth/4; + qreal squareDistance = delta.y() * delta.y() + delta.x() * delta.x(); + qreal squareRadius = HbRockerWidth * HbRockerWidth / 4; if (squareRadius > squareDistance) { // the touch point is inside circle which diameter is HbRockerWidth - d->setCenter(); d->mLastPoint = position; d->mMousePressPoint = position; - if (d->mKeyboard) { - d->mKeyboard->setKeyboardDimmed(true); - } + emit rockerDirection(HbRockerDirectionPress, d->mShifted); HbWidgetFeedback::triggered(this, Hb::InstantPressed); setOpacity(HbRockerNormalOpacity); d->mPressed = true; @@ -202,30 +194,27 @@ } /*! - \reimp - \sa QGraphicsWidget. +\deprecated HbInputVirtualRocker::mouseReleaseEvent(QGraphicsSceneMouseEvent*) + is deprecated. */ -void HbInputVirtualRocker::mouseReleaseEvent(QGraphicsSceneMouseEvent* event) +void HbInputVirtualRocker::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event) Q_D(HbInputVirtualRocker); - if (d->mKeyboard) { - d->mKeyboard->setKeyboardDimmed(false); - setOpacity(HbRockerDimOpacity); - } + emit rockerDirection(HbRockerDirectionRelease, d->mShifted); + setOpacity(HbRockerDimOpacity); d->mPressed = false; update(); - d->setCenter(); d->mShifted = RockerSelectionModeOff; HbWidgetFeedback::triggered(this, Hb::InstantReleased); } /*! - \reimp - \sa QGraphicsWidget. +\deprecated HbInputVirtualRocker::mouseMoveEvent(QGraphicsSceneMouseEvent*) + is deprecated. */ -void HbInputVirtualRocker::mouseMoveEvent(QGraphicsSceneMouseEvent* event) +void HbInputVirtualRocker::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { Q_D(HbInputVirtualRocker); @@ -237,13 +226,13 @@ HbWidgetFeedback::triggered(this, Hb::InstantDraggedOver); if (delta.x() > HbRockerXThreshold) { - repeats = d->rockerEventRepeats( delta.x() ); + repeats = d->rockerEventRepeats(delta.x()); for (int i = 0; i < repeats; i++) { emit rockerDirection(HbRockerDirectionRight, d->mShifted); } d->mLastPoint = event->pos(); } else if (delta.x() < -HbRockerXThreshold) { - repeats = d->rockerEventRepeats( -delta.x() ); + repeats = d->rockerEventRepeats(-delta.x()); for (int i = 0; i < repeats; i++) { emit rockerDirection(HbRockerDirectionLeft, d->mShifted); } @@ -258,20 +247,15 @@ emit rockerDirection(HbRockerDirectionUp, d->mShifted); d->mLastPoint = event->pos(); } - - d->mPointerPosition = HbIconWidth * deltaPressLoc / d->mCenterPosition.x() / 2 - + QPointF((HbRockerWidth-HbPointerWidth)/2, (HbRockerWidth-HbPointerWidth)/2); - update(); - } } /*! - \reimp - \sa QGraphicsWidget. +\deprecated HbInputVirtualRocker::mouseDoubleClickEvent(QGraphicsSceneMouseEvent*) + is deprecated. */ -void HbInputVirtualRocker::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event) +void HbInputVirtualRocker::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event) Q_D(HbInputVirtualRocker); @@ -282,18 +266,15 @@ d->mShifted = RockerSelectionModeOff; } - // dim the keypad. - if (d->mKeyboard) { - d->mKeyboard->setKeyboardDimmed(true); - } + emit rockerDirection(HbRockerDirectionDoubleClick, d->mShifted); setOpacity(HbRockerNormalOpacity); } /*! - \reimp - \sa QGraphicsWidget. +\deprecated HbInputVirtualRocker::paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*) + is deprecated. */ -void HbInputVirtualRocker::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) +void HbInputVirtualRocker::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option) Q_UNUSED(widget) @@ -301,30 +282,22 @@ painter->setRenderHint(QPainter::Antialiasing, true); - if (d->mIconNormal && - !d->mIconNormal->isNull()) { - // We have icon, lets draw it. - - d->mIconNormal->paint(painter, rect(), Qt::IgnoreAspectRatio); - if (d->mPressed) { - painter->setBrush(Qt::blue); - painter->setPen(Qt::blue); - painter->drawEllipse(static_cast(d->mPointerPosition.x()), - static_cast(d->mPointerPosition.y()), - HbPointerWidth, HbPointerWidth); - } - + qreal unitValue = HbDeviceProfile::profile(mainWindow()).unitValue(); + if (selectionMode() == RockerSelectionModeOn) { + d->mIconActivated.setSize(QSizeF(HbActivatedSizeInUnits * unitValue, HbActivatedSizeInUnits * unitValue)); + d->mIconActivated.paint(painter, rect()); + } else if (d->mPressed) { + d->mIconPressed.setSize(QSizeF(HbPressedSizeInUnits * unitValue, HbPressedSizeInUnits * unitValue)); + d->mIconPressed.paint(painter, rect()); } else { - // Otherwise just draw a white ellipse as a fallback. - painter->setBrush(Qt::white); - painter->setPen(Qt::white); - painter->drawEllipse(boundingRect()); + d->mIconNormal.setSize(QSizeF(HbNormalSizeInUnits * unitValue, HbNormalSizeInUnits * unitValue)); + d->mIconNormal.paint(painter, rect()); } } /*! -Returns true if virtual rocker is in selection state, ie. it sends event with shift modifier -on. +\deprecated HbInputVirtualRocker::selectionMode() const + is deprecated. */ HbInputVirtualRocker::RockerSelectionMode HbInputVirtualRocker::selectionMode() const { @@ -332,9 +305,13 @@ return d->mShifted; } +/*! +\deprecated HbInputVirtualRocker::gestureEvent(QGestureEvent*) + is deprecated. +*/ void HbInputVirtualRocker::gestureEvent(QGestureEvent *event) { - Q_UNUSED (event); + Q_UNUSED(event); } // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputvirtualrocker.h --- a/src/hbinput/inputwidgets/hbinputvirtualrocker.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputvirtualrocker.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,10 @@ HbRockerDirectionLeft, HbRockerDirectionRight, HbRockerDirectionUp, - HbRockerDirectionDown + HbRockerDirectionDown, + HbRockerDirectionPress, + HbRockerDirectionDoubleClick, + HbRockerDirectionRelease, }; enum RockerSelectionMode { @@ -56,22 +59,24 @@ RockerSelectionMode selectionMode() const; enum { Type = Hb::ItemType_VirtualTrackPoint }; - int type() const { return Type; } + int type() const { + return Type; + } protected: // From QGraphicsItem void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void mouseMoveEvent ( QGraphicsSceneMouseEvent *event); + void mouseMoveEvent(QGraphicsSceneMouseEvent *event); void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event); - void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); + void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); virtual void gestureEvent(QGestureEvent *event); signals: void rockerDirection(int aDirection, HbInputVirtualRocker::RockerSelectionMode aSelectionMode); protected: - HbInputVirtualRocker(HbInputVirtualRockerPrivate &dd, QGraphicsWidget* parent = 0); - HbInputVirtualRockerPrivate* const d_ptr; + HbInputVirtualRocker(HbInputVirtualRockerPrivate &dd, QGraphicsWidget *parent = 0); + HbInputVirtualRockerPrivate *const d_ptr; private: Q_DISABLE_COPY(HbInputVirtualRocker) diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputvkbwidget.cpp --- a/src/hbinput/inputwidgets/hbinputvkbwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputvkbwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,6 +22,9 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbinputvkbwidget.h" +#include "hbinputvkbwidget_p.h" + #include #include #include @@ -43,12 +46,15 @@ #include #include #include +#include +#include #include #include #include #include #include +#include #include #include #include @@ -59,16 +65,24 @@ #include #include #include -#include "hbinputvirtualrocker.h" -#include "hbinputvkbwidget.h" -#include "hbinputvkbwidget_p.h" +#include +#include + #include "hbinputsettinglist.h" #include "hbinputmodeindicator.h" -#include #include "hbinputsmileypicker.h" #include "hbinputscreenshotwidget.h" -const qreal HbRockerWidth = 50.0; +const int HB_DIGIT_LATIN_START_VALUE = 0x0030; +const int HB_DIGIT_ARABIC_INDIC_START_VALUE = 0x0660; +const int HB_DIGIT_EASTERN_ARABIC_START_VALUE = 0x06F0; +const int HB_DIGIT_DEVANAGARI_START_VALUE = 0x0966; + +const qreal HbPortraitSmileyPickerHeightInUnits = 43.7; +const qreal HbPortraitSmileyPickerWidthInUnits = 47.8; +const qreal HbLandscapeSmileyPickerHeightInUnits = 31.9; +const qreal HbLandscapeSmileyPickerWidthInUnits = 83.4; +const qreal HbSmileyPickerMarginInUnits = 0.9; /*! @@ -86,47 +100,47 @@ /// @cond -inline HbWidget* hbwidget_cast(QGraphicsItem *item) +inline HbWidget *hbwidget_cast(QGraphicsItem *item) { - if( item->isWidget() && static_cast(item)->inherits("HbWidget") ) { - return static_cast(item); + if (item->isWidget() && static_cast(item)->inherits("HbWidget")) { + return static_cast(item); } return 0; } HbInputVkbWidgetPrivate::HbInputVkbWidgetPrivate() -: mOwner(0), -mMode(EModeAbc), -mKeymap(0), -mModifiers(0), -mInputModeIndicator(0), -mSettingList(0), -mButtonLayout(0), -mRocker(0), -mBackgroundDrawer(0), -mIconDrawer(0), -mMainWinConnected(false), -mShowRocker(false), -mLayout(0), -mCurrentHost(0), -mDrawbackground(true), -mMouseButtonPressedDown(false), -mFlickDirection(HbInputVkbWidget::HbFlickDirectionNone), -mSmileyPicker(0), -mScreenshotWidget(0), -mScreenshotTimeLine(250), -mMostRecentlyAccessedButton(0), -mMostRecentlyClickedLocation(0.0,0.0), -mFocusedObject(0), -mFlickAnimation(false), -mSettingsListOpen(false), -mAnimateWhenDialogCloses(false), -mKeyboardSize(HbQwerty4x10), -mCloseHandleHeight(0), -mCloseHandle(0), -mSettingView(0), -mCurrentView(0), -mKeyboardDimmed(false) + : mOwner(0), + mMode(EModeAbc), + mKeymap(0), + mModifiers(0), + mInputModeIndicator(0), + mSettingList(0), + mButtonLayout(0), + mBackgroundDrawer(0), + mIconDrawer(0), + mMainWinConnected(false), + mLayout(0), + mCurrentHost(0), + mDrawbackground(true), + mMouseButtonPressedDown(false), + mFlickDirection(HbInputVkbWidget::HbFlickDirectionNone), + mSmileyPicker(0), + mScreenshotWidget(0), + mScreenshotTimeLine(250), + mMostRecentlyAccessedButton(0), + mMostRecentlyClickedLocation(0.0, 0.0), + mFocusedObject(0), + mCurrentFocusedObject(0), + mFlickAnimation(false), + mSettingsListOpen(false), + mAnimateWhenDialogCloses(false), + mKeyboardSize(HbQwerty4x10), + mCloseHandleHeight(0), + mCloseHandle(0), + mSettingView(0), + mCurrentView(0), + mKeyboardDimmed(false), + mSettingWidget(0) { mScreenshotTimeLine.setUpdateInterval(16); } @@ -150,8 +164,8 @@ mLayout->setSpacing(0.0); qreal unitValue = HbDeviceProfile::profile(q->mainWindow()).unitValue(); - mCloseHandleHeight = HbCloseHandleHeightInUnits * unitValue; - mCloseHandleWidth = HbCloseHandleWidthInUnits * unitValue; + mCloseHandleHeight = (int)(HbCloseHandleHeightInUnits * unitValue); + mCloseHandleWidth = (int)(HbCloseHandleWidthInUnits * unitValue); mCloseHandle = new QGraphicsWidget(); mCloseHandle->setObjectName("vkbHandle"); @@ -166,18 +180,17 @@ void HbInputVkbWidgetPrivate::init() { Q_Q(HbInputVkbWidget); + QGraphicsItem::GraphicsItemFlags itemFlags = q->flags(); +#if QT_VERSION >= 0x040600 + itemFlags |= QGraphicsItem::ItemSendsGeometryChanges; +#endif + // Make sure the keypad never steals focus. + itemFlags |= QGraphicsItem::ItemIsPanel; + q->setFlags(itemFlags); - mRocker = new HbInputVirtualRocker(q); - mRocker->setObjectName("VirtualRocker"); - QSizeF rockerSize(HbRockerWidth, HbRockerWidth); - mRocker->resize(rockerSize); - mRocker->setMinimumSize(HbRockerWidth, HbRockerWidth); - mRocker->setMaximumSize(HbRockerWidth*20, HbRockerWidth*20); - - QObject::connect(mRocker, SIGNAL(rockerDirection(int, HbInputVirtualRocker::RockerSelectionMode)), - q, SIGNAL(rockerDirection(int, HbInputVirtualRocker::RockerSelectionMode))); - - mRocker->setVisible(false); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + QObject::connect(buttonGroup, SIGNAL(aboutToActivateCustomAction(HbAction *)), + q, SIGNAL(aboutToActivateCustomAction(HbAction *))); mBackgroundDrawer = new HbFrameDrawer(); mBackgroundDrawer->setFrameGraphicsName(backgroundGraphics); @@ -198,6 +211,8 @@ // eating gestures below the panel (remove when panel starts to do this) q->grabGesture(Qt::TapGesture); q->grabGesture(Qt::PanGesture); + + HbInputRegionCollector::instance()->attach(q); } // re-implemented by inherited keyboards @@ -240,8 +255,8 @@ } } -void HbInputVkbWidgetPrivate::addCustomButtonToLayout( HbTouchKeypadButton* button, - int index) +void HbInputVkbWidgetPrivate::addCustomButtonToLayout(HbTouchKeypadButton *button, + int index) { Q_UNUSED(button); Q_UNUSED(index); @@ -266,10 +281,10 @@ { Q_Q(HbInputVkbWidget); - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { int key = 0; - QList buttons = buttonGroup->buttons(); + QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { HbInputButton *item = buttons.at(i); @@ -290,16 +305,16 @@ { Q_Q(HbInputVkbWidget); - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { int key = 0; - QList buttons = buttonGroup->buttons(); + QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { HbInputButton *item = buttons.at(i); const HbKeyboardMap *keyboardMap = mKeymap->keyboard(q->keyboardType()); - if (keyboardMap && key < keyboardMap->keys.count()) { + if (keyboardMap && key < keyboardMap->keys.count() && keyboardMap->keys.at(key)->characters(mModifiers) != QString("")) { QString keydata = keyboardMap->keys.at(key)->characters(mModifiers); item->setText(keydata.at(0), HbInputButton::ButtonTextIndexPrimary); @@ -327,7 +342,7 @@ { Q_Q(HbInputVkbWidget); - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { HbInputButton *item = buttonGroup->button(HbInputButton::ButtonKeyCodeSettings); if (item) { @@ -338,31 +353,19 @@ } } -void HbInputVkbWidgetPrivate::setRockerPosition() -{ - Q_Q(HbInputVkbWidget); - - // Set rocker position. - QSizeF padArea = q->keypadButtonAreaSize(); - QPointF point((padArea.width() * 0.5) - (mRocker->size().width() * 0.5), - (padArea.height() * 0.5) - (mRocker->size().height() * 0.5)); - point.setY(point.y() + mCloseHandleHeight); - - mRocker->setPos(point); -} - void HbInputVkbWidgetPrivate::captureScreenshot() { Q_Q(HbInputVkbWidget); if (!mScreenshotWidget) { mScreenshotWidget = new HbInputScreenshotWidget(); + mScreenshotWidget->setZValue(q->zValue()); mScreenshotWidget->setGeometry(q->geometry()); q->mainWindow()->scene()->addItem(mScreenshotWidget); } QPointF position = q->pos(); - QRectF rect = QRectF(position.x(), position.y()+ mCloseHandleHeight, q->boundingRect().width(), q->boundingRect().height()- mCloseHandleHeight); + QRectF rect = QRectF(position.x(), position.y() + mCloseHandleHeight, q->boundingRect().width(), q->boundingRect().height() - mCloseHandleHeight); QTransform rotateTrans; rotateTrans = q->mainWindow()->viewportTransform(); QRectF transRect = rotateTrans.mapRect(rect); @@ -382,11 +385,11 @@ void HbInputVkbWidgetPrivate::normalizeProbabilities(QList &allProbableKeys) { qreal sum = 0.0; - foreach (HbKeyPressProbability key, allProbableKeys) { + foreach(const HbKeyPressProbability &key, allProbableKeys) { sum += key.probability; } - for (int count=0;countsetPreferredInputMethod(q->mainWindow()->orientation(), descriptor, customData); + // Activate immediately. + mOwner->activateInputMethod(descriptor); + } +} + +void HbInputVkbWidgetPrivate::_q_smileyPickerClosed() +{ + Q_Q(HbInputVkbWidget); + + q->setKeyboardDimmed(false); +} + +QChar HbInputVkbWidgetPrivate::numberCharacterBoundToKey(int key) +{ + QChar numChr; + if (!mKeymap || !mOwner) { + return numChr; + } + + HbInputFocusObject *focusObject = mOwner->focusObject(); + if (!focusObject) { + return numChr; + } + HbInputLanguage language = mKeymap->language(); + if (language.language() != (QLocale::Language)0) { + HbInputDigitType digitType = HbInputUtils::inputDigitType(language); + + // In number editors, show the native digits only when both device and writing languages are same, + // else show latin digits + if (focusObject->editorInterface().isNumericEditor()) { + QLocale::Language systemLanguage = QLocale::system().language(); + if (language.language() != systemLanguage) { + digitType = HbDigitTypeLatin; + } + } + + HbKeyboardType keyboardType = mOwner->inputState().keyboard(); + + if (keyboardType == HbKeyboardVirtual12Key) { + numChr = HbInputUtils::findFirstNumberCharacterBoundToKey( + mKeymap->keyboard(keyboardType)->keys.at(key), + language, digitType); + } else if (keyboardType == HbKeyboardVirtualQwerty) { + switch (digitType) { + case HbDigitTypeLatin: + numChr = HB_DIGIT_LATIN_START_VALUE + key; + break; + case HbDigitTypeArabicIndic: + numChr = HB_DIGIT_ARABIC_INDIC_START_VALUE + key; + break; + case HbDigitTypeEasternArabic: + numChr = HB_DIGIT_EASTERN_ARABIC_START_VALUE + key; + break; + case HbDigitTypeDevanagari: + numChr = HB_DIGIT_DEVANAGARI_START_VALUE + key; + break; + default: + break; + } + } + } + return numChr; +} + +void HbInputVkbWidgetPrivate::_q_settingsClosed(HbAction* action) +{ + Q_UNUSED(action); + Q_Q(HbInputVkbWidget); + + q->settingsClosed(); +} + /// @endcond /*! Costructs the object. */ -HbInputVkbWidget::HbInputVkbWidget(QGraphicsItem* parent) +HbInputVkbWidget::HbInputVkbWidget(QGraphicsItem *parent) : HbWidget(*new HbInputVkbWidgetPrivate, parent) { Q_D(HbInputVkbWidget); @@ -424,22 +507,24 @@ d->init(); setFocusPolicy(Qt::ClickFocus); - setPos(QPointF(0,0)); + setPos(QPointF(0, 0)); #ifdef HB_EFFECTS HbEffect::disable(this); #endif // HB_EFFECTS - // Make sure the keypad never steals focus. - setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); + + if (!d->mOwner) { + d->mOwner = HbInputMethod::activeInputMethod(); + } } /*! Constructs the object. */ -HbInputVkbWidget::HbInputVkbWidget(HbInputVkbWidgetPrivate& dd, QGraphicsItem* parent) - : HbWidget(dd, parent) +HbInputVkbWidget::HbInputVkbWidget(HbInputVkbWidgetPrivate &dd, QGraphicsItem *parent) + : HbWidget(dd, parent) { Q_D(HbInputVkbWidget); d->q_ptr = this; @@ -447,14 +532,12 @@ d->init(); setFocusPolicy(Qt::ClickFocus); - setPos(QPointF(0,0)); + setPos(QPointF(0, 0)); #ifdef HB_EFFECTS HbEffect::disable(this); #endif // HB_EFFECTS - // Make sure the keypad never steals focus. - setFlag(QGraphicsItem::ItemIsPanel, true); setActive(false); } @@ -473,8 +556,6 @@ Q_D(HbInputVkbWidget); d->mCurrentHost = host; - d->mRocker->setVisible(d->mShowRocker); - d->setRockerPosition(); d->mFlickDirection = HbFlickDirectionNone; } @@ -488,7 +569,6 @@ Q_UNUSED(host); Q_D(HbInputVkbWidget); - d->mRocker->setVisible(false); d->mFlickDirection = HbFlickDirectionNone; } @@ -507,7 +587,7 @@ /*! The paint method. Draws the widget. */ -void HbInputVkbWidget::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) +void HbInputVkbWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); Q_UNUSED(widget); @@ -567,25 +647,25 @@ } /*! +\deprecated HbInputVkbWidget::setRockerVisible(bool) + is deprecated. + Sets virtual rocker visibility. */ void HbInputVkbWidget::setRockerVisible(bool visible) { - Q_D(HbInputVkbWidget); - d->mShowRocker = visible; + Q_UNUSED(visible); } /*! +\deprecated HbInputVkbWidget::isRockerVisible() const + is deprecated. + Returns true if virtual rocker is allowed to be visible. */ bool HbInputVkbWidget::isRockerVisible() const { - Q_D(const HbInputVkbWidget); - if (d->mShowRocker) { - return d->mRocker->isVisible(); - } else { - return false; - } + return false; } /*! @@ -616,9 +696,10 @@ d->mModifiers = modifiers; d->updateButtons(); + d->updateKeyCodes(); d->applyEditorConstraints(); - HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); if (buttonGroup && d->mOwner->focusObject()) { buttonGroup->setCustomButtonActions(d->mOwner->focusObject()->editorInterface().actions()); } @@ -632,7 +713,7 @@ Sets key map data object. Given key map data will be used as a source for button titles. Usually the key map data for active input language is used. */ -void HbInputVkbWidget::setKeymap(const HbKeymap* keymap) +void HbInputVkbWidget::setKeymap(const HbKeymap *keymap) { Q_D(HbInputVkbWidget); if (keymap) { @@ -660,7 +741,6 @@ if (d->mOwner && d->mOwner->focusObject()) { qreal vkbZValue = d->mOwner->focusObject()->findVkbZValue(); setZValue(vkbZValue); - d->mRocker->setZValue(vkbZValue + 0.5); } show(); @@ -675,18 +755,20 @@ d->mCurrentHost = host; - d->mRocker->setVisible(false); + if (d->mSmileyPicker && d->mSmileyPicker->isVisible()) { + d->mSmileyPicker->hide(); + } if (d->mSettingList) { d->mSettingList->close(); } } /*! -Enables or disabled all buttons in the keyboard that have not been disabled directly. +Enables or disables all buttons in the keyboard that have not been disabled directly. */ void HbInputVkbWidget::setKeyboardDimmed(bool dimmed) { - HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); if (buttonGroup) { buttonGroup->setEnabled(!dimmed); } @@ -706,19 +788,27 @@ if (!d->mSettingList) { d->mSettingList = new HbInputSettingList(); connect(d->mSettingList, SIGNAL(inputSettingsButtonClicked()), this, SLOT(showSettingsView())); - connect(d->mSettingList, SIGNAL(inputMethodsButtonClicked()), this, SLOT(executeMethodDialog())); + connect(d->mSettingList, SIGNAL(inputMethodSelected(const HbInputMethodDescriptor &, const QByteArray &)), + this, SLOT(_q_activateInputMethod(const HbInputMethodDescriptor &, const QByteArray &))); } HbInputFocusObject *focusObject = d->mOwner->focusObject(); - if (focusObject && - focusObject->editorInterface().isPredictionAllowed() && - predFactory->predictionEngineForLanguage(HbInputSettingProxy::instance()->globalInputLanguage())) { - d->mSettingList->setPredictionSelectionEnabled(true); - } else { - d->mSettingList->setPredictionSelectionEnabled(false); + if (focusObject) { + if (focusObject->editorInterface().inputConstraints() & HbEditorConstraintLatinAlphabetOnly) { + d->mSettingList->setLanguageSelectionEnabled(false); + } else { + d->mSettingList->setLanguageSelectionEnabled(true); + } + + if (focusObject->editorInterface().isPredictionAllowed() && + predFactory->predictionEngineForLanguage(HbInputSettingProxy::instance()->globalInputLanguage())) { + d->mSettingList->setPredictionSelectionEnabled(true); + } else { + d->mSettingList->setPredictionSelectionEnabled(false); + } } - HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); if (buttonGroup) { HbInputButton *item = buttonGroup->button(HbInputButton::ButtonKeyCodeSettings); if (item) { @@ -732,7 +822,7 @@ d->settingListPosition(position, placement); d->mSettingList->setPreferredPos(position, placement); d->mSettingList->updateSettingList(); - d->mSettingList->open(this, SLOT(settingsClosed())); + d->mSettingList->open(this, SLOT(_q_settingsClosed(HbAction*))); } /*! @@ -742,7 +832,7 @@ { Q_D(HbInputVkbWidget); - HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); if (buttonGroup) { HbInputButton *item = buttonGroup->button(HbInputButton::ButtonKeyCodeSettings); if (item) { @@ -752,10 +842,10 @@ } d->mSettingsListOpen = false; - if ( d->mAnimateWhenDialogCloses ) { + if (d->mAnimateWhenDialogCloses) { animKeyboardChange(); d->mAnimateWhenDialogCloses = false; - } else if(d->mScreenshotTimeLine.state() != QTimeLine::Running) { + } else if (d->mScreenshotTimeLine.state() != QTimeLine::Running) { keypadLanguageChangeFinished(); } } @@ -776,22 +866,35 @@ { Q_D(HbInputVkbWidget); - closeSettingList(); + /* + Added for vanilla input + When settings dialog is launched, keypad is not closed. + */ + HbInputFocusObject *focusObject = 0; + if (!d->mOwner || !(focusObject = d->mOwner->focusObject())) { + return; + } + HbVkbHost *vkbHost = focusObject->editorInterface().vkbHost(); + if (vkbHost && vkbHost->keypadStatus() != HbVkbHost::HbVkbStatusClosed) { + vkbHost->closeKeypad(); + } + d->mCurrentFocusedObject = focusObject->object(); - d->mSettingView = new HbView(this); + closeSettingList(); + if(!d->mSettingView) { + d->mSettingView = new HbView(this); + HbAction *backAction = new HbAction(Hb::BackNaviAction, d->mSettingView); + backAction->setText(tr("Back")); + connect(backAction, SIGNAL(triggered(bool)), this, SLOT(closeSettingsView())); + d->mSettingView->setNavigationAction(backAction); + HbDataForm *dataForm = new HbDataForm(); + d->mSettingView->setWidget(dataForm); + d->mSettingWidget = new HbInputSettingWidget(dataForm, d->mSettingView); + } + d->mSettingWidget->initializeWidget(); + HbInputRegionCollector::instance()->attach(d->mSettingView); d->mSettingView->setTitle(tr("Input Settings")); mainWindow()->addView(d->mSettingView); - - HbAction *backAction = new HbAction(Hb::BackNaviAction, d->mSettingView); - backAction->setText(tr("Back")); - connect(backAction, SIGNAL(triggered(bool)), this, SLOT(closeSettingsView())); - d->mSettingView->setNavigationAction(backAction); - - HbDataForm *dataForm = new HbDataForm(); - d->mSettingView->setWidget(dataForm); - HbInputSettingWidget *settingWidget = new HbInputSettingWidget(dataForm, d->mSettingView); - settingWidget->initializeWidget(); - d->mCurrentView = mainWindow()->currentView(); mainWindow()->setCurrentView(d->mSettingView); } @@ -805,29 +908,32 @@ mainWindow()->setCurrentView(d->mCurrentView); mainWindow()->removeView(d->mSettingView); - delete d->mSettingView; - d->mSettingView = 0; + if (d->mSettingView->scene()) { + d->mSettingView->scene()->removeItem(d->mSettingView); + } + HbInputRegionCollector::instance()->detach(d->mSettingView); + d->mSettingWidget->resetWidget(); + + if (d->mCurrentFocusedObject) { + HbInputFocusObject *focusObject = new HbInputFocusObject(d->mCurrentFocusedObject); + d->mOwner->setFocusObject(focusObject); + d->mCurrentFocusedObject = 0; + } } /*! +\deprecated HbInputVkbWidget::executeMethodDialog() + is deprecated. Executes input method selection dialog */ void HbInputVkbWidget::executeMethodDialog() { - Q_D(HbInputVkbWidget); - - closeSettingList(); - HbInputMethodDescriptor method - = HbInputCommonDialogs::showCustomInputMethodSelectionDialog(HbInputSettingProxy::instance()->globalInputLanguage()); - if (!method.isEmpty() && d->mOwner) { - d->mOwner->activateInputMethod(method); - } } /*! \reimp */ -QWidget* HbInputVkbWidget::asWidget() +QWidget *HbInputVkbWidget::asWidget() { return HbInputUtils::createWrapperWidget(this); } @@ -835,7 +941,7 @@ /*! \reimp */ -QGraphicsWidget* HbInputVkbWidget::asGraphicsWidget() +QGraphicsWidget *HbInputVkbWidget::asGraphicsWidget() { return this; } @@ -863,9 +969,6 @@ { Q_UNUSED(type); Q_UNUSED(x); - - Q_D(HbInputVkbWidget); - d->setRockerPosition(); } /*! @@ -883,6 +986,18 @@ } /*! +\deprecated HbInputVkbWidget::rockerPosition() + is deprecated. + +Returns the virtual rocker position. The default position is in the middle +of keypad button area. +*/ +QPointF HbInputVkbWidget::rockerPosition() +{ + return QPointF(); +} + +/*! Sets the status of the background drawing. This method can be used to optimize vkb widget drawing. If it is known that the widget will cover whole vkb area and there are no places where the background shows through, then the background @@ -896,15 +1011,15 @@ /*! -Returns all possible keys those the user could have intended to press +Returns all possible keys that the user could have intended to press for the last registered touch along with their corresponding probability. */ QList HbInputVkbWidget::probableKeypresses() { QList probabilities; - HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); if (buttonGroup) { - probabilities = buttonGroup->buttonProbabilities(); + probabilities = buttonGroup->buttonProbabilities(); } return probabilities; } @@ -961,11 +1076,23 @@ } if (d->mSmileyPicker) { - d->mSmileyPicker->setGeometry(QRectF(0, pos().y(), geometry().width(), - geometry().height())); - d->mSmileyPicker->show(); + qreal unitValue = HbDeviceProfile::profile(mainWindow()).unitValue(); + QSizeF screenSize = HbDeviceProfile::profile(mainWindow()).logicalSize(); - HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + qreal width = HbPortraitSmileyPickerWidthInUnits * unitValue; + qreal height = HbPortraitSmileyPickerHeightInUnits * unitValue; + if (mainWindow()->orientation() == Qt::Horizontal) { + width = HbLandscapeSmileyPickerWidthInUnits * unitValue; + height = HbLandscapeSmileyPickerHeightInUnits * unitValue; + } + + d->mSmileyPicker->setPreferredSize(QSizeF(width, height)); + d->mSmileyPicker->setPos((screenSize.width() - width) * 0.5, + screenSize.height() - height - HbSmileyPickerMarginInUnits * unitValue); + d->mSmileyPicker->open(this, SLOT(_q_smileyPickerClosed())); + setKeyboardDimmed(true); + + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); if (buttonGroup) { buttonGroup->cancelButtonPress(); } @@ -1009,12 +1136,12 @@ { Q_D(HbInputVkbWidget); + if (d->mOwner && event.key() > 0) { + d->mOwner->filterEvent(&event); + } + if (event.key() == HbInputButton::ButtonKeyCodeSettings) { showSettingList(); - } else { - if (d->mOwner) { - d->mOwner->filterEvent(&event); - } } } @@ -1055,10 +1182,10 @@ QRectF rect = boundingRect(); QPointF position = pos(); - position.setX(direction * (-rect.width() + rect.width() * value)); + position.setX(direction *(-rect.width() + rect.width() * value)); if (d->mScreenshotWidget) { - d->mScreenshotWidget->setPos(position.x() + direction * rect.width(), position.y()); - setPos(position); + d->mScreenshotWidget->setPos(position.x() + direction * rect.width(), position.y()); + setPos(position); } } @@ -1074,7 +1201,7 @@ { Q_D(HbInputVkbWidget); if (mainWindow()) { - if (d->mSettingsListOpen){ + if (d->mSettingsListOpen) { d->mAnimateWhenDialogCloses = true; } else { if (!d->mAnimateWhenDialogCloses) { @@ -1097,20 +1224,20 @@ QSizeF sh; switch (which) { - case Qt::MinimumSize: - sh = QSizeF(0, 0); - break; - case Qt::PreferredSize: - if (d->mCurrentHost) { - sh = d->mCurrentHost->keyboardArea(); - } - break; - case Qt::MaximumSize: - sh = QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); - break; - default: - qWarning("HbInputVkbWidget::sizeHint(): Don't know how to handle the value of 'which'"); - break; + case Qt::MinimumSize: + sh = QSizeF(0, 0); + break; + case Qt::PreferredSize: + if (d->mCurrentHost) { + sh = d->mCurrentHost->keyboardArea(); + } + break; + case Qt::MaximumSize: + sh = QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); + break; + default: + qWarning("HbInputVkbWidget::sizeHint(): Don't know how to handle the value of 'which'"); + break; } return sh; } @@ -1135,7 +1262,7 @@ { Q_D(HbInputVkbWidget); - if(HbSwipeGesture *gesture = qobject_cast(event->gesture(Qt::SwipeGesture))) { + if (HbSwipeGesture *gesture = qobject_cast(event->gesture(Qt::SwipeGesture))) { if (gesture->state() == Qt::GestureFinished) { HbWidgetFeedback::triggered(this, Hb::InstantFlicked); // vertical swipes @@ -1150,20 +1277,22 @@ } else { d->mFlickDirection = (HbInputVkbWidget::HbFlickDirection)gesture->sceneHorizontalDirection(); // horizontal swipes - if (d->mFlickAnimation){ + if (d->mFlickAnimation) { animKeyboardChange(); } emit flickEvent(d->mFlickDirection); } } - } else if(HbTapGesture *gesture = qobject_cast(event->gesture(Qt::TapGesture))) { - if (gesture->state() == Qt::GestureFinished) { - // if keypad is minimized, open it - if ( d->mCurrentHost->keypadStatus() == HbVkbHost::HbVkbStatusMinimized ) { + } else if (HbTapGesture *gesture = qobject_cast(event->gesture(Qt::TapGesture))) { + if (gesture->state() == Qt::GestureFinished) { + // if keypad is minimized, open it + if (d->mCurrentHost && d->mCurrentHost->keypadStatus() == HbVkbHost::HbVkbStatusMinimized) { d->mCurrentHost->openKeypad(this, d->mOwner); } } } } +#include "moc_hbinputvkbwidget.cpp" + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputvkbwidget.h --- a/src/hbinput/inputwidgets/hbinputvkbwidget.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputvkbwidget.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,7 @@ const QString backgroundGraphics("qtg_fr_input_v_bg"); const QString HbInputVkbHandleIcon("qtg_graf_input_v_swipe"); const qreal HbCloseHandleHeight = 0; -const qreal HbCloseHandleHeightInUnits = 2.23; +const qreal HbCloseHandleHeightInUnits = 3.13; const qreal HbCloseHandleWidthInUnits = 18.8; class HbInputVkbWidgetPrivate; @@ -51,8 +51,7 @@ Q_OBJECT public: - enum HbFlickDirection - { + enum HbFlickDirection { HbFlickDirectionNone = 0, HbFlickDirectionLeft, HbFlickDirectionRight, @@ -60,25 +59,24 @@ HbFlickDirectionDown }; - enum HbVkbCloseMethod - { + enum HbVkbCloseMethod { HbVkbCloseMethodButtonDrag = 0x1, HbVkbCloseMethodCloseButton = 0x2, HbVkbCloseMethodCloseButtonDrag = HbVkbCloseMethodCloseButton | HbVkbCloseMethodButtonDrag, HbVkbCloseMethodCloseGesture = 0x4, }; - enum HbSctView { + enum HbSctView { HbSctViewSpecialCharacter, HbSctViewSmiley }; - HbInputVkbWidget(QGraphicsItem *parent = 0); + HbInputVkbWidget(QGraphicsItem *parent = 0); virtual ~HbInputVkbWidget(); public: // From HbVirtualKeyboard - QWidget* asWidget(); - QGraphicsWidget* asGraphicsWidget(); + QWidget *asWidget(); + QGraphicsWidget *asGraphicsWidget(); QSizeF preferredKeyboardSize(); QSizeF minimizedKeyboardSize(); virtual void aboutToOpen(HbVkbHost *host); @@ -88,7 +86,7 @@ virtual void keyboardMinimized(HbVkbHost *host); virtual void keyboardAnimationFrame(HbVkbAnimationType type, qreal x); - virtual void setKeymap(const HbKeymap* keymap); + virtual void setKeymap(const HbKeymap *keymap); virtual void setMode(HbKeypadMode mode, HbModifiers modifiers); virtual HbKeypadMode mode() const; @@ -108,16 +106,19 @@ HbFlickDirection flickDirection(); protected: // From QGraphicsItem - virtual QPainterPath shape () const; + virtual QPainterPath shape() const; virtual void changeEvent(QEvent *event); - virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); - virtual int type() const {return Hb::ItemType_InputVkbWidget;} + virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); + virtual int type() const { + return Hb::ItemType_InputVkbWidget; + } QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; virtual void gestureEvent(QGestureEvent *event); protected: // layout QSizeF keypadButtonAreaSize(); + virtual QPointF rockerPosition(); public slots: void showSettingList(); @@ -126,7 +127,7 @@ void executeMethodDialog(); void closeSettingList(); void settingsClosed(); - void showSmileyPicker(int rows, int columns); + void showSmileyPicker(int rows = 0, int columns = 0); void keypadLanguageChangeAnimationUpdate(qreal value); void keypadLanguageChangeFinished(); @@ -142,12 +143,16 @@ void flickEvent(HbInputVkbWidget::HbFlickDirection direction); void smileySelected(QString text); void mouseMovedOutOfButton(); + void aboutToActivateCustomAction(HbAction *custAction); protected: - HbInputVkbWidget(HbInputVkbWidgetPrivate &dd, QGraphicsItem* parent); + HbInputVkbWidget(HbInputVkbWidgetPrivate &dd, QGraphicsItem *parent); private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputVkbWidget) Q_DISABLE_COPY(HbInputVkbWidget) + Q_PRIVATE_SLOT(d_func(), void _q_activateInputMethod(const HbInputMethodDescriptor &, const QByteArray &)) + Q_PRIVATE_SLOT(d_func(), void _q_settingsClosed(HbAction *action)) + Q_PRIVATE_SLOT(d_func(), void _q_smileyPickerClosed()) friend class HbTouchKeypadButton; friend class HbInputUsedSymbolPane; diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/hbinputvkbwidget_p.h --- a/src/hbinput/inputwidgets/hbinputvkbwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/hbinputvkbwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -52,7 +52,6 @@ class QBitmap; class QPixmap; class QGraphicsGridLayout; -class HbInputVirtualRocker; class HbPushButton; class HbFrameDrawer; class QAction; @@ -67,6 +66,8 @@ class HbInputScreenshotWidget; class HbInputFocusObject; class HbInputSettingList; +class HbInputMethodDescriptor; +class HbInputSettingWidget; const qreal VerticalSpacing = 0.0, HorizontalSpacing = 0.0; //vertical and horizontal spacing for buttons in layout @@ -75,11 +76,10 @@ Q_DECLARE_PUBLIC(HbInputVkbWidget) public: - enum HbQwertyKeyboardSize - { - HbQwerty4x10, - HbQwerty4x11 - }; + enum HbQwertyKeyboardSize { + HbQwerty4x10, + HbQwerty4x11 + }; HbInputVkbWidgetPrivate(); virtual ~HbInputVkbWidgetPrivate(); @@ -92,8 +92,8 @@ virtual void handleStandardButtonPress(int aButtonId); virtual void handleStandardButtonRelease(int aButtonId); - virtual void addCustomButtonToLayout( HbTouchKeypadButton* button, - int index); + virtual void addCustomButtonToLayout(HbTouchKeypadButton *button, + int index); void redirectMousePressEvent(QGraphicsSceneMouseEvent *aEvent); void redirectMouseReleaseEvent(QGraphicsSceneMouseEvent *aEvent); @@ -103,8 +103,6 @@ virtual void updateButtons(); virtual void settingListPosition(QPointF &position, HbPopup::Placement &placement); - virtual void setRockerPosition(); - void captureScreenshot(); void updateMouseHitItem(HbTouchKeypadButton *button, QPointF position); void normalizeProbabilities(QList &allProbableKeys); @@ -112,6 +110,12 @@ bool isSmileysEnabled(); bool isKeyboardDimmed(); + void showInputMethodSelectionDialog(); + void _q_activateInputMethod(const HbInputMethodDescriptor &descriptor, const QByteArray &customData); + void _q_settingsClosed(HbAction *action); + void _q_smileyPickerClosed(); + + virtual QChar numberCharacterBoundToKey(int key); friend class HbTouchKeypadButton; friend class HbInputUsedSymbolPane; @@ -132,19 +136,16 @@ QPointer mSettingsButton; QPointer mSettingList; - QGraphicsGridLayout* mButtonLayout; + QGraphicsGridLayout *mButtonLayout; QSignalMapper *mPressMapper; QSignalMapper *mReleaseMapper; QSignalMapper *mActionMapper; - HbInputVirtualRocker *mRocker; - HbFrameDrawer *mBackgroundDrawer; HbFrameDrawer *mIconDrawer; bool mMainWinConnected; - bool mShowRocker; QGraphicsLinearLayout *mLayout; QPointer mCurrentHost; bool mDrawbackground; @@ -153,11 +154,12 @@ HbInputVkbWidget::HbFlickDirection mFlickDirection; HbInputSmileyPicker *mSmileyPicker; - HbInputScreenshotWidget* mScreenshotWidget; + HbInputScreenshotWidget *mScreenshotWidget; QTimeLine mScreenshotTimeLine; HbTouchKeypadButton *mMostRecentlyAccessedButton; QPointF mMostRecentlyClickedLocation; HbInputFocusObject *mFocusedObject; + QObject *mCurrentFocusedObject; bool mFlickAnimation; bool mSettingsListOpen; bool mAnimateWhenDialogCloses; @@ -168,6 +170,7 @@ HbView *mSettingView; HbView *mCurrentView; bool mKeyboardDimmed; + HbInputSettingWidget *mSettingWidget; }; #endif //HB_INPUT_VKB_WIDGET_PRIVATE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbinput/inputwidgets/inputwidgets.pri --- a/src/hbinput/inputwidgets/inputwidgets.pri Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbinput/inputwidgets/inputwidgets.pri Thu Jul 22 16:36:53 2010 +0100 @@ -42,6 +42,7 @@ PUBLIC_HEADERS += $$PWD/hbinputbuttongroup.h PUBLIC_HEADERS += $$PWD/hbinputbutton.h PUBLIC_HEADERS += $$PWD/hbinputsctkeyboard.h +PUBLIC_HEADERS += $$PWD/hbinputmethodselectionlist.h # hb input widget private headers PRIVATE_HEADERS += $$PWD/hbinputvkbwidget_p.h @@ -65,3 +66,4 @@ SOURCES += $$PWD/hbinputbuttongroup.cpp SOURCES += $$PWD/hbinputbutton.cpp SOURCES += $$PWD/hbinputsctkeyboard.cpp +SOURCES += $$PWD/hbinputmethodselectionlist.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxwidget.cpp --- a/src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,17 +39,8 @@ TRACE_ENTRY mLastError = NoError; mShowEventReceived = false; - QList actList = actions(); - for(int i = 0; i < NumActions; i++) { - mActions[i].mAction = 0; - mActions[i].mOwned = false; // we haven't created the action - mActions[i].mInDialog = false; // action has not been inserted to the dialog - if (i < actList.count()) { - mActions[i].mAction = actList[i]; - mActions[i].mInDialog = true; - connect(mActions[i].mAction, SIGNAL(triggered()), SLOT(actionTriggered())); - } - } + initActions(); + connectToActions(); resetProperties(); constructDialog(parameters); TRACE_EXIT @@ -58,11 +49,7 @@ // Destructor HbDeviceMessageBoxWidget::~HbDeviceMessageBoxWidget() { - for(int i = 0; i < NumActions; i++) { - if (mActions[i].mOwned) { - delete mActions[i].mAction; - } - } + deleteActions(); } // Set parameters @@ -155,11 +142,27 @@ void HbDeviceMessageBoxWidget::setProperties(const QVariantMap ¶meters) { TRACE_ENTRY + // Set properties other than accept/reject action first + const char *acceptKey = "acceptAction"; + const char *rejectKey = "rejectAction"; QVariantMap::const_iterator i = parameters.constBegin(); - while (i != parameters.constEnd()) { - QByteArray key = i.key().toAscii(); - if (property(key.constData()).isValid()) { - setProperty(key.constData(), i.value()); + while(i != parameters.constEnd()) { + if (i.key() != acceptKey && i.key() != rejectKey) { + QByteArray key = i.key().toAscii(); + if (property(key.constData()).isValid()) { + setProperty(key.constData(), i.value()); + } + } + ++i; + } + // Set accept/reject action last + i = parameters.constBegin(); + while(i != parameters.constEnd()) { + if (i.key() == acceptKey || i.key() == rejectKey) { + QByteArray key = i.key().toAscii(); + if (property(key.constData()).isValid()) { + setProperty(key.constData(), i.value()); + } } ++i; } @@ -180,6 +183,45 @@ return; } +// Delete actions we own +void HbDeviceMessageBoxWidget::deleteActions() +{ + TRACE_ENTRY + for(int i = 0; i < NumActions; i++) { + if (mActions[i].mOwned) { + delete mActions[i].mAction; + } + mActions[i].mAction = 0; + mActions[i].mOwned = false; // we haven't created the action + mActions[i].mInDialog = false; // action has not been inserted to the dialog + } + TRACE_EXIT +} + +// Initialize actions +void HbDeviceMessageBoxWidget::initActions() +{ + TRACE_ENTRY + for(int i = 0; i < NumActions; i++) { + mActions[i].mAction = 0; + mActions[i].mOwned = false; // we haven't created the action + mActions[i].mInDialog = false; // action has not been inserted to the dialog + } + TRACE_EXIT +} + +// Connect to message box triggered actions +void HbDeviceMessageBoxWidget::connectToActions() +{ + QList actList = actions(); + int count = qMin(static_cast(NumActions), actList.count()); + for(int i = 0; i < count; i++) { + mActions[i].mAction = actList[i]; + mActions[i].mInDialog = true; + connect(mActions[i].mAction, SIGNAL(triggered()), SLOT(actionTriggered())); + } +} + QString HbDeviceMessageBoxWidget::iconName() const { TRACE_ENTRY @@ -249,6 +291,21 @@ return mAnimationDefinition; } +void HbDeviceMessageBoxWidget::setStandardButtons(HbMessageBox::StandardButtons buttons) +{ + // Clear buttons first. Otherwise display doesn't get updated always. + HbMessageBox::setStandardButtons(HbMessageBox::NoButton); + HbMessageBox::setStandardButtons(buttons); + deleteActions(); + initActions(); + connectToActions(); +} + +HbMessageBox::StandardButtons HbDeviceMessageBoxWidget::standardButtons() const +{ + return HbMessageBox::standardButtons(); +} + // Action (accept or reject) was triggered void HbDeviceMessageBoxWidget::actionTriggered() { diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxwidget_p.h --- a/src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/devicedialogs/devicemessageboxplugin/hbdevicemessageboxwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,6 +45,7 @@ Q_PROPERTY(QString acceptAction READ acceptAction WRITE setAcceptAction) Q_PROPERTY(QString rejectAction READ rejectAction WRITE setRejectAction) Q_PROPERTY(QString animationDefinition READ animationDefinition WRITE setAnimationDefinition) + Q_PROPERTY(HbMessageBox::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons) public: HbDeviceMessageBoxWidget(HbMessageBox::MessageBoxType type, const QVariantMap ¶meters); @@ -74,6 +75,9 @@ bool checkProperties(const QVariantMap ¶meters); void setProperties(const QVariantMap ¶meters); void resetProperties(); + void initActions(); + void deleteActions(); + void connectToActions(); QString iconName() const; void setIconName(QString &iconName); QString acceptAction() const; @@ -84,6 +88,8 @@ void showEvent(QShowEvent *event); void setAnimationDefinition(QString &animationDefinition); QString animationDefinition() const; + void setStandardButtons(HbMessageBox::StandardButtons buttons); + HbMessageBox::StandardButtons standardButtons() const; static void parseActionData(QString &data); QString actionData(ActionIndex index) const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu.cpp --- a/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -173,11 +173,20 @@ { HbMainWindow* mainWnd = mainWindow(); Q_ASSERT(mainWnd); - if (mainWnd && !mShowEventReceived) { - connect(mainWnd, SIGNAL(orientationChanged(Qt::Orientation)), - this, SLOT(orientationChanged(Qt::Orientation))); + if (mainWnd && !mShowEventReceived) { + // To have a consistant user experience the indicator menu's behaviour + // got aligned to the options menu's behaviour. + // The menu is now closed before a view/orientation change happens. + connect(mainWnd, SIGNAL(aboutToChangeOrientation()), + this, SLOT(close())); + connect(mainWnd, SIGNAL(aboutToChangeView(HbView *,HbView *)), + this, SLOT(close())); } + HbIndicatorMenuContent *menuContent = + qobject_cast(contentWidget()); + menuContent->handleAboutToShow(); + HbDialog::showEvent(event); mShowEventReceived = true; } @@ -234,20 +243,11 @@ menuContent->indicatorActivated(activatedIndicator); } -void HbIndicatorMenu::indicatorRemoved( - HbIndicatorInterface *indicatorRemoved) +void HbIndicatorMenu::indicatorDeactivated( + HbIndicatorInterface *indicator) { //forward to content widget. HbIndicatorMenuContent *menuContent = qobject_cast(contentWidget()); - menuContent->indicatorRemoved(indicatorRemoved); + menuContent->indicatorRemoved(indicator); } - -void HbIndicatorMenu::orientationChanged(Qt::Orientation orientation) -{ - Q_UNUSED(orientation); - doMenuLayout(); -} - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu_p.h --- a/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenu_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -66,9 +66,7 @@ void indicatorsActivated(QList activatedIndicators); void indicatorActivated(HbIndicatorInterface *activatedIndicator); - void indicatorRemoved(HbIndicatorInterface *indicatorRemoved); -protected slots: - void orientationChanged(Qt::Orientation orientation); + void indicatorDeactivated(HbIndicatorInterface *indicator); private: bool constructMenu(const QVariantMap ¶meters); diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenucontent.cpp --- a/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenucontent.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenucontent.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -152,6 +152,19 @@ return indicatorModel.rowCount(); } +void HbIndicatorMenuContent::handleAboutToShow() +{ + for (int i = 0; i < mIndicatorList->model()->rowCount(); ++i) { + HbIndicatorInterface *indicator = + indicatorFromIndex(indicatorModel.item(i)->index()); + if (indicator) { + if (indicator->refreshData()) { + setData(indicator, indicatorModel.item(i)->index()); + } + } + } +} + void HbIndicatorMenuContent::updatePrimitives() { repolish(); @@ -233,12 +246,12 @@ int index = listIndexFromIndicator(indicatorRemoved); if (index >= 0) { indicatorModel.removeRow(index); + //update indices. + for(int i = indicatorRemoved->category()+1; i < IndicatorTypes;++i){ + mGroupTypeIndeces[i]--; + } + repolish(); } - //update indices. - for(int i = indicatorRemoved->category()+1; i < IndicatorTypes;++i){ - mGroupTypeIndeces[i]--; - } - repolish(); } //data changed inside indicator. diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenucontent_p.h --- a/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenucontent_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenucontent_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -88,6 +88,8 @@ static HbIndicatorInterface *indicatorFromIndex( const QModelIndex &modelIndex); + void handleAboutToShow(); + signals: void aboutToClose(); void userActivity(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenuplugin.cpp --- a/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenuplugin.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/devicedialogs/indicatormenuplugin/hbindicatormenuplugin.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -110,7 +110,7 @@ Q_UNUSED(parameters) info->group = IndicatorGroup; - info->flags = NoDeviceDialogFlags; + info->flags = ReceiveIndicatorStatus; info->priority = DefaultPriority; TRACE_EXIT diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectengine.cpp --- a/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectengine.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectengine.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -320,12 +320,11 @@ } else if (HbFeedbackEffectUtils::widgetFamily(widget) == HbFeedbackEffectUtils::Editor) { effect = HbFeedbackEffectUtils::instantOnRelease(widget, modifiers()); - } else if (widget->type() == HbPrivate::ItemType_GroupBoxHeadingWidget || widget->type() == Hb::ItemType_ComboBox) { + } else if (widget->type() == Hb::ItemType_ComboBox) { effect = HbFeedbackEffectUtils::instantOnRelease(widget, modifiers()) ; } - else if (widget->type() == HbPrivate::ItemType_GroupBoxHeadingWidget - || widget->type() == HbPrivate::ItemType_GroupBoxContentWidget - || widget->type() == HbPrivate::ItemType_DataGroupHeadingWidget + else if (widget->type() == HbPrivate::ItemType_GroupBoxContentWidget + || widget->type() == HbPrivate::ItemType_GroupBoxHeadingWidget || widget->type() == Hb::ItemType_ComboBox) { effect = HbFeedbackEffectUtils::instantOnRelease(widget, modifiers()); } @@ -355,7 +354,10 @@ effect = overrider.newInstantEffect; } else { effect = HbFeedback::None; - if (widget->type() == Hb::ItemType_InputButtonGroup) { + if (widget->type() == Hb::ItemType_InputButtonGroup && modifiers() & Hb::ModifierInputFunctionButton) { + effect = HbFeedback::BasicKeypad; + } + else if(widget->type() == Hb::ItemType_InputButtonGroup) { effect = HbFeedback::SensitiveKeypad; } else { @@ -413,7 +415,7 @@ if(widgetOverridesEffect( widget, interaction)) { effect = overrider.newInstantEffect; } else { - effect = HbFeedbackEffectUtils::instantOnKeyRepeat(widget); + effect = HbFeedbackEffectUtils::instantOnKeyRepeat(widget, modifiers()); } if(widgetOverridesModalities(widget,interaction)) { @@ -450,13 +452,26 @@ QGraphicsItem* graphicsItem = trackPoint->mainWindow()->scene()->focusItem(); - if (graphicsItem->isWidget() && - static_cast(graphicsItem)->inherits("HbAbstractEdit")) { - - if (HbAbstractEdit* edit = static_cast(graphicsItem)) { - if (edit->cursorPosition() != previousCursorPosition) { - effect = HbFeedbackEffectUtils::instantOnEditorHighlight(edit, previousCursorPosition); - previousCursorPosition = edit->cursorPosition(); + if (graphicsItem->isWidget()) { + if (static_cast(graphicsItem)->inherits("HbAbstractEdit")) { + if (HbAbstractEdit* edit = static_cast(graphicsItem)) { + if (edit->cursorPosition() != previousCursorPosition) { + effect = HbFeedbackEffectUtils::instantOnEditorHighlight(edit, previousCursorPosition); + previousCursorPosition = edit->cursorPosition(); + } + } + } + else if (static_cast(graphicsItem)->inherits("QGraphicsWebView") ) + { + // This takes care of the case when the track point is used on a QGraphicsWebView (for e.g. cWRT) + QVariant v; + v = graphicsItem->scene()->inputMethodQuery( Qt::ImCursorPosition ); + if ( v.isValid() && v.canConvert()) { + int currentCursorPosition = v.toInt(); + if (currentCursorPosition != previousCursorPosition) { + effect = HbFeedbackEffectUtils::instantOnEditorHighlight(trackPoint, previousCursorPosition); + previousCursorPosition = currentCursorPosition; + } } } } @@ -512,18 +527,17 @@ */ void HbFeedbackEffectEngine::rotated90Degrees(const HbWidget *widget) { - HbFeedback::InstantEffect effect = HbFeedback::None ; - HbFeedback::Modalities modalities = 0 ; + HbFeedback::InstantEffect effect = HbFeedback::None; + HbFeedback::Modalities modalities = 0; Hb::InstantInteraction interaction = Hb::InstantRotated90Degrees; - if(widgetOverridesEffect( widget, interaction)) { + if(widgetOverridesEffect(widget, interaction)) { effect = overrider.newInstantEffect; } else { effect = HbFeedback::RotateStep; - } - if(widgetOverridesModalities(widget,interaction)) { + if (widgetOverridesModalities(widget,interaction)) { modalities = overrider.newModalities ; } else { modalities = HbFeedbackEffectUtils::modalities(widget, interaction, modifiers()); @@ -539,18 +553,20 @@ { HbFeedback::Modalities modalities = 0 ; Hb::InstantInteraction interaction = Hb::InstantPopupOpened; + HbFeedback::InstantEffect effect = HbFeedback::None; if(widgetOverridesModalities(widget,interaction)) { - modalities = overrider.newModalities ; - } else { + modalities = overrider.newModalities; + } else { modalities = HbFeedbackEffectUtils::modalities(widget, interaction, modifiers()); } - if(widgetOverridesEffect( widget, interaction)) { + if (widgetOverridesEffect(widget, interaction)) { playInstantFeedback(widget, overrider.newInstantEffect, modalities); } else { - if(HbFeedbackEffectUtils::isFeedbackAllowedForPopup(widget)) { - playInstantFeedback(widget, HbFeedback::PopupOpen, modalities); + if (HbFeedbackEffectUtils::isFeedbackAllowedForPopup(widget)) { + effect = HbFeedbackEffectUtils::instantOnPopupOpened(widget); + playInstantFeedback(widget, effect, modalities); } } } @@ -562,6 +578,7 @@ { HbFeedback::Modalities modalities = 0 ; Hb::InstantInteraction interaction = Hb::InstantPopupClosed; + HbFeedback::InstantEffect effect = HbFeedback::None; if(widgetOverridesModalities(widget,interaction)) { modalities = overrider.newModalities ; @@ -569,11 +586,12 @@ modalities = HbFeedbackEffectUtils::modalities(widget, interaction, modifiers()); } - if(widgetOverridesEffect( widget, interaction)) { + if(widgetOverridesEffect(widget, interaction)) { playInstantFeedback(widget, overrider.newInstantEffect, modalities); } else { - if(HbFeedbackEffectUtils::isFeedbackAllowedForPopup(widget)) { - playInstantFeedback(widget, HbFeedback::PopupClose, modalities); + if (HbFeedbackEffectUtils::isFeedbackAllowedForPopup(widget)) { + effect = HbFeedbackEffectUtils::instantOnPopupClosed(widget); + playInstantFeedback(widget, effect, modalities); } } } @@ -682,51 +700,6 @@ } break; } - case HbFeedbackEffectUtils::List: - case HbFeedbackEffectUtils::Grid: - { - if (interaction == Hb::ContinuousScrolled) { - if (const HbAbstractItemView * itemView = qobject_cast(widget)) { - feedbackPlayed = true; - QList visibleItems = itemView->visibleItems(); - bool newItemFound(false); - int index(-1); - QList visibleIndexes; - if (widget == activelyScrollingItemView) { - foreach (HbAbstractViewItem * item, visibleItems) { - index = item->modelIndex().row(); - if (!oldVisibleIndexes.contains(index)) { - newItemFound = true; - } - visibleIndexes.append(index); - } - } - if (widget != activelyScrollingItemView){ - activelyScrollingItemView = widget; - newItemFound = false; - } - // To prevent the uninitialized list to cause false new item detections - if (oldVisibleIndexes.empty()) { - newItemFound = false; - } - oldVisibleIndexes.clear(); - oldVisibleIndexes = visibleIndexes; - - if (newItemFound) { - const HbListView* listView = qobject_cast(widget); - if (!( listView && - listView->arrangeMode() && - listView->draggedItem())){ - if(!widgetOverridesModalities(widget,interaction)) { - modalities = HbFeedback::Audio | HbFeedback::Tactile; - } - playInstantFeedback(widget, HbFeedback::ItemScroll, modalities); - } - } - } - } - break; - } default: { break; @@ -738,6 +711,45 @@ if (widget->type() == HbPrivate::ItemType_MenuListView) { feedbackPlayed = true; } + if(widget->type() == Hb::ItemType_TumbleView) + { + if (const HbAbstractItemView * itemView = qobject_cast(widget)) { + feedbackPlayed = true; + QList visibleItems = itemView->visibleItems(); + bool newItemFound(false); + int index(-1); + QList visibleIndexes; + if (widget == activelyScrollingItemView) { + foreach (HbAbstractViewItem * item, visibleItems) { + index = item->modelIndex().row(); + if (!oldVisibleIndexes.contains(index)) { + newItemFound = true; + } + visibleIndexes.append(index); + } + } + if (widget != activelyScrollingItemView){ + activelyScrollingItemView = widget; + newItemFound = false; + } + // To prevent the uninitialized list to cause false new item detections + if (oldVisibleIndexes.empty()) { + newItemFound = false; + } + oldVisibleIndexes.clear(); + oldVisibleIndexes = visibleIndexes; + + if (newItemFound) { + if(!widgetOverridesModalities(widget,interaction)) { + modalities = HbFeedback::Audio | HbFeedback::Tactile; + } + playInstantFeedback(widget, HbFeedback::ItemScroll, modalities); + + } + } + } + + // generic scroll areas don't emit continuous feedback if (const HbScrollArea* scrollArea = qobject_cast(widget)) { @@ -815,35 +827,22 @@ void HbFeedbackEffectEngine::playContinuousFeedback(const HbWidget* widget, HbFeedback::ContinuousEffect effect, int intensity, HbFeedback::Modalities modalities) { const QGraphicsView* view = widget->mainWindow(); + HbContinuousFeedback* feedback; - // if feedback can be played if (view && HbFeedbackEffectUtils::isFeedbackAllowed(widget)) { - // if this widget has been playing if (continuousFeedbacks.contains(widget)) { - HbContinuousFeedback* feedback = continuousFeedbacks.value(widget); - - // if this feedback is already playing then only its effect and intensity are updated - feedback->setModalities(modalities); - feedback->setOwningWindow(view); - feedback->setRect(widget, view); - feedback->setContinuousEffect(effect); - feedback->setIntensity(intensity); - // if this feedback is not being played, play it - if (!feedback->isPlaying()) { - feedback->play(); - } + feedback = continuousFeedbacks.value(widget); } else { - // this widget has not played anything before - HbContinuousFeedback *feedback = new HbContinuousFeedback(); - feedback->setModalities(modalities); - feedback->setOwningWindow(view); - feedback->setRect(widget, view); - feedback->setContinuousEffect(effect); - feedback->setIntensity(intensity); + feedback = new HbContinuousFeedback(); continuousFeedbacks.insert(widget, feedback); - feedback->play(); } + feedback->setModalities(modalities); + feedback->setOwningWindow(view); + feedback->setRect(widget, view); + feedback->setContinuousEffect(effect); + feedback->setIntensity(intensity); + feedback->play(); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectutils.cpp --- a/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectutils.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectutils.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,14 +23,15 @@ ** ****************************************************************************/ +#include "hbfeedbackeffectutils.h" #include "hbnamespace_p.h" -#include "hbfeedbackeffectutils.h" #include #include #include #include #include +#include #include #include #include @@ -155,6 +156,8 @@ case Hb::ItemType_ScrollBar: + case Hb::ItemType_RatingSlider: + family = HbFeedbackEffectUtils::Slider; break; @@ -239,21 +242,24 @@ } } - if (widget->type() == HbPrivate::ItemType_NavigationButton - // Commented out until use cases are clarified - /*|| widget->type() == HbPrivate::ItemType_IndicatorButton*/) { + if (widget->type() == HbPrivate::ItemType_NavigationButton || + widget->type() == Hb::ItemType_ToolButton) { effect = HbFeedback::BasicButton; } // input widget special case - if (widget->type() == Hb::ItemType_InputButtonGroup) { + if (widget->type() == Hb::ItemType_InputButtonGroup && modifiers & Hb::ModifierInputFunctionButton) { + effect = HbFeedback::BasicKeypad; + } + else if (widget->type() == Hb::ItemType_InputButtonGroup) { effect = HbFeedback::SensitiveKeypad; } else if (widget->type() == Hb::ItemType_InputFunctionButton) { effect = HbFeedback::BasicKeypad; } - else if (widget->type() == Hb::ItemType_CheckBox) { - effect = HbFeedback::None; // Checkbox deferred to release + + if (widget->type() == Hb::ItemType_CheckBox) { + effect = HbFeedback::BasicButton; } // title pane specific special case @@ -269,18 +275,27 @@ effect = HbFeedback::BasicItem; } else { + effect = HbFeedback::BasicItem; + } + if (widget->type() == Hb::ItemType_DataFormViewItem) { effect = HbFeedback::SensitiveItem; } + else if (widget->type() == HbPrivate::ItemType_DataGroup) { + effect = HbFeedback::None; + } + break; case HbFeedbackEffectUtils::Grid: - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::BasicItem; break; case HbFeedbackEffectUtils::Slider: - // slider area - effect = HbFeedback::None; + // slider track default + effect = HbFeedback::BasicSlider; + + // special cases if (const HbProgressSlider *progressSlider = qobject_cast(widget)) { Q_UNUSED(progressSlider) effect = HbFeedback::BasicSlider; @@ -291,12 +306,12 @@ // slider handle if (modifiers & Hb::ModifierSliderHandle) { - effect = HbFeedback::SensitiveSlider; + effect = HbFeedback::BasicSlider; } // slider elements if (modifiers & Hb::ModifierSliderElement) { - effect = HbFeedback::SensitiveButton; + effect = HbFeedback::BasicButton; } break; @@ -318,20 +333,15 @@ break; } - if (widget->type() == Hb::ItemType_MenuItem) { - if (modifiers & Hb::ModifierScrolling) { - effect = HbFeedback::StopFlick; - } - } // item view specific special cases if ( const HbAbstractViewItem * viewItem = qobject_cast(widget)) { const HbAbstractItemView* itemView = viewItem->itemView(); if (itemView) { - // checkable item is checked with a press + // Different press feedbacks for single and multiselection list items switch (itemView->selectionMode()) { case HbAbstractItemView::SingleSelection: case HbAbstractItemView::MultiSelection: { - effect = HbFeedback::None; + effect = HbFeedback::BasicButton; break; } case HbAbstractItemView::NoSelection: @@ -346,12 +356,12 @@ break; } - // radio button list works like a normal list item + // radio button list behaves like an item view on press if (viewItem->type() == Hb::ItemType_RadioButtonListViewItem) { - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::BasicItem; } else if(viewItem->type() == Hb::ItemType_TumbleViewItem ) { - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::BasicItem; } // expandable or collapsable items give a BasicItem feedback @@ -360,17 +370,21 @@ effect = HbFeedback::BasicItem; } else { - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::BasicItem; } } - - if (modifiers & Hb::ModifierScrolling) { - effect = HbFeedback::StopFlick; - } } } - if (widget->type() == Hb::ItemType_VirtualTrackPoint) { - effect = HbFeedback::Editor; + + if (widget->type() == Hb::ItemType_VirtualTrackPoint || QString(widget->metaObject()->className()) == "HbSelectionControl") { + effect = HbFeedback::BasicButton; + } + else if (widget->type() == Hb::ItemType_NotificationDialog) { + effect = HbFeedback::BasicItem; + } + + if (modifiers & Hb::ModifierScrolling) { + effect = HbFeedback::StopFlick; } return effect; @@ -412,25 +426,26 @@ } } - if (widget->type() == HbPrivate::ItemType_NavigationButton - // Commented out until use cases are clarified - /*|| widget->type() == HbPrivate::ItemType_IndicatorButton*/) { + if (widget->type() == HbPrivate::ItemType_NavigationButton || + widget->type() == Hb::ItemType_ToolButton) { effect = HbFeedback::BasicButton; } // input widget special case - if (widget->type() == Hb::ItemType_InputButtonGroup - || widget->type() == Hb::ItemType_InputFunctionButton) { + if (widget->type() == Hb::ItemType_InputButtonGroup && modifiers & Hb::ModifierInputFunctionButton) { + effect = HbFeedback::BasicKeypad; + } + else if (widget->type() == Hb::ItemType_InputButtonGroup) { effect = HbFeedback::SensitiveKeypad; - } else if (widget->type() == Hb::ItemType_CheckBox) { - effect = HbFeedback::Checkbox; // deferred from press + } + + if (widget->type() == Hb::ItemType_CheckBox) { + effect = HbFeedback::Checkbox; } // title pane specific special case if (widget->type() == HbPrivate::ItemType_TitlePane) { - if (isOptionsMenuEmpty(widget)) { - effect = HbFeedback::None; - } + effect = HbFeedback::None; } if (widget->type() == Hb::ItemType_ComboBox) { @@ -444,36 +459,39 @@ effect = HbFeedback::BasicItem; } else { - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::BasicItem; } - // menu items give popop closed feedback on release + // menu items give popup close feedback on release if (widget->type() == Hb::ItemType_MenuItem) { effect = HbFeedback::None; } + else if (widget->type() == Hb::ItemType_DataFormViewItem) { + effect = HbFeedback::None; + } break; case HbFeedbackEffectUtils::Grid: - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::BasicItem; break; case HbFeedbackEffectUtils::Slider: - // slider area - effect = HbFeedback::None; + // slider track default + effect = HbFeedback::BasicSlider; // slider handle if (modifiers & Hb::ModifierSliderHandle) { - effect = HbFeedback::SensitiveSlider; + effect = HbFeedback::BasicSlider; } // slider elements if (modifiers & Hb::ModifierSliderElement) { - effect = HbFeedback::SensitiveButton; + effect = HbFeedback::None; } break; case HbFeedbackEffectUtils::Editor: - effect = HbFeedback::Editor; + effect = HbFeedback::None; break; default: @@ -486,7 +504,7 @@ if (itemView) { switch (itemView->selectionMode()) { case HbAbstractItemView::SingleSelection: - effect = HbFeedback::Checkbox; // deferred from press + effect = HbFeedback::Checkbox; break; case HbAbstractItemView::MultiSelection: { effect = HbFeedback::None; @@ -510,12 +528,15 @@ } } - // radio button list works like a normal list item + // radio button list has checkbox feedback behaviour on release if (viewItem->type() == Hb::ItemType_RadioButtonListViewItem) { - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::Checkbox; } else if(viewItem->type() == Hb::ItemType_TumbleViewItem ) { - effect = HbFeedback::SensitiveItem; + effect = HbFeedback::BasicItem; + } + else if (widget->type() == Hb::ItemType_NotificationDialog) { + effect = HbFeedback::BasicItem; } if (modifiers & Hb::ModifierExpandedItem || modifiers & Hb::ModifierCollapsedItem) { @@ -523,13 +544,14 @@ } } } + return effect; } /*! Returns the instant feedback effect on key repeat interaction. */ -HbFeedback::InstantEffect HbFeedbackEffectUtils::instantOnKeyRepeat(const HbWidget *widget) +HbFeedback::InstantEffect HbFeedbackEffectUtils::instantOnKeyRepeat(const HbWidget *widget, Hb::InteractionModifiers modifiers) { HbFeedback::InstantEffect effect = HbFeedback::Sensitive; @@ -544,10 +566,13 @@ effect = HbFeedback::SensitiveButton; // input widget special case - if (widget->type() == Hb::ItemType_InputButtonGroup - || widget->type() == Hb::ItemType_InputFunctionButton) { + if (widget->type() == Hb::ItemType_InputButtonGroup && modifiers & Hb::ModifierInputFunctionButton) { + effect = HbFeedback::BasicKeypad; + } + else if (widget->type() == Hb::ItemType_InputButtonGroup) { effect = HbFeedback::SensitiveKeypad; } + break; case HbFeedbackEffectUtils::List: @@ -602,9 +627,11 @@ if (widget->type() == Hb::ItemType_VirtualTrackPoint) { effect = HbFeedback::Editor; } + if (widget->type() == Hb::ItemType_Menu) { effect = HbFeedback::ItemScroll; } + return effect; } @@ -664,6 +691,49 @@ } } } + else if (const HbInputVirtualRocker *trackPoint = qobject_cast(widget)) { + + QGraphicsItem* graphicsItem = trackPoint->mainWindow()->scene()->focusItem(); + + if (graphicsItem->isWidget() && (static_cast(graphicsItem)->inherits("QGraphicsWebView"))) { + QVariant v; + v = graphicsItem->scene()->inputMethodQuery( Qt::ImCursorPosition ); + if ( v.isValid() && v.canConvert()) { + int index; + index = v.toInt(); + QVariant varSurrText; + varSurrText = graphicsItem->scene()->inputMethodQuery( Qt::ImSurroundingText ); + if ( varSurrText.isValid() ) { + QString text = varSurrText.toString(); + // Index (current cursor position) can be equal to the + // length of the string (for e.g. when the cursor is at the end) + // So we make sure we bring index within the bounds of the string + if (!text.isEmpty() && index <= text.count()) { + dist = abs(index - previousCursorPosition); + + if (previousCursorPosition < index || index == text.count()) { + index--; + } + QChar character = text.at(index); + emptyline = character.category() == QChar::Separator_Paragraph; + + if (emptyline) { + effect = HbFeedback::EmptyLineSelection; + } + else if (dist > 1) { + effect = HbFeedback::LineSelection; + } + else if (character.isSpace()) { + effect = HbFeedback::BlankSelection; + } + else { + effect = HbFeedback::TextSelection; + } + } + } + } + } + } return effect; } @@ -673,11 +743,11 @@ bool HbFeedbackEffectUtils::isFeedbackAllowedForPopup(const HbWidget *widget) { bool feedbackAllowed(false); + if (widgetFamily(widget) == HbFeedbackEffectUtils::Popup) { feedbackAllowed = true; if (widget->type() == HbPrivate::ItemType_ToolTipLabel - || widget->type() == Hb::ItemType_InputCharPreviewPane - || widget->type() == Hb::ItemType_InputVkbWidget) { + || widget->type() == Hb::ItemType_InputCharPreviewPane) { feedbackAllowed = false; } else if (QString(widget->metaObject()->className()) == "HbSelectionControl") { @@ -687,10 +757,44 @@ else if (QString(widget->metaObject()->className()) == "HbComboDropDown") { feedbackAllowed = true; } + return feedbackAllowed; } /*! + Returns the instant feedback effect for popup open event. +*/ +HbFeedback::InstantEffect HbFeedbackEffectUtils::instantOnPopupOpened(const HbWidget *widget) { + + HbFeedback::InstantEffect effect = HbFeedback::None; + + if (QString(widget->metaObject()->className()) == "HbDeviceNotificationDialogWidget") { + effect = HbFeedback::PopUp; + } + else { + effect = HbFeedback::PopupOpen; + } + return effect; +} + +/*! + Returns the instant feedback effect for popup close event. +*/ +HbFeedback::InstantEffect HbFeedbackEffectUtils::instantOnPopupClosed(const HbWidget *widget) { + + HbFeedback::InstantEffect effect = HbFeedback::None; + + if (QString(widget->metaObject()->className()) == "HbDeviceNotificationDialogWidget") { + effect = HbFeedback::None; + } + else { + effect = HbFeedback::PopupClose; + } + + return effect; +} + +/*! Returns the instant feedback effect on key press interaction. */ HbFeedback::InstantEffect HbFeedbackEffectUtils::instantOnKeyPress(const HbWidget *widget, Hb::InteractionModifiers modifiers) @@ -706,7 +810,7 @@ { HbFeedback::InstantEffect effect = HbFeedback::None; - if ( const HbAbstractViewItem * viewItem = qobject_cast(widget)) { + if (const HbAbstractViewItem * viewItem = qobject_cast(widget)) { const HbAbstractItemView* itemView = viewItem->itemView(); if (itemView) { switch (itemView->selectionMode()) { @@ -716,19 +820,20 @@ break; } case HbAbstractItemView::MultiSelection: { - effect = HbFeedback::MultipleCheckbox; + effect = HbFeedback::Checkbox; break; } default: break; } - if (modifiers == Hb::ModifierScrolling) { - effect = HbFeedback::StopFlick; - } } } - - return effect; + else if (const HbAbstractItemView* itemView = qobject_cast(widget)) { + if (itemView->selectionMode() == HbAbstractItemView::MultiSelection && (modifiers & Hb::ModifierScrolling)) { + effect = HbFeedback::MultipleCheckbox; + } + } + return effect; } /*! @@ -750,7 +855,10 @@ default: break; + } + if (widget->type() == Hb::ItemType_ScrollBar) { + effect = HbFeedback::ContinuousNone; } if (interaction == Hb::ContinuousPinched) { @@ -791,10 +899,6 @@ break; } } - else if (const HbScrollBar *scrollbar = qobject_cast(widget)) { - Q_UNUSED(scrollbar); - intensity = HbFeedback::IntensitySmooth; - } else { // The default intensity for continuous effects intensity = HbFeedback::IntensityFull; @@ -859,6 +963,7 @@ HbFeedback::Modalities HbFeedbackEffectUtils::modalities(const HbWidget *widget, Hb::InstantInteraction interaction, Hb::InteractionModifiers modifiers ) { Q_UNUSED(modifiers) + Q_UNUSED(widget) HbFeedback::Modalities modalities = 0; @@ -874,9 +979,6 @@ case Hb::InstantClicked: modalities = HbFeedback::Tactile; - if(widget->type() == Hb::ItemType_CheckBox) { - modalities |= HbFeedback::Audio; - } break; case Hb::InstantKeyRepeated: diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectutils.h --- a/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectutils.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/feedback/feedbackeffectplugin/hbfeedbackeffectutils.h Thu Jul 22 16:36:53 2010 +0100 @@ -60,14 +60,16 @@ static WidgetFamily widgetFamily(const HbWidget *widget); static HbFeedback::InstantEffect instantOnPress(const HbWidget *widget, Hb::InteractionModifiers modifiers); static HbFeedback::InstantEffect instantOnRelease(const HbWidget *widget, Hb::InteractionModifiers modifiers); - static HbFeedback::InstantEffect instantOnKeyRepeat(const HbWidget *widget); + static HbFeedback::InstantEffect instantOnKeyRepeat(const HbWidget *widget, Hb::InteractionModifiers modifiers); static HbFeedback::InstantEffect instantOnDrag(const HbWidget *widget, Hb::InteractionModifiers modifiers); static HbFeedback::InstantEffect instantOnKeyPress(const HbWidget *widget, Hb::InteractionModifiers modifiers); static HbFeedback::InstantEffect instantOnEditorHighlight(const HbWidget *widget, int previousCursorFocus); static HbFeedback::InstantEffect instantOnSelectionChanged(const HbWidget *widget, Hb::InteractionModifiers modifiers); + static HbFeedback::InstantEffect instantOnPopupOpened(const HbWidget *widget); + static HbFeedback::InstantEffect instantOnPopupClosed(const HbWidget *widget); static HbFeedback::ContinuousEffect continuousEffect(const HbWidget *widget, Hb::ContinuousInteraction interaction); - static HbFeedback::Modalities modalities(const HbWidget *widget, Hb::InstantInteraction interaction, Hb::InteractionModifiers modifiers ); - static HbFeedback::Modalities modalities(const HbWidget *widget, Hb::ContinuousInteraction interaction, Hb::InteractionModifiers modifiers ); + static HbFeedback::Modalities modalities(const HbWidget *widget, Hb::InstantInteraction interaction, Hb::InteractionModifiers modifiers); + static HbFeedback::Modalities modalities(const HbWidget *widget, Hb::ContinuousInteraction interaction, Hb::InteractionModifiers modifiers); static bool isFeedbackAllowedForPopup(const HbWidget *widget); static int intensity(const HbWidget *widget, Hb::ContinuousInteraction interaction, QPointF delta = QPointF()); static bool isFeedbackAllowed(const HbWidget* widget); diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputabstractbase.cpp --- a/src/hbplugins/inputmethods/common/hbinputabstractbase.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputabstractbase.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include "hbinputabstractbase.h" @@ -38,6 +40,7 @@ // --------------------------------------------------------------------------- HbInputAbstractMethod::HbInputAbstractMethod() { + mVanillQwertySwitch = new HbAction(QString("QTY")); } // --------------------------------------------------------------------------- @@ -46,6 +49,7 @@ // --------------------------------------------------------------------------- HbInputAbstractMethod::~HbInputAbstractMethod() { + delete mVanillQwertySwitch; } // --------------------------------------------------------------------------- @@ -156,18 +160,60 @@ } } -void HbInputAbstractMethod::showThaiSpecialCharacters(uint buttonId) -{ - Q_UNUSED(buttonId); -} bool HbInputAbstractMethod::isSctModeActive() const { return false; } + HbKeyboardType HbInputAbstractMethod::currentKeyboardType() const { return HbKeyboardNone; } + +void HbInputAbstractMethod::focusReceived() +{ + bool isVannilaApp = false; + QInputContext* context = qApp->inputContext(); + if (context && context->focusWidget()) { + QWidget *focusedWidget = context->focusWidget(); + if (!focusedWidget->inherits("HbMainWindow")) { + isVannilaApp = true; + } + } + + if(isVannilaApp && focusObject() ) { + QList customActions= focusObject()->editorInterface().actions(); + if(!customActions.contains(mVanillQwertySwitch)) { + disconnect(mVanillQwertySwitch, SIGNAL(triggered(bool))); + connect(mVanillQwertySwitch, SIGNAL(triggered(bool)), this, SLOT(switchKeypad(bool))); + focusObject()->editorInterface().addAction(mVanillQwertySwitch); + } + } +} + +void HbInputAbstractMethod::switchKeypad(bool isActive) +{ + Q_UNUSED(isActive); + HbKeyboardType keyboard = HbInputSettingProxy::instance()->activeKeyboard(); + if (keyboard == HbKeyboardVirtual12Key) { + HbInputSettingProxy::instance()->setActiveKeyboard(HbKeyboardVirtualQwerty); + } else if (keyboard == HbKeyboardVirtualQwerty) { + HbInputSettingProxy::instance()->setActiveKeyboard(HbKeyboardVirtual12Key); + } +} + +// EOF + + + +QChar HbInputAbstractMethod ::previousChar() +{ + return QChar(); +} + + +// EOF + diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputabstractbase.h --- a/src/hbplugins/inputmethods/common/hbinputabstractbase.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputabstractbase.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,13 +49,18 @@ virtual void launchAutoCompletionPopup(const QStringList& candidates); virtual void closeAutoCompletionPopup(); virtual void switchMode(int keyCode); - virtual void showThaiSpecialCharacters(uint buttonId); virtual void starKeySelected(); virtual void getCandidatePositionAndSize(HbCandidateList *candidatePopup, HbInputVkbWidget *currentKeypad, QPointF & pos,QSizeF & size); virtual bool isSctModeActive() const; + virtual QChar previousChar(); virtual HbKeyboardType currentKeyboardType() const; +public: // From HbInputMethod + void focusReceived(); +public slots: + void switchKeypad(bool isActive); private: + HbAction *mVanillQwertySwitch; Q_DISABLE_COPY(HbInputAbstractMethod) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputbasichandler.cpp --- a/src/hbplugins/inputmethods/common/hbinputbasichandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputbasichandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -155,8 +155,12 @@ switch (event->key()) { case Qt::Key_Backspace: case HbInputButton::ButtonKeyCodeDelete: { - QKeyEvent keyEvent(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier); - sendAndUpdate(keyEvent); + // passing both the keypress and keyrelease events + // as webkit requires both the events to be delivered to them. + QKeyEvent keyEventPress(QEvent::KeyPress, Qt::Key_Backspace, Qt::NoModifier); + QKeyEvent keyEventRelease(QEvent::KeyRelease, Qt::Key_Backspace, Qt::NoModifier); + sendAndUpdate(keyEventPress); + sendAndUpdate(keyEventRelease); // pass event to auto completer. deleteCharacterInAutoCompleter(); // return false since the event is sent forward @@ -172,6 +176,12 @@ commitAndUpdate(qc); } break; + case HbInputButton::ButtonKeyCodeSettings: + // Hide the autocompletion popup when InputSetting dialog is launched + if(d->mAutoCompleter) { + d->mInputMethod->closeAutoCompletionPopup(); + } + break; default: ret = HbInputModeHandler::filterEvent(event); break; diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputmodehandler.cpp --- a/src/hbplugins/inputmethods/common/hbinputmodehandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputmodehandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -73,34 +73,33 @@ return -1; } -void HbInputModeHandlerPrivate::getAndFilterCharactersBoundToKey(QStringList &spellList, Qt::Key key) +void HbInputModeHandlerPrivate::getAndFilterCharactersBoundToKey(QString &allowedChars, HbKeyboardType type, \ + int key, HbModifiers modifiers) { - HbInputFocusObject *focusObject = mInputMethod->focusObject(); - - spellList.clear(); - // Get the functionized character - const HbMappedKey* mappedKey = mKeymap->keyForKeycode(mInputMethod->inputState().keyboard(), key); + allowedChars.clear(); + HbInputLanguage language = mInputMethod->inputState().language(); + + if (!mKeymap) { + mKeymap = HbKeymapFactory::instance()->keymap(language); + } + const HbMappedKey* mappedKey = mKeymap->keyForKeycode(type, key); if (!mappedKey) { return; } - - if (!mappedKey->characters(HbModifierFnPressed).isNull() && focusObject && focusObject->characterAllowedInEditor(mappedKey->characters(HbModifierFnPressed).at(0))) { - spellList.append(mappedKey->characters(HbModifierFnPressed).at(0)); - } - - // Get the characters mapped to the key. - HbInputState inputState = mInputMethod->inputState(); - HbTextCase textCase = inputState.textCase(); - HbModifiers modifiers = HbModifierNone; - - if (textCase == HbTextCaseUpper || textCase == HbTextCaseAutomatic) { - modifiers |= HbModifierShiftPressed; - } - for (int i=0; i < mappedKey->characters(modifiers).length(); i++) { - if (focusObject && focusObject->characterAllowedInEditor(mappedKey->characters(modifiers).at(i))) { - spellList.append(mappedKey->characters(modifiers).at(i)); - } - } + QString chars = mappedKey->characters(modifiers); + // check whether current input language supports native digits. if yes, replace latin digits with native digits + for (int i = 0; i < chars.length(); i++) { + if (chars.at(i) >= '0' && chars.at(i) <= '9') { + chars = chars.replace(chars.at(i), HbInputUtils::findFirstNumberCharacterBoundToKey(mappedKey, + language, HbInputUtils::inputDigitType(language))); + } + } + // We need to see which of the characters in keyData are allowed to the editor. + // this looks like expensive operation, need to find out a better way/place to do it. + HbInputFocusObject *focusedObject = mInputMethod->focusObject(); + if(focusedObject) { + focusedObject->filterStringWithEditorFilter(chars,allowedChars); + } } @@ -233,7 +232,7 @@ return ; } QStringList patterns = focusObject->editorInterface().smileyTheme().patterns(smiley); - foreach( QString string, patterns) { + foreach( const QString string, patterns) { QString filtered; focusObject->filterStringWithEditorFilter(string, filtered); if (filtered == string) { @@ -293,30 +292,10 @@ if (type != HbKeyboardSctPortrait && (textCase == HbTextCaseUpper || textCase == HbTextCaseAutomatic)) { modifiers |= HbModifierShiftPressed; } - HbInputLanguage language = d->mInputMethod->inputState().language(); - - if (!d->mKeymap) { - d->mKeymap = HbKeymapFactory::instance()->keymap(language); - } - const HbMappedKey* mappedKey = d->mKeymap->keyForKeycode(type, key); - if (!mappedKey) { - return 0; - } - QString chars = mappedKey->characters(modifiers); - // check whether current input language supports native digits. if yes, replace latin digits with native digits - for (int i = 0; i < chars.length(); i++) { - if (chars.at(i) >= '0' && chars.at(i) <= '9') { - chars = chars.replace(chars.at(i), HbInputUtils::findFirstNumberCharacterBoundToKey(mappedKey, - language, HbInputUtils::inputDigitType(language))); - } - } - // We need to see which of the characters in keyData are allowed to the editor. - // this looks like expensive operation, need to find out a better way/place to do it. - QString allowedChars = chars; - HbInputFocusObject *focusedObject = d->mInputMethod->focusObject(); - if(focusedObject) { - focusedObject->filterStringWithEditorFilter(chars,allowedChars); - } + + QString allowedChars; + getAndFilterCharactersBoundToKey(allowedChars,type,key,modifiers); + QChar character = 0; if (!allowedChars.isNull()) { if (index >= allowedChars.length() || index < 0) { @@ -324,6 +303,9 @@ } character = allowedChars.at(index); index++; + if (index >= allowedChars.length() || index < 0) { + index = 0; + } } return character; } @@ -331,10 +313,11 @@ /*! This function gets all the characters bound to a key and filters those character based on the editor. */ -void HbInputModeHandler::getAndFilterCharactersBoundToKey(QStringList &spellList, Qt::Key key) +void HbInputModeHandler::getAndFilterCharactersBoundToKey(QString &allowedChars, HbKeyboardType type, \ + int key, HbModifiers modifiers) { Q_D(HbInputModeHandler); - d->getAndFilterCharactersBoundToKey(spellList, key); + d->getAndFilterCharactersBoundToKey(allowedChars,type,key,modifiers); } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputmodehandler.h --- a/src/hbplugins/inputmethods/common/hbinputmodehandler.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputmodehandler.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,6 +32,7 @@ #include #include #include +#include "hbinputspellquerydialog.h" class HbInputAbstractMethod; class QMouseEvent; @@ -68,7 +69,7 @@ HbInputModeActionSetupAutoCompletion, // setting up of autocompletion // focus change - HbInputModeActionFocusRecieved, // focus recived state + HbInputModeActionFocusRecieved, // focus received state HbInputModeActionFocusLost, // focus lost state HbInputModeActionCancelButtonPress, HbInputModeActionCloseSpellQuery @@ -84,8 +85,8 @@ // Utility functions. void commitFirstMappedNumber(int key, HbKeyboardType type); - void getAndFilterCharactersBoundToKey(QStringList &list, Qt::Key key); - QChar getNthCharacterInKey(int &index, int key, HbKeyboardType type); + void getAndFilterCharactersBoundToKey(QString &allowedChars, HbKeyboardType type, int key, HbModifiers modifiers); + virtual QChar getNthCharacterInKey(int &index, int key, HbKeyboardType type); virtual void commitAndAppendString(const QString& string); virtual void commitAndUpdate(const QString& string, int replaceFrom = 0, int replaceLength = 0, bool isAsync = false); void sendAndUpdate(QEvent &event); @@ -184,14 +185,17 @@ virtual void deleteOneCharacter(); virtual void processExactWord(QString exactWord); void commitExactWord(); - virtual void processCustomWord(QString customWord); virtual void candidatePopupClosed(QString activatedWord, int closingKey); virtual void showExactWordPopupIfNeeded(); + void closeSpellQueryDialog(); + void spellQueryDialogClosed(QObject *savedFocusObject,HbInputSpellQuery::HbSpellCloseReason closeReason,const QString &string); + void setAutocompletionStatus(bool status); public slots: // different utility popup callbacks virtual void inputQueryPopupClosed(QString activatedWord, int closingKey); void sctCharacterSelected(QString character); void smileySelected(QString smiley); + void launchSpellQueryDialog(); signals://some useful signals related to popups void launchInputQueryPopup(QString editWord); diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputmodehandler_p.h --- a/src/hbplugins/inputmethods/common/hbinputmodehandler_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputmodehandler_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,7 +39,7 @@ void init(); virtual void _q_timeout(); - void getAndFilterCharactersBoundToKey(QStringList &spellList, Qt::Key key); + void getAndFilterCharactersBoundToKey(QString &allowedChars, HbKeyboardType type, int key, HbModifiers modifiers); void updateTextCase(); // HbPredictionCallback diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputnumerichandler.cpp --- a/src/hbplugins/inputmethods/common/hbinputnumerichandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputnumerichandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -73,6 +73,8 @@ commitAndUpdate(qc); break; } + case HbInputButton::ButtonKeyCodeSettings: + break; default: ret = HbInputModeHandler::filterEvent(event); break; diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputpredictionhandler.cpp --- a/src/hbplugins/inputmethods/common/hbinputpredictionhandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputpredictionhandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,17 +39,17 @@ #include "hbinputpredictionhandler_p.h" #include "hbinputabstractbase.h" -#define HbDeltaHeight 3.0 +static const qreal HbDeltaHeight = 3.0; HbInputPredictionHandlerPrivate::HbInputPredictionHandlerPrivate() :mEngine(0), mCandidates(0), mBestGuessLocation(0), mShowTail(true), - mTailShowing(false), mAutoAddedSpace(true), mCanContinuePrediction(true), - mShowTooltip(true) + mShowTooltip(true), + mSpellQueryDialog(0) { } @@ -63,13 +63,17 @@ void HbInputPredictionHandlerPrivate::deleteOneCharacter() { + if (!mEngine && !mInputMethod->focusObject()) { + return; + } mShowTail = true; mShowTooltip = true; // A backspace in predictive means updating the engine for the delete key press // and get the new candidate list from the engine. if ( mEngine->inputLength() >= 1 ) { - //Only autocomplition part should be deleted when autocompliton part is enable and user pressed a delete key - if(false == mTailShowing) { + int tailLength = mInputMethod->focusObject()->preEditString().length() - mEngine->inputLength(); + //Only autocomplition part should be deleted when autocompliton part is shown and user pressed a delete key + if(tailLength <= 0) { // no autocompletion part displayed mEngine->deleteKeyPress( this ); } //To prevent showing autocompletion part while deleting the characters using backspace key @@ -112,16 +116,8 @@ QString commitString; if (mEngine->inputLength() > 0 && mCandidates->count() > 0) { - if(mCandidates->count() <= mBestGuessLocation) { - commitString = mCandidates->at(0); - mEngine->addUsedWord(mCandidates->at(0)); - } else if (mShowTail == false) { - commitString = mCandidates->at(mBestGuessLocation).left(mEngine->inputLength()); - mEngine->addUsedWord(mCandidates->at(mBestGuessLocation).left(mEngine->inputLength())); - } else { - commitString = mCandidates->at(mBestGuessLocation); - mEngine->addUsedWord(mCandidates->at(mBestGuessLocation)); - } + commitString = getCommitString(); + mEngine->addUsedWord(commitString); if (character == QChar(' ') || character == QChar('\n')) { mAutoAddedSpace = true; } @@ -167,14 +163,6 @@ */ void HbInputPredictionHandlerPrivate::showExactWordPopupIfNeeded() { - Q_Q(HbInputPredictionHandler); - if (mShowTooltip && mBestGuessLocation > 0 && mCandidates->at(0).mid(0, mEngine->inputLength()) \ - != mCandidates->at(mBestGuessLocation).mid(0, mEngine->inputLength())) { - q->processExactWord(mCandidates->at(0)); - } else { - QString empty; - q->processExactWord(empty); - } } QList HbInputPredictionHandlerPrivate::probableKeypresses() @@ -222,16 +210,21 @@ QBrush brush(col); QTextCharFormat gray; gray.setForeground(brush); - list.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, mEngine->inputLength(), taillength, gray)); + if((focusedObject->object())->inherits("QGraphicsWebView") || (focusedObject->object())->inherits("QWebView")) { + //QGraphicsWebView does not handle partial input length formatting well. Causes crash, a temporary fix provided, + //This makes the whole text field grey insted of just the auto-completion part. Anyways, it does not cause crash. + //This should be treated as a work around till QGraphicsWebView is fixed. + list.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, QInputMethodEvent::TextFormat, gray)); + } else { + list.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, mEngine->inputLength(), taillength, gray)); + } list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mEngine->inputLength(), 0, 0)); QInputMethodEvent event(mCandidates->at(mBestGuessLocation), list); focusedObject->sendEvent(event); - mTailShowing = true; } else { list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mCandidates->at(mBestGuessLocation).length(), 0, 0)); QInputMethodEvent event(mCandidates->at(mBestGuessLocation).left(mEngine->inputLength()), list); focusedObject->sendEvent(event); - mTailShowing = false; } if (mShowTooltip && mBestGuessLocation > 0 && mCandidates->at(0).mid(0, mEngine->inputLength()) \ != mCandidates->at(mBestGuessLocation).mid(0, mEngine->inputLength())) { @@ -252,7 +245,8 @@ HbInputFocusObject* focusObject = 0; focusObject = mInputMethod->focusObject(); //If the focused object is NULL or the key event is improper, can not continue - if(!focusObject || (event->key()<0)) { + if(!focusObject || event->key() < 0 || + event->key() == HbInputButton::ButtonKeyCodeCustom) { return false; } @@ -280,59 +274,16 @@ } ret = true; break; - case Qt::Key_Period: // TODO: better handling for punctuation - case Qt::Key_Comma: { // Need to take fn, shift etc. in account - HbModifier modifier = HbModifierNone; - int currentTextCase = focusObject->editorInterface().textCase(); - if ( HbTextCaseUpper == currentTextCase || HbTextCaseAutomatic == currentTextCase ) { - modifier = HbModifierShiftPressed; - } - QString qc; - const HbMappedKey* mappedKey = mKeymap->keyForKeycode(mInputMethod->inputState().keyboard(), event->key()); - - if (mappedKey) { - if (modifier == HbModifierNone) { - qc = mappedKey->characters(HbModifierNone).left(1); - } else if (modifier == HbModifierShiftPressed) { - qc = mappedKey->characters(HbModifierShiftPressed).left(1); - } - } - - if (mEngine->inputLength() == 0) { - QList list; - QInputMethodEvent event(QString(), list); - if (mAutoAddedSpace) { - int cursorPos = mInputMethod->focusObject()->inputMethodQuery(Qt::ImCursorPosition).toInt(); - QString text = mInputMethod->focusObject()->inputMethodQuery(Qt::ImSurroundingText).toString(); - if (cursorPos > 0 && text.at(cursorPos-1).isSpace()) { - event.setCommitString(qc, -1, 1); - } else { - event.setCommitString(qc); - } - } else { - event.setCommitString(qc); - } - mAutoAddedSpace = false; - q->sendAndUpdate(event); - } else { - // Fix for input stopping after ,. keys in qwerty predictive - commitAndAppendCharacter(qc.at(0)); - QString empty; - q->processExactWord(empty); - } - ret = true; - } - break; + case HbInputButton::ButtonKeyCodeEnter: case HbInputButton::ButtonKeyCodeSpace: - case Qt::Key_0: {//Space + + { // A space means we have to commit the candidates when we are in predictive mode. QChar qc(event->key()); if (qc == Qt::Key_Enter) { qc = QChar('\n'); // Editor expects normal line feed. - } else if (qc == Qt::Key_0) { - qc = QChar(' '); - } + } commitAndAppendCharacter(qc); // if exact word popup functionality is on then we should inform exact word popup // about the space.//++TODO @@ -415,18 +366,15 @@ } //The mouse has been clicked outside of the pre-editing word and hence need to commit the word. - if ( cursorPosition < 0 || (mCandidates->size()>0 && cursorPosition >= mCandidates->at(mBestGuessLocation).length())) { - if (mEngine->inputLength() > 0 && mCandidates->count() > 0 && mBestGuessLocation < mCandidates->count()) { - commit(mCandidates->at(mBestGuessLocation),true); - } + if ( cursorPosition < 0 || cursorPosition >= mInputMethod->focusObject()->preEditString().length()) { + commit(); } else if (mCandidates->size() > 0) { if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) { - // mouse has been clicked on the pre-editing string ends with "?" + // mouse has been clicked on the pre-editing string ends with "?" //Remove the "?" mark (*mCandidates)[mBestGuessLocation].chop(1); updateEditor(); - q->processCustomWord((*mCandidates)[mBestGuessLocation]); - mCanContinuePrediction = true; + q->launchSpellQueryDialog(); } else { //The mouse has been clicked on the pre-editing word, launch candidate list @@ -437,7 +385,7 @@ void HbInputPredictionHandlerPrivate::init() { - mEngine = NULL; + mEngine = 0; HbInputLanguage language = HbInputSettingProxy::instance()->globalInputLanguage(); mEngine = HbPredictionFactory::instance()->predictionEngineForLanguage(language.language()); if (mEngine && !mCandidates) { @@ -453,24 +401,33 @@ if (mCandidates) { mCandidates->clear(); } - - mTailShowing = false; } void HbInputPredictionHandlerPrivate::commit() { if (mEngine && mEngine->inputLength() > 0 && mCandidates->count() > 0) { - if(!mCanContinuePrediction) { - //Remove the "?" mark - (*mCandidates)[mBestGuessLocation].chop(1); - } // Close exact word pop up in qwerty when the word is committed if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) { mInputMethod->closeExactWordPopup(); } - QString commitString; + QString commitString = getCommitString(); + + // need to update the freq information + mEngine->commit(commitString); + commit(commitString,false); + } +} + +QString HbInputPredictionHandlerPrivate::getCommitString() +{ + QString commitString; + if(mCandidates->count()) { + if(!mCanContinuePrediction) { + //Remove the "?" mark + (*mCandidates)[mBestGuessLocation].chop(1); + } if(mCandidates->count() <= mBestGuessLocation) { commitString = mCandidates->at(0); } else if (mShowTail == false) { @@ -478,10 +435,8 @@ } else { commitString = mCandidates->at(mBestGuessLocation); } - // need to update the freq information - mEngine->commit(commitString); - commit(commitString,false); } + return commitString; } /*! @@ -491,12 +446,8 @@ void HbInputPredictionHandlerPrivate::commit(const QString& string, bool addToUsedWordDict, bool isAsync) { Q_Q(HbInputPredictionHandler); - if(!mCanContinuePrediction) { - //Remove the "?" mark - (*mCandidates)[mBestGuessLocation].chop(1); - } - // Close exact word pop up in qwerty when the word is committed + // Close exact word pop up in qwerty when the word is committed if(HbInputUtils::isQwertyKeyboard(mInputMethod->inputState().keyboard())) { mInputMethod->closeExactWordPopup(); } @@ -505,9 +456,9 @@ if(mEngine) { if(addToUsedWordDict && !string.isEmpty()) { - QString separator = " "; - QStringList stringList = string.split(separator, QString::SkipEmptyParts); - foreach (QString str, stringList) { + QChar spaceChar(' '); + QStringList stringList = string.split(spaceChar, QString::SkipEmptyParts); + foreach (const QString str, stringList) { mEngine->addUsedWord(str); } } @@ -516,7 +467,6 @@ //Enable the flag after commit mCanContinuePrediction = true; - mTailShowing = false; } /*! @@ -545,8 +495,6 @@ //Enable the flag after commit mCanContinuePrediction = true; - mTailShowing = false; - } void HbInputPredictionHandlerPrivate::commitExactWord() @@ -601,6 +549,21 @@ } } +void HbInputPredictionHandlerPrivate::setPreEditTextToEditor(QString string, bool showAutocompletionPart) +{ + //update the editor with pre-edit text + mEngine->setWord(string); + bool used = false; + mEngine->updateCandidates(mBestGuessLocation, used); + if(showAutocompletionPart) { + mShowTail = true; + } else { + mShowTail = false; + } + updateEditor(); + +} + HbInputPredictionHandler::HbInputPredictionHandler(HbInputPredictionHandlerPrivate &dd, HbInputAbstractMethod* inputMethod) :HbInputModeHandler(dd, inputMethod) { @@ -631,25 +594,16 @@ Q_D(HbInputPredictionHandler); bool ret = true; switch (action) { - case HbInputModeActionReset: { - //At the moment we are commiting the text with the autocompletion part as it needs to be committed on clicking outside the editor. + case HbInputModeActionReset: + case HbInputModeActionCommit: + case HbInputModeActionFocusLost: { + //At the moment we are committing the text with the autocompletion part as it needs to be committed on clicking outside the editor. //TO DO : When We back to the application by pressing Application key the inline word should not commit and remain in the inline editing //d->mShowTail = false; d->commit(); d->reset(); } break; - case HbInputModeActionFocusLost: { - // if focus lost happens and before that if toolitip is available then typing line word should be committed in the editor - // if tooltip and autocompletion part is available then typing line word should be committed in the editor along with the autocompletion part - // Focus change should commit the auto-completed part as well. - d->commit(); - } - break; - case HbInputModeActionCommit: { - d->commit(); - } - break; case HbInputModeActionDeleteAndCommit: { deleteOneCharacter(); d->commit(); @@ -694,9 +648,12 @@ case HbInputModeActionHideTail: d->mShowTail = false; break; + case HbInputModeActionCloseSpellQuery: + closeSpellQueryDialog(); + break; default: ret = HbInputModeHandler::actionHandler(action); - break; + break; } return ret; @@ -813,14 +770,106 @@ Q_UNUSED(exactWord); } -void HbInputPredictionHandler::processCustomWord(QString customWord) -{ - Q_UNUSED(customWord); -} - void HbInputPredictionHandler::showExactWordPopupIfNeeded() { Q_D(HbInputPredictionHandler); d->showExactWordPopupIfNeeded(); } + +// Launch spell query dialog in responce to launchSpellQueryDialog signal +void HbInputPredictionHandler::launchSpellQueryDialog() +{ + Q_D(HbInputPredictionHandler); + HbInputFocusObject *focusedObject = d->mInputMethod->focusObject(); + if(!focusedObject) { + return; + } + + // As of now we need to delete and create mSpellQueryDialog every time + // we launch it. If we launch the same dialog, keypad does not open sometimes. + // Will take sometime to find out the root cause of this, and will fix this. + if(d->mSpellQueryDialog) { + delete d->mSpellQueryDialog; + d->mSpellQueryDialog =0; + } + if(!d->mSpellQueryDialog) { + d->mSpellQueryDialog = new HbInputSpellQuery(d->mInputMethod,this); + d->mSpellQueryDialog->setParent(this); + } + + QString string; + if(d->mCandidates && (*(d->mCandidates)).size() >= d->mBestGuessLocation + 1) { + string = (*(d->mCandidates))[d->mBestGuessLocation].left(d->mEngine->inputLength()); + } + d->reset(); + d->mSpellQueryDialog->launch(string); + +} + +// To force the spell query dialog to close. +void HbInputPredictionHandler::closeSpellQueryDialog() +{ + Q_D(HbInputPredictionHandler); + if (d->mSpellQueryDialog && d->mSpellQueryDialog->isVisible()) { + d->mSpellQueryDialog->close(); + } +} + +// +void HbInputPredictionHandler::spellQueryDialogClosed(QObject *savedFocusObject + ,HbInputSpellQuery::HbSpellCloseReason closeReason,const QString &string) +{ + if(!savedFocusObject) { + return; + } + + Q_D(HbInputPredictionHandler); + // set the focus back to the editor which caused the launch of spell dialog. + HbInputFocusObject *newFocusObject = new HbInputFocusObject(savedFocusObject); + newFocusObject->releaseFocus(); + newFocusObject->setFocus(); + HbAbstractEdit *abstractEdit = qobject_cast(savedFocusObject); + if(abstractEdit) { + abstractEdit->setCursorPosition(abstractEdit->cursorPosition()); + } + d->mInputMethod->setFocusObject(newFocusObject); + + if (closeReason == HbInputSpellQuery::HbOkPressed) { + d->commit(string,true); + } else if(closeReason == HbInputSpellQuery::HbCancelPressed) { + //update the editor with pre-edit text + d->setPreEditTextToEditor(string, d->mCanContinuePrediction); + // This update is need for below usecase + // Editor is empty => enter some data till their is no match => click on word + // to launch spell query => now press cancel => testcase of keypad is uppercase, + // but it should be lower case + d->mInputMethod->updateState(); + } else if (closeReason == HbInputSpellQuery::HbForceClose) { + // Force spell query close happens when oriantation is about to change. + // In this case nomal commit() on input method does not seems to work. + // So we are directly sending commit even to editor. + QList list; + QInputMethodEvent event(QString(), list); + event.setCommitString(string); + QApplication::sendEvent(savedFocusObject, &event); + } + // Enable the flag + d->mCanContinuePrediction = true; +} + + +void HbInputPredictionHandler::setAutocompletionStatus(bool status) +{ + Q_D(HbInputPredictionHandler); + d->mAutocompletionEnabled = status; + if(!d->mEngine) { + return; + } + if(!status) { + d->mEngine->disableFeature(HbPredFeatureWordCompletion); + } else { + d->mEngine->enableFeature(HbPredFeatureWordCompletion); + } + +} // EOF diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputpredictionhandler_p.h --- a/src/hbplugins/inputmethods/common/hbinputpredictionhandler_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/common/hbinputpredictionhandler_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,6 +28,7 @@ #include "hbinputmodehandler_p.h" class HbPredictionEngine; +class HbInputSpellQuery; QT_BEGIN_NAMESPACE class QStringList; class QInputMethodEvent; @@ -54,21 +55,23 @@ virtual void deleteOneCharacter(); void commitExactWord(); void handleEmptyCandidateList(); - void showExactWordPopupIfNeeded(); + virtual void showExactWordPopupIfNeeded(); QList probableKeypresses(); + void setPreEditTextToEditor(QString string, bool showAutocompletionPart); + virtual QString getCommitString(); public: HbPredictionEngine *mEngine; QStringList *mCandidates; int mBestGuessLocation; bool mShowTail; - bool mTailShowing; bool mAutoAddedSpace; bool mCanContinuePrediction; bool mShowTooltip; Qt::KeyboardModifiers mModifiers; - + HbInputSpellQuery *mSpellQueryDialog; + bool mAutocompletionEnabled; public: - void updateEditor(); + virtual void updateEditor(); }; #endif //HB_INPUT_PREDICTION_HANDLER_PRIVATE diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputspellquerydialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbplugins/inputmethods/common/hbinputspellquerydialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,143 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbPlugins module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "hbinputspellquerydialog.h" +#include "hbinputmodehandler.h" + +static const qint16 MAXUDBWORDSIZE = 64; + +HbInputSpellQuery::HbInputSpellQuery(HbInputMethod *inputMethod, HbInputPredictionHandler *predictionHandler) + : mOwner(inputMethod), mPredictionHandler(predictionHandler), mPrimaryAction(0) +{ + setInputMode(HbInputDialog::TextInput); + setPromptText(tr("Word:")); + setActive(true); + HbInputRegionCollector::instance()->attach(this); +} + +HbInputSpellQuery::~HbInputSpellQuery() +{ +} + +void HbInputSpellQuery::launch(QString editorText) +{ + HbInputFocusObject *focusObject = 0; + if (!mOwner || !(focusObject = mOwner->focusObject())) { + return; + } + mSavedState = mOwner->inputState(); + // close the keypad before showing the spell dialog + HbVkbHost *vkbHost = focusObject->editorInterface().vkbHost(); + if (vkbHost && vkbHost->keypadStatus() != HbVkbHost::HbVkbStatusClosed) { + vkbHost->closeKeypad(); + } + + setValue(QVariant(editorText)); + + // set the spell dialog position + QPointF newPos((qreal)HbDeviceProfile::current().logicalSize().width() * 0.5, + (qreal)HbDeviceProfile::current().logicalSize().height() * 0.5); + if (vkbHost) { + newPos.setY(((qreal)HbDeviceProfile::current().logicalSize().height() - + vkbHost->activeKeypad()->preferredKeyboardSize().height()) * 0.5); + } + setPreferredPos(newPos, HbPopup::Center); + + // change the focus to spell dialog editor + HbLineEdit *spellEdit = lineEdit(); + if (spellEdit) { + spellEdit->setMaxLength(MAXUDBWORDSIZE); + spellEdit->setSmileysEnabled(false); + HbEditorInterface eInt(spellEdit); + // we don't want prediction and automatic textcase in spell query dialog + spellEdit->setInputMethodHints(spellEdit->inputMethodHints() | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase); + eInt.setLastFocusedState(mSavedState); + spellEdit->setFocus(); + } + // execute the spell dialog + mSavedFocusObject = focusObject->object(); + mSavedEditorText = editorText; + mDidHandleFinish = false; + mainWindow()->setProperty("SpellQueryLaunched", true); + open(this,SLOT(dialogClosed(HbAction*))); + mPrimaryAction = qobject_cast(actions().first()); + + // Open keypad for the spell query + QInputContext *ic = qApp->inputContext(); + if (ic) { + QEvent *event = new QEvent(QEvent::RequestSoftwareInputPanel); + ic->filterEvent(event); + delete event; + } +} + +void HbInputSpellQuery::dialogClosed(HbAction* action) +{ + mainWindow()->setProperty("SpellQueryLaunched", false); + //There are multiple dialog closed event received. This will make sure we handle finish + //only once + if(mDidHandleFinish) { + return; + } else { + mDidHandleFinish = true; + } + + HbSpellCloseReason closeReason = HbForceClose; + QString string = mSavedEditorText; + // action is null when input query is closed externally , for example by calling + // HbDialog::close() function. + if (action) { + if(mPrimaryAction == action) { + closeReason = HbOkPressed; + string = value().toString(); + } else { + closeReason = HbCancelPressed; + } + } + //Need to disable effects as asynchronous hide will commit the word otherwise. + HbEffect::disable(this); + hide(); + HbEffect::enable(this); + + mPredictionHandler->spellQueryDialogClosed(mSavedFocusObject,closeReason,string); + mSavedFocusObject = 0; + mSavedEditorText.clear(); + mPrimaryAction = 0; +} + +// End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/common/hbinputspellquerydialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbplugins/inputmethods/common/hbinputspellquerydialog.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,62 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbPlugins module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#ifndef HB_INPUT_SPELL_QUERY_H +#define HB_INPUT_SPELL_QUERY_H + +#include +#include + +class HbAction; +class HbInputMethod; +class HbInputPredictionHandler; + +class HbInputSpellQuery : public HbInputDialog +{ + Q_OBJECT +public: + HbInputSpellQuery(HbInputMethod *mOwner,HbInputPredictionHandler *predictionHandler); + ~HbInputSpellQuery(); + void launch(QString editorText); + enum HbSpellCloseReason { + HbOkPressed, + HbCancelPressed, + HbForceClose + }; +public slots: + void dialogClosed(HbAction* action); +private: + HbInputState mSavedState; + bool mDidHandleFinish; + QString mSavedEditorText; + QPointer mOwner; + QPointer mPredictionHandler; + HbAction *mPrimaryAction; + QObject *mSavedFocusObject; +}; + +#endif // HB_INPUT_SPELL_QUERY_H + +// End of file + diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/hardwareinput/hbhardwareinputbasicqwertyhandler.cpp --- a/src/hbplugins/inputmethods/hardwareinput/hbhardwareinputbasicqwertyhandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/hardwareinput/hbhardwareinputbasicqwertyhandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -131,7 +131,7 @@ break; case Qt::Key_Backspace: case Qt::Key_Delete: { - // let's pass the backspace event to the focussed editor. + // let's pass the backspace event to the focused editor. //return q->HbInputBasicHandler::filterEvent(event); break; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/hbim/hbim.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbplugins/inputmethods/hbim/hbim.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,144 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbPlugins module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hbim.h" + +#include +#include +#include +#include + +bool HbInputInitializer::mRecursive = false; +// --------------------------------------------------------------------------- +// HbInputInitializer::HbInputInitializer +// +// Constructs HbInputInitializer +// --------------------------------------------------------------------------- +// +HbInputInitializer::HbInputInitializer(QObject *parent) + : QInputContextPlugin(parent) +{ +} + +// --------------------------------------------------------------------------- +// HbInputInitializer::~HbInputInitializer +// +// --------------------------------------------------------------------------- +// +HbInputInitializer::~HbInputInitializer() +{ +} + +// --------------------------------------------------------------------------- +// HbInputInitializer::create +// +// --------------------------------------------------------------------------- +// +QInputContext* HbInputInitializer::create(const QString& key) +{ + if (key == QString("hbim")) { + // This function is called from Qt framework's QApplication::inputContext(). + // Now if this function or any function which is called from this function + // calls QApplication::inputContext() it will result in infinite recursion. + // To guard this we are using mRecursive. + // Also setting HbMainWindowPrivate::initializeInputs to false will avoid + // re-initialization of inputfw if HbMainWindow is launched. + // If the app is HbApplication, we don't do the initialization yet, + // but let HbMainWindow do deferred construction later. + if (!mRecursive) { + mRecursive = true; + if (!qobject_cast(qApp)) { + HbMainWindowPrivate::initializeInputs = false; + HbInputMethod::initializeFramework(*qApp); + } + QInputContext *ic = qApp->inputContext(); + mRecursive = false; + return ic; + } else { + // It was a recursive call, so for clarity return 0 from here. + // This function is called only when QApplication's inputContext is null, + // so returning a null for a recursive call. + return 0; + } + } + return 0; +} + +// --------------------------------------------------------------------------- +// HbInputInitializer::description +// +// --------------------------------------------------------------------------- +// +QString HbInputInitializer::description(const QString& key) +{ + if (key == QString("hbim")) { + return QString("Hb Input Initialization"); + } else { + return QString(""); + } +} + +// --------------------------------------------------------------------------- +// HbInputInitializer::displayName +// +// --------------------------------------------------------------------------- +// +QString HbInputInitializer::displayName(const QString& key) +{ + if (key == QString("hbim")) { + return QString("Hb Input Initialization"); + } else { + return QString(""); + } +} + +// --------------------------------------------------------------------------- +// HbInputInitializer::keys +// +// --------------------------------------------------------------------------- +// +QStringList HbInputInitializer::keys() const +{ + QStringList keys; + keys.append(QString("hbim")); + return keys; +} + +// --------------------------------------------------------------------------- +// HbInputInitializer::languages +// +// --------------------------------------------------------------------------- +// +QStringList HbInputInitializer::languages(const QString& /*key*/) +{ + return QStringList(); +} + +// +// Make plugin loadable. +// +Q_EXPORT_PLUGIN2(OrbitInputInit, HbInputInitializer) + +// End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/hbim/hbim.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbplugins/inputmethods/hbim/hbim.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,50 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbPlugins module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HB_IM +#define HB_IM + +#include + +class HbInputInitializer : public QInputContextPlugin +{ + Q_OBJECT + +public: + HbInputInitializer(QObject *parent = 0); + ~HbInputInitializer(); + +public: + QInputContext *create(const QString& key); + QString description(const QString& key); + QString displayName(const QString& key); + QStringList keys() const; + QStringList languages(const QString& key); +private: + static bool mRecursive; +}; + +#endif //HB_IM + diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/hbim/hbim.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbplugins/inputmethods/hbim/hbim.pro Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,50 @@ +# +############################################################################# +## +## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# +# + +TEMPLATE = lib +TARGET = $$hbLibraryTarget(HbIm) +CONFIG += plugin + +hbAddLibrary(hbcore/HbCore) + +SOURCES += hbim.cpp +HEADERS += hbim.h + +symbian { + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + TARGET.UID3 = 0x2002EACD + + pluginstub.sources = HbIm.dll + pluginstub.path = /resource/qt/plugins/inputmethods + DEPLOYMENT += pluginstub +} + +target.path = $$[QT_INSTALL_PLUGINS]/inputmethods +INSTALLS += target + +include($${HB_SOURCE_DIR}/src/hbcommon.pri) diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/inputmethods.pro --- a/src/hbplugins/inputmethods/inputmethods.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/inputmethods.pro Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,7 @@ TEMPLATE = subdirs SUBDIRS += touchinput +SUBDIRS += hbim # SUBDIRS += hardwareinput include($${HB_SOURCE_DIR}/src/hbcommon.pri) diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,9 +36,11 @@ #include "hbinputbutton.h" #include "hbinputmodeindicator.h" -const qreal HbKeyboardHeightInUnits = 37.8; +const qreal HbKeyboardHeightInUnits = 36.9; const qreal HbKeyboardWidthInUnits = 53.8; +const int HbFirstRowIndex = 0; +const int HbSecondRowIndex = 2; const int HbVirtual12KeyNumberOfRows = 4; const int HbVirtual12KeyNumberOfColumns = 4; const int HbButtonKeyCodeTable[HbVirtual12KeyNumberOfRows * HbVirtual12KeyNumberOfColumns] = @@ -193,47 +195,58 @@ if (mMode == EModeNumeric) { QChar numChr; - const HbKeyboardMap *keyboardMap = mKeymap->keyboard(HbKeyboardVirtual12Key); - if (keyboardMap && key < keyboardMap->keys.count()) { - numChr = HbInputUtils::findFirstNumberCharacterBoundToKey(keyboardMap->keys.at(key), mKeymap->language()); + const HbKeyboardMap *labelMap = mKeymap->keyboard(HbKeyboardVirtual12KeyLabels); + const HbKeyboardMap *keyMap = mKeymap->keyboard(HbKeyboardVirtual12Key); + if (labelMap && key < labelMap->keys.count()) { + numChr = labelMap->keys.at(key)->keycode; } - if (numChr > 0) { - item->setText(numChr, HbInputButton::ButtonTextIndexPrimary); - } else { - item->setText(QString(), HbInputButton::ButtonTextIndexPrimary); + // Fallback to normal keymappings if key labels are not present + if (keyMap && key < keyMap->keys.count() && numChr.isNull()) { + numChr = numberCharacterBoundToKey(key); } + + item->setText(numChr, HbInputButton::ButtonTextIndexPrimary); item->setText(QString(), HbInputButton::ButtonTextIndexSecondaryFirstRow); item->setText(QString(), HbInputButton::ButtonTextIndexSecondarySecondRow); item->setIcon(HbIcon(), HbInputButton::ButtonIconIndexPrimary); item->setIcon(HbIcon(), HbInputButton::ButtonIconIndexSecondaryFirstRow); item->setIcon(HbIcon(), HbInputButton::ButtonIconIndexSecondarySecondRow); } else if (mMode == EModeAbc) { - QString keydata; + QString firstRow; + QString secondRow; QChar numChr; - const HbKeyboardMap *keyboardMap = mKeymap->keyboard(HbKeyboardVirtual12Key); - if (keyboardMap && key < keyboardMap->keys.count()) { - keydata = keyboardMap->keys.at(key)->characters(mModifiers); - numChr = HbInputUtils::findFirstNumberCharacterBoundToKey(keyboardMap->keys.at(key), mKeymap->language()); + const HbKeyboardMap *labelMap = mKeymap->keyboard(HbKeyboardVirtual12KeyLabels); + const HbKeyboardMap *keyMap = mKeymap->keyboard(HbKeyboardVirtual12Key); + if (labelMap && key < labelMap->keys.count()) { + firstRow = keyLabel(labelMap->keys.at(key)->chars, HbFirstRowIndex | mModifiers); + secondRow = keyLabel(labelMap->keys.at(key)->chars, HbSecondRowIndex | mModifiers); + numChr = labelMap->keys.at(key)->keycode; } - QString title(""); - if (mOwner->focusObject()) { - QString allowedData; - mOwner->focusObject()->filterStringWithEditorFilter(keydata, allowedData); - title.append(allowedData.left(numberOfCharactersToShow(key))); - } else { - title.append(keydata.left(numberOfCharactersToShow(key))); + // Fallback to normal keymappings if key labels are not present + if (keyMap && key < keyMap->keys.count()) { + if (firstRow.isEmpty()) { + firstRow = keyMap->keys.at(key)->characters(mModifiers); + if (mOwner->focusObject()) { + QString allowedData; + mOwner->focusObject()->filterStringWithEditorFilter(firstRow, allowedData); + firstRow = allowedData.left(3); + } else { + firstRow = firstRow.left(3); + } + } + if (numChr.isNull()) { + numChr = numberCharacterBoundToKey(key); + } } - if (numChr == QChar('0')) { + if (key == 9) { item->setText(numChr, HbInputButton::ButtonTextIndexPrimary); item->setIcon(HbIcon(HbInputButtonIconSpace2), HbInputButton::ButtonIconIndexSecondaryFirstRow); - // Set space as secondaty text so that the layout is correct if icon is not found. This can be removed when - // new space graphics are included in the main line. - item->setText(QString(" "), HbInputButton::ButtonTextIndexSecondaryFirstRow); } else { - item->setText(title, HbInputButton::ButtonTextIndexSecondaryFirstRow); + item->setText(firstRow, HbInputButton::ButtonTextIndexSecondaryFirstRow); + item->setText(secondRow, HbInputButton::ButtonTextIndexSecondarySecondRow); item->setText(numChr, HbInputButton::ButtonTextIndexPrimary); } } @@ -241,29 +254,39 @@ ++key; } else if (keyCode(i) == HbInputButton::ButtonKeyCodeShift) { if (mMode == EModeNumeric) { - item->setText(QString("#"), HbInputButton::ButtonTextIndexSecondaryFirstRow); + item->setIcon(HbIcon(), HbInputButton::ButtonIconIndexPrimary); + item->setText(QString("#"), HbInputButton::ButtonTextIndexPrimary); + item->setText(QString(), HbInputButton::ButtonTextIndexSecondaryFirstRow); } else if (mMode == EModeAbc) { + item->setIcon(HbIcon(HbInputButtonIconShift), HbInputButton::ButtonIconIndexPrimary); item->setText(QString(" "), HbInputButton::ButtonTextIndexSecondaryFirstRow); } + } else if (keyCode(i) == HbInputButton::ButtonKeyCodeAsterisk) { + if (mMode == EModeNumeric) { + item->setText(QString("*"), HbInputButton::ButtonTextIndexPrimary); + item->setText(QString(""), HbInputButton::ButtonTextIndexSecondaryFirstRow); + } else if (mMode == EModeAbc) { + item->setText(QString("*"), HbInputButton::ButtonTextIndexPrimary); + item->setText(QString("+"), HbInputButton::ButtonTextIndexSecondaryFirstRow); + } } } buttonGroup->setButtons(buttons); } } -int Hb12KeyTouchKeyboardPrivate::numberOfCharactersToShow(int key) +QString Hb12KeyTouchKeyboardPrivate::keyLabel(const QStringList &labels, int index) { - QChar keyCode; - const HbKeyboardMap *keyboardMap = mKeymap->keyboard(HbKeyboardVirtual12Key); - if (keyboardMap && key < keyboardMap->keys.count()) { - keyCode = keyboardMap->keys.at(key)->keycode; + if (index == HbFirstRowIndex && labels.count() >= 2) { + return labels.at(1); + } else if (index == (HbFirstRowIndex | HbModifierShiftPressed) && labels.count() >= 3) { + return labels.at(2); + } else if (index == HbSecondRowIndex && labels.count() >= 4) { + return labels.at(3); + } else if (index == (HbSecondRowIndex | HbModifierShiftPressed) && labels.count() >= 5) { + return labels.at(4); } - - if (keyCode == QChar('7') || keyCode == QChar('9')) { - return 4; - } else { - return 3; - } + return QString(); } /*! @@ -332,4 +355,19 @@ return QSizeF(result); } +/*! +Sends key event to owning input method. +*/ +void Hb12KeyTouchKeyboard::sendLongPressEvent(const QKeyEvent &event) +{ + Q_D(Hb12KeyTouchKeyboard); + if (d->mMode == EModeAbc) { + HbInputButtonGroup *buttonGroup = static_cast(contentItem()); + if (buttonGroup) { + buttonGroup->cancelButtonPress(); + } + } + HbInputVkbWidget::sendLongPressEvent(event); +} + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard.h --- a/src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard.h Thu Jul 22 16:36:53 2010 +0100 @@ -46,6 +46,9 @@ public: // From HbInputVkbWidget QSizeF preferredKeyboardSize(); +public slots: + void sendLongPressEvent(const QKeyEvent &event); + protected: Hb12KeyTouchKeyboard(Hb12KeyTouchKeyboardPrivate &dd, HbInputMethod *owner, const HbKeymap *keymap, QGraphicsItem* parent); diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard_p.h --- a/src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinput12keytouchkeyboard_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -52,7 +52,8 @@ int keyCode(int buttonId); void applyEditorConstraints(); void updateButtons(); - int numberOfCharactersToShow(int key); + + QString keyLabel(const QStringList &labels, int index); }; #endif // HB_INPUT_12KEY_TOUCH_KEYBOARD_PRIVATE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputbasic12keyhandler.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputbasic12keyhandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputbasic12keyhandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -61,23 +61,25 @@ int index = mNumChr; do { + int currCharIndex = 0; + mCurrentChar = 0; //This condition is to avoid get the characters mapped to Asterisk //Especially for Thai language we have mapped character to Asterisk if (buttonId != HbInputButton::ButtonKeyCodeAsterisk || mInputMethod->currentKeyboardType() == HbKeyboardSctPortrait) { + currCharIndex = mNumChr ; mCurrentChar = q->getNthCharacterInKey(mNumChr, buttonId, type); } if (mCurrentChar != 0) { if (focusObject->characterAllowedInEditor(mCurrentChar)) { - QString str; - str += mCurrentChar; - - //If the keypad is SCT, we can commit the character immidiately - if (mInputMethod->currentKeyboardType() == HbKeyboardSctPortrait) { - focusObject->filterAndCommitCharacter(mCurrentChar); - mCurrentChar = 0; + //If the keypad is SCT or button has only one character that is allowed to editor, + //we can commit the character immidiately + if (mInputMethod->currentKeyboardType() == HbKeyboardSctPortrait || currCharIndex == mNumChr) { + _q_timeout(); } else { + QString str; + str += mCurrentChar; QList list; QInputMethodEvent event(str, list); focusObject->sendEvent(event); @@ -106,11 +108,16 @@ if (mDownKey == HbInputButton::ButtonKeyCodeShift) { mLongPressHappened = true; mInputMethod->switchMode(HbInputButton::ButtonKeyCodeShift); - } else if (mDownKey == HbInputButton::ButtonKeyCodeSymbol || - (mDownKey == HbInputButton::ButtonKeyCodeAsterisk && - mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait)) { + } else if (mDownKey == HbInputButton::ButtonKeyCodeSymbol) { + // launch the smiley popup when long press of Sym key is received mLongPressHappened = true; mInputMethod->selectSpecialCharacterTableMode(); + } else if (mDownKey == HbInputButton::ButtonKeyCodeAsterisk && + // launch the SCT keypad when long press of Asterisk key is + // received in non-SCT mode + !mInputMethod->isSctModeActive()) { + mLongPressHappened = true; + mInputMethod->switchMode(mDownKey); } else if (mDownKey != HbInputButton::ButtonKeyCodeDelete && mInputMethod->currentKeyboardType() != HbKeyboardSctPortrait) { mLongPressHappened = true; @@ -161,8 +168,7 @@ */ bool HbInputBasic12KeyHandlerPrivate::buttonReleased(const QKeyEvent *keyEvent) { - HbInputVkbWidget::HbFlickDirection flickDir = static_cast(mInputMethod)->flickDirection(); - if (mInputMethod && flickDir!=HbInputVkbWidget::HbFlickDirectionDown) { + if (mInputMethod) { Q_Q(HbInputBasic12KeyHandler); int buttonId = keyEvent->key(); HbInputFocusObject *focusObject = mInputMethod->focusObject(); @@ -170,12 +176,12 @@ return false; } mDownKey = 0; - if (mLongPressHappened){ + if ( mLongPressHappened ){ mLongPressHappened = false; return false; } - if (mTimer->isActive() && mLastKey != buttonId) { + if(mTimer->isActive() && mLastKey != buttonId) { mNumChr = 0; // For QLineEdit it works fine. For HbLineEdit, need to set the state @@ -192,13 +198,9 @@ refreshAutoCompleter(); } - if (buttonId == HbInputButton::ButtonKeyCodeEnter) { - mInputMethod->closeKeypad(); - mLastKey = buttonId; - return true; - } else if (buttonId == HbInputButton::ButtonKeyCodeShift) { + if (buttonId == HbInputButton::ButtonKeyCodeShift) { // single tap of shift key toggles prediction status in case insensitive languages - // The Editor should not be Web or URL which allows only Latin Alphabet + // The Editor should not be Web or URL which allows only Latin Alphabet if (!HbInputSettingProxy::instance()->globalInputLanguage().isCaseSensitiveLanguage() && ((HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField)!=focusObject->editorInterface().inputConstraints()) && // when the language does not support prediction in that case we should not update the state and prediction @@ -218,7 +220,8 @@ // (the case was changed on the single tap) updateTextCase(); // when the language does not support prediction in that case we should not update the state and prediction - if(HbPredictionFactory::instance()->predictionEngineForLanguage(mInputMethod->inputState().language())) { + if(HbPredictionFactory::instance()->predictionEngineForLanguage(mInputMethod->inputState().language()) && + mInputMethod->focusObject()->editorInterface().isPredictionAllowed()) { q->togglePrediction(); } } else { @@ -254,10 +257,11 @@ if (!mTimer->isActive() && buttonId == HbInputButton::ButtonKeyCodeSymbol) { return true; } - if (buttonId == HbInputButton::ButtonKeyCodeAsterisk || buttonId == HbInputButton::ButtonKeyCodeSymbol || + // switch the keypad mode when the short key press of Asterisk key in non-SCT mode + // or SYM button or Alphabet button is received + if ((buttonId == HbInputButton::ButtonKeyCodeAsterisk && + !mInputMethod->isSctModeActive()) || buttonId == HbInputButton::ButtonKeyCodeSymbol || buttonId == HbInputButton::ButtonKeyCodeAlphabet) { - //Same asterisk key is used for launching candidate list (long key press) - //and also for SCT. So, do not launch SCT if candidate list is already launched. mInputMethod->switchMode(buttonId); return true; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputbasic12keythaihandler.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputbasic12keythaihandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "virtual12key.h" -#include -#include -#include "hbinputbasic12keythaihandler.h" -#include "hbinputbasic12keyhandler_p.h" - -class HbInputBasic12KeyThaiHandlerPrivate: public HbInputBasic12KeyHandlerPrivate -{ - Q_DECLARE_PUBLIC(HbInputBasic12KeyThaiHandler) - -public: - HbInputBasic12KeyThaiHandlerPrivate(); - ~HbInputBasic12KeyThaiHandlerPrivate(); - - void showThaiSpecialCharacters(); - bool buttonPressed(const QKeyEvent *keyEvent); - bool buttonReleased(const QKeyEvent *keyEvent); -}; - -HbInputBasic12KeyThaiHandlerPrivate::HbInputBasic12KeyThaiHandlerPrivate() -{ - -} - -HbInputBasic12KeyThaiHandlerPrivate::~HbInputBasic12KeyThaiHandlerPrivate() -{ - -} - -/*! -Handles the key press events from the VKB. -*/ -bool HbInputBasic12KeyThaiHandlerPrivate::buttonPressed(const QKeyEvent *keyEvent) -{ - if (keyEvent->isAutoRepeat() && mDownKey == keyEvent->key() && - mDownKey == HbInputButton::ButtonKeyCodeAsterisk) { - //For Thai Language Launch Special Characters popup - mInputMethod->showThaiSpecialCharacters(mDownKey); - mTimer->stop(); - mLongPressHappened = true; - mDownKey = 0; - return true; - } else { - return HbInputBasic12KeyHandlerPrivate::buttonPressed(keyEvent); - } - return false; -} - -/*! -Handles the key release events from the VKB. Launches Thai special popup with key release event of -asterisk and shift key. -*/ -bool HbInputBasic12KeyThaiHandlerPrivate::buttonReleased(const QKeyEvent *keyEvent) -{ - Q_UNUSED(keyEvent); - HbInputVkbWidget::HbFlickDirection flickDir = static_cast(mInputMethod)->flickDirection(); - if (mInputMethod && flickDir!=HbInputVkbWidget::HbFlickDirectionDown) { - int buttonId = keyEvent->key(); - HbInputFocusObject *focusObject = 0; - focusObject = mInputMethod->focusObject(); - if (!focusObject || !mDownKey) { - return false; - } - if (mLongPressHappened) { - mLongPressHappened = false; - return false; - } - //Handle if Shift and Asterisk key release happen or else let's pass it to base class to handle - if (buttonId == Qt::Key_Shift) { - //For Thai Language Launch Special Characters popup - mInputMethod->showThaiSpecialCharacters(buttonId); - mLastKey = buttonId; - mCurrentChar = 0; - mDownKey = 0; - return true; - } else if (buttonId == Qt::Key_Asterisk && !mInputMethod->isSctModeActive()) { - //For Thai Language Launch Special Characters popup - mInputMethod->showThaiSpecialCharacters(buttonId); - mLastKey = buttonId; - mCurrentChar = 0; - mDownKey = 0; - return true; - } else { - HbInputBasic12KeyHandlerPrivate::buttonReleased(keyEvent); - } - } - return false; -} - -HbInputBasic12KeyThaiHandler::HbInputBasic12KeyThaiHandler(HbInputAbstractMethod* inputMethod) -:HbInputBasic12KeyHandler(*new HbInputBasic12KeyThaiHandlerPrivate, inputMethod) -{ - Q_D(HbInputBasic12KeyThaiHandler); - d->q_ptr = this; -} - -HbInputBasic12KeyThaiHandler::~HbInputBasic12KeyThaiHandler() -{ -} - -/*! - filterEvent function for handling different keyevents. -*/ -bool HbInputBasic12KeyThaiHandler::filterEvent(const QKeyEvent * event) -{ - Q_D(HbInputBasic12KeyThaiHandler); - - if (event->type() == QEvent::KeyRelease) { - return d->buttonReleased(event); - } else { - return d->buttonPressed(event); - } -} - -//End of file - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputbasic12keythaihandler.h --- a/src/hbplugins/inputmethods/touchinput/hbinputbasic12keythaihandler.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ -#ifndef HB_INPUT_BASIC_12KEY_THAI_HANDLER -#define HB_INPUT_BASIC_12KEY_THAI_HANDLER - -#include "hbinputbasic12keyhandler.h" - -class HbInputBasic12KeyThaiHandlerPrivate; -class HbInputBasic12KeyThaiHandler: public HbInputBasic12KeyHandler -{ - Q_OBJECT -public: - HbInputBasic12KeyThaiHandler(HbInputAbstractMethod* inputMethod); - ~HbInputBasic12KeyThaiHandler(); - - bool filterEvent(const QKeyEvent * event); - -private: - Q_DECLARE_PRIVATE_D(d_ptr, HbInputBasic12KeyThaiHandler) - Q_DISABLE_COPY(HbInputBasic12KeyThaiHandler) -}; - -#endif //HB_INPUT_BASIC_12KEY_THAI_HANDLER - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputbasicqwertyhandler.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputbasicqwertyhandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputbasicqwertyhandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -210,7 +210,8 @@ return true; } - if (event->key() == HbInputButton::ButtonKeyCodeDelete || event->key() == Qt::Key_Backspace) { + if (event->key() == HbInputButton::ButtonKeyCodeDelete || event->key() == Qt::Key_Backspace || + event->key() == HbInputButton::ButtonKeyCodeCustom) { return false; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -44,171 +44,25 @@ #include "hbinputabstractbase.h" #include "hbinputprediction12keyhandler_p.h" -#define HbDeltaHeight 3.0 -#define MAXUDBWORDSIZE 64 - -HbInputSpellQuery::HbInputSpellQuery(HbInputPrediction12KeyHandlerPrivate *owner) : mOwner(owner) -{ -} - -void HbInputSpellQuery::launch(QString editorText) -{ - HbInputFocusObject *focusObject = mOwner->mInputMethod->focusObject(); - if (!focusObject) { - return; - } - mSavedState = mOwner->mInputMethod->inputState(); - mOwner->mEngine->clear(); - mOwner->mCanContinuePrediction = true; - // close the keypad before showing the spell dialog - HbVkbHost *vkbHost = focusObject->editorInterface().vkbHost(); - if (vkbHost && vkbHost->keypadStatus() != HbVkbHost::HbVkbStatusClosed) { - vkbHost->closeKeypad(); - } - setInputMode(HbInputDialog::TextInput); - setPromptText(tr("Spell:")); - setValue(QVariant(editorText)); - - //set the spell dialog position - QSizeF newSize; - QPointF newPos; - QRectF newGeometry; - getPositionAndSize(newPos, newSize, newGeometry); - newGeometry.setHeight(newSize.height()); - newGeometry.setWidth(newSize.width()); - setGeometry(newGeometry); - setPos(newPos); - - // change the focus to spell dialog editor - HbLineEdit *spellEdit = lineEdit(); - if (spellEdit) { - spellEdit->setMaxLength(MAXUDBWORDSIZE); - spellEdit->setSmileysEnabled(false); - HbEditorInterface eInt(spellEdit); - // we don't want prediction and automatic textcase in spell query dialog - spellEdit->setInputMethodHints(spellEdit->inputMethodHints() | Qt::ImhNoPredictiveText | Qt::ImhNoAutoUppercase); - eInt.setLastFocusedState(mSavedState); - spellEdit->setFocus(); - } - - // execute the spell dialog - mSavedFocusObject = focusObject->object(); - mSavedEditorText = editorText; - //setAttribute(Qt::WA_DeleteOnClose); - mDidHandleFinish = false; - open(this,SLOT(dialogClosed(HbAction*))); -} - -void HbInputSpellQuery::dialogClosed(HbAction* action) -{ - //There are multiple dialog closed event received. This will make sure we handle finish - //only once - if(mDidHandleFinish) { - return; - } else { - mDidHandleFinish = true; - } - - bool isOk = false; - bool isCancel = false; - bool isExternalClose = false; - // action is null when input query is closed externally , for example by calling - // HbDialog::close() function. - if (action) { - isOk = (action->text() == actions().at(0)->text())? true : false; - isCancel = (action->text() == actions().at(1)->text())? true:false; - } else { - isExternalClose = true; - } - - //Need to disable effects as asynchronous hide will commit the word otherwise. - HbEffect::disable(this); - hide(); - HbEffect::enable(this); - - HbInputFocusObject *newFocusObject = new HbInputFocusObject(mSavedFocusObject); - newFocusObject->releaseFocus(); - newFocusObject->setFocus(); - - HbAbstractEdit *abstractEdit = qobject_cast(mSavedFocusObject); - - if(abstractEdit) { - abstractEdit->setCursorPosition(abstractEdit->cursorPosition()); - } - - mOwner->mInputMethod->setFocusObject(newFocusObject); - mOwner->mInputMethod->focusObject()->editorInterface().setTextCase(mSavedState.textCase()); - - if (isOk) { - mOwner->commit(value().toString(), true, true); - } else if (isCancel) { - //update the editor with pre-edit text - mOwner->mEngine->setWord(mSavedEditorText); - bool used = false; - mOwner->mEngine->updateCandidates(mOwner->mBestGuessLocation, used); - mOwner->mShowTail = false; - mOwner->updateEditor(); - } else if (isExternalClose) { - mOwner->commit(mSavedEditorText, true, true); - } - - mSavedEditorText.clear(); -} - -void HbInputSpellQuery::getPositionAndSize(QPointF &pos,QSizeF &size, QRectF &geom) -{ - pos = HbInputDialog::pos(); - size = HbInputDialog::size(); - geom = HbInputDialog::geometry(); - - QRectF cursorRect = mOwner->mInputMethod->focusObject()->microFocus(); // from the top of the screen - pos = QPointF(cursorRect.bottomLeft().x(),cursorRect.bottomLeft().y()); - qreal heightOfTitlebar = 80.0; // Using magic number for now... - qreal screenHeight = (qreal)HbDeviceProfile::current().logicalSize().height(); - - if( ((screenHeight - cursorRect.bottomLeft().y()) > (cursorRect.y() - heightOfTitlebar)) - || ((screenHeight - cursorRect.bottomLeft().y() + HbDeltaHeight ) > geom.height()) ) { - // this means there is amore space below inline text than at the top or we can fit spell Dialog - // below inline text - pos.setY(cursorRect.bottomLeft().y() + HbDeltaHeight); - size.setHeight(screenHeight - pos.y()); - } else { - // this means there is amore space above inline text than below it - pos.setY(cursorRect.y() - geom.height() - HbDeltaHeight); - if (pos.y() < heightOfTitlebar) { - // this means that spell dialog can not be fit in from top of inline text, we need to trim it - pos.setY(heightOfTitlebar); - } - size.setHeight(cursorRect.y() - heightOfTitlebar - HbDeltaHeight); - } - if ( size.height() > geom.height()) { - size.setHeight(geom.height()); - } - if ((pos.x() + size.width()) > (qreal)HbDeviceProfile::current().logicalSize().width()) { - // can not fit spell dialog to the right side of inline edit text. - pos.setX((qreal)HbDeviceProfile::current().logicalSize().width()- size.width()); - } -} +static const qreal HbDeltaHeight = 3.0; +static const qint16 MAXUDBWORDSIZE = 64; HbInputPrediction12KeyHandlerPrivate::HbInputPrediction12KeyHandlerPrivate() :mLastKey(0), mButtonDown(false), mCurrentChar(0), mLongPressHappened(false), -mShiftKeyDoubleTap(false), -mInputSpellQuery(NULL) +mShiftKeyDoubleTap(false) { } HbInputPrediction12KeyHandlerPrivate::~HbInputPrediction12KeyHandlerPrivate() { - delete mInputSpellQuery; - mInputSpellQuery = 0; } void HbInputPrediction12KeyHandlerPrivate::chopQMarkAndUpdateEditor() { - if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) { + if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) { (*mCandidates)[mBestGuessLocation].chop(1); updateEditor(); mCanContinuePrediction = true; @@ -228,14 +82,15 @@ int buttonId = keyEvent->key(); if (keyEvent->isAutoRepeat() && mLastKey == buttonId) { - if (buttonId == HbInputButton::ButtonKeyCodeAsterisk) { + // mode switch should happen only when Qt::Key_Asterisk key is pressed in non-SCT + // keypad. + if (buttonId == HbInputButton::ButtonKeyCodeAsterisk && + !mInputMethod->isSctModeActive()) { + //Remove the "?" mark if present if (!mCanContinuePrediction) { - mInputMethod->switchMode(buttonId); - } else { - //Remove the "?" mark if present chopQMarkAndUpdateEditor(); - mInputMethod->selectSpecialCharacterTableMode(); - } + } + mInputMethod->switchMode(buttonId); mLongPressHappened = true; } else if (buttonId == HbInputButton::ButtonKeyCodeShift) { mInputMethod->switchMode(HbInputButton::ButtonKeyCodeShift); @@ -256,10 +111,13 @@ deleteOneCharacter(); mLongPressHappened = true; } - if (buttonId != HbInputButton::ButtonKeyCodeDelete) { - q->commitFirstMappedNumber(buttonId, mInputMethod->currentKeyboardType()); + // commit the first mapped number character when long key press + // of character key received in alphanumeric mode + if (buttonId != HbInputButton::ButtonKeyCodeDelete && + !mInputMethod->isSctModeActive()) { + q->commitFirstMappedNumber(buttonId, mInputMethod->currentKeyboardType()); mLongPressHappened = true; - } + } } if (mLongPressHappened) { @@ -268,8 +126,8 @@ } } - if (buttonId == HbInputButton::ButtonKeyCodeShift) { - // if we get a second consequtive shift key press, + if (buttonId == HbInputButton::ButtonKeyCodeShift) { + // if we get a second consecutive shift key press, // we want to handle it in buttonRelease if (mTimer->isActive() && (mLastKey == buttonId)){ mShiftKeyDoubleTap = true; @@ -298,6 +156,11 @@ mButtonDown = false; int buttonId = keyEvent->key(); + // short key press of character keys should not be handled when "?" is displayed + if (!mCanContinuePrediction && !mLongPressHappened && + buttonId >= Qt::Key_1 && buttonId <= Qt::Key_9) { + return false; + } // Sym key is handled in this class it self, so not passing it to // the base mode handlers. if (buttonId == HbInputButton::ButtonKeyCodeSymbol || @@ -308,23 +171,25 @@ return true; } /* Behavior of Short Press of Asterisk Key when in inline editing state - - Should launch Candidate List if we can continue with prediction i.e. "?" is not displayed - - Should launch Spell Query Dialog if we cannot continue with prediction - - Behavior of Short Press of Asterisk Key when not in inline editing state - - Should launch SCT - */ - else if (buttonId == HbInputButton::ButtonKeyCodeAsterisk ) { - if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) { + - Should launch Candidate List if we can continue with prediction i.e. "?" is not displayed + - Should launch Spell Query Dialog if we cannot continue with prediction + - Behavior of Short Press of Asterisk Key when not in inline editing state + - Should launch SCT + - Behaviour of Short Press of Asterisk Key in SCT keypad + - Should input the * character and should not change the keypad mode + */ + else if (buttonId == HbInputButton::ButtonKeyCodeAsterisk && + !mInputMethod->isSctModeActive()) { + if(!mCanContinuePrediction && (*mCandidates)[mBestGuessLocation].endsWith('?')) { //Remove the "?" mark (*mCandidates)[mBestGuessLocation].chop(1); updateEditor(); - q->processCustomWord((*mCandidates)[mBestGuessLocation]); - mCanContinuePrediction = true; - } - else - mInputMethod->starKeySelected(); + q->launchSpellQueryDialog(); + } else { + mInputMethod->starKeySelected(); + } return true; - } + } else if (buttonId == HbInputButton::ButtonKeyCodeEnter) { mInputMethod->closeKeypad(); return true; @@ -335,14 +200,14 @@ HbInputSettingProxy::instance()->togglePrediction(); } else { if (mShiftKeyDoubleTap) { - mTimer->stop(); - mShiftKeyDoubleTap = false; - //mShowTail = false; + mTimer->stop(); + mShiftKeyDoubleTap = false; + //mShowTail = false; if (HbInputSettingProxy::instance()->globalInputLanguage()== mInputMethod->inputState().language()) { // in latin variants , double tap of shift key toggles the prediction status // revert back to the old case as this is a double tap // (the case was changed on the single tap) - updateTextCase(); + updateTextCase(); q->togglePrediction(); } else { // if the global language is different from the input mode language, we should @@ -351,7 +216,7 @@ // to chinese input mode from latin input mode HbInputState rootState; mInputMethod->editorRootState(rootState); - mInputMethod->activateState(rootState); + mInputMethod->activateState(rootState); } } else { updateTextCase(); @@ -362,14 +227,17 @@ } return true; } - + // ButtonKeyCodeSettings should not be propagated to the engine + if(buttonId == HbInputButton::ButtonKeyCodeSettings) { + return true; + } if (buttonId != HbInputButton::ButtonKeyCodeDelete && mInputMethod->currentKeyboardType() == HbKeyboardSctPortrait) { q->sctCharacterSelected(QChar(buttonId)); return true; } - // text input happens on button release + // text input happens on button release if (q->HbInputPredictionHandler::filterEvent(keyEvent)) { return true; } @@ -418,7 +286,7 @@ if(!d->mCanContinuePrediction) { int eventKey = event->key(); switch(eventKey) { - case Qt::Key_0: + case Qt::Key_0: case HbInputButton::ButtonKeyCodeSpace: { if(d->mCandidates->size() && focusObject) { //Remove the "?" mark @@ -438,11 +306,9 @@ case Qt::Key_Backspace: case HbInputButton::ButtonKeyCodeDelete: case HbInputButton::ButtonKeyCodeEnter: - case HbInputButton::ButtonKeyCodeAsterisk: + case HbInputButton::ButtonKeyCodeAsterisk: case HbInputButton::ButtonKeyCodeControl: - break; - /* Behavior for other keys i.e. from key1 to key9 - - To start the long press timer as we need to handle long press functionality i.e Enter corresponding number mapped to a key */ + case HbInputButton::ButtonKeyCodeSymbol: case Qt::Key_1: case Qt::Key_2: case Qt::Key_3: @@ -451,15 +317,8 @@ case Qt::Key_6: case Qt::Key_7: case Qt::Key_8: - case Qt::Key_9: { - if (event->type() == QEvent::KeyRelease) { - d->mButtonDown = false; - } else { - d->mButtonDown = true; - d->mLastKey = event->key(); - } - return true; - } + case Qt::Key_9: + break; //The default behavior for any other key press is just to consume the key event and //not to do anything. default: { @@ -510,11 +369,6 @@ HbInputPredictionHandler::actionHandler(HbInputModeActionSetKeypad); d->mTimer->stop(); break; - case HbInputModeActionCloseSpellQuery: - if (d->mInputSpellQuery) { - d->mInputSpellQuery->close(); - } - break; default: ret = HbInputPredictionHandler::actionHandler(action); break; @@ -544,15 +398,4 @@ return d->mEngine != 0; } -void HbInputPrediction12KeyHandler::processCustomWord(QString customWord) -{ - Q_D(HbInputPrediction12KeyHandler); - if (customWord.size()) { - if(!d->mInputSpellQuery) { - d->mInputSpellQuery = new HbInputSpellQuery(d); - } - d->mInputSpellQuery->launch(customWord); - } - return; -} //EOF diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler.h --- a/src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,8 +38,7 @@ bool actionHandler(HbInputModeAction action); bool filterEvent(const QKeyEvent * event); bool isActive() const; - void processCustomWord(QString customWord); - void mouseHandler(int cursorPosition, QMouseEvent* mouseEvent); + void mouseHandler(int cursorPosition, QMouseEvent* mouseEvent); protected: HbInputPrediction12KeyHandler(HbInputPrediction12KeyHandlerPrivate &dd, HbInputAbstractMethod* inputMethod); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler_p.h --- a/src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputprediction12keyhandler_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,7 +32,6 @@ #include "hbinputprediction12keyhandler.h" class HbAction; -class HbInputSpellQuery; class HbInputPrediction12KeyHandlerPrivate: public HbInputPredictionHandlerPrivate { @@ -52,23 +51,6 @@ QChar mCurrentChar; bool mLongPressHappened; bool mShiftKeyDoubleTap; - HbInputSpellQuery *mInputSpellQuery; }; -class HbInputSpellQuery : public HbInputDialog -{ -Q_OBJECT -public: - HbInputSpellQuery(HbInputPrediction12KeyHandlerPrivate *owner); - void getPositionAndSize(QPointF & pos,QSizeF & size, QRectF &geom); - void launch(QString editorText); -public slots: - void dialogClosed(HbAction* action); -private: - HbInputState mSavedState; - bool mDidHandleFinish; - QPointer mSavedFocusObject; - HbInputPrediction12KeyHandlerPrivate* mOwner; - QString mSavedEditorText; -}; #endif //HB_INPUT_PREDICTION_12KEY_HANDLER_PRIVATE diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputprediction12keythaihandler.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputprediction12keythaihandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ -#include - -#include -#include -#include -#include - -#include "virtual12key.h" - -#include "hbinputprediction12keyhandler_p.h" -#include "hbinputprediction12keythaihandler.h" - -class HbInputPrediction12KeyThaiHandlerPrivate: public HbInputPrediction12KeyHandlerPrivate -{ - Q_DECLARE_PUBLIC(HbInputPrediction12KeyThaiHandler) - -public: - HbInputPrediction12KeyThaiHandlerPrivate(); - ~HbInputPrediction12KeyThaiHandlerPrivate(); - - bool buttonReleased(const QKeyEvent *keyEvent); - bool buttonPressed(const QKeyEvent *keyEvent); -}; - -HbInputPrediction12KeyThaiHandlerPrivate::HbInputPrediction12KeyThaiHandlerPrivate() -{ -} - -HbInputPrediction12KeyThaiHandlerPrivate::~HbInputPrediction12KeyThaiHandlerPrivate() -{ - -} - -bool HbInputPrediction12KeyThaiHandlerPrivate::buttonPressed(const QKeyEvent *keyEvent) -{ - Q_Q(HbInputPrediction12KeyThaiHandler); - - mLongPressHappened = false; - HbInputFocusObject *focusObject = 0; - focusObject = mInputMethod->focusObject(); - if (!focusObject) { - return false; - } - - int buttonId = keyEvent->key(); - - if (keyEvent->isAutoRepeat() && mLastKey == buttonId) { - if (buttonId == Qt::Key_0) { - q->actionHandler(HbInputModeHandler::HbInputModeActionCommit); - q->commitFirstMappedNumber(buttonId, mInputMethod->currentKeyboardType()); - mLongPressHappened = true; - } else if (buttonId != HbInputButton::ButtonKeyCodeAsterisk) { - return HbInputPrediction12KeyHandlerPrivate::buttonPressed(keyEvent); - } - if (mLongPressHappened) { - mLastKey = 0; - return true; - } - } - - //Pass the event to base class except Shift key - if (buttonId == Qt::Key_Shift) { - mLastKey = buttonId; - mButtonDown = true; - } else { - return HbInputPrediction12KeyHandlerPrivate::buttonPressed(keyEvent); - } - return false; -} - -/*! -Handles the key release events from the VKB. Launches the SCT with key release event of -asterisk. -*/ -bool HbInputPrediction12KeyThaiHandlerPrivate::buttonReleased(const QKeyEvent *keyEvent) -{ - Q_Q(HbInputPrediction12KeyHandler); - - if(!mButtonDown || mLongPressHappened){ - mLongPressHappened = false; - return false; - } - - int buttonId = keyEvent->key(); - - if (buttonId == HbInputButton::ButtonKeyCodeAsterisk && !mInputMethod->isSctModeActive()) { - //Handle if key Asterisk pressed and SCT is not launched or else pass it to base handlers - if (q->HbInputPredictionHandler::filterEvent(keyEvent)) { - mButtonDown = false; - return true; - } - } else if ( buttonId == HbInputButton::ButtonKeyCodeShift ) { - //As we can't map charatcers to Shift key in keymapping, making use of "#" key i.e. Qt::Key_NumberSign - //in keymapping and manipulating event to Qt::Key_NumberSign when shift key is pressed - const QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, Qt::Key_NumberSign, Qt::NoModifier); - if (q->HbInputPredictionHandler::filterEvent(event)) { - mButtonDown = false; - return true; - } - } else { - HbInputPrediction12KeyHandlerPrivate::buttonReleased(keyEvent); - } - return false; -} - - -HbInputPrediction12KeyThaiHandler::HbInputPrediction12KeyThaiHandler(HbInputAbstractMethod *inputMethod) - :HbInputPrediction12KeyHandler(* new HbInputPrediction12KeyThaiHandlerPrivate, inputMethod) -{ - Q_D(HbInputPrediction12KeyThaiHandler); - d->q_ptr = this; -} - -HbInputPrediction12KeyThaiHandler::~HbInputPrediction12KeyThaiHandler() -{ -} -/*! - filterEvent to handler keypress/release events. -*/ - -bool HbInputPrediction12KeyThaiHandler::filterEvent(const QKeyEvent * event) -{ - Q_D(HbInputPrediction12KeyThaiHandler); - HbInputFocusObject *focusObject = 0; - focusObject = d->mInputMethod->focusObject(); - - //If there was a handling for empty candidate-list, i.e. the engine did not predict - //any meaningful word for the input sequence. - - if(!d->mCanContinuePrediction) { - int eventKey = event->key(); - //let's us return If engine did not predict any meaningful word for the input sequence - //for Shift,Asterisk and Control - if(eventKey == Qt::Key_Control || eventKey == Qt::Key_0) { - if(d->mCandidates->size() && focusObject ) { - //Remove the "?" mark - (*d->mCandidates)[d->mBestGuessLocation].chop(1); - d->updateEditor(); - d->mCanContinuePrediction = true; - } - } else if (eventKey != Qt::Key_Shift && eventKey != Qt::Key_Asterisk){ - // For Shift key and Asterisk key Will handle it in button release Since we have character mapped to Shift and Asterisk - // or else pass it to Prediction12KeyHandler handler - HbInputPrediction12KeyHandler::filterEvent(event); - } - } - - // If the word is in inline edit First tap of Qt::Key_0 should commit the word in the editor - // For successive tap prediction mode can't handle Qt::Key_0, so we will emit a passFilterEvent - // this signal must be connected to by the plugin to a modehandler. - // which can handle it. - - if (event->key() == Qt::Key_0 && d->mEngine->inputLength() >= 1 ) { - if(event->type() == QEvent::KeyPress) { - d->mButtonDown = true; - } else if(event->type() == QEvent::KeyRelease) { - d->mTimer->stop(); - d->mButtonDown = false; - actionHandler(HbInputModeHandler::HbInputModeActionCommit); - } - d->mLastKey = Qt::Key_0; - return true; - } else if (event->key() == Qt::Key_0) { - emit passFilterEvent(event); - d->mLastKey = Qt::Key_0; - return true; - } else { - if (d->mLastKey == Qt::Key_0) { - emit passActionHandler(HbInputModeActionCommit); - } - if (event->type() == QEvent::KeyRelease) { - return d->buttonReleased(event); - } else { - return d->buttonPressed(event); - } - } -} - - -//EOF - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputprediction12keythaihandler.h --- a/src/hbplugins/inputmethods/touchinput/hbinputprediction12keythaihandler.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ -#ifndef HB_INPUT_PREDICTION_12KEY_THAI_HANDLER -#define HB_INPUT_PREDICTION_12KEY_THAI_HANDLER - -#include "hbinputprediction12keyhandler.h" - -class HbInputPrediction12KeyThaiHandlerPrivate; -class HbInputPrediction12KeyThaiHandler: public HbInputPrediction12KeyHandler -{ - Q_OBJECT -public: - HbInputPrediction12KeyThaiHandler(HbInputAbstractMethod *inputMethod); - ~HbInputPrediction12KeyThaiHandler(); - - bool filterEvent(const QKeyEvent * event); - -private: - Q_DECLARE_PRIVATE_D(d_ptr, HbInputPrediction12KeyThaiHandler) - Q_DISABLE_COPY(HbInputPrediction12KeyThaiHandler) -}; - - -#endif //HB_INPUT_PREDICTION_12KEY_THAI_HANDLER - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputpredictionqwertyhandler.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputpredictionqwertyhandler.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputpredictionqwertyhandler.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -1,3 +1,4 @@ + /**************************************************************************** ** ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). @@ -27,7 +28,8 @@ #include #include #include - +#include +#include #include "hbinputpredictionqwertyhandler.h" #include "hbinputpredictionhandler_p.h" #include "hbinputabstractbase.h" @@ -44,19 +46,26 @@ bool buttonPressed(const QKeyEvent *event); bool buttonReleased(const QKeyEvent *event); void init(); + void updateEditor(); + void commitSecondaryWord(); + QString getCommitString(); + void showExactWordPopupIfNeeded(); public: int mButton; HbFnState mFnState; - bool mExactPopupLaunched; - bool mLongPressHappened; + bool mExactPopupLaunched; + bool mShowExactWordInTooltip; + int mPrimaryCandidateIndex; + int mSecondaryCandidateIndex; + int mTypingCorrectionLevel; + HbTypingCorrectionLevel mCorrectionLevel; }; HbInputPredictionQwertyHandlerPrivate::HbInputPredictionQwertyHandlerPrivate() :mButton(0), mFnState(HbFnOff), - mExactPopupLaunched(false), - mLongPressHappened(false) + mExactPopupLaunched(false) { } @@ -78,10 +87,6 @@ return false; } - if (mLongPressHappened) { - mLongPressHappened = false; - return false; - } int key = event->key(); @@ -97,39 +102,43 @@ } break; case HbInputButton::ButtonKeyCodeShift: { - HbTextCase currentTextCase = (HbTextCase)focusObject->editorInterface().textCase(); - HbInputLanguage language = mInputMethod->inputState().language(); + HbTextCase currentTextCase = (HbTextCase)focusObject->editorInterface().textCase(); + HbInputLanguage language = mInputMethod->inputState().language(); - // Update the Case Information in HbInputState, it internally updates in HbEditorInterface as well - switch(currentTextCase) { - case HbTextCaseLower: - // For Case-insensitive languages, Shift Key is used to switch between character sets (i.e lower case characters and shifted characters) - if(!language.isCaseSensitiveLanguage()){ - currentTextCase = HbTextCaseUpper; - } - else { - currentTextCase = HbTextCaseAutomatic; - } - break; - case HbTextCaseUpper: - currentTextCase = HbTextCaseLower; - break; + // Update the Case Information in HbInputState, it internally updates in HbEditorInterface as well + switch(currentTextCase) { + case HbTextCaseLower: + // For Case-insensitive languages, Shift Key is used to switch between character sets (i.e lower case characters and shifted characters) + if(!language.isCaseSensitiveLanguage()){ + currentTextCase = HbTextCaseUpper; + } + else { + currentTextCase = HbTextCaseAutomatic; + } + break; + case HbTextCaseUpper: + currentTextCase = HbTextCaseLower; + break; case HbTextCaseAutomatic: - currentTextCase = HbTextCaseUpper; + currentTextCase = HbTextCaseUpper; break; default: break; } - HbInputState state = mInputMethod->inputState(); - state.setTextCase(currentTextCase); - mInputMethod->activateState(state); + HbInputState state = mInputMethod->inputState(); + state.setTextCase(currentTextCase); + mInputMethod->activateState(state); } break; case HbInputButton::ButtonKeyCodeSymbol: { // Ctrl/Chr case HbInputButton::ButtonKeyCodeAlphabet: - mInputMethod->switchSpecialCharacterTable(); - } + mInputMethod->switchSpecialCharacterTable(); + q->HbInputPredictionHandler::actionHandler(HbInputModeHandler::HbInputModeActionSetKeypad); + } break; + case HbInputButton::ButtonKeyCodeSettings: + mInputMethod->closeExactWordPopup(); + break; default: { HbTextCase currentTextCase = focusObject->editorInterface().textCase(); Qt::KeyboardModifiers modifiers = Qt::NoModifier; @@ -144,12 +153,6 @@ modifiers |= Qt::ShiftModifier; } - if (key != HbInputButton::ButtonKeyCodeDelete && - key != HbInputButton::ButtonKeyCodeEnter && - mInputMethod->currentKeyboardType() == HbKeyboardSctLandscape) { - q->sctCharacterSelected(QChar(key)); - return true; - } // let's pass it to the base class. ret = q->HbInputPredictionHandler::filterEvent(event); @@ -166,9 +169,6 @@ if (event->isAutoRepeat() && mButton == event->key()) { if (mButton == HbInputButton::ButtonKeyCodeSymbol) { mInputMethod->selectSpecialCharacterTableMode(); - mLongPressHappened = true; - } - if (mLongPressHappened) { mButton = 0; return true; } @@ -200,7 +200,6 @@ bool ret = true; switch (action) { case HbInputModeActionCancelButtonPress: - case HbInputModeActionReset: break; case HbInputModeActionFocusRecieved: HbInputPredictionHandler::actionHandler(HbInputModeActionSetCandidateList); @@ -220,10 +219,8 @@ // close exactword popup. d->mInputMethod->closeExactWordPopup(); break; - case HbInputModeActionCommit: { - d->commit(); - } - default: ret = HbInputPredictionHandler::actionHandler(action); + default: + ret = HbInputPredictionHandler::actionHandler(action); } return ret; } @@ -251,7 +248,6 @@ HbInputModeHandler::commitAndUpdate(string, replaceFrom, replaceLength); d->mInputMethod->closeExactWordPopup(); d->mExactPopupLaunched = false; - d->mTailShowing = false; } /*! @@ -286,6 +282,12 @@ commitExactWord(); } +void HbInputPredictionQwertyHandler::exactWordSelected() +{ + Q_D(HbInputPredictionQwertyHandler); + d->commitSecondaryWord(); +} + void HbInputPredictionQwertyHandler::sctCharacterSelected(QString character) { HbInputPredictionHandler::sctCharacterSelected(character); @@ -307,6 +309,9 @@ void HbInputPredictionQwertyHandlerPrivate::deleteOneCharacter() { + if (!mEngine && !mInputMethod->focusObject()) { + return; + } mShowTail = true; mShowTooltip = true; // A backspace in predictive means updating the engine for the delete key press @@ -321,36 +326,30 @@ //we actually reduce ambiguity in the engine and hence we should have //some word getting predicted as a result to that. mCanContinuePrediction = true; - - if(false == mTailShowing && true == mExactPopupLaunched) { - mEngine->deleteKeyPress(); - mEngine->updateCandidates(mBestGuessLocation); - } - if (true == mExactPopupLaunched) { - mBestGuessLocation = 0 ; - } - //When there is a deletion of key press, no need to update the candidate list - //This is because deletion should not cause reprediction. - if(mCandidates->count() && (mCandidates->count()>mBestGuessLocation) && false == mTailShowing && false == mExactPopupLaunched) { - QString currentWord = mCandidates->at(mBestGuessLocation); - if(currentWord.length() > mEngine->inputLength()) { - //chop off the autocompletion part - currentWord = currentWord.left(mEngine->inputLength()); - } - if(currentWord.length()) { + + int tailLength = mInputMethod->focusObject()->preEditString().length() - mEngine->inputLength(); + if(tailLength <= 0 && true == mExactPopupLaunched) { + mEngine->deleteKeyPress(); + mEngine->updateCandidates(mBestGuessLocation); + } + + mBestGuessLocation = 0; + if(mCandidates->count() && (mCandidates->count()>mBestGuessLocation) && tailLength <= 0 && false == mExactPopupLaunched) { + QString currentWord = mCandidates->at(mBestGuessLocation); + if(currentWord.length()) { currentWord.chop(1); - mEngine->deleteKeyPress(); - //We are not supposed to re-construct the candidate list as deletion - //does not cause reprediction. Also, candidate list construction is the - //heaviest operation out of all engine operations. - (*mCandidates)[mBestGuessLocation] = currentWord; - } else { - commit(QString(""),false); - } - - } else if(!mCandidates->count() && mEngine->inputLength() >= 1) { + mEngine->deleteKeyPress(); + //We are not supposed to re-construct the candidate list as deletion + //does not cause reprediction. Also, candidate list construction is the + //heaviest operation out of all engine operations. + (*mCandidates)[mBestGuessLocation] = currentWord; + } else { + commit(QString(""),false); + } + + } else if(!mCandidates->count() && mEngine->inputLength() >= 1) { //If Input length greater or equal to one then Append the current word to candidate - mCandidates->append(mEngine->currentWord()); + mCandidates->append(mEngine->currentWord()); } // update the editor with the new preedit text. updateEditor(); @@ -368,4 +367,155 @@ } } +void HbInputPredictionQwertyHandler::setPrimaryCandidateMode(HbPrimaryCandidateMode mode) +{ + Q_D(HbInputPredictionQwertyHandler); + if(mode == HbPrimaryCandidateModeExactTyping) { + d->mShowExactWordInTooltip = false; + } else { + d->mShowExactWordInTooltip = true; + } + // we need to close the exact word popup when this happens. + d->mInputMethod->closeExactWordPopup(); + d->mExactPopupLaunched = false; +} + +void HbInputPredictionQwertyHandlerPrivate::updateEditor() +{ + Q_Q(HbInputPredictionQwertyHandler); + if (!mEngine) { + return; + } + HbInputFocusObject *focusedObject = 0; + QList list; + focusedObject = mInputMethod->focusObject(); + QTextCharFormat underlined; + underlined.setFontUnderline(true); + + Q_ASSERT(focusedObject); + if (mEngine->inputLength() == 0) { + QInputMethodEvent event(QString(), list); + q->sendAndUpdate(event); + } else { + if (mCandidates->count() > 0) { + // index of the candidate that is shown on the typing line + mPrimaryCandidateIndex = mBestGuessLocation; + // index of the candidate that is shown in the tooltip (if any) + mSecondaryCandidateIndex = 0; + QString bestGuessWord = mCandidates->at(mBestGuessLocation); + QString exactTypedWord = mCandidates->at(0); + bool hasAutocompletionPart = (bestGuessWord.length() > exactTypedWord.length()) && (bestGuessWord.left(exactTypedWord.length()) == exactTypedWord); + // when we are showing the autocompletion part we generally do not show the tooltip, + // both primary and secondary candidates are the same. + if(hasAutocompletionPart && mAutocompletionEnabled && mShowTail) { + mPrimaryCandidateIndex = mSecondaryCandidateIndex = mBestGuessLocation; + } + // in case of exact tying, exact typed word in the primary candidate + // and the best predicted word is the secondary candidate + if(!mShowExactWordInTooltip && !(hasAutocompletionPart && mAutocompletionEnabled)) { + mPrimaryCandidateIndex = 0; + mSecondaryCandidateIndex = mBestGuessLocation; + } + if (hasAutocompletionPart && mShowTail && mAutocompletionEnabled) { + // showing the word with auto completion + int taillength = bestGuessWord.length() - exactTypedWord.length(); + // TODO: Color from skin should be used + QColor col = HbColorScheme::color("qtc_input_hint_normal"); + QBrush brush(col); + // underline formatting is applied to only the input length part of the word + QInputMethodEvent::Attribute textstyle(QInputMethodEvent::TextFormat, 0, mEngine->inputLength(), underlined); + list.append(textstyle); + + QTextCharFormat gray; + gray.setForeground(brush); + if((focusedObject->object())->inherits("QGraphicsWebView") || (focusedObject->object())->inherits("QWebView")) { + //QGraphicsWebView does not handle partial input length formatting well. Causes crash, a temporary fix provided, + //This makes the whole text field grey insted of just the auto-completion part. Anyways, it does not cause crash. + //This should be treated as a work around till QGraphicsWebView is fixed. + list.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, 0, QInputMethodEvent::TextFormat, gray)); + } else { + list.append(QInputMethodEvent::Attribute(QInputMethodEvent::TextFormat, mEngine->inputLength(), taillength, gray)); + } + list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mEngine->inputLength(), 0, 0)); + // the best guess word is sent to the editor + QInputMethodEvent event(bestGuessWord, list); + focusedObject->sendEvent(event); + } else { + QInputMethodEvent::Attribute textstyle(QInputMethodEvent::TextFormat, 0, mCandidates->at(mPrimaryCandidateIndex).length(), underlined); + list.append(textstyle); + list.append(QInputMethodEvent::Attribute(QInputMethodEvent::Cursor, mCandidates->at(mPrimaryCandidateIndex).length(), 0, 0)); + QInputMethodEvent event(mCandidates->at(mPrimaryCandidateIndex), list); + focusedObject->sendEvent(event); + } + + if (mShowTooltip && mPrimaryCandidateIndex != mSecondaryCandidateIndex) { + q->processExactWord(mCandidates->at(mSecondaryCandidateIndex)); + } else { + QString empty; + q->processExactWord(empty); + } + } else { + QInputMethodEvent event(QString(""), list); + focusedObject->sendEvent(event); + } + } +} + +void HbInputPredictionQwertyHandlerPrivate::commitSecondaryWord() +{ + if(mCandidates->count()>mSecondaryCandidateIndex) { + QString commitString = mCandidates->at(mSecondaryCandidateIndex); + commit(commitString, true, false); + } +} + +void HbInputPredictionQwertyHandlerPrivate::showExactWordPopupIfNeeded() +{ + Q_Q(HbInputPredictionHandler); + if (mShowTooltip && mCandidates->count() > mPrimaryCandidateIndex && mCandidates->at(0).mid(0, mEngine->inputLength()) \ + != mCandidates->at(mPrimaryCandidateIndex).mid(0, mEngine->inputLength())) { + q->processExactWord(mCandidates->at(mSecondaryCandidateIndex)); + } else { + QString empty; + q->processExactWord(empty); + } +} + +QString HbInputPredictionQwertyHandlerPrivate::getCommitString() +{ + QString commitString; + if(mCandidates->count() <= mPrimaryCandidateIndex) { + commitString = mCandidates->at(0); + } else { + commitString = mCandidates->at(mPrimaryCandidateIndex); + } + return commitString; +} + +void HbInputPredictionQwertyHandler::setTypingCorrectionLevel(HbTypingCorrectionLevel correctionLevel) +{ + Q_D(HbInputPredictionQwertyHandler); + HbPredictionEngine::HbErrorCorrectionLevel errorCorrectionLevel = HbPredictionEngine::HbErrorCorrectionLevelMedium; + if(d->mCorrectionLevel == correctionLevel) { + return; + } + d->mCorrectionLevel = correctionLevel; + switch(correctionLevel) { + case HbTypingCorrectionLevelLow: + errorCorrectionLevel = HbPredictionEngine::HbErrorCorrectionLevelLow; + break; + case HbTypingCorrectionLevelMedium: + errorCorrectionLevel = HbPredictionEngine::HbErrorCorrectionLevelMedium; + break; + case HbTypingCorrectionLevelHigh: + errorCorrectionLevel = HbPredictionEngine::HbErrorCorrectionLevelHigh; + break; + default: + break; + } + if(d->mEngine) { + d->mEngine->setErrorCorrectionLevel(errorCorrectionLevel); + } +} + //EOF diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputpredictionqwertyhandler.h --- a/src/hbplugins/inputmethods/touchinput/hbinputpredictionqwertyhandler.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputpredictionqwertyhandler.h Thu Jul 22 16:36:53 2010 +0100 @@ -43,8 +43,11 @@ void commitAndUpdate(const QString& string, int replaceFrom = 0, int replaceLength = 0); void deleteOneCharacter(); void smileySelected(QString smiley); + void setPrimaryCandidateMode(HbPrimaryCandidateMode mode); + void setTypingCorrectionLevel(HbTypingCorrectionLevel correctionLevel); public slots: void exactWordPopupClosed(); + void exactWordSelected(); private: Q_DECLARE_PRIVATE_D(d_ptr, HbInputPredictionQwertyHandler) Q_DISABLE_COPY(HbInputPredictionQwertyHandler) diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputqwerty10x4touchkeyboard.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputqwerty10x4touchkeyboard.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputqwerty10x4touchkeyboard.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ #include "hbinputbutton.h" #include "hbinputmodeindicator.h" -const qreal HbKeyboardHeightInUnits = 34.6; +const qreal HbKeyboardHeightInUnits = 33.7; const qreal HbKeyboardWidthInUnits = 95.5; const int HbVirtualQwertyNumberOfRows = 4; @@ -148,18 +148,26 @@ if (buttonGroup) { QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { - if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { - HbInputButton *item = buttons.at(i); - - HbInputButton::HbInputButtonState state = item->state(); + HbInputButton *item = buttons.at(i); + HbInputButton::HbInputButtonState state = item->state(); + if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { QString data = item->text(HbInputButton::ButtonTextIndexPrimary); if (data.isEmpty() || !focusedObject->characterAllowedInEditor(data.at(0))) { state = HbInputButton::ButtonStateDisabled; } else if (item->state() == HbInputButton::ButtonStateDisabled) { state = HbInputButton::ButtonStateReleased; } - item->setState(state); } + else if (keyCode(i) == HbInputButton::ButtonKeyCodeSpace) { + bool allowed = focusedObject->characterAllowedInEditor(QChar(' ')); + if (!allowed) { + state = HbInputButton::ButtonStateDisabled; + } + else if (item->state() == HbInputButton::ButtonStateDisabled) { + state = HbInputButton::ButtonStateReleased; + } + } + item->setState(state); } buttonGroup->setButtons(buttons); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputqwerty11x4touchkeyboard.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputqwerty11x4touchkeyboard.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputqwerty11x4touchkeyboard.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ #include "hbinputbutton.h" #include "hbinputmodeindicator.h" -const qreal HbKeyboardHeightInUnits = 34.6; +const qreal HbKeyboardHeightInUnits = 33.7; const qreal HbKeyboardWidthInUnits = 95.5; const int HbVirtualQwertyNumberOfRows = 4; @@ -139,21 +139,6 @@ return HbButtonKeyCodeTable[buttonId]; } -void HbQwerty11x4KeyboardPrivate::setRockerPosition() -{ - Q_Q(HbQwerty11x4Keyboard); - - HbInputVkbWidgetPrivate::setRockerPosition(); - - HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); - if (buttonGroup) { - QPointF position = mRocker->pos(); - position.setX(position.x() + 0.5 * buttonGroup->size().width() / HbVirtualQwertyNumberOfColumns); - - mRocker->setPos(position); - } -} - /*! Constructs the object. owner is the owning input method implementation. Keymap is key mapping data to be used to display button texts. Key mapping data can be diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputqwerty11x4touchkeyboard_p.h --- a/src/hbplugins/inputmethods/touchinput/hbinputqwerty11x4touchkeyboard_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputqwerty11x4touchkeyboard_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -51,7 +51,6 @@ void init(); int keyCode(int buttonId); - void setRockerPosition(); }; #endif // HB_INPUT_QWERTY_11x4_TOUCH_KEYBOARD_PRIVATE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputqwertynumerictouchkeyboard.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputqwertynumerictouchkeyboard.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/hbinputqwertynumerictouchkeyboard.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ #include "hbinputbutton.h" #include "hbinputmodeindicator.h" -const qreal HbKeyboardHeightInUnits = 17.3; +const qreal HbKeyboardHeightInUnits = 16.4; const qreal HbKeyboardWidthInUnits = 95.5; const int HbVirtualQwertyNumberOfRows = 2; @@ -152,15 +152,20 @@ HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { int key = 0; + int charKeyCount = 0; + QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { HbInputButton *item = buttons.at(i); - - if (key < characters.count()) { + // digits always comes in the first row + if (charKeyCount < 10) { + item->setKeyCode(numberCharacterBoundToKey((charKeyCount + 1) % 10).unicode()); + charKeyCount++; + } else if (key < characters.count()) { item->setKeyCode(characters.at(key).unicode()); + ++key; } - ++key; } } } @@ -176,17 +181,24 @@ HbInputButtonGroup *buttonGroup = static_cast(q->contentItem()); if (buttonGroup) { int key = 0; + int charKeyCount = 0; + QList buttons = buttonGroup->buttons(); for (int i = 0; i < buttons.count(); ++i) { if (keyCode(i) == HbInputButton::ButtonKeyCodeCharacter) { HbInputButton *item = buttons.at(i); - - if (key < characters.count()) { - item->setText(characters.at(key), HbInputButton::ButtonTextIndexPrimary); + if (charKeyCount < 10) { + item->setText(numberCharacterBoundToKey((charKeyCount + 1) % 10), + HbInputButton::ButtonTextIndexPrimary); + charKeyCount++; } else { - item->setText(QString(), HbInputButton::ButtonTextIndexPrimary); - } - ++key; + if (key < characters.count()) { + item->setText(characters.at(key), HbInputButton::ButtonTextIndexPrimary); + } else { + item->setText(QString(), HbInputButton::ButtonTextIndexPrimary); + } + ++key; + } } } buttonGroup->setButtons(buttons); @@ -195,32 +207,36 @@ void HbQwertyNumericKeyboardPrivate::getCharacters(QString &characters) { - characters = QString("1234567890"); - if (mKeymap) { const HbKeyboardMap* keyboardMap = mKeymap->keyboard(HbKeyboardSctLandscape); if (!keyboardMap) { return; } - + QString chars; + foreach (const HbMappedKey* mappedKey, keyboardMap->keys) { - QString chars = mappedKey->characters(HbModifierNone); - + chars.append(mappedKey->characters(HbModifierNone)); + } HbInputFocusObject *focusedObject = mOwner->focusObject(); QString allowedChars; if (focusedObject) { focusedObject->filterStringWithEditorFilter(chars, allowedChars); } - + // Remove digits from it ( digits always come in the first row ) + for (int i=0; i < 10; i++) { + allowedChars.remove(numberCharacterBoundToKey(i)); + } + foreach (QChar sctChar, allowedChars) { if (!characters.contains(sctChar)) { characters.append(sctChar); } } - } + } } + /*! Constructs the object. owner is the owning input method implementation. Keymap is key mapping data to be used to display button texts. Key mapping data can be diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputthaispecialpopup.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputthaispecialpopup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,534 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include "hbinputtouchkeypadbutton.h" -#include "hbinputthaispecialpopup.h" - -const QString HbAbcButtonObjName = "Popup abc"; - -const int HbPopupAsteriskColumns = 5; -const int HbPopupAsteriskRows = 4; -const int HbPopupShiftColumns = 4; -const int HbPopupShiftRows = 3; - - -const int HBPopupEmptyButtonSeven = 7; -const int HBPopupEmptyButtonEight = 8; -const int HBPopupEmptyButtonNine = 9; - -const QString HbPopupPortraitButtonTextLayout = "_hb_sctp_button_text_layout"; -const QString HbPopupPortraitButtonIconLayout = "_hb_sctp_button_icon_layout"; - -/*! -@proto -@hbtouchinput -\class HbInputThaiSpecialPopup -\brief Implementation of Thai Special Popup. - -Implementation of Thai Special Popup. - -*/ - -/// @cond - -class HbInputThaiSpecialPopupPrivate: public HbDialogPrivate -{ - Q_DECLARE_PUBLIC(HbInputThaiSpecialPopup) - -public: - //Character classes - enum ThaiGlyphTypes { - HbThaiCharNon = 0, //Not a Thai letter - HbThaiCharCons, //Thai consonant - HbThaiCharLV, //Leading vowel - HbThaiCharFV1, //Following vowel, type 1 - HbThaiCharFV2, //Following vowel, type 2 - HbThaiCharFV3, //Following vowel, type 3 - HbThaiCharBV1, //Below vowel, type 1 - HbThaiCharBV2, //Below vowel, type 2 - HbThaiCharBD, //Below diacritic - HbThaiCharTone, //Tone mark - HbThaiCharAD1, //Above diacritic, type 1 - HbThaiCharAD2, //Above diacritic, type 2 - HbThaiCharAD3, //Above diacritic, type 3 - HbThaiCharAV1, //Above vowel, type 1 - HbThaiCharAV2, //Above vowel, type 2 - HbThaiCharAV3, //Above vowel, type 3 - HbThaiCharNonThai //Not a Thai letter - }; - QGraphicsGridLayout* mButtonLayout; - QGraphicsWidget* mButtonWidget; - QList mPopupButtons; - QSignalMapper *mActionMapper; - QSignalMapper *mClickMapper; - QString mSpecialCharacterSet; - const HbKeymap *mKeymap; - QSizeF mSize; - int mButtonId; - int mPopupGridColumns; - int mPopupGridRows; - int mNumPopupButtons; - int mAbcButtonId; - uint mPrevChar; - - -public: - HbInputThaiSpecialPopupPrivate(); - ~HbInputThaiSpecialPopupPrivate(); - void setNumberOfKeys(); - void createPopupButtons(int screenWidth, int screenHeight); - void setLayoutDimensions(QSizeF dimensions); - void getSpecialCharacters(); - void setPopupButtons(const QString &aCharSet); - void applyEditorConstraints(); - int thaiGlyphType(uint prevChar); - void initializeAbcButton(); - void handleStandardButtonClick(int buttonId); - void _q_mappedKeyClick(int buttonid); -}; - -HbInputThaiSpecialPopupPrivate::HbInputThaiSpecialPopupPrivate() -{ - // we should make sure that it comes above vkb - setPriority(HbPopupPrivate::VirtualKeyboard + 1); - mClickMapper = 0; - mSize = QSizeF(); -} - -HbInputThaiSpecialPopupPrivate::~HbInputThaiSpecialPopupPrivate() -{ -} - -/*! -Sets number of keys to layout -*/ -void HbInputThaiSpecialPopupPrivate::setNumberOfKeys() -{ - //Manipulate number of keys on the layout depending on the Key_Asterisk and Qt::Key_Shift - if(Qt::Key_Asterisk == mButtonId) { - mPopupGridColumns = HbPopupAsteriskColumns; - mPopupGridRows = HbPopupAsteriskRows; - }else if (Qt::Key_Shift == mButtonId) { - mPopupGridColumns = HbPopupShiftColumns; - mPopupGridRows = HbPopupShiftRows; - } - mNumPopupButtons = mPopupGridColumns * mPopupGridRows; - mAbcButtonId = mPopupGridColumns*mPopupGridRows-1; -} - - -/*! -Create Popup Buttons -*/ -void HbInputThaiSpecialPopupPrivate::createPopupButtons(int screenWidth, int screenHeight) -{ - Q_Q(HbInputThaiSpecialPopup); - Q_UNUSED(q) - if (mPopupButtons.size() == 0) { - for (int i = 0; i < mNumPopupButtons; ++i) { - HbTouchKeypadButton *button = new HbTouchKeypadButton(0,QString(""),0); - q->connect(button, SIGNAL(clicked()), mClickMapper, SLOT(map())); - mClickMapper->setMapping(button, i); - mPopupButtons.append(button); - button->setProperty(HbStyleRulesCacheId::hbStyleRulesForNodeCache, HbPopupPortraitButtonTextLayout); - } - - for (int i = 0; i < mNumPopupButtons; ++i) { - if(Qt::Key_Asterisk == mButtonId) { - //This check is for logical separation between Above below vowels , Diacritics and Tone marks - //In Thai Language we have 7 Above and Below Vowels, 5 Diacritics and 4 Tone marks - if(!(i == HBPopupEmptyButtonSeven || i== HBPopupEmptyButtonEight || i == HBPopupEmptyButtonNine)) { - mButtonLayout->addItem(mPopupButtons.at(i), i/mPopupGridColumns, i%mPopupGridColumns); - } - } else if (Qt::Key_Shift == mButtonId) { - mButtonLayout->addItem(mPopupButtons.at(i), i/mPopupGridColumns, i%mPopupGridColumns); - } - } - } - //Set the Layout Dimensions - setLayoutDimensions(QSizeF(screenWidth/mPopupGridColumns, screenHeight/mPopupGridRows)); - //Assign button layout to widget - mButtonWidget->setLayout(mButtonLayout); -} - -/*! -This function defines the layout porperties for popup. -*/ -void HbInputThaiSpecialPopupPrivate::setLayoutDimensions(QSizeF dimensions) -{ - // only update the dimensions if they are not previously set - if (mSize == dimensions) { - return; - } - mSize = dimensions; - - mButtonLayout->setContentsMargins(0.0, 0.0, 0.0, 0.0); - - for (int i = 0; i < mPopupGridColumns; i++) { - mButtonLayout->setColumnFixedWidth(i, dimensions.width()); - } - for (int i = 0; i < mPopupGridRows; i++) { - mButtonLayout->setRowFixedHeight(i, dimensions.height()); - } - - mButtonLayout->setHorizontalSpacing(0.0); - mButtonLayout->setVerticalSpacing(0.0); - foreach (HbTouchKeypadButton* button, mPopupButtons) { - if (button) { - button->setInitialSize(dimensions); - } - } -} - - -/*! -Gets the special character sets from set keymapping. -*/ -void HbInputThaiSpecialPopupPrivate::getSpecialCharacters() -{ - mSpecialCharacterSet.clear(); - if (mKeymap) { - const HbKeyboardMap* keyboardMap = 0; - //Set keyboard map depending on Key_Asterisk and Key_Shift - if(Qt::Key_Asterisk == mButtonId) { - keyboardMap = mKeymap->keyboard(HbKeyboardThaiStarSctPortrait); - } else if(Qt::Key_Shift == mButtonId) { - keyboardMap = mKeymap->keyboard(HbKeyboardThaiHashSctPortrait); - } - if (keyboardMap) { - foreach (const HbMappedKey* mappedKey, keyboardMap->keys) { - //Creats character set through keyboard map - mSpecialCharacterSet.append(mappedKey->characters(HbModifierNone)); - } - } - } -} - -/*! -Let's set Thai Special Character to Buttons -*/ -void HbInputThaiSpecialPopupPrivate::setPopupButtons(const QString &aCharSet) -{ - int i = 0; - int j = 0; - for (; i < mPopupButtons.size()-1 && j < aCharSet.size(); ++i) { - if(Qt::Key_Asterisk == mButtonId) { - //This check is for logical separation between Above below Vowels , Diacritics and Tone marks - //In Thai Language we have 7 Above and Below Vowels, 5 Diacritics and 4 Tone marks - if(!(i == HBPopupEmptyButtonSeven || i== HBPopupEmptyButtonEight || i == HBPopupEmptyButtonNine)) { - const QChar &character = aCharSet[j]; - mPopupButtons.at(i)->setText(character); - mPopupButtons.at(i)->setObjectName("Thai Sct portrait " + QString(character)); - j++; - } - } else if (Qt::Key_Shift == mButtonId) { - const QChar &character = aCharSet[j]; - mPopupButtons.at(i)->setText(character); - mPopupButtons.at(i)->setObjectName("Thai Sct portrait " + QString(character)); - j++; - } - } - - for (; i < mPopupButtons.size()-1; ++i) { - mPopupButtons.at(i)->setText(""); - } - applyEditorConstraints(); - initializeAbcButton(); -} - -/*! -Apply editor constraints on buttons -*/ -void HbInputThaiSpecialPopupPrivate::applyEditorConstraints() -{ - if (Qt::Key_Asterisk == mButtonId) { - //Get Character class - int glyphType = thaiGlyphType(mPrevChar); - //Set the rules to the editor to allow or disallow characters - switch(glyphType) { - case HbThaiCharNonThai: - case HbThaiCharNon: - case HbThaiCharLV: - case HbThaiCharFV1: - case HbThaiCharFV2: - case HbThaiCharFV3: - case HbThaiCharBD: - case HbThaiCharTone: - case HbThaiCharAD1: - case HbThaiCharAD2: - case HbThaiCharAD3: - for (int i=0; i < mPopupButtons.size()-1; ++i) { - mPopupButtons.at(i)->setFade(true); - } - break; - case HbThaiCharCons: - for (int i=0; i < mPopupButtons.size()-1; ++i) { - mPopupButtons.at(i)->setFade(false); - } - break; - case HbThaiCharAV1: - case HbThaiCharBV1: { - static const QChar data[6] = { 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d }; - QString allowChar(data, 6); - - for (int i=0; i < mPopupButtons.size()-1; ++i) { - QString buttonText = mPopupButtons.at(i)->text(); - - if(buttonText.isEmpty()) { - mPopupButtons.at(i)->setFade(true); - } else { - if (allowChar.contains(buttonText)) { - mPopupButtons.at(i)->setFade(false); - } else { - mPopupButtons.at(i)->setFade(true); - } - } - } - } - break; - case HbThaiCharAV2: - case HbThaiCharBV2: { - static const QChar data[4] = { 0x0e48, 0x0e49, 0x0e4a, 0x0e4b }; - QString allowChar(data, 4); - - for (int i=0; i < mPopupButtons.size()-1; ++i) { - QString buttonText = mPopupButtons.at(i)->text(); - - if(buttonText.isEmpty()) { - mPopupButtons.at(i)->setFade(true); - } else { - if (allowChar.contains(buttonText)) { - mPopupButtons.at(i)->setFade(false); - } else { - mPopupButtons.at(i)->setFade(true); - } - } - - } - - } - break; - - case HbThaiCharAV3: { - static const QChar data[5] = { 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e47 }; - QString allowChar(data, 5); - - for (int i=0; i < mPopupButtons.size()-1; ++i) { - QString buttonText = mPopupButtons.at(i)->text(); - - if(buttonText.isEmpty()) { - mPopupButtons.at(i)->setFade(true); - } else { - if (allowChar.contains(buttonText)) { - mPopupButtons.at(i)->setFade(false); - } else { - mPopupButtons.at(i)->setFade(true); - } - } - } - - } - break; - default: - break; - - } - } - -} -/*! -Returns Character classes depending on the previous entered character -*/ -int HbInputThaiSpecialPopupPrivate::thaiGlyphType(uint prevChar) -{ - if (prevChar >= 0x0E01 && prevChar <= 0x0E2E && prevChar != 0x0E24 && prevChar != 0x0E26 ) { - return(HbThaiCharCons); - } else if (prevChar >= 0x0E40 && prevChar <= 0x0E44) { - return(HbThaiCharLV); - } else if (prevChar == 0x0E30 || prevChar == 0x0E32 || prevChar == 0x0E33) { - return(HbThaiCharFV1); - } else if (prevChar == 0x0E45) { - return(HbThaiCharFV2); - } else if (prevChar == 0x0E24 || prevChar == 0x0E26) { - return(HbThaiCharFV3); - } else if (prevChar == 0x0E38) { - return(HbThaiCharBV1); - } else if (prevChar == 0x0E39) { - return(HbThaiCharBV2); - } else if (prevChar == 0x0E3A) { - return(HbThaiCharBD); - } else if (prevChar >= 0x0E48 && prevChar <= 0x0E4B) { - return(HbThaiCharTone); - } else if (prevChar == 0x0E4C || prevChar == 0x0E4D) { - return(HbThaiCharAD1); - } else if (prevChar == 0x0E47) { - return(HbThaiCharAD2); - } else if (prevChar == 0x0E4E) { - return(HbThaiCharAD3); - } else if (prevChar == 0x0E34) { - return(HbThaiCharAV1); - } else if (prevChar == 0x0E31 || prevChar == 0x0E36) { - return(HbThaiCharAV2); - } else if (prevChar == 0x0E35 || prevChar == 0x0E37) { - return(HbThaiCharAV3); - } else { - return(HbThaiCharNonThai); - } -} - -/*! -Initialize ABC button -*/ -void HbInputThaiSpecialPopupPrivate::initializeAbcButton() -{ - mPopupButtons.at(mAbcButtonId)->setIcon(HbIcon("qtg_mono_alpha_mode")); - mPopupButtons.at(mAbcButtonId)->setObjectName(HbAbcButtonObjName); - mPopupButtons.at(mAbcButtonId)->setObjectName(HbAbcButtonObjName); - mPopupButtons.at(mAbcButtonId)->setProperty(HbStyleRulesCacheId::hbStyleRulesForNodeCache, HbPopupPortraitButtonIconLayout); - mPopupButtons.at(mAbcButtonId)->setButtonType(HbTouchKeypadButton::HbTouchButtonFunction); - mPopupButtons.at(mAbcButtonId)->setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); -} - - -/*! -Handles button clicks. -*/ -void HbInputThaiSpecialPopupPrivate::handleStandardButtonClick(int buttonId) -{ - Q_Q(HbInputThaiSpecialPopup); - - if (buttonId >= 0 && buttonId < mNumPopupButtons-1 ) { - QString buttonText = mPopupButtons.at(buttonId)->text(); - //Emit the signal when button is not faded and it has some text - if (!mPopupButtons.at(buttonId)->isFaded() && buttonText.length() > 0) { - emit q->chrSelected(buttonText.at(0)); - } - } - //It will hide popup for any click event - q->hide(); - -} - -/*! -Handles virtual key clicks -*/ -void HbInputThaiSpecialPopupPrivate::_q_mappedKeyClick(int buttonid) -{ - handleStandardButtonClick(buttonid); -} - -/// @endcond - - -/*! -Constructs the object. -*/ - -HbInputThaiSpecialPopup::HbInputThaiSpecialPopup(int buttonId, uint prevChar, QGraphicsItem* parent) - : HbDialog(*new HbInputThaiSpecialPopupPrivate(), parent) -{ - Q_D(HbInputThaiSpecialPopup); - //Initialize member variable - d->mPrevChar = prevChar; - d->mButtonId = buttonId; -#if QT_VERSION >= 0x040600 - // Make sure the Thai special popup never steals focus. - setFlag(QGraphicsItem::ItemIsPanel, true); - setActive(false); -#endif - // set dialog properties - setFocusPolicy(Qt::ClickFocus); - setBackgroundFaded(false); - setDismissPolicy(TapAnywhere); - setTimeout(NoTimeout); - - d->mButtonLayout = new QGraphicsGridLayout(); - d->mButtonLayout->setSpacing(0.0); - d->mButtonLayout->setContentsMargins(0.0, 0.0, 0.0, 0.0); - - d->mButtonWidget = new QGraphicsWidget(); - //Create Signal mapper - d->mClickMapper = new QSignalMapper(this); - - // let's connect buttons to handle click events - connect(d->mClickMapper, SIGNAL(mapped(int)), this, SLOT(_q_mappedKeyClick(int))); -} - -/*! -Destructs the object. -*/ -HbInputThaiSpecialPopup::~HbInputThaiSpecialPopup() -{ -} - -/*! -This function should be called when ever there is a Key_Asterisk and Key_Shift click happens. -This create buttons, Set the layout dimensions and gets the special characters from the given keymappings and set it accordingly. -*/ -void HbInputThaiSpecialPopup::setPopupLayout(const HbKeymap* keymap, uint prevChar, int buttonId, int screenWidth, int screenHeight) -{ - Q_D(HbInputThaiSpecialPopup); - if(d->mButtonId != buttonId) { - d->mButtonId = buttonId; - while (!d->mPopupButtons.isEmpty()) - delete d->mPopupButtons.takeFirst(); - } - d->mKeymap = keymap; - d->mPrevChar = prevChar; - //Initialize Number of keys dependent on Key_Asterisk and Key_Shift - d->setNumberOfKeys(); - //Create buttons. - d->createPopupButtons(screenWidth,screenHeight); - //Gets the special character sets from set keymapping. - d->getSpecialCharacters(); - //Let's set Special Character Table Buttons - d->setPopupButtons(d->mSpecialCharacterSet); - setContentWidget(d->mButtonWidget); -} - -/*! -This a virtual functions in QGraphicsWidget. It is called whenever the Thai popup is shown. - -*/ -void HbInputThaiSpecialPopup::showEvent( QShowEvent * event ) -{ - HbDialog::showEvent(event); -} - -#include "moc_hbinputthaispecialpopup.cpp" - -//End of file - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputthaispecialpopup.h --- a/src/hbplugins/inputmethods/touchinput/hbinputthaispecialpopup.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HB_INPUT_THAISPECIALPOPUP_H -#define HB_INPUT_THAISPECIALPOPUP_H - -#include - -#include -#include -#include -#include - - -class HbInputThaiSpecialPopupPrivate; - -class HbInputThaiSpecialPopup : public HbDialog -{ - Q_OBJECT -public: - HbInputThaiSpecialPopup(int buttonId, uint prevChar, QGraphicsItem* parent = 0); - ~HbInputThaiSpecialPopup(); - - void showEvent( QShowEvent *event); - void setPopupLayout(const HbKeymap* keymap,uint prevChar,int buttonId, int screenWidth, int screenHeight ); - -signals: - void chrSelected(QString sctText); -private: - Q_DECLARE_PRIVATE_D(d_ptr, HbInputThaiSpecialPopup) - Q_DISABLE_COPY(HbInputThaiSpecialPopup) - Q_PRIVATE_SLOT(d_func(), void _q_mappedKeyClick(int )) -}; - -#endif // HB_INPUT_THAISPECIALPOPUP_H - -// End of file - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputtouchkeypadbutton.cpp --- a/src/hbplugins/inputmethods/touchinput/hbinputtouchkeypadbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,454 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#ifdef HB_EFFECTS -#include -#endif -#include - -#include "hbinputtouchkeypadbutton.h" -#include "hbinputvkbwidget.h" -#include "hbinputvkbwidget_p.h" - -/// @cond - -/*! -@proto -@hbinput -\class HbTouchKeypadButton -\brief A button widget to be used in touch keypads. - -Expands HbPushButton functionality to suit touch keypad purposes. It handles virtual keyboard closing gesture -that is initiated from within the button area and knows how to act as a sticky input button. Sticky buttons propagate -mouse press state to neighboring button when a drag event crosses widget boundary. This is needed for example in virtual qwerty where -user must be able to slide finger across the keyboard. -*/ - -const QString HbNormalBackground("qtg_fr_input_btn_keypad_normal"); -const QString HbNormalPressedBackground("qtg_fr_input_btn_keypad_pressed"); -const QString HbNormalInActiveBackground("qtg_fr_input_btn_keypad_disabled"); -const QString HbNormalLatchedBackground("qtg_fr_input_btn_keypad_latched"); - -const QString HbFunctionBackground("qtg_fr_input_btn_function_normal"); -const QString HbFunctionPressedBackground("qtg_fr_input_btn_function_pressed"); -const QString HbFuncInActiveBackground("qtg_fr_input_btn_function_disabled"); -const QString HbFunctionLatchedBackground("qtg_fr_input_btn_function_latched"); - -inline HbTouchKeypadButton* hbtouchkeypadbutton_cast(QGraphicsItem *item) -{ - if( item->isWidget() && qobject_cast(static_cast(item)) ) { - return static_cast(item); - } - return 0; -} - -class HbTouchKeypadButtonPrivate -{ -public: - HbTouchKeypadButtonPrivate(HbInputVkbWidget* owner) - : mOwner(owner), - mFaded(false), - mButtonType(HbTouchKeypadButton::HbTouchButtonNormal), - mFrameIcon(0), - mStickyKey(false), - mLatch(false) - {} - -public: - HbInputVkbWidget* mOwner; - bool mFaded; - HbTouchKeypadButton::HbTouchButtonType mButtonType; - HbFrameItem *mFrameIcon; - bool mStickyKey; - bool mLatch; - int mKeyCode; -}; - -HbTouchKeypadButton::HbTouchKeypadButton(HbInputVkbWidget *owner, - const QString &text, - QGraphicsWidget *parent) - : HbPushButton(text, parent), d_ptr(new HbTouchKeypadButtonPrivate(owner)) -{ - #ifdef HB_EFFECTS - HbEffect::disable(this); - #endif - - this->setToolTip(QString()); - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); - setProperty("buttonType", "normal"); -} - -HbTouchKeypadButton::HbTouchKeypadButton(HbInputVkbWidget *owner, - const HbIcon &icon, - const QString &text, - QGraphicsItem *parent) - : HbPushButton(icon, text, parent), d_ptr(new HbTouchKeypadButtonPrivate(owner)) -{ - #ifdef HB_EFFECTS - HbEffect::disable(this); - #endif - - this->setToolTip(QString()); - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); - setProperty("buttonType", "normal"); -} - -HbTouchKeypadButton::~HbTouchKeypadButton() -{ - delete d_ptr; -} - -void HbTouchKeypadButton::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - Q_UNUSED(event) -} - -void HbTouchKeypadButton::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) -{ - Q_UNUSED(event) -} - -void HbTouchKeypadButton::mouseMoveEvent(QGraphicsSceneMouseEvent *event) -{ - Q_UNUSED(event) -} - -void HbTouchKeypadButton::gestureEvent(QGestureEvent *event) -{ - Q_D(HbTouchKeypadButton); - if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { - switch(tap->state()) { - case Qt::GestureStarted: - if (d->mOwner && d->mOwner->d_func()) { - d->mOwner->d_func()->updateMouseHitItem(this, tap->scenePosition()); - } - if (!(d->mButtonType == HbTouchButtonNormalInActive && text().isEmpty())) { - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonPressed); - } - break; - case Qt::GestureUpdated: - // Handle tap-and-hold? - break; - case Qt::GestureFinished: - if (!(d->mButtonType == HbTouchButtonNormalInActive && text().isEmpty())) { - if (d->mLatch) { - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonLatched); - } else { - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); - } - break; - case Qt::GestureCanceled: - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); - break; - default: - break; - } - } - } - HbPushButton::gestureEvent(event); -} - -void HbTouchKeypadButton::resizeEvent(QGraphicsSceneResizeEvent *event) -{ - Q_D(HbTouchKeypadButton); - - HbPushButton::resizeEvent(event); - - // setting the draw rect for the frameitem in this button - // get the new size, and use the new size to the frameitem - if (d->mFrameIcon ) { - QSizeF mySize = event->newSize(); - QRectF rect = QRectF(mySize.width()*0.1, mySize.height()*0.3, mySize.width()*0.8, mySize.height()); - d->mFrameIcon->setGeometry( rect ); - } -} - -bool HbTouchKeypadButton::isFaded() -{ - Q_D(HbTouchKeypadButton); - return d->mFaded; -} - -void HbTouchKeypadButton::setFade(bool fade) -{ - Q_D(HbTouchKeypadButton); - if (d->mFaded == fade) { - return; - } - - d->mFaded = fade; - - // now set button's text, type and background attributes based on d->mFaded value - if(d->mFaded) { - if (d->mFrameIcon) { - d->mFrameIcon->setOpacity(0.2); - } - if(HbTouchButtonNormal == getButtonType() ){ - setButtonType(HbTouchKeypadButton::HbTouchButtonNormalInActive); - } else if(HbTouchButtonFunction == getButtonType()) { - setButtonType(HbTouchKeypadButton::HbTouchButtonFnInActive); - } - } else { - if (d->mFrameIcon) { - d->mFrameIcon->setOpacity(1.0); - } - if(HbTouchButtonNormalInActive == getButtonType()){ - setButtonType(HbTouchKeypadButton::HbTouchButtonNormal); - } else if(HbTouchButtonFnInActive == getButtonType()) { - setButtonType(HbTouchKeypadButton::HbTouchButtonFunction); - } - } - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); -} - -void HbTouchKeypadButton::setButtonType(HbTouchButtonType buttonType) -{ - Q_D(HbTouchKeypadButton); - d->mButtonType = buttonType; - if (buttonType == HbTouchButtonNormal || - buttonType == HbTouchButtonNormalInActive) { - setProperty("buttonType", "normal"); - } else if (buttonType == HbTouchButtonFunction || - buttonType == HbTouchButtonFnInActive){ - setProperty("buttonType", "function"); - } -} - -int HbTouchKeypadButton::getButtonType() -{ - Q_D(HbTouchKeypadButton); - return d->mButtonType; -} - -HbFrameItem * HbTouchKeypadButton::getFrameIcon() -{ - Q_D(HbTouchKeypadButton); - return d->mFrameIcon; -} - -void HbTouchKeypadButton::setBackgroundAttributes(HbTouchButtonState buttonState) -{ - Q_D(HbTouchKeypadButton); - - if(d->mButtonType == HbTouchButtonNormal) { - if(buttonState == HbTouchKeypadButton::HbTouchButtonPressed) { - setBackground(HbNormalPressedBackground); - } else if (buttonState == HbTouchKeypadButton::HbTouchButtonLatched) { - setBackground(HbNormalLatchedBackground); - } else { - setBackground(HbNormalBackground); - } - } else if(d->mButtonType == HbTouchButtonFunction) { - if(buttonState == HbTouchKeypadButton::HbTouchButtonPressed) { - setBackground(HbFunctionPressedBackground); - } else if (buttonState == HbTouchKeypadButton::HbTouchButtonLatched) { - setBackground(HbFunctionLatchedBackground); - } else{ - setBackground(HbFunctionBackground); - } - } else if(d->mButtonType == HbTouchButtonFnInActive){ - setBackground(HbFuncInActiveBackground); - } else if(d->mButtonType == HbTouchButtonNormalInActive) { - setBackground(HbNormalInActiveBackground); - } else { - setBackground(HbFuncInActiveBackground); - } -} - -void HbTouchKeypadButton::setBackground(const QString& backgroundFrameFilename) -{ - HbFrameDrawer* drawer = frameBackground(); - if (!drawer || drawer->frameGraphicsName() != backgroundFrameFilename) { - setFrameBackground(HbFrameDrawerPool::get(backgroundFrameFilename, HbFrameDrawer::NinePieces, size())); - update(); - } -} - -void HbTouchKeypadButton::setFrameIcon(const QString& frameIconFileName ) -{ - Q_D(HbTouchKeypadButton); - - if (!d->mFrameIcon ) { - d->mFrameIcon = new HbFrameItem(this); - HbFrameDrawer *framedrawer = new HbFrameDrawer(frameIconFileName, HbFrameDrawer::ThreePiecesHorizontal); - d->mFrameIcon->setFrameDrawer(framedrawer); - } else { - d->mFrameIcon->frameDrawer().setFrameGraphicsName(frameIconFileName); - } -} - -int HbTouchKeypadButton::type() const -{ - Q_D(const HbTouchKeypadButton); - - if (d->mButtonType == HbTouchButtonFunction || - d->mButtonType == HbTouchButtonFnInActive) { - return Hb::ItemType_InputFunctionButton; - } else if (d->mButtonType == HbTouchButtonNormal || - d->mButtonType == HbTouchButtonNormalInActive) { - return Hb::ItemType_InputCharacterButton; - } else { - return Hb::ItemType_InputCharacterButton; - } -} - -void HbTouchKeypadButton::setAsStickyButton(bool isSticky) -{ - Q_D(HbTouchKeypadButton); - d->mStickyKey = isSticky; -} - -bool HbTouchKeypadButton::isStickyButton() const -{ - Q_D(const HbTouchKeypadButton); - return d->mStickyKey; -} - -void HbTouchKeypadButton::setLatch(bool enable) -{ - Q_D(HbTouchKeypadButton); - - d->mLatch = enable; - if (d->mLatch) { - setProperty("state", "latched"); - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonLatched); - } else { - setProperty("state", "normal"); - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); - } -} - -bool HbTouchKeypadButton::isLatched() const -{ - Q_D(const HbTouchKeypadButton); - return d->mLatch; -} - -int HbTouchKeypadButton::keyCode() const -{ - Q_D(const HbTouchKeypadButton); - return d->mKeyCode; -} - -void HbTouchKeypadButton::setKeyCode(int code) -{ - Q_D(HbTouchKeypadButton); - d->mKeyCode = code; -} - -void HbTouchKeypadButton::setText(const QString &text) -{ - // Workaround for pushbutton feature - if (!text.isNull()) { - HbPushButton::setText(text); - } else { - HbPushButton::setText(QString("")); - } -} - -void HbTouchKeypadButton::setAdditionalText(const QString &additionalText) -{ - if (!additionalText.isNull()) { - HbPushButton::setAdditionalText(additionalText); - } else { - HbPushButton::setAdditionalText(QString("")); - } -} - -void HbTouchKeypadButton::changeEvent( QEvent *event ) -{ - if ( event->type() == HbEvent::ThemeChanged ) { - updatePrimitives(); - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); - } - HbPushButton::changeEvent(event); -} - -void HbTouchKeypadButton::updatePrimitives() -{ - Q_D(HbTouchKeypadButton); - HbPushButton::updatePrimitives(); - - if (d->mFrameIcon && d->mFaded) { - d->mFrameIcon->setOpacity(0.2); - } -} - -QSizeF HbTouchKeypadButton::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const -{ - QSizeF sh; - switch (which) { - case Qt::MinimumSize: - sh = QSizeF(50, 50); - break; - case Qt::PreferredSize: - sh = HbAbstractButton::sizeHint(which, constraint); - break; - case Qt::MaximumSize: - sh = QSizeF(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX); - break; - default: - sh = HbAbstractButton::sizeHint(which, constraint); - break; - } - return sh; -} - -QVariant HbTouchKeypadButton::itemChange( GraphicsItemChange change, const QVariant & value ) -{ - // If the button is being hidden and it has the press background, - // need to set it to released background. This fix is needed for the error: - // In ITU-T long press * key and then return back to alpha mode, the * key - // has button pressed background. - if (QGraphicsItem::ItemVisibleHasChanged == change && !value.toBool()) { - if (isDown()) { - setBackgroundAttributes(HbTouchKeypadButton::HbTouchButtonReleased); - } - } - return HbPushButton::itemChange(change, value); -} - -void HbTouchKeypadButton::setInitialSize(const QSizeF& initialSize) -{ - setPreferredSize(initialSize); - QGraphicsItem* backgroundPrimitive = primitive(HbStyle::P_PushButton_background); - if (backgroundPrimitive) { - HbIconItem *iconItem = static_cast(backgroundPrimitive); - iconItem->setSize(initialSize); - } -} - -/// @endcond - -// End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/hbinputtouchkeypadbutton.h --- a/src/hbplugins/inputmethods/touchinput/hbinputtouchkeypadbutton.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbPlugins module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HB_TOUCH_KEYPAD_BUTTON_H -#define HB_TOUCH_KEYPAD_BUTTON_H - -#include // For HB_INPUT_EXPORT -#include - -class HbInputVkbWidget; -class HbTouchKeypadButtonPrivate; -class HbStyleOptionLabel; -class HbFrameItem; - -class HbTouchKeypadButton : public HbPushButton -{ - Q_OBJECT - Q_PROPERTY(int keyCode READ keyCode WRITE setKeyCode) - -public: - enum HbTouchButtonType { - HbTouchButtonNormal, - HbTouchButtonFunction, - HbTouchButtonNormalInActive, - HbTouchButtonFnInActive - }; - - enum HbTouchButtonState { - HbTouchButtonReleased, - HbTouchButtonPressed, - HbTouchButtonLatched - }; - -public: - HbTouchKeypadButton(HbInputVkbWidget* owner, const QString &text, QGraphicsWidget *parent = 0); - HbTouchKeypadButton(HbInputVkbWidget* owner, const HbIcon &icon, const QString &text, QGraphicsItem *parent = 0 ); - virtual ~HbTouchKeypadButton(); - - int keyCode() const; - void setKeyCode(int code); - virtual void setText(const QString &text); - virtual void setAdditionalText(const QString &additionalText); - bool isFaded(); - void setFade(bool fade); - void setButtonType(HbTouchButtonType buttonType); - int getButtonType(); - HbFrameItem * getFrameIcon(); - void setBackgroundAttributes(HbTouchButtonState buttonState); - int type() const; - void setFrameIcon(const QString& frameIconFileName); - void setAsStickyButton(bool isSticky); - bool isStickyButton() const; - void setLatch(bool enable); - bool isLatched() const; - void setInitialSize(const QSizeF& initialSize); - -signals: - void enteredInNonStickyRegion(); - -protected: - void mousePressEvent(QGraphicsSceneMouseEvent *event); - void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); - void resizeEvent(QGraphicsSceneResizeEvent *event); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); - void gestureEvent(QGestureEvent *event); - void setBackground(const QString& backgroundFrameFilename); - virtual void changeEvent( QEvent *event ); - virtual void updatePrimitives(); - QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const; - QVariant itemChange( GraphicsItemChange change, const QVariant & value ); - -protected: - HbTouchKeypadButtonPrivate * const d_ptr; - -private: - Q_DECLARE_PRIVATE_D(d_ptr, HbTouchKeypadButton) - Q_DISABLE_COPY(HbTouchKeypadButton) -}; - -#endif // HB_TOUCH_KEYPAD_BUTTON_H - -// End of file - diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/touchinput.pro --- a/src/hbplugins/inputmethods/touchinput/touchinput.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/touchinput.pro Thu Jul 22 16:36:53 2010 +0100 @@ -54,9 +54,7 @@ HEADERS += ..\common\hbinputabstractbase.h HEADERS += hbinputprediction12keyhandler_p.h HEADERS += hbinputbasic12keyhandler_p.h -HEADERS += hbinputbasic12keythaihandler.h -HEADERS += hbinputprediction12keythaihandler.h -HEADERS += hbinputthaispecialpopup.h +HEADERS += ..\common\hbinputspellquerydialog.h HEADERS += hbinput12keytouchkeyboard.h HEADERS += hbinput12keytouchkeyboard_p.h HEADERS += hbinputqwerty10x4touchkeyboard.h @@ -65,7 +63,6 @@ HEADERS += hbinputqwerty11x4touchkeyboard_p.h HEADERS += hbinputqwertynumerictouchkeyboard.h HEADERS += hbinputqwertynumerictouchkeyboard_p.h -HEADERS += hbinputtouchkeypadbutton.h SOURCES = virtual12key.cpp SOURCES += virtualqwerty.cpp @@ -81,14 +78,11 @@ SOURCES += hbinputnumericqwertyhandler.cpp SOURCES += hbinputnumeric12keyhandler.cpp SOURCES += ..\common\hbinputabstractbase.cpp -SOURCES += hbinputbasic12keythaihandler.cpp -SOURCES += hbinputprediction12keythaihandler.cpp -SOURCES += hbinputthaispecialpopup.cpp SOURCES += hbinput12keytouchkeyboard.cpp SOURCES += hbinputqwerty10x4touchkeyboard.cpp SOURCES += hbinputqwerty11x4touchkeyboard.cpp SOURCES += hbinputqwertynumerictouchkeyboard.cpp -SOURCES += hbinputtouchkeypadbutton.cpp +SOURCES += ..\common\hbinputspellquerydialog.cpp symbian { TARGET.EPOCALLOWDLLDATA = 1 diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/touchinputplugin.cpp --- a/src/hbplugins/inputmethods/touchinput/touchinputplugin.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/touchinputplugin.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,31 +31,22 @@ #include "virtualqwerty.h" #include "hbinputmodeproperties.h" -// --------------------------------------------------------------------------- -// HbTouchInputPlugin::HbTouchInputPlugin -// -// Constructs HbTouchInputPlugin -// --------------------------------------------------------------------------- -// +const QString HbTouchInput12KeyIcon("qtg_small_itut"); +const QString HbTouchInputQwertyIcon("qtg_small_keyboard"); + HbTouchInputPlugin::HbTouchInputPlugin(QObject *parent) - : QInputContextPlugin(parent) + : HbInputContextPlugin(parent) { } -// --------------------------------------------------------------------------- -// HbTouchInputPlugin::~HbTouchInputPlugin -// -// --------------------------------------------------------------------------- -// + HbTouchInputPlugin::~HbTouchInputPlugin() { } -// --------------------------------------------------------------------------- -// Virtual12KeyImpl::create -// -// --------------------------------------------------------------------------- -// +/*! +\reimp +*/ QInputContext* HbTouchInputPlugin::create(const QString& key) { if (key == QString("HbVirtual12Key")) { @@ -67,11 +58,9 @@ } } -// --------------------------------------------------------------------------- -// HbTouchInputPlugin::description -// -// --------------------------------------------------------------------------- -// +/*! +\reimp +*/ QString HbTouchInputPlugin::description(const QString& key) { if (key == QString("HbVirtual12Key")) { @@ -83,11 +72,9 @@ } } -// --------------------------------------------------------------------------- -// HbTouchInputPlugin::displayName -// -// --------------------------------------------------------------------------- -// +/*! +\reimp +*/ QString HbTouchInputPlugin::displayName(const QString& key) { if (key == QString("HbVirtual12Key")) { @@ -99,11 +86,9 @@ } } -// --------------------------------------------------------------------------- -// HbTouchInputPlugin::keys -// -// --------------------------------------------------------------------------- -// +/*! +\reimp +*/ QStringList HbTouchInputPlugin::keys() const { QStringList keys; @@ -112,11 +97,9 @@ return keys; } -// --------------------------------------------------------------------------- -// HbTouchInputPlugin::languages -// -// --------------------------------------------------------------------------- -// +/*! +\reimp +*/ QStringList HbTouchInputPlugin::languages(const QString& key) { QStringList result; @@ -132,16 +115,45 @@ HbInputModeProperties properties(HbInputModeDefault, HbInputLanguage(), HbKeyboardVirtualQwerty); result.append(properties.asString()); - QList languages = HbKeymapFactory::availableLanguages(); - foreach (HbInputLanguage language, languages) { - properties = HbInputModeProperties(HbInputModeNumeric, language, HbKeyboardVirtualQwerty); - result.append(properties.asString()); - } + properties = HbInputModeProperties(HbInputModeNumeric, HbInputLanguage(), HbKeyboardVirtualQwerty); + result.append(properties.asString()); } return QStringList(result); } +/*! +\reimp +*/ +QStringList HbTouchInputPlugin::displayNames(const QString &key) +{ + Q_UNUSED(key); + return QStringList(); +} + +/*! +\reimp +*/ +HbIcon HbTouchInputPlugin::icon(const QString &key) +{ + if (key == "HbVirtual12Key") { + return HbIcon(HbTouchInput12KeyIcon); + } else if (key == "HbVirtualQwerty") { + return HbIcon(HbTouchInputQwertyIcon); + } + + return HbIcon(); +} + +/*! +\reimp +*/ +QList HbTouchInputPlugin::icons(const QString &key) +{ + Q_UNUSED(key); + return QList(); +} + // // Make plugin loadable. // diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/touchinputplugin.h --- a/src/hbplugins/inputmethods/touchinput/touchinputplugin.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/touchinputplugin.h Thu Jul 22 16:36:53 2010 +0100 @@ -26,9 +26,9 @@ #ifndef TouchInputPlugin_IMPL_H #define TouchInputPlugin_IMPL_H -#include +#include -class HbTouchInputPlugin : public QInputContextPlugin +class HbTouchInputPlugin : public HbInputContextPlugin { Q_OBJECT @@ -42,6 +42,9 @@ QString displayName(const QString& key); QStringList keys() const; QStringList languages(const QString& key); + QStringList displayNames(const QString &key); + HbIcon icon(const QString &key); + QList icons(const QString &key); }; #endif // TouchInputPlugin_IMPL_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/virtual12key.cpp --- a/src/hbplugins/inputmethods/touchinput/virtual12key.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/virtual12key.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -47,15 +47,9 @@ //User includes #include "hbinput12keytouchkeyboard.h" -#include "hbinputthaispecialpopup.h" #include "hbinputbasic12keyhandler.h" #include "hbinputprediction12keyhandler.h" #include "hbinputnumeric12keyhandler.h" -#include "hbinputbasic12keythaihandler.h" -#include "hbinputprediction12keythaihandler.h" - -const int HbSmileyNumberOfRows = 5; -const int HbSmileyNumberOfColumns = 5; /*! \class HbVirtual12Key @@ -71,7 +65,6 @@ : mCurrentKeypad(0), mItutKeypad(0), mSctKeypad(0), - mThaiSpecialChar(0), mKeymap(0), mOrientationAboutToChange(false), mCandidatePopup(0), @@ -87,14 +80,12 @@ mBasicModeHandler = new HbInputBasic12KeyHandler(this); mPredictionModeHandler = new HbInputPrediction12KeyHandler(this); mNumericModeHandler = new HbInputNumeric12KeyHandler(this); - mBasic12keyThaiHandler = new HbInputBasic12KeyThaiHandler(this); - mPrediction12keyThaiHandler = new HbInputPrediction12KeyThaiHandler(this); + mActiveModeHandler = mBasicModeHandler; mBasicModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionInit); mPredictionModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionInit); mNumericModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionInit); - mPrediction12keyThaiHandler->actionHandler(HbInputModeHandler::HbInputModeActionInit); // let's connect prediction mode handler with latin basic mode handler. It is required incase we Qt::key_0 is pressed in prediction mode // key @@ -102,12 +93,10 @@ mBasicModeHandler, SLOT(filterEvent(const QKeyEvent *))); connect(mPredictionModeHandler, SIGNAL(passActionHandler(HbInputModeAction )), mBasicModeHandler, SLOT(actionHandler(HbInputModeAction ))); - connect(mPrediction12keyThaiHandler, SIGNAL(passFilterEvent(const QKeyEvent *)), - mBasicModeHandler, SLOT(filterEvent(const QKeyEvent *))); - connect(mPrediction12keyThaiHandler, SIGNAL(passActionHandler(HbInputModeAction )), - mBasicModeHandler, SLOT(actionHandler(HbInputModeAction ))); connect(HbInputSettingProxy::instance(), SIGNAL(predictiveInputStateChanged(HbKeyboardSettingFlags,bool)), this, SLOT(predictiveInputStateChanged(HbKeyboardSettingFlags,bool))); + connect(HbInputSettingProxy::instance(), SIGNAL(autocompletionStateChanged(HbKeyboardSettingFlags,bool)), this, SLOT(autocompletionStateChanged(HbKeyboardSettingFlags,bool))); + mPredictionModeHandler->setAutocompletionStatus(HbInputSettingProxy::instance()->isAutocompletionEnabled(HbKeyboardSetting12key)); } bool HbVirtual12Key::isSctModeActive() const @@ -128,20 +117,14 @@ mSctKeypad = 0; delete mCandidatePopup; mCandidatePopup = 0; - delete mThaiSpecialChar; - mThaiSpecialChar = 0; - + // free mode handlers delete mBasicModeHandler; mBasicModeHandler = 0; delete mPredictionModeHandler; mPredictionModeHandler = 0; delete mNumericModeHandler; - mNumericModeHandler = 0; - delete mBasic12keyThaiHandler; - mBasic12keyThaiHandler = 0; - delete mPrediction12keyThaiHandler; - mPrediction12keyThaiHandler = 0; + mNumericModeHandler = 0; } /*! @@ -195,7 +178,6 @@ //FLICKDISABLED connect(tempKeypad, SIGNAL(flickEvent(HbInputVkbWidget::FlickDirection)), this, SLOT(flickEvent(HbInputVkbWidget::FlickDirection))); connect(tempKeypad, SIGNAL(smileySelected(QString)), this, SLOT(smileySelected(QString))); connect(tempKeypad, SIGNAL(mouseMovedOutOfButton()), this, SLOT(mouseMovedOutOfButton())); - connect(tempKeypad, SIGNAL(chrSelected(QString)), this, SLOT(thaiSctCharacterSelected(QString))); tempKeypad->setRockerVisible(true); return tempKeypad; } @@ -255,6 +237,7 @@ connect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), mActiveModeHandler, SLOT(cursorPositionChanged(int, int))); } + HbInputAbstractMethod::focusReceived(); } /*! @@ -262,8 +245,10 @@ */ void HbVirtual12Key::focusLost(bool focusSwitch) { - // inform the active mode handler about the focus lost event. - mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionFocusLost); + if(mActiveModeHandler) { + // inform the active mode handler about the focus lost event. + mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionFocusLost); + } if (focusObject()) { disconnect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), @@ -289,9 +274,6 @@ mVkbHost->closeKeypad(!stateChangeInProgress()); // set mCurrentKeypad to null. mCurrentKeypad = 0; - if (mThaiSpecialChar) { - mThaiSpecialChar->hide(); - } if (mCandidatePopup) { mCandidatePopup->hide(); } @@ -303,15 +285,16 @@ */ void HbVirtual12Key::openKeypad(HbInputVkbWidget * keypadToOpen,bool inMinimizedMode) { + // if null is sent, just return. + if(!keypadToOpen || !focusObject()) { + return; + } + mKeyboardChangeAlreadyInprogress = true; HbInputSettingProxy::instance()->setActiveKeyboard(HbKeyboardVirtual12Key); mKeyboardChangeAlreadyInprogress = false; - // if null is sent, just return. - if(!keypadToOpen) { - return; - } - bool wasKeypadOpen = false; + bool disableAnimation = false; // see if we are trying to open a different keypad than what is already opened. if (mCurrentKeypad != keypadToOpen) { // close currently open keypad. We always close keypad without animation @@ -321,13 +304,19 @@ mVkbHost->closeKeypad(false); // when their is a keypad that needs to be closed before opening the new keypad, we don't // want to animate the opening of new keypad. - wasKeypadOpen = true; + disableAnimation = true; } } // Close candidate popup if open if (mCandidatePopup) { mCandidatePopup->hide(); } + + QObject::disconnect(mCurrentKeypad,SIGNAL(aboutToActivateCustomAction(HbAction*)), + this,SLOT(aboutToActivateCustomAction(HbAction*))); + QObject::connect(keypadToOpen,SIGNAL(aboutToActivateCustomAction(HbAction*)), + this,SLOT(aboutToActivateCustomAction(HbAction*))); + // assign new keypad to be opened to varable mCurrentKeypad mCurrentKeypad = keypadToOpen; @@ -338,14 +327,25 @@ if (inMinimizedMode) { mVkbHost->openMinimizedKeypad(mCurrentKeypad, this); } else { - mVkbHost->openKeypad(mCurrentKeypad, this, (!stateChangeInProgress() && !wasKeypadOpen)); + mVkbHost->openKeypad(mCurrentKeypad, this, (!stateChangeInProgress() && !disableAnimation)); + } + if (focusObject()) { + connect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), + mVkbHost, SLOT(ensureCursorVisibility())); } - connect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), - mVkbHost, SLOT(ensureCursorVisibility())); } } /*! +vkb widget is about to call a custom action that is mapped to one of the keypad buttons. +*/ +void HbVirtual12Key::aboutToActivateCustomAction(HbAction *custAction) +{ + Q_UNUSED(custAction); + mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionCommit); +} + +/*! The mouse event handler for the input method. Launches the candidate list if the mouse is clicked on the pre-editing text. */ @@ -370,14 +370,19 @@ } } +void HbVirtual12Key::autocompletionStateChanged(HbKeyboardSettingFlags keyboardType, bool newState) +{ + if (keyboardType & HbKeyboardSetting12key) { + mPredictionModeHandler->setAutocompletionStatus(newState); + } +} + /*! Call back indicating that the keypad is closed. */ void HbVirtual12Key::keypadClosed() { - if (mOrientationAboutToChange) { - mOrientationAboutToChange = false; - } + mOrientationAboutToChange = false; } /*! @@ -401,7 +406,14 @@ if (mCandidatePopup) { mCandidatePopup->hide(); } - mVkbHost->minimizeKeypad(!stateChangeInProgress()); + + // Close input. + QInputContext* ic = qApp->inputContext(); + if (ic) { + QEvent *closeEvent = new QEvent(QEvent::CloseSoftwareInputPanel); + ic->filterEvent(closeEvent); + delete closeEvent; + } } } } @@ -467,7 +479,7 @@ loadKeymap(newLanguage); // inform all the mode handler about the language change. mPredictionModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionPrimaryLanguageChanged); - if (mCurrentKeypad) { + if (focusObject() && mCurrentKeypad) { mCurrentKeypad->animKeyboardChange(); } } @@ -513,19 +525,8 @@ } HbInputModeHandler *previousModeHandler = mActiveModeHandler; - if (HbInputSettingProxy::instance()->globalInputLanguage() == QLocale::Thai && - usePrediction() && newState.inputMode() != HbInputModeNumeric) { - mActiveModeHandler = mPrediction12keyThaiHandler; - // by passing HbInputModeActionFocusRecieved we will be setting the candidate list and keypad - mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionFocusRecieved); - } else if (HbInputSettingProxy::instance()->globalInputLanguage() == QLocale::Thai && - !usePrediction() && newState.inputMode() != HbInputModeNumeric && - ((HbEditorConstraintLatinAlphabetOnly | HbEditorConstraintAutoCompletingField)!=focusObject()->editorInterface().inputConstraints())) { - mActiveModeHandler = mBasic12keyThaiHandler; - // by passing HbInputModeActionFocusRecieved we will be setting the candidate list and keypad - mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionFocusRecieved); - } else if (newState.inputMode() == HbInputModeDefault && usePrediction()) { - mActiveModeHandler = mPredictionModeHandler; + if (newState.inputMode() == HbInputModeDefault && usePrediction()) { + mActiveModeHandler = mPredictionModeHandler; // by passing HbInputModeActionFocusRecieved we will be setting the candidate list and keypad mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionFocusRecieved); } else if (newState.inputMode() == HbInputModeDefault) { @@ -551,8 +552,7 @@ // Auto Completion part needs to be committed as well on mode change. previousModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionCommit); - if (mActiveModeHandler == mPredictionModeHandler || - mActiveModeHandler == mPrediction12keyThaiHandler) { + if (mActiveModeHandler == mPredictionModeHandler) { // lets set candidate list and keypad type to the engine. mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionSetCandidateList); mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionSetKeypad); @@ -567,7 +567,7 @@ */ void HbVirtual12Key::loadKeymap(const HbInputLanguage &newLanguage) { - //dont try to get the keymappings if we ( mKeyData) already have keymappings for newLanguage + //don't try to get the keymappings if we ( mKeyData) already have keymappings for newLanguage if (!mKeymap || mKeymap->language().language() != newLanguage.language()) { const HbKeymap* keymap = HbKeymapFactory::instance()->keymap(newLanguage); if(keymap) { @@ -586,15 +586,9 @@ if (mPredictionModeHandler) { mPredictionModeHandler->setKeymap(mKeymap); } - if (mNumericModeHandler) { + if(mNumericModeHandler) { mNumericModeHandler->setKeymap(mKeymap); - } - if (mBasic12keyThaiHandler) { - mBasic12keyThaiHandler->setKeymap(mKeymap); - } - if (mPrediction12keyThaiHandler) { - mPrediction12keyThaiHandler->setKeymap(mKeymap); - } + } } } } @@ -655,46 +649,6 @@ switchToAlphaMode(); } } -/*! -Returns previous character from editor -*/ -uint HbVirtual12Key::previousChar() -{ - if (focusObject()) { - int cursorPosition = focusObject()->editorCursorPosition(); - if (cursorPosition) { - QString editorText = focusObject()->editorSurroundingText(); - return((editorText.at(cursorPosition-1)).unicode()); - } - } - return 0; -} -/*! -Shows the Thai specific special characters -*/ -void HbVirtual12Key::showThaiSpecialCharacters(uint buttonId) -{ - uint prevChar = previousChar(); - int screenWidth = 0; - int screenHeight = 0; - //Get the sceen size from device profile - if (mCurrentKeypad) { - screenWidth = HbDeviceProfile::profile(mCurrentKeypad).logicalSize().width(); - screenHeight = HbDeviceProfile::profile(mCurrentKeypad).logicalSize().height(); - } - //Create Thai special popup if not created - if( !mThaiSpecialChar) { - mThaiSpecialChar = new HbInputThaiSpecialPopup(buttonId,prevChar,0); - connect(mThaiSpecialChar, SIGNAL(chrSelected(QString)), - this, SLOT(thaiSctCharacterSelected(QString))); - } - //Set Geometry and Layout for popup - if (mThaiSpecialChar) { - mThaiSpecialChar->setGeometry(QRectF(0,screenHeight/2,screenWidth,screenHeight/2)); - mThaiSpecialChar->setPopupLayout(mKeymap,prevChar,buttonId,screenWidth,screenHeight/2); - mThaiSpecialChar->show(); - } -} /*! Shows the special character table. Re-implements the same method from HbInputMethod. @@ -751,8 +705,9 @@ if (!mCandidatePopup) { mCandidatePopup = new HbCandidateList(this); connect(mCandidatePopup, SIGNAL(candidateSelected(int,QString)), this, SLOT(candidatePopupClosed(int,QString))); + QObject::connect(mCandidatePopup,SIGNAL(launchSpellQueryDialog()),mPredictionModeHandler,SLOT(launchSpellQueryDialog())); } - mCandidatePopup->populateList(candidates); + mCandidatePopup->populateList(candidates,true); mCandidatePopup->setModal(true); QSizeF candListSize = mCandidatePopup->size(); @@ -802,18 +757,10 @@ mActiveModeHandler->smileySelected(smiley); } -void HbVirtual12Key::thaiSctCharacterSelected(QString sctChar) -{ - mActiveModeHandler->sctCharacterSelected(sctChar); - /* Update the text case */ - updateState(); -} - - void HbVirtual12Key::selectSpecialCharacterTableMode() { if (mItutKeypad) { - mItutKeypad->showSmileyPicker(HbSmileyNumberOfRows, HbSmileyNumberOfColumns); + mItutKeypad->showSmileyPicker(); } } @@ -843,6 +790,7 @@ if (!mCandidatePopup) { mCandidatePopup = new HbCandidateList(this); connect(mCandidatePopup, SIGNAL(candidateSelected(int,QString)), this, SLOT(candidatePopupClosed(int,QString))); + QObject::connect(mCandidatePopup,SIGNAL(launchSpellQueryDialog()),mPredictionModeHandler,SLOT(launchSpellQueryDialog())); } if (candidates.count() > 0) { @@ -875,15 +823,4 @@ return false; } -/*! -This function returns true if the latest mouse release was part of a horizontal flick event -*/ -HbInputVkbWidget::HbFlickDirection HbVirtual12Key::flickDirection() const -{ - if (mCurrentKeypad) { - return mCurrentKeypad->flickDirection(); - } else { - return HbInputVkbWidget::HbFlickDirectionNone; - } -} // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/virtual12key.h --- a/src/hbplugins/inputmethods/touchinput/virtual12key.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/virtual12key.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,6 @@ class HbInputVkbWidget; class Hb12KeyTouchKeyboard; class HbSctKeyboard; -class HbInputThaiSpecialPopup; class HbCandidateList; class HbPredictionEngine; class HbAction; @@ -46,8 +45,6 @@ class HbInputPrediction12KeyHandler; class HbInputBasic12KeyHandler; class HbInputNumeric12KeyHandler; -class HbInputBasic12KeyThaiHandler; -class HbInputPrediction12KeyThaiHandler; class HbVirtual12Key : public HbInputAbstractMethod { @@ -85,16 +82,13 @@ void showAutoCompletionFieldCandidates(); void initializeModeHandlers(); bool isSctModeActive() const; - HbInputVkbWidget::HbFlickDirection flickDirection() const; void launchCandidatePopup(const QStringList& candidates); void closeKeypad(); void selectSpecialCharacterTableMode(); void launchAutoCompletionPopup(const QStringList &candidates); void closeAutoCompletionPopup(); void switchMode(int keyCode); - void showThaiSpecialCharacters(uint buttonId); void starKeySelected(); - uint previousChar(); HbKeyboardType currentKeyboardType() const; private: void openKeypad(HbInputVkbWidget * keypadToOpen,bool inMinimizedMode = false); @@ -115,18 +109,17 @@ void mouseMovedOutOfButton(); void smileySelected(QString smiley); void predictiveInputStateChanged(HbKeyboardSettingFlags keyboardType, bool newState); - void thaiSctCharacterSelected(QString sctChar); + void aboutToActivateCustomAction(HbAction *custAction); + void autocompletionStateChanged(HbKeyboardSettingFlags keyboardType, bool newState); private: - // mCurrentKeypad contains currently active keypad, we dont need to have + // mCurrentKeypad contains currently active keypad, we don't need to have // anyother variables to tell us which is current keypad QPointer mCurrentKeypad; // contains itut keypad QPointer mItutKeypad; // contains sct keypad QPointer mSctKeypad; - // contains Thai special characters - QPointer mThaiSpecialChar; //Owned by the keymap factory const HbKeymap* mKeymap; @@ -141,9 +134,7 @@ HbInputPrediction12KeyHandler *mPredictionModeHandler; HbInputBasic12KeyHandler *mBasicModeHandler; HbInputNumeric12KeyHandler *mNumericModeHandler; - HbInputBasic12KeyThaiHandler *mBasic12keyThaiHandler; - HbInputPrediction12KeyThaiHandler *mPrediction12keyThaiHandler; - + QPointer mVkbHost; bool mKeyboardChangeAlreadyInprogress; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/virtualqwerty.cpp --- a/src/hbplugins/inputmethods/touchinput/virtualqwerty.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/virtualqwerty.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -86,6 +86,12 @@ connect(this, SIGNAL(autoCompletionPopupClosed(QString, int)), mBasicModeHandler, SLOT(autoCompletionPopupClosed(QString, int))); connect(HbInputSettingProxy::instance(), SIGNAL(predictiveInputStateChanged(HbKeyboardSettingFlags,bool)), this, SLOT(predictiveInputStateChanged(HbKeyboardSettingFlags,bool))); + connect(HbInputSettingProxy::instance(), SIGNAL(primaryCandidateModeChanged(HbPrimaryCandidateMode)), this, SLOT(primaryCandidateModeChanged(HbPrimaryCandidateMode))); + connect(HbInputSettingProxy::instance(), SIGNAL(autocompletionStateChanged(HbKeyboardSettingFlags,bool)), this, SLOT(autocompletionStateChanged(HbKeyboardSettingFlags,bool))); + connect(HbInputSettingProxy::instance(), SIGNAL(typingCorrectionLevelChanged(HbTypingCorrectionLevel)), this, SLOT(typingCorrectionLevelChanged(HbTypingCorrectionLevel))); + mPredictionModeHandler->setPrimaryCandidateMode(HbInputSettingProxy::instance()->primaryCandidateMode()); + mPredictionModeHandler->setAutocompletionStatus(HbInputSettingProxy::instance()->isAutocompletionEnabled(HbKeyboardSettingQwerty)); + mPredictionModeHandler->setTypingCorrectionLevel(HbInputSettingProxy::instance()->typingCorrectionLevel()); } // --------------------------------------------------------------------------- @@ -158,7 +164,7 @@ else if (automaticTextCaseNeeded()) { state.setTextCase(HbTextCaseAutomatic); } - state.inputMode() = HbInputModeDefault; + state.setInputMode(HbInputModeDefault); activateState(state); inputStateToEditor(state); } @@ -207,6 +213,7 @@ disconnect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), mActiveModeHandler, SLOT(cursorPositionChanged(int, int))); connect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), mActiveModeHandler, SLOT(cursorPositionChanged(int, int))); } + HbInputAbstractMethod::focusReceived(); } void HbVirtualQwerty::focusLost(bool focusSwitch) @@ -217,6 +224,7 @@ disconnect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), mActiveModeHandler, SLOT(cursorPositionChanged(int, int))); } + closeExactWordPopup(); if (!focusSwitch) { if (mVkbHost && mVkbHost->keypadStatus() != HbVkbHost::HbVkbStatusClosed) { // Context switch has happened but the keypad is still open. @@ -241,10 +249,10 @@ void HbVirtualQwerty::openKeypad(HbInputVkbWidget * keypadToOpen,bool inMinimizedMode ) { // if null is sent, just return. - if(!keypadToOpen) { + if(!keypadToOpen || !focusObject()) { return; } - bool wasKeypadOpen = false; + bool disableAnimation = false; // see if we are trying to open a different keypad than what is already opened. if (mCurrentKeypad != keypadToOpen) { // close currently open keypad. We always close keypad without animation @@ -254,41 +262,48 @@ mVkbHost->closeKeypad(false); // when their is a keypad that needs to be closed before opening the new keypad, we don't // want to animate the opening of new keypad. - wasKeypadOpen = true; + disableAnimation = true; } } // Close candidate popup if open if (mCandidatePopup) { mCandidatePopup->hide(); } + + QObject::disconnect(mCurrentKeypad,SIGNAL(aboutToActivateCustomAction(HbAction*)), + this,SLOT(aboutToActivateCustomAction(HbAction*))); + QObject::connect(keypadToOpen,SIGNAL(aboutToActivateCustomAction(HbAction*)), + this,SLOT(aboutToActivateCustomAction(HbAction*))); + // assign new keypad to be opened to varable mCurrentKeypad mCurrentKeypad = keypadToOpen; + activeKeyboardChanged(currentKeyboardType()); + if (mVkbHost && mVkbHost->keypadStatus() != HbVkbHost::HbVkbStatusOpened) { connect(mVkbHost, SIGNAL(keypadClosed()), this, SLOT(keypadClosed())); if (inMinimizedMode) { mVkbHost->openMinimizedKeypad(mCurrentKeypad, this); } else { - mVkbHost->openKeypad(mCurrentKeypad, this, !wasKeypadOpen); + mVkbHost->openKeypad(mCurrentKeypad, this, !disableAnimation); } - // If previous focused editor was numeric, prediction is disabled. - // Enable prediction if prediction was set in alpha editor prior - // to focusing numeric editor. -/* if (mPrevKeypadMode == EModeAbc && HbInputModeLatinPredictive == mPreviousInputMode) { - mMode = HbInputModeLatinPredictive; - } else if (mPrevKeypadMode == EModeNumeric && HbInputModeLatinPredictive == mMode) { - // If the previous focused editor was alpha and if prediction is - // on, disable prediction. Store the previous state because if - // any alpha editor is focused next, the previous prediction state - // should be enabled. - mMode = HbInputModeDefault; - mPreviousInputMode = HbInputModeLatinPredictive; - } */ - connect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), mVkbHost, SLOT(ensureCursorVisibility())); + if (focusObject()) { + connect(&(focusObject()->editorInterface()), SIGNAL(cursorPositionChanged(int, int)), + mVkbHost, SLOT(ensureCursorVisibility())); + } } } +/*! +vkb widget is about to call a custom action that is mapped to one of the keypad buttons. +*/ +void HbVirtualQwerty::aboutToActivateCustomAction(HbAction *custAction) +{ + Q_UNUSED(custAction); + mActiveModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionCommit); +} + HbInputVkbWidget* HbVirtualQwerty::constructKeyboard(HbKeypadMode currentInputType) { HbInputVkbWidget *keyboard = 0; @@ -329,9 +344,11 @@ void HbVirtualQwerty::keypadClosed() { - if (mOrientationAboutToChange) { - mOrientationAboutToChange = false; - } + mOrientationAboutToChange = false; + + if (mVkbHost->keypadStatus() == HbVkbHost::HbVkbStatusMinimized) { + closeExactWordPopup(); + } } void HbVirtualQwerty::keypadCloseEventDetected(HbInputVkbWidget::HbVkbCloseMethod vkbCloseMethod) @@ -344,7 +361,14 @@ if (mCandidatePopup) { mCandidatePopup->hide(); } - mVkbHost->minimizeKeypad(!stateChangeInProgress()); + + // Close input. + QInputContext* ic = qApp->inputContext(); + if (ic) { + QEvent *closeEvent = new QEvent(QEvent::CloseSoftwareInputPanel); + ic->filterEvent(closeEvent); + delete closeEvent; + } } } } @@ -361,17 +385,14 @@ // load the new key keymappings for newLanguage to all keypads and all mode handlers loadKeymap(aNewLanguage); - if (mCurrentKeypad && mCurrentKeypad != mQwertyAlphaKeypad - && mCurrentKeypad != mQwertyNumericKeypad) { - mCurrentKeypad->animKeyboardChange(); - openKeypad(mQwertyAlphaKeypad); - } - - mPredictionModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionPrimaryLanguageChanged); - if (mCurrentKeypad){ + if (focusObject() && mCurrentKeypad) { + if (mCurrentKeypad != mQwertyAlphaKeypad && mCurrentKeypad != mQwertyNumericKeypad) { + mCurrentKeypad->animKeyboardChange(); + openKeypad(mQwertyAlphaKeypad); + } mCurrentKeypad->animKeyboardChange(); } - + mPredictionModeHandler->actionHandler(HbInputModeHandler::HbInputModeActionPrimaryLanguageChanged); } void HbVirtualQwerty::inputStateActivated(const HbInputState& newState) @@ -431,7 +452,7 @@ void HbVirtualQwerty::loadKeymap(const HbInputLanguage &newLanguage) { // inform all the mode handler about the language change. - //dont try to get the keymappings if we ( mKeyData) already have keymappings for newLanguage + //don't try to get the keymappings if we ( mKeyData) already have keymappings for newLanguage if (!mKeymap || mKeymap->language() != newLanguage) { const HbKeymap* keymap = HbKeymapFactory::instance()->keymap(newLanguage); @@ -505,7 +526,7 @@ void HbVirtualQwerty::selectSpecialCharacterTableMode() { mQwertyAlphaKeypad = constructKeyboard(EModeAbc); - mQwertyAlphaKeypad->showSmileyPicker(4, 10); + mQwertyAlphaKeypad->showSmileyPicker(); } /*! @@ -677,6 +698,22 @@ } } +void HbVirtualQwerty::primaryCandidateModeChanged(HbPrimaryCandidateMode mode) +{ + mPredictionModeHandler->setPrimaryCandidateMode(mode); +} + +void HbVirtualQwerty::autocompletionStateChanged(HbKeyboardSettingFlags keyboardType, bool newState) +{ + if (keyboardType & HbKeyboardSettingQwerty) { + mPredictionModeHandler->setAutocompletionStatus(newState); + } +} + +void HbVirtualQwerty::typingCorrectionLevelChanged(HbTypingCorrectionLevel correctionLevel) +{ + mPredictionModeHandler->setTypingCorrectionLevel(correctionLevel); +} /*! this function is called whenever there is a hardware keypress Or virtual keypad button is pressed. */ @@ -697,7 +734,7 @@ { if (!mExactWordPopup) { mExactWordPopup = HbExactWordPopup::instance(); - connect(mExactWordPopup, SIGNAL(exactWordSelected()), mPredictionModeHandler, SLOT(exactWordPopupClosed())); + connect(mExactWordPopup, SIGNAL(exactWordSelected()), mPredictionModeHandler, SLOT(exactWordSelected())); } mExactWordPopup->setText(exactWord); mExactWordPopup->showText(getCursorCoordinatePosition()); @@ -716,7 +753,19 @@ QPointF HbVirtualQwerty::getCursorCoordinatePosition() { QRectF microRect = focusObject()->microFocus(); - return microRect.topLeft(); + QPointF cursorPos = microRect.topLeft(); + + if (mVkbHost) { + QSizeF exactPopupSize = mExactWordPopup->size(); + QRectF activeViewRect = mVkbHost->applicationArea(); + // if the exact word doesnt fit inside the visible area, then show it on the right side of + // the current cursor position + if (microRect.left() + exactPopupSize.width() > activeViewRect.width()) { + qreal startPos = microRect.left() - exactPopupSize.width(); + cursorPos.setX((startPos > activeViewRect.left()) ? startPos : activeViewRect.left()); + } + } + return cursorPos; } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbplugins/inputmethods/touchinput/virtualqwerty.h --- a/src/hbplugins/inputmethods/touchinput/virtualqwerty.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbplugins/inputmethods/touchinput/virtualqwerty.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,6 +41,7 @@ class HbCandidateList; class HbExactWordPopup; class HbSctKeyboard; +class HbAction; class HbInputModeHandler; class HbInputBasicQwertyHandler; @@ -73,7 +74,10 @@ void mouseMovedOutOfButton(); void smileySelected(QString smiley); void predictiveInputStateChanged(HbKeyboardSettingFlags keyboardType, bool newState); + void autocompletionStateChanged(HbKeyboardSettingFlags keyboardType, bool newState); + void typingCorrectionLevelChanged(HbTypingCorrectionLevel typingCorrectionLevel); void candidatePopupClosed(int closingKey, const QString& candidate); + void aboutToActivateCustomAction(HbAction *custAction); public: // From HbInputMethod void focusReceived(); @@ -103,6 +107,7 @@ private slots: void candidatePopupCancelled(); + void primaryCandidateModeChanged(HbPrimaryCandidateMode mode); private: void initializePredictiveMode(); @@ -117,7 +122,7 @@ HbInputVkbWidget *constructKeyboard(HbKeypadMode currentInputType); private: - // mCurrentKeypad contains currently active keypad, we dont need to have + // mCurrentKeypad contains currently active keypad, we don't need to have // anyother variables to tell us which is current keypad QPointer mCurrentKeypad; // contains qwerty alpha keypad diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbdevicedialogappserver/hbddappfactorysymbian.cpp --- a/src/hbservers/hbdevicedialogappserver/hbddappfactorysymbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbdevicedialogappserver/hbddappfactorysymbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,11 +23,13 @@ ** ****************************************************************************/ -#include "hbddappfactorysymbian.h" +#include "hbddappfactorysymbian_p.h" +#include #include #include #include +#include // In order to override CCoeAppUi::FrameworkCallsRendezvous() Application/Document/AppUi needs to be // derived from. @@ -50,10 +52,33 @@ { protected: CApaDocument *CreateDocumentL() - {return new (ELeave) DeviceDialogMainDocument(*this);} + {return new (ELeave) DeviceDialogMainDocument(*this);} }; CApaApplication *deviceDialogAppFactory() { return new DeviceDialogMainApplication; } + +HbDeviceDialogServerApp::HbDeviceDialogServerApp(QApplication::QS60MainApplicationFactory factory, + int &argc, char *argv[], Hb::ApplicationFlags flags) : + HbApplication(factory, argc, argv, flags) +{ +} + +// Event filter to block exit +bool HbDeviceDialogServerApp::symbianEventFilter(const QSymbianEvent *event) +{ + if (event->type() == QSymbianEvent::CommandEvent) { + int command = event->command(); + if (command == EAknSoftkeyExit || command == EEikCmdExit) { + return true; // block exit commands + } + } + return false; +} + +// Block application quit() slot +void HbDeviceDialogServerApp::quit() +{ +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbdevicedialogappserver/hbddappfactorysymbian.h --- a/src/hbservers/hbdevicedialogappserver/hbddappfactorysymbian.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbServers module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ -#ifndef HBDDAPPFACTORYSYMBIAN_H -#define HBDDAPPFACTORYSYMBIAN_H - -#include - -class CApaApplication; -#include - -// Device dialog server application needs a custom application factory in order to override -// CCoeAppUi::FrameworkCallsRendezvous() - -CApaApplication *deviceDialogAppFactory(); - -#endif // HBDDAPPFACTORYSYMBIAN_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbdevicedialogappserver/hbddappfactorysymbian_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbdevicedialogappserver/hbddappfactorysymbian_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ +#ifndef HBDDAPPFACTORYSYMBIAN_P_H +#define HBDDAPPFACTORYSYMBIAN_P_H + +#include +#include + +class CApaApplication; + +// Device dialog server application needs a custom application factory in order to override +// CCoeAppUi::FrameworkCallsRendezvous() +CApaApplication *deviceDialogAppFactory(); + +// Derive from HbApplication to block exit +class HbDeviceDialogServerApp : public HbApplication +{ + Q_OBJECT + +public: + HbDeviceDialogServerApp(QApplication::QS60MainApplicationFactory factory, + int &argc, char *argv[], Hb::ApplicationFlags flags = Hb::DefaultApplicationFlags); + bool symbianEventFilter(const QSymbianEvent *event); + +public slots: + static void quit(); +}; + +#endif // HBDDAPPFACTORYSYMBIAN_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbdevicedialogappserver/hbdevicedialogappserver.pro --- a/src/hbservers/hbdevicedialogappserver/hbdevicedialogappserver.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbdevicedialogappserver/hbdevicedialogappserver.pro Thu Jul 22 16:36:53 2010 +0100 @@ -38,6 +38,7 @@ symbian { SOURCES += $$PWD/hbddappfactorysymbian.cpp + HEADERS += $$PWD/hbddappfactorysymbian_p.h TARGET.CAPABILITY = ProtServ SwEvent TrustedUI ReadDeviceData TARGET.UID3 = 0x20022FC5 diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbdevicedialogappserver/main.cpp --- a/src/hbservers/hbdevicedialogappserver/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbdevicedialogappserver/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,13 +31,12 @@ #include #include #include -#include #if defined (Q_OS_SYMBIAN) #include #include #include #include -#include "hbddappfactorysymbian.h" +#include "hbddappfactorysymbian_p.h" #endif // Q_OS_SYMBIAN #if defined (Q_OS_SYMBIAN) @@ -99,7 +98,6 @@ TFullName name; return findHbServer.Next(name) == KErrNone; } - #endif // Q_OS_SYMBIAN #define USE_LOCKER 1 @@ -134,8 +132,9 @@ } _LIT(KThreadName, "hbdevdlgsrvapp"); RThread().RenameMe(KThreadName); // nicer panic info - - HbApplication app(deviceDialogAppFactory, arg, args, Hb::NoSplash); + RThread().SetProcessPriority(EPriorityHigh); + + HbDeviceDialogServerApp app(deviceDialogAppFactory, arg, args, Hb::NoSplash); #else // Q_OS_SYMBIAN HbApplication app(arg, args); #endif // Q_OS_SYMBIAN diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbservers.pro --- a/src/hbservers/hbservers.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbservers.pro Thu Jul 22 16:36:53 2010 +0100 @@ -27,10 +27,10 @@ TEMPLATE = subdirs -SUBDIRS += hbdevicedialogappserver hbthemeserver hbsplashgenerator +SUBDIRS += hbdevicedialogappserver hbsplashgenerator symbian { - SUBDIRS += hbthemeserveroogmplugin + SUBDIRS += hbthemeserver hbthemeserveroogmplugin } include($${HB_SOURCE_DIR}/src/hbcommon.pri) diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashblacklist_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbsplashgenerator/hbsplashblacklist_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBSPLASHBLACKLIST_P_H +#define HBSPLASHBLACKLIST_P_H + +#include + +// List of apps that should use Hb::NoSplash but they don't. +// Showing a splash screen for these does not make sense anyway. +inline QList hbsplash_blacklist() +{ + return QList() + + // started on phone boot + << 0x20022f35 // app/homescreen/homescreenapp/hsapplication + << 0x100058b3 // app/phone/phoneapp/phoneui2 + << 0x2002e67a // app/phone/phoneengine/networkhandlingstarter + + // uses hbapplication but not hbmainwindow + << 0x1028339d // app/devicecontrol/deviceupdateui/deviceupdateqtsp + << 0x2001fe74 // app/messaging/messagingapp/msgnotifications/msgerrornotifier + << 0xe0022e73 // mw/securitysrv/securitydialogs/autolocksrv (this uid cannot be the final one, can it...) + + // started to background and may not need splash anyway + << 0x2002e669 // mw/webruntime/app/widget/wrtwidgetui + + // probably launched on first boot, including for now to prevent mess in startup sequence + << 0x20026f95 // app/firsttimeuse/ftuapplication + + ; +} + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashcompositor_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbsplashgenerator/hbsplashcompositor_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,41 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBSPLASHCOMPOSITOR_P_H +#define HBSPLASHCOMPOSITOR_P_H + +#include + +class HbSplashCompositorInterface +{ +public: + virtual ~HbSplashCompositorInterface() { } + virtual void release() = 0; + virtual void composeToBitmap(void *bitmap, + Qt::Orientation orientation, + int splashExtraFlags) = 0; +}; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashdirs_p.h --- a/src/hbservers/hbsplashgenerator/hbsplashdirs_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbsplashgenerator/hbsplashdirs_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -41,8 +41,7 @@ TInt drive; TChar driveLetter; if (DriveInfo::GetDefaultDrive(driveType, drive) == KErrNone - && DriveInfo::GetDefaultDrive(driveType, driveLetter) == KErrNone) - { + && DriveInfo::GetDefaultDrive(driveType, driveLetter) == KErrNone) { bool driveUsable = true; CCoeEnv *env = CCoeEnv::Static(); if (env) { @@ -53,11 +52,10 @@ // Check if the drive is really internal (devices without internal mass // storage will return the memory card which is not what we want here). if (!(driveStatus & DriveInfo::EDriveInternal) - || !(driveStatus & DriveInfo::EDrivePresent) - || !(driveStatus & DriveInfo::EDriveFormatted) - || (driveStatus & DriveInfo::EDriveCorrupt) - || (driveStatus & DriveInfo::EDriveInUse)) - { + || !(driveStatus & DriveInfo::EDrivePresent) + || !(driveStatus & DriveInfo::EDriveFormatted) + || (driveStatus & DriveInfo::EDriveCorrupt) + || (driveStatus & DriveInfo::EDriveInUse)) { qDebug("[hbsplash] drive not usable, skipping"); driveUsable = false; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashgen_server_symbian.cpp --- a/src/hbservers/hbsplashgenerator/hbsplashgen_server_symbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbsplashgenerator/hbsplashgen_server_symbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,11 +27,19 @@ #include "hbsplashgenerator_p.h" #include "hbsplashdirs_p.h" #include "hbsplashdefs_p.h" +#include "hbsplashblacklist_p.h" +#include "hbsplash_direct_symbian_p.h" +#include "hbsplashcompositor_p.h" #include #include +#include #include +#include +#include #include +const int bitmap_cache_limit = 4; // Must be at least 1. Each bitmap consumes ~1 MB. + #define PRE "[hbsplashgenerator] [server]" TBool HbSplashGenAppUi::FrameworkCallsRendezvous() const @@ -47,12 +55,12 @@ CEikAppUi *HbSplashGenDocument::CreateAppUiL() { qDebug() << PRE << "using custom appui"; - return new (ELeave) HbSplashGenAppUi; + return new(ELeave) HbSplashGenAppUi; } CApaDocument *HbSplashGenApplication::CreateDocumentL() { - return new (ELeave) HbSplashGenDocument(*this); + return new(ELeave) HbSplashGenDocument(*this); } class HbSplashGenServerSymbian : public CServer2 @@ -62,19 +70,39 @@ ~HbSplashGenServerSymbian(); CSession2 *NewSessionL(const TVersion &version, const RMessage2 &message) const; - void setSplashScreenDir(const QString &dir) { mSplashScreenDir = dir; } - void setSplashScreenDirContents(const QStringList &entries) { mSplashScreenDirEntries = entries; } - bool startupSuccess() const { return mStartupSuccess; } - + void setSplashScreenDir(const QString &dir) { + mSplashScreenDir = dir; + } + void setSplashScreenDirContents(const QStringList &entries) { + mSplashScreenDirEntries = entries; + } + bool startupSuccess() const { + return mStartupSuccess; + } + void clearBitmapCache(); + void addCompositor(HbSplashCompositorInterface *compositor) { + mCompositors.append(compositor); + } bool processGetSplash(const RMessage2 &message); private: - bool transferHandle(const RMessage2 &message, const QString &fileName); + struct BitmapCacheData { + CFbsBitmap *mBitmap; + int mExtraSplashFlags; + Qt::Orientation mOrientation; + }; + + bool completeGetSplash(const RMessage2 &message, const QString &fileName, const QString &ori); + void completeWithBitmap(const RMessage2 &message, const BitmapCacheData &data); + const BitmapCacheData *getCachedBitmap(const QString &fileName) const; + void cacheBitmap(const QString &key, const BitmapCacheData &data); bool mStartupSuccess; RFs mFs; QString mSplashScreenDir; QStringList mSplashScreenDirEntries; + QList< QPair > mBitmaps; + QList mCompositors; }; class HbSplashGenServerSession : public CSession2 @@ -93,6 +121,12 @@ { connect(generator, SIGNAL(outputDirContentsUpdated(QString, QStringList)), SLOT(onOutputDirContentsUpdated(QString, QStringList))); + // React immediately on a theme change, showing out-dated graphics + // is never acceptable. + connect(generator, SIGNAL(regenerateStarted()), SLOT(dropCachedData())); + // Clear the cache again when all the screens are regenerated to + // make sure that only the latest ones are used. + connect(generator, SIGNAL(finished()), SLOT(dropCachedData())); } HbSplashGenServer::~HbSplashGenServer() @@ -100,7 +134,8 @@ delete mServer; } -void HbSplashGenServer::onOutputDirContentsUpdated(const QString &dir, const QStringList &entries) +void HbSplashGenServer::onOutputDirContentsUpdated(const QString &dir, + const QStringList &entries) { qDebug() << PRE << "splash screen dir contents received" << dir; qDebug() << PRE << entries; @@ -108,11 +143,21 @@ mServer->setSplashScreenDirContents(entries); } +void HbSplashGenServer::dropCachedData() +{ + mServer->clearBitmapCache(); +} + bool HbSplashGenServer::startupSuccess() const { return mServer->startupSuccess(); } +void HbSplashGenServer::addCompositor(HbSplashCompositorInterface *compositor) +{ + mServer->addCompositor(compositor); +} + HbSplashGenServerSymbian::HbSplashGenServerSymbian() : CServer2(CActive::EPriorityHigh) { @@ -138,31 +183,101 @@ HbSplashGenServerSymbian::~HbSplashGenServerSymbian() { mFs.Close(); + clearBitmapCache(); } -CSession2 *HbSplashGenServerSymbian::NewSessionL(const TVersion &version, const RMessage2 &message) const +CSession2 *HbSplashGenServerSymbian::NewSessionL(const TVersion &version, + const RMessage2 &message) const { Q_UNUSED(message); TVersion v(hbsplash_version_major, hbsplash_version_minor, hbsplash_version_build); if (!User::QueryVersionSupported(v, version)) { User::Leave(KErrNotSupported); } - return new (ELeave) HbSplashGenServerSession(const_cast(this)); + return new(ELeave) HbSplashGenServerSession(const_cast(this)); +} + +void HbSplashGenServerSymbian::clearBitmapCache() +{ + for (int i = 0, ie = mBitmaps.count(); i != ie; ++i) { + delete mBitmaps.at(i).second.mBitmap; + } + mBitmaps.clear(); +} + +const HbSplashGenServerSymbian::BitmapCacheData *HbSplashGenServerSymbian::getCachedBitmap( + const QString &fileName) const +{ + for (int i = 0, ie = mBitmaps.count(); i != ie; ++i) { + if (!mBitmaps.at(i).first.compare(fileName, Qt::CaseInsensitive)) { + return &mBitmaps.at(i).second; + } + } + return 0; } -bool HbSplashGenServerSymbian::transferHandle(const RMessage2 &message, const QString &fileName) +void HbSplashGenServerSymbian::cacheBitmap(const QString &key, const BitmapCacheData &data) +{ + while (mBitmaps.count() >= bitmap_cache_limit) { + delete mBitmaps.at(0).second.mBitmap; + mBitmaps.removeAt(0); + } + mBitmaps.append(QPair(key, data)); +} + +void HbSplashGenServerSymbian::completeWithBitmap(const RMessage2 &message, + const BitmapCacheData &data) { + foreach(HbSplashCompositorInterface * compositor, mCompositors) { + compositor->composeToBitmap(data.mBitmap, data.mOrientation, data.mExtraSplashFlags); + } + TPckg bmpHandle(data.mBitmap->Handle()); + message.Write(3, bmpHandle); + message.Complete(KErrNone); +} + +bool HbSplashGenServerSymbian::completeGetSplash(const RMessage2 &message, + const QString &fileName, + const QString &ori) +{ + bool wantsBitmap = message.Function() == HbSplashSrvGetSplashData; + if (wantsBitmap) { + const BitmapCacheData *cachedBitmapData = getCachedBitmap(fileName); + if (cachedBitmapData) { + qDebug() << PRE << "returning cached bitmap for" << fileName; + completeWithBitmap(message, *cachedBitmapData); + return true; + } + } QDir splashScreenDir(mSplashScreenDir); QString nativeName = QDir::toNativeSeparators(splashScreenDir.filePath(fileName)); qDebug() << PRE << "trying to read" << nativeName; TPtrC nativeNameDes(static_cast(nativeName.utf16()), nativeName.length()); RFile f; if (f.Open(mFs, nativeNameDes, EFileRead | EFileShareReadersOrWriters) == KErrNone) { - TInt err = f.TransferToClient(message, 3); // completes the message with the fs handle - f.Close(); - if (err != KErrNone) { - // the message is not yet completed if TransferToClient() failed - return false; + if (wantsBitmap) { + BitmapCacheData data; + data.mBitmap = static_cast( + HbSplashDirectSymbian::load(&f, &data.mExtraSplashFlags)); + f.Close(); + if (data.mBitmap) { + data.mOrientation = Qt::Vertical; + if (!ori.compare(QLatin1String("lsc"), Qt::CaseInsensitive)) { + data.mOrientation = Qt::Horizontal; + } + cacheBitmap(fileName, data); + completeWithBitmap(message, data); + } else { + qWarning() << PRE << "splash load failed"; + return false; + } + } else { + TInt err = f.TransferToClient(message, 3); // completes the message with the fs handle + f.Close(); + if (err != KErrNone) { + // the message is not yet completed if TransferToClient() failed + return false; + } } } else { qWarning() << PRE << "could not open" << nativeName; @@ -217,6 +332,12 @@ } } + // No splash screen for blacklisted clients. + if (hbsplash_blacklist().contains(message.SecureId().iId)) { + qWarning() << PRE << "app is blacklisted"; + return false; + } + // First check for file existence without filesystem access by using the directory // listing received from the generator. This prevents wasting time with unnecessary // Open() calls. @@ -245,22 +366,22 @@ usingAppSpecific = true; } - bool transferred = transferHandle(message, name); - if (!transferred) { + bool completed = completeGetSplash(message, name, orientation); + if (!completed) { // If the screens are just being regenerated then there is a chance that // the app-specific file is not yet ready but the generic one is already // there (and the directory listing checked before is out-of-date). So // try the generic file too. if (usingAppSpecific) { - transferred = transferHandle(message, genericName); + completed = completeGetSplash(message, genericName, orientation); } - if (!transferred) { - qWarning() << PRE << "could not transfer file handle"; + if (!completed) { + qWarning() << PRE << "could not complete getSplash request"; return false; } } - qDebug() << PRE << "file handle transfered"; + qDebug() << PRE << "getSplash request completed"; if (!cachedEntryListValid) { // Set the splash dir back to empty so future invocations can also // recognize that the generator has not notified us yet. @@ -285,17 +406,24 @@ /* Supported functions: - EHbSplashSrvGetSplash + EHbSplashSrvGetSplashFile param 0 [in] requested orientation ("prt" or "lsc") param 1 [in] empty or uid (currently ignored if does not match the client's secure id) param 2 [in] empty or screen id param 3 [out] RFile handle (file is open for read) Request is completed with RFs handle or KErrNotFound. + + EHbSplashSrvGetSplashData + param 0 [in] requested orientation ("prt" or "lsc") + param 1 [in] empty or uid (currently ignored if does not match the client's secure id) + param 2 [in] empty or screen id + param 3 [out] CFbsBitmap handle */ qDebug() << PRE << "ServiceL" << message.Function() << QString::number(message.SecureId().iId, 16); switch (message.Function()) { - case HbSplashSrvGetSplash: + case HbSplashSrvGetSplashFile: // fallthrough + case HbSplashSrvGetSplashData: if (!mServer->processGetSplash(message)) { message.Complete(KErrNotFound); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashgen_server_symbian_p.h --- a/src/hbservers/hbsplashgenerator/hbsplashgen_server_symbian_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbsplashgenerator/hbsplashgen_server_symbian_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -34,6 +34,7 @@ class HbSplashGenerator; class HbSplashGenServerSymbian; +class HbSplashCompositorInterface; class HbSplashGenServer : public QObject { @@ -43,9 +44,11 @@ HbSplashGenServer(HbSplashGenerator *generator); ~HbSplashGenServer(); bool startupSuccess() const; + void addCompositor(HbSplashCompositorInterface *compositor); private slots: void onOutputDirContentsUpdated(const QString &dir, const QStringList &entries); + void dropCachedData(); private: HbSplashGenServerSymbian *mServer; diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashgenerator.cpp --- a/src/hbservers/hbsplashgenerator/hbsplashgenerator.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbsplashgenerator/hbsplashgenerator.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,6 +25,7 @@ #include "hbsplashgenerator_p.h" #include "hbsplashdirs_p.h" +#include "hbsplashdefs_p.h" #include "hbmainwindow.h" #include "hbmainwindow_p.h" #include "hbinstance.h" @@ -45,19 +46,37 @@ #include #include #include +#include #include #include #include +#if defined(Q_OS_SYMBIAN) +#include +#include +#endif + const char *last_theme_key = "lasttheme"; const char *last_lang_key = "lastlang"; const char *last_file_count_key = "lastfilecount"; const char *last_output_dir_key = "lastoutdir"; HbSplashGenerator::HbSplashGenerator() - : mBusy(false), mForceRegen(false), mMainWindow(0), mFirstRegenerate(true), - mSettings("Nokia", "HbSplash") + : mMainWindowLocked(false), + mProcessQueuePending(false), + mForceRegen(false), + mMainWindow(0), + mFirstRegenerate(true) { +#if defined(Q_OS_SYMBIAN) + CCoeEnv::Static()->FsSession().CreatePrivatePath(EDriveC); + QString iniFileName = QString("c:/private/%1/hbsplashgen.ini") + .arg(QString::number(hbsplash_server_uid3.iUid, 16)); + mSettings = new QSettings(iniFileName, QSettings::IniFormat, this); +#else + mSettings = new QSettings("Nokia", "Hb", this); + mSettings->beginGroup("Splash"); +#endif // Effects on decorators (started when they are shown) would ruin // the screenshot. So disable everything (except the orientation // switch effect which is needed for a proper rotated image). @@ -117,7 +136,7 @@ // Watch also the directories containing splashml files. Files may // be added/updated at any time. connect(&mFsWatcher, SIGNAL(directoryChanged(QString)), SLOT(onDirectoryChanged(QString))); - foreach (const QString &dir, hbsplash_splashml_dirs()) { + foreach(const QString & dir, hbsplash_splashml_dirs()) { // Check for directory existence before calling addPath() to // avoid printing warnings. if (QDir(dir).exists()) { @@ -129,10 +148,10 @@ // number of files in the splash screen directory, or the splash screen // directory path is different than the recorded values. (or when // regeneration is forced via command line arg) - QString lastTheme = mSettings.value(QLatin1String(last_theme_key)).toString(); - QString lastLang = mSettings.value(QLatin1String(last_lang_key)).toString(); - int lastFileCount = mSettings.value(QLatin1String(last_file_count_key)).toInt(); - QString lastOutputDir = mSettings.value(QLatin1String(last_output_dir_key)).toString(); + QString lastTheme = mSettings->value(QLatin1String(last_theme_key)).toString(); + QString lastLang = mSettings->value(QLatin1String(last_lang_key)).toString(); + int lastFileCount = mSettings->value(QLatin1String(last_file_count_key)).toInt(); + QString lastOutputDir = mSettings->value(QLatin1String(last_output_dir_key)).toString(); QString currentTheme = theme->name(); QString currentLang = QLocale::system().name(); QString currentOutputDir = hbsplash_output_dir(); @@ -140,11 +159,11 @@ qDebug() << PRE << "last regen:" << lastTheme << lastLang << lastFileCount << lastOutputDir << "current:" << currentTheme << currentLang << currentFileCount << currentOutputDir; if (mForceRegen - || currentTheme != lastTheme - || currentLang != lastLang - || currentFileCount != lastFileCount - || currentOutputDir != lastOutputDir) - { + || currentFileCount == 0 // not having any files is wrong for sure + || currentTheme != lastTheme + || currentLang != lastLang + || currentFileCount != lastFileCount + || currentOutputDir != lastOutputDir) { QMetaObject::invokeMethod(this, "regenerate", Qt::QueuedConnection); } } @@ -163,6 +182,7 @@ qDebug() << PRE << "regenerate() theme:" << themeName; if (!themeName.isEmpty()) { try { + emit regenerateStarted(); QTime queuePrepTime; queuePrepTime.start(); // Delete existing splash screens. This is important because apps @@ -173,7 +193,7 @@ QDir outDir(hbsplash_output_dir()); if (outDir.exists()) { QStringList names = outDir.entryList(QStringList() << "*", QDir::Files); - foreach (const QString &name, names) { + foreach(const QString & name, names) { outDir.remove(name); } } @@ -202,13 +222,17 @@ } } -void HbSplashGenerator::regenerateOne(const QString &splashmlFileName) +void HbSplashGenerator::regenerateOne(const QString &splashmlFileName, const QString &customTrDir) { mQueue.clear(); QueueItem item(hbInstance->theme()->name(), Qt::Vertical); - item.mWorkDirForSingleFileRegen = QFileInfo(splashmlFileName).path(); // e.g. for translations + QString path = QFileInfo(splashmlFileName).path(); + item.mCustomTrDirs.append(path); + if (!customTrDir.isEmpty()) { + item.mCustomTrDirs.append(customTrDir); + } parseSplashml(splashmlFileName, item); - item.mDocmlFileName = QDir(item.mWorkDirForSingleFileRegen).filePath(item.mDocmlFileName); + item.mDocmlFileName = QDir(path).filePath(item.mDocmlFileName); mQueue.enqueue(item); // generate it regardless of the fixed orientation setting item.mOrientation = Qt::Horizontal; mQueue.enqueue(item); @@ -245,34 +269,29 @@ // the settings and stop. if (mQueue.isEmpty()) { qDebug() << PRE << "queue is empty regen finished"; - mSettings.setValue(last_theme_key, hbInstance->theme()->name()); - mSettings.setValue(last_lang_key, QLocale::system().name()); + mSettings->setValue(last_theme_key, hbInstance->theme()->name()); + mSettings->setValue(last_lang_key, QLocale::system().name()); QString outDir = hbsplash_output_dir(); - mSettings.setValue(last_file_count_key, updateOutputDirContents(outDir)); - mSettings.setValue(last_output_dir_key, outDir); + mSettings->setValue(last_file_count_key, updateOutputDirContents(outDir)); + mSettings->setValue(last_output_dir_key, outDir); emit finished(); qDebug() << PRE << "processQueue() over"; return; } - // If a previous splash generation is still in progress then do nothing. - if (mBusy) { + // If a previous splash generation is still in progress or a compositor is + // working then do nothing. + if (!lockMainWindow()) { + mProcessQueuePending = true; qDebug() << PRE << "still busy processQueue() over"; return; } try { - mBusy = true; + mProcessQueuePending = false; mItem = mQueue.dequeue(); mItemTime.start(); log("generating splash screen", mItem.mThemeName, mItem.mOrientation); - if (!mMainWindow) { - // The FixedVertical flag is used just to disable the sensor-based - // orientation switching. - mMainWindow = new HbMainWindow(0, Hb::WindowFlagFixedVertical); - // Make sure that at least the 1st phase of the delayed - // construction is done right now. - HbMainWindowPrivate::d_ptr(mMainWindow)->_q_delayedConstruction(); - } + ensureMainWindow(); mMainWindow->setOrientation(mItem.mOrientation, false); qDebug() << PRE << "mainwindow init time (ms):" << mItemTime.elapsed(); @@ -290,6 +309,19 @@ qDebug() << PRE << "processQueue() over"; } +HbMainWindow *HbSplashGenerator::ensureMainWindow() +{ + if (!mMainWindow) { + // The FixedVertical flag is used just to disable the sensor-based + // orientation switching. + mMainWindow = new HbMainWindow(0, Hb::WindowFlagFixedVertical); + // Make sure that at least the 1st phase of the delayed + // construction is done right now. + HbMainWindowPrivate::d_ptr(mMainWindow)->_q_delayedConstruction(); + } + return mMainWindow; +} + void HbSplashGenerator::processWindow() { // Take the screenshot, remove content, and move on to the next request in the queue. @@ -298,13 +330,13 @@ qDebug() << PRE << "total time for screen (ms):" << mItemTime.elapsed(); QList views = mMainWindow->views(); - foreach (HbView *view, views) { + foreach(HbView * view, views) { mMainWindow->removeView(view); delete view; } clearTranslators(); - mBusy = false; + unlockMainWindowInternal(); QMetaObject::invokeMethod(this, "processQueue", Qt::QueuedConnection); log("processWindow() over", mItem.mThemeName, mItem.mOrientation); } @@ -325,7 +357,7 @@ t.start(); QString splashFile = splashFileName(); qDebug() << PRE << "saving to" << splashFile; - if (saveSpl(splashFile, image)) { + if (saveSpl(splashFile, image, mItem.mFlagsToStore)) { #if !defined(Q_OS_SYMBIAN) && defined(QT_DEBUG) image.save(splashFile + QLatin1String(".png")); #endif @@ -362,27 +394,22 @@ return splashFile; } -// helper to avoid calling the non-const version of QImage::bits() -inline const uchar *imageBits(const QImage &image) -{ - return image.bits(); -} - -bool HbSplashGenerator::saveSpl(const QString &nameWithoutExt, const QImage &image) +bool HbSplashGenerator::saveSpl(const QString &nameWithoutExt, const QImage &image, quint32 extra) { QString fn(nameWithoutExt); fn.append(".spl"); QFile f(fn); if (f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - int w = image.width(); - int h = image.height(); - int bpl = image.bytesPerLine(); - QImage::Format fmt = image.format(); - f.write((char *) &w, sizeof(int)); - f.write((char *) &h, sizeof(int)); - f.write((char *) &bpl, sizeof(int)); - f.write((char *) &fmt, sizeof(QImage::Format)); - f.write((const char *) imageBits(image), bpl * h); + quint32 w = (quint32) image.width(); + quint32 h = (quint32) image.height(); + quint32 bpl = (quint32) image.bytesPerLine(); + qint32 fmt = (qint32) image.format(); + f.write((char *) &w, sizeof(quint32)); + f.write((char *) &h, sizeof(quint32)); + f.write((char *) &bpl, sizeof(quint32)); + f.write((char *) &fmt, sizeof(qint32)); + f.write((char *) &extra, sizeof(quint32)); + f.write((const char *) image.bits(), bpl * h); f.close(); return true; } @@ -395,10 +422,11 @@ delete mMainWindow; mMainWindow = 0; clearTranslators(); - mBusy = false; + unlockMainWindowInternal(); + mProcessQueuePending = false; } -QDebug operator<<(QDebug dbg, const HbSplashGenerator::QueueItem& item) +QDebug operator<<(QDebug dbg, const HbSplashGenerator::QueueItem &item) { dbg << "[" << item.mDocmlFileName @@ -414,13 +442,16 @@ HbSplashGenerator::QueueItem::QueueItem() : mOrientation(Qt::Vertical), - mHideBackground(false) + mHideBackground(false), + mFlagsToStore(0) { } HbSplashGenerator::QueueItem::QueueItem(const QString &themeName, Qt::Orientation orientation) - : mThemeName(themeName), mOrientation(orientation), - mHideBackground(false) + : mThemeName(themeName), + mOrientation(orientation), + mHideBackground(false), + mFlagsToStore(0) { } @@ -441,13 +472,13 @@ { QSet processedFileNames; QStringList dirNames(hbsplash_splashml_dirs()); - foreach (const QString &dirName, dirNames) { + foreach(const QString & dirName, dirNames) { QDir dir(dirName); if (!dir.exists()) { continue; } QStringList entries = dir.entryList(QStringList() << "*.splashml", QDir::Files); - foreach (const QString &entry, entries) { + foreach(const QString & entry, entries) { // Skip if a file with the same name has already been processed from // a different location. if (processedFileNames.contains(entry)) { @@ -468,10 +499,9 @@ QueueItem item(themeName, orientation); bool ok = parseSplashml(fullName, item); if (ok - && !item.mAppId.isEmpty() - && !item.mDocmlWidgetName.isEmpty() - && !item.mDocmlFileName.isEmpty()) - { + && !item.mAppId.isEmpty() + && !item.mDocmlWidgetName.isEmpty() + && !item.mDocmlFileName.isEmpty()) { // Add the full path to the filename. The docml is supposed to // be in the same directory as the splashml. item.mDocmlFileName = dir.filePath(item.mDocmlFileName); @@ -505,8 +535,7 @@ ok = false; break; } else if (token == QXmlStreamReader::StartElement - && xml.name() == QLatin1String("hbsplash")) - { + && xml.name() == QLatin1String("hbsplash")) { docOk = true; } else if (docOk) { parseSplashmlElements(xml, item, fullFileName); @@ -524,8 +553,8 @@ } void HbSplashGenerator::parseSplashmlElements(QXmlStreamReader &xml, - QueueItem &item, - const QString &fullFileName) + QueueItem &item, + const QString &fullFileName) { if (xml.isStartElement()) { QStringRef name = xml.name(); @@ -535,7 +564,7 @@ item.mDocmlWidgetName = xml.readElementText().trimmed(); } else if (name == QLatin1String("appid") || name == QLatin1String("appuid")) { item.mAppId = xml.readElementText().trimmed(); - if (item.mAppId.startsWith("0x")) { + if (item.mAppId.startsWith(QLatin1String("0x"))) { item.mAppId.remove(0, 2); } } else if (name == QLatin1String("screenid")) { @@ -543,7 +572,7 @@ } else if (name == QLatin1String("tsappname")) { item.mTsAppName = xml.readElementText().trimmed(); } else if (name == QLatin1String("view-flags")) { - item.mViewFlags = xml.readElementText().split(",", QString::SkipEmptyParts); + item.mViewFlags = xml.readElementText().split(',', QString::SkipEmptyParts); for (int i = 0, ie = item.mViewFlags.count(); i != ie; ++i) { item.mViewFlags[i] = item.mViewFlags[i].trimmed().toLower(); } @@ -589,7 +618,7 @@ req.mFrameGraphicsType = HbFrameDrawer::ThreePiecesVertical; } else if (type == QLatin1String("9")) { req.mFrameGraphicsType = HbFrameDrawer::NinePieces; - } + } QString z = xml.attributes().value("z").toString().trimmed(); if (z.isEmpty()) { req.mZValue = -1; @@ -662,10 +691,12 @@ CustomDocumentLoader loader(mMainWindow, mItem); QStringList sections; if (!mItem.mCondSections.isEmpty()) { - if (mItem.mCondSections.contains("portrait") && mItem.mOrientation == Qt::Vertical) { - sections << mItem.mCondSections.value("portrait"); - } else if (mItem.mCondSections.contains("landscape") && mItem.mOrientation == Qt::Horizontal) { - sections << mItem.mCondSections.value("landscape"); + QLatin1String prtKey("portrait"); + QLatin1String lscKey("landscape"); + if (mItem.mCondSections.contains(prtKey) && mItem.mOrientation == Qt::Vertical) { + sections << mItem.mCondSections.value(prtKey); + } else if (mItem.mCondSections.contains(lscKey) && mItem.mOrientation == Qt::Horizontal) { + sections << mItem.mCondSections.value(lscKey); } } sections << mItem.mForcedSections; @@ -673,7 +704,7 @@ bool ok; loader.load(mItem.mDocmlFileName, &ok); if (ok && !sections.isEmpty()) { - foreach (const QString §ion, sections) { + foreach(const QString & section, sections) { qDebug() << PRE << "loading" << mItem.mDocmlFileName << "section" << section; loader.load(mItem.mDocmlFileName, section, &ok); } @@ -700,8 +731,7 @@ for (int i = 0, ie = mItem.mItemBgGraphics.count(); i != ie; ++i) { QueueItem::ItemBgGraphicsRequest req = mItem.mItemBgGraphics.at(i); if ((req.mOrientation == QLatin1String("portrait") && mItem.mOrientation != Qt::Vertical) - || (req.mOrientation == QLatin1String("landscape") && mItem.mOrientation != Qt::Horizontal)) - { + || (req.mOrientation == QLatin1String("landscape") && mItem.mOrientation != Qt::Horizontal)) { continue; } HbWidget *widget = qobject_cast(loader.findWidget(req.mTargetWidgetName)); @@ -717,9 +747,8 @@ void HbSplashGenerator::finishWindow() { - // Process additional settings. + // There must be a view always in order to support view-specific settings. if (mMainWindow->views().isEmpty()) { - // There must be a view always in order to support view-specific settings. mMainWindow->addView(new HbWidget); } @@ -728,32 +757,36 @@ HbView *view = views.at(0); // view-flags - HbView::HbViewFlags viewFlags = HbView::ViewFlagNone; - if (mItem.mViewFlags.contains("tb-minimizable")) { + HbView::HbViewFlags viewFlags = view->viewFlags(); + if (mItem.mViewFlags.contains(QLatin1String("tb-minimizable"))) { viewFlags |= HbView::ViewTitleBarMinimizable; } - if (mItem.mViewFlags.contains("tb-minimized")) { + if (mItem.mViewFlags.contains(QLatin1String("tb-minimized"))) { viewFlags |= HbView::ViewTitleBarMinimized; } - if (mItem.mViewFlags.contains("tb-hidden")) { + if (mItem.mViewFlags.contains(QLatin1String("tb-hidden"))) { viewFlags |= HbView::ViewTitleBarHidden; } - if (mItem.mViewFlags.contains("tb-transparent")) { + if (mItem.mViewFlags.contains(QLatin1String("tb-transparent"))) { viewFlags |= HbView::ViewTitleBarTransparent; } - if (mItem.mViewFlags.contains("tb-floating")) { + if (mItem.mViewFlags.contains(QLatin1String("tb-floating"))) { viewFlags |= HbView::ViewTitleBarFloating; } - if (mItem.mViewFlags.contains("sb-hidden")) { + if (mItem.mViewFlags.contains(QLatin1String("sb-hidden"))) { viewFlags |= HbView::ViewStatusBarHidden; } - if (mItem.mViewFlags.contains("sb-transparent")) { + if (mItem.mViewFlags.contains(QLatin1String("sb-transparent"))) { viewFlags |= HbView::ViewStatusBarTransparent; } - if (mItem.mViewFlags.contains("sb-floating")) { + if (mItem.mViewFlags.contains(QLatin1String("sb-floating"))) { viewFlags |= HbView::ViewStatusBarFloating; } view->setViewFlags(viewFlags); + if (viewFlags.testFlag(HbView::ViewStatusBarHidden) + || viewFlags.testFlag(HbView::ViewStatusBarTransparent)) { + mItem.mFlagsToStore |= HbSplashNonStandardStatusBar; + } // navi-action-icon if (!mItem.mNaviActionIcon.isEmpty()) { @@ -780,7 +813,7 @@ HbBackgroundItem *bgItem = mwd->mBgItem; if (bgItem) { QString backgroundImageName = mItem.mBackgroundImageName.value( - mItem.mOrientation == Qt::Vertical ? "portrait" : "landscape"); + mItem.mOrientation == Qt::Vertical ? "portrait" : "landscape"); if (backgroundImageName.isEmpty()) { backgroundImageName = mItem.mBackgroundImageName.value("always"); if (backgroundImageName.isEmpty()) { @@ -792,17 +825,24 @@ } // Hide dynamic content from status bar (clock, indicators). + setStatusBarElementsVisible(mMainWindow, false); +} + +void HbSplashGenerator::setStatusBarElementsVisible(HbMainWindow *mw, bool visible) +{ + HbMainWindowPrivate *mwd = HbMainWindowPrivate::d_ptr(mw); HbStatusBar *statusBar = mwd->mStatusBar; if (statusBar) { - foreach (QGraphicsItem *item, statusBar->childItems()) { + foreach(QGraphicsItem * item, statusBar->childItems()) { QString name = HbStyle::itemName(item); - bool hideItem = name == QLatin1String("signal") + bool knownItem = + name == QLatin1String("signal") || name == QLatin1String("battery") || name == QLatin1String("notificationindicators") || name == QLatin1String("settingsindicators") || name == QLatin1String("timetext"); - if (hideItem) { - item->setVisible(false); + if (knownItem) { + item->setVisible(visible); } } } @@ -814,10 +854,8 @@ QTranslator *translator = new QTranslator; bool ok = false; QStringList dirNames(hbsplash_translation_dirs()); - if (!mItem.mWorkDirForSingleFileRegen.isEmpty()) { - dirNames.append(mItem.mWorkDirForSingleFileRegen); - } - foreach (const QString &dirName, dirNames) { + dirNames.append(mItem.mCustomTrDirs); + foreach(const QString & dirName, dirNames) { QDir dir(dirName); QString fullName = dir.filePath(name + '_' + lang); // fullName is not necessarily an existing file, however the translator @@ -839,7 +877,7 @@ void HbSplashGenerator::clearTranslators() { - foreach (QTranslator *translator, mTranslators) { + foreach(QTranslator * translator, mTranslators) { QCoreApplication::removeTranslator(translator); } qDeleteAll(mTranslators); @@ -854,3 +892,27 @@ // directory-changed notifications. QTimer::singleShot(1000, this, SLOT(regenerate())); } + +bool HbSplashGenerator::lockMainWindow() +{ + if (!mMainWindowLocked) { + mMainWindowLocked = true; + return true; + } + return false; +} + +void HbSplashGenerator::unlockMainWindowInternal() +{ + mMainWindowLocked = false; +} + +void HbSplashGenerator::unlockMainWindow() +{ + // This version is used by the compositors. Besides resetting the flag it + // also queues a call to processQueue() if needed. + unlockMainWindowInternal(); + if (mProcessQueuePending) { + QMetaObject::invokeMethod(this, "processQueue", Qt::QueuedConnection); + } +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashgenerator.pro --- a/src/hbservers/hbsplashgenerator/hbsplashgenerator.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbsplashgenerator/hbsplashgenerator.pro Thu Jul 22 16:36:53 2010 +0100 @@ -30,10 +30,15 @@ SOURCES += $$PWD/main.cpp SOURCES += $$PWD/hbsplashgenerator.cpp +SOURCES += $$PWD/hbsplashindicompositor.cpp symbian: SOURCES += $$PWD/hbsplashgen_server_symbian.cpp HEADERS += $$PWD/hbsplashgenerator_p.h HEADERS += $$PWD/hbsplashdirs_p.h +HEADERS += $$PWD/hbsplashcompositor_p.h +HEADERS += $$PWD/hbsplashindicompositor_p.h +HEADERS += $$PWD/hbsplashblacklist_p.h +HEADERS += $$PWD/hbwidgetenabler_p.h symbian: HEADERS += $$PWD/hbsplashgen_server_symbian_p.h symbian { @@ -55,6 +60,7 @@ LIBS += -lavkon LIBS += -leikcore LIBS += -lapparc + LIBS += -lfbscli } hbAddLibrary(hbcore/HbCore) diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashgenerator_p.h --- a/src/hbservers/hbsplashgenerator/hbsplashgenerator_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbsplashgenerator/hbsplashgenerator_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,6 @@ #include #include #include -#include #include #include #include @@ -41,6 +40,7 @@ QT_BEGIN_NAMESPACE class QTranslator; +class QSettings; QT_END_NAMESPACE class HbMainWindow; @@ -56,14 +56,20 @@ void start(bool forceRegen); + HbMainWindow *ensureMainWindow(); + bool lockMainWindow(); + void unlockMainWindow(); + static void setStatusBarElementsVisible(HbMainWindow *mw, bool visible); + signals: + void regenerateStarted(); void outputDirContentsUpdated(const QString &dir, const QStringList &entries); void finished(); public slots: void regenerate(); void uncachedRegenerate(); - void regenerateOne(const QString &splashmlFileName); + void regenerateOne(const QString &splashmlFileName, const QString &customTrDir = QString()); private slots: void doStart(); @@ -100,7 +106,8 @@ QString mOrientation; }; QList mItemBgGraphics; - QString mWorkDirForSingleFileRegen; + QStringList mCustomTrDirs; + quint32 mFlagsToStore; }; private: @@ -108,7 +115,7 @@ void cleanup(); QImage renderView(); QString splashFileName(); - bool saveSpl(const QString &nameWithoutExt, const QImage &image); + bool saveSpl(const QString &nameWithoutExt, const QImage &image, quint32 extra); void addSplashmlItemToQueue(const QueueItem &item); void queueAppSpecificItems(const QString &themeName, Qt::Orientation orientation); bool parseSplashml(const QString &fullFileName, QueueItem &item); @@ -119,8 +126,10 @@ void addTranslator(const QString &name); void clearTranslators(); int updateOutputDirContents(const QString &outDir); + void unlockMainWindowInternal(); - bool mBusy; + bool mMainWindowLocked; + bool mProcessQueuePending; bool mForceRegen; HbMainWindow *mMainWindow; QQueue mQueue; @@ -129,10 +138,10 @@ QTime mItemTime; bool mFirstRegenerate; QHash mParsedSplashmls; - QSettings mSettings; + QSettings *mSettings; QFileSystemWatcher mFsWatcher; }; -QDebug operator<<(QDebug dbg, const HbSplashGenerator::QueueItem& item); +QDebug operator<<(QDebug dbg, const HbSplashGenerator::QueueItem &item); #endif // HBSPLASHGENERATOR_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashindicompositor.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbsplashgenerator/hbsplashindicompositor.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,185 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hbsplashindicompositor_p.h" +#include "hbsplashgenerator_p.h" +#include "hbsplashdefs_p.h" +#include "hbmainwindow.h" +#include "hbmainwindow_p.h" +#include "hbsleepmodelistener_p.h" +#include "hbevent.h" +#include +#include + +#ifdef Q_OS_SYMBIAN +#include +#endif + +// The indicator compositor renders a part of the mainwindow (the +// statusbar) into an image from time to time. This pixel data is then +// copied over to the splash screen bitmap whenever a client requests +// a screen (except if the screen is marked having a non-standard +// (hidden or transparent) statusbar). +// +// This ensures that there will be relatively up-to-date indicators in +// the splash screens. + +HbSplashIndicatorCompositor::HbSplashIndicatorCompositor(HbSplashGenerator *gen) + : mGenerator(gen), mSleeping(false), mSignalsConnected(false) +{ + // When the splash screens are regenerated the statusbar must be rendered + // again too because the theme or the splashml files may have changed. + connect(mGenerator, SIGNAL(finished()), SLOT(renderStatusBar()), Qt::QueuedConnection); + + // Regenerate once using a singleshot timer (to have a little delay) but + // then start listening to change notifications from the statusbar instead. + mRenderTimer = new QTimer(this); + mRenderTimer->setSingleShot(true); + connect(mRenderTimer, SIGNAL(timeout()), SLOT(renderStatusBar())); + mRenderTimer->start(5000); // 5 sec + + // There must be no activity while the device is sleeping so listen to sleep + // mode events too. + HbSleepModeListener::instance(); // just to make sure it is created + QApplication::instance()->installEventFilter(this); +} + +void HbSplashIndicatorCompositor::release() +{ + delete this; +} + +void HbSplashIndicatorCompositor::connectSignals() +{ + HbStatusBar *sb = HbMainWindowPrivate::d_ptr(mGenerator->ensureMainWindow())->mStatusBar; + connect(sb, SIGNAL(contentChanged(HbStatusBar::ContentChangeFlags)), + SLOT(handleStatusBarContentChange(HbStatusBar::ContentChangeFlags))); + mSignalsConnected = true; +} + +void HbSplashIndicatorCompositor::handleStatusBarContentChange( + HbStatusBar::ContentChangeFlags changeType) +{ + // No need to rush when battery level changes while charging + // because it is not the real level, just the animation. + queueRender(changeType.testFlag(HbStatusBar::BatteryCharging)); +} + +void HbSplashIndicatorCompositor::queueRender(bool lazy) +{ + // Compress subsequent change notifications into one update. + if (!mRenderTimer->isActive() && !mSleeping) { + mRenderTimer->start(lazy ? 10000 : 100); // 10 sec or 0.1 sec + } +} + +void HbSplashIndicatorCompositor::renderStatusBar() +{ + // Do nothing in sleep mode. + if (mSleeping) { + return; + } + // Try again later if a screen is just being generated. We share the same + // mainwindow and our changes done here (orientation, statusbar visibility) + // could possibly ruin the output. + if (!mGenerator->lockMainWindow()) { + mRenderTimer->start(1000); // 1 sec + return; + } + try { + if (!mSignalsConnected) { + connectSignals(); + // The first rendering may be wrong due to the deferred + // polish/layout handling. So issue a regenerate request. + queueRender(); + } + HbMainWindow *mw = mGenerator->ensureMainWindow(); + HbSplashGenerator::setStatusBarElementsVisible(mw, true); + mw->setOrientation(Qt::Vertical, false); + doRender(mw, &mStatusBarImagePrt, &mStatusBarRectPrt); + mw->setOrientation(Qt::Horizontal, false); + doRender(mw, &mStatusBarImageLsc, &mStatusBarRectLsc); + } catch (const std::bad_alloc &) { + mStatusBarImagePrt = mStatusBarImageLsc = QImage(); + } + mGenerator->unlockMainWindow(); +} + +void HbSplashIndicatorCompositor::doRender(HbMainWindow *mw, + QImage *statusBarImage, + QRect *statusBarRect) +{ + *statusBarRect = mw->mapFromScene(HbMainWindowPrivate::d_ptr(mw)->mStatusBar->geometry()) + .boundingRect().intersected(QRect(QPoint(0, 0), mw->size())); + *statusBarImage = QImage(statusBarRect->size(), QImage::Format_ARGB32_Premultiplied); + statusBarImage->fill(QColor(Qt::transparent).rgba()); + QPainter painter(statusBarImage); + mw->render(&painter, statusBarImage->rect(), *statusBarRect); +} + +void HbSplashIndicatorCompositor::composeToBitmap(void *bitmap, + Qt::Orientation orientation, + int splashExtraFlags) +{ +#ifdef Q_OS_SYMBIAN + if (!(splashExtraFlags & HbSplashNonStandardStatusBar)) { + const QImage *srcImg = orientation == Qt::Horizontal ? &mStatusBarImageLsc + : &mStatusBarImagePrt; + const QRect *sbRect = orientation == Qt::Horizontal ? &mStatusBarRectLsc + : &mStatusBarRectPrt; + if (!srcImg->isNull()) { + CFbsBitmap *bmp = static_cast(bitmap); + uchar *dst = reinterpret_cast(bmp->DataAddress()); + const int dstBpl = CFbsBitmap::ScanLineLength(bmp->SizeInPixels().iWidth, + bmp->DisplayMode()); + const uchar *src = srcImg->bits(); + const int srcBpl = srcImg->bytesPerLine(); + const int dstLineStartOffset = sbRect->left() * 4; + const int y0 = sbRect->top(); + const int y1 = sbRect->bottom(); + for (int y = y0; y <= y1; ++y) { + int dstOffset = y * dstBpl + dstLineStartOffset; + int srcOffset = (y - y0) * srcBpl; + qMemCopy(dst + dstOffset, src + srcOffset, srcBpl); + } + } + } +#else + Q_UNUSED(bitmap); + Q_UNUSED(orientation); + Q_UNUSED(splashExtraFlags); +#endif +} + +bool HbSplashIndicatorCompositor::eventFilter(QObject *obj, QEvent *event) +{ + if (event->type() == HbEvent::SleepModeEnter && !mSleeping) { + mSleeping = true; + } else if (event->type() == HbEvent::SleepModeExit && mSleeping) { + mSleeping = false; + queueRender(); + } + return QObject::eventFilter(obj, event); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbsplashindicompositor_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbsplashgenerator/hbsplashindicompositor_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBSPLASHINDICOMPOSITOR_P_H +#define HBSPLASHINDICOMPOSITOR_P_H + +#include "hbsplashcompositor_p.h" +#include "hbstatusbar_p.h" +#include +#include +#include + +class HbSplashGenerator; +class HbMainWindow; + +QT_BEGIN_NAMESPACE +class QTimer; +QT_END_NAMESPACE + +class HbSplashIndicatorCompositor : public QObject, public HbSplashCompositorInterface +{ + Q_OBJECT + +public: + HbSplashIndicatorCompositor(HbSplashGenerator *gen); + void release(); + void composeToBitmap(void *bitmap, Qt::Orientation orientation, int splashExtraFlags); + +private slots: + void renderStatusBar(); + void handleStatusBarContentChange(HbStatusBar::ContentChangeFlags changeType); + +private: + void connectSignals(); + void queueRender(bool lazy = false); + void doRender(HbMainWindow *mw, QImage *statusBarImage, QRect *statusBarRect); + bool eventFilter(QObject *obj, QEvent *event); + + HbSplashGenerator *mGenerator; + bool mSleeping; + bool mSignalsConnected; + QImage mStatusBarImagePrt; + QImage mStatusBarImageLsc; + QRect mStatusBarRectPrt; + QRect mStatusBarRectLsc; + QTimer *mRenderTimer; +}; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/hbwidgetenabler_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbsplashgenerator/hbwidgetenabler_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBWIDGETENABLER_P_H +#define HBWIDGETENABLER_P_H + +#include + +class WidgetEnabler : public QObject +{ + Q_OBJECT +public: + WidgetEnabler(QWidget *widget) : mWidget(widget) { } +public slots: + void enable() { mWidget->setEnabled(true); } +private: + QWidget *mWidget; +}; + +#endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbsplashgenerator/main.cpp --- a/src/hbservers/hbsplashgenerator/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbsplashgenerator/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -28,10 +28,11 @@ #include #include "hbsplashgenerator_p.h" #include "hbsplashdefs_p.h" +#include "hbsplashindicompositor_p.h" +#include "hbwidgetenabler_p.h" #if defined(Q_OS_SYMBIAN) #include "hbsplashgen_server_symbian_p.h" -#include "hbsplashdefs_p.h" #include #include #include @@ -56,6 +57,9 @@ wgName->SetWindowGroupName(env->RootWin()); CleanupStack::PopAndDestroy(); RThread::RenameMe(hbsplash_server_name); + RProcess process; + process.SetPriority(EPriorityForeground); + process.Close(); } #else Q_UNUSED(mutexToSignal); @@ -80,16 +84,19 @@ QMainWindow mw; QPushButton *btnRegen = new QPushButton("Regenerate"); gen.connect(btnRegen, SIGNAL(clicked()), SLOT(uncachedRegenerate())); + btnRegen->setEnabled(false); // will be enabled only when the generator is really ready + WidgetEnabler widgetEnabler(btnRegen); + QObject::connect(&gen, SIGNAL(outputDirContentsUpdated(QString, QStringList)), + &widgetEnabler, SLOT(enable()), Qt::QueuedConnection); mw.setCentralWidget(btnRegen); mw.show(); #endif // The server must be initialized before calling HbSplashGenerator::start(). -#ifdef Q_OS_SYMBIAN +#if defined(Q_OS_SYMBIAN) qDebug("[hbsplashgenerator] starting server"); HbSplashGenServer server(&gen); - // If there was an error (or an instance is already running (it is - // possible in certain race conditions)) then exit right away. + // If there was an error then exit right away. if (!server.startupSuccess()) { qDebug("[hbsplashgenerator] exiting due to failed server startup"); return 0; @@ -99,7 +106,10 @@ qDebug("[hbsplashgenerator] starting generator"); gen.start(forceRegen); + HbSplashIndicatorCompositor indiCompositor(&gen); + #if defined(Q_OS_SYMBIAN) + server.addCompositor(&indiCompositor); if (mutexToSignal) { qDebug("[hbsplashgenerator] signaling mutex"); static_cast(mutexToSignal)->Signal(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbcache_p.cpp --- a/src/hbservers/hbthemeserver/hbcache_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbcache_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -50,7 +50,7 @@ \a key denotes the unique identifier for the cache item whose value is to be returned */ -HbCacheItem* HbCache::value(const QString& key) const +HbCacheItem* HbCache::value(const QString &key) const { return cache.value(key, 0); } @@ -62,9 +62,9 @@ \a key denotes the unique identifier for the cache item that is to be searched in the cache. */ -HbCacheItem* HbCache::cacheItem(const QString& key) +HbCacheItem* HbCache::cacheItem(const QString &key) { - HbCacheItem* item = 0; + HbCacheItem *item = 0; if (!cache.contains(key)) { return 0; } @@ -86,12 +86,12 @@ \a key denotes the unique identifier for the cache item that is to be searched in the cache. \a item represents the cache-item to be inserted. */ -bool HbCache::insert(const QString& key, HbCacheItem* item) +bool HbCache::insert(const QString &key, HbCacheItem *item) { if (!item) { return false; } - cache.insert(key, const_cast(item)); + cache.insert(key, const_cast(item)); item->refCount++; //if item is also present in LRU list, remove it from there to avoid // deletion following LRU policy @@ -109,12 +109,12 @@ unused-resources list for removal later in case of OOM scenario. \a key denotes the unique identifier for the cache item that is to be searched in the cache. */ -bool HbCache::remove(const QString& key) +bool HbCache::remove(const QString &key) { if (key.isEmpty() || !cache.contains(key)) { return false; } - HbCacheItem* item = cache[key]; + HbCacheItem *item = cache[key]; //reference count can obviously be never less than zero, meaning that for all the //css files stored with server-css-cache, there would be minimum zero client (app) //associated @@ -152,7 +152,7 @@ \fn HbCache::cacheHandle() Returns a handle to the cache which holds (css-file-name, cacheItem) key-value pair. */ -QHash &HbCache::cacheHandle() +QHash &HbCache::cacheHandle() { return cache; } @@ -167,7 +167,7 @@ for (QHash::const_iterator iter = cache.constBegin(); iter != itEnd; ++iter) { - HbCacheItem* temp = iter.value(); + HbCacheItem *temp = iter.value(); manager->free(temp->offset); delete temp; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbdoublelinkedlist_p.h --- a/src/hbservers/hbthemeserver/hbdoublelinkedlist_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbdoublelinkedlist_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,9 +45,9 @@ inline HbDLink(); - inline ElemType* next() const; + inline ElemType *next() const; - inline ElemType* prev() const; + inline ElemType *prev() const; inline void setNext(ElemType *element); @@ -55,8 +55,8 @@ private: - ElemType* mNext; - ElemType* mPrev; + ElemType *mNext; + ElemType *mPrev; }; @@ -85,7 +85,6 @@ class HbDLinkList { public: - inline explicit HbDLinkList(HbDLink ElemType:: *dLink); inline ~HbDLinkList(); inline void insertBack(ElemType *item); @@ -101,11 +100,9 @@ inline void insertAfter(ElemType *newItem, ElemType *lastItem); private: - ElemType *listFront; ElemType *listBack; - HbDLink ElemType:: *mDLink; - + HbDLink ElemType:: *mDLink; }; #include "hbdoublelinkedlistinline_p.h" diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbiconcacheitemcreator_p.cpp --- a/src/hbservers/hbthemeserver/hbiconcacheitemcreator_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbiconcacheitemcreator_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -46,7 +46,8 @@ @hbserver \class HbIconCacheItemCreator \brief HbIconCacheItemCreator is a factory class responsible for creating the cache items. - The cache item structure internally maintains details of the icons created both in the Gpu and the Cpu memory. + The cache item structure internally maintains details of + the icons created both in the Gpu and the Cpu memory. */ @@ -72,19 +73,20 @@ QString HbIconCacheItemCreator::KSvg = "SVG"; QString HbIconCacheItemCreator::KNvg = "NVG"; QString HbIconCacheItemCreator::KPic = "PIC"; -QString HbIconCacheItemCreator::KBlob = "BOLB"; +QString HbIconCacheItemCreator::KBlob = "BLOB"; QString HbIconCacheItemCreator::KSgimage = "SGIMAGE"; /*! \fn HbIconCacheItemCreator::createCacheItem() - The createCacheItem is responsible for creating an icon in cpu or gpu memory based on the format provided + The createCacheItem is responsible for creating an icon in cpu or gpu memory + based on the format provided. \a key denotes the unique identifier for the cache item \a options indicate different ways of loading icons \a format indicates the icon format e.g. svg/nvg etc.\ \a currentRenderingMode ThemeServer's current rendering mode state. */ -HbIconCacheItem* HbIconCacheItemCreator::createCacheItem(const HbIconKey &key, +HbIconCacheItem *HbIconCacheItemCreator::createCacheItem(const HbIconKey &key, HbIconLoader::IconLoaderOptions options, const QString &format, HbRenderingMode currentRenderingMode, @@ -95,7 +97,7 @@ Q_UNUSED(currentRenderingMode) #endif QScopedPointer tempIconCacheItem(new HbIconCacheItem); - HbIconCacheItem* item = tempIconCacheItem.data(); + HbIconCacheItem *item = tempIconCacheItem.data(); QScopedPointer rasterIcon; QScopedPointer vectorIcon; @@ -124,32 +126,32 @@ if (!isMultiPiece) { #ifdef HB_SGIMAGE_ICON if(renderMode == ESWRendering){ - rasterIcon.reset(new HbPixmapIconProcessor( key, options, format)); - }else { + rasterIcon.reset(new HbPixmapIconProcessor(key, options, format)); + } else { if (HbThemeServerPrivate::gpuMemoryState()) { - rasterIcon.reset(new HbSgimageIconProcessor( key, options, format)); + rasterIcon.reset(new HbSgimageIconProcessor(key, options, format)); } - vectorIcon.reset(new HbNvgIconProcessor( key, options, format )); + vectorIcon.reset(new HbNvgIconProcessor(key, options, format)); } #endif // if sgImage support is enabled by default remove this block #ifndef HB_SGIMAGE_ICON if(renderMode == ESWRendering){ - rasterIcon.reset(new HbPixmapIconProcessor( key, options, format)); + rasterIcon.reset(new HbPixmapIconProcessor(key, options, format)); } else { - vectorIcon.reset(new HbNvgIconProcessor( key, options, format )); + vectorIcon.reset(new HbNvgIconProcessor(key, options, format)); } #endif // block end } else { if(renderMode == ESWRendering){ - rasterIcon.reset(new HbPixmapIconProcessor( key, options, format)); + rasterIcon.reset(new HbPixmapIconProcessor(key, options, format)); } else { // multipieceIcon So make nvgiconimpl for .nvg files // No raster icon data is created - vectorIcon.reset(new HbNvgIconProcessor( key, options, format )); + vectorIcon.reset(new HbNvgIconProcessor(key, options, format)); } } #endif @@ -210,14 +212,14 @@ /*! \fn HbIconCacheItemCreator::createCacheItem() - This overloaded createCacheItem is a helper function to populate a cache item if this item is already - created with some parameters either on the Gpu or the Cpu + This overloaded createCacheItem is a helper function to populate a cache item + if this item is already created with some parameters either on the Gpu or the Cpu \a iconCacheItem denotes the cacheItem to be populated \a key unique identifier to identify the cache item \a currentRenderingMode ThemeServer's current rendering mode state */ -void HbIconCacheItemCreator::createCacheItem(HbIconCacheItem& iconCacheItem, +void HbIconCacheItemCreator::createCacheItem(HbIconCacheItem &iconCacheItem, const HbIconKey &key, HbRenderingMode currentRenderingMode) { @@ -252,10 +254,12 @@ #ifdef HB_SGIMAGE_ICON if(renderMode == EHWRendering){ if (HbThemeServerPrivate::gpuMemoryState()){ - rasterIcon.reset(new HbSgimageIconProcessor( key, iconCacheItem.iconOptions, format)); + rasterIcon.reset(new HbSgimageIconProcessor(key, iconCacheItem.iconOptions, + format)); } }else { - rasterIcon.reset(new HbPixmapIconProcessor( key, iconCacheItem.iconOptions, format)); + rasterIcon.reset(new HbPixmapIconProcessor(key, iconCacheItem.iconOptions, + format)); } #endif #ifdef NVG_ICON @@ -308,8 +312,8 @@ Q_UNUSED(currentRenderingMode) #endif - HbIconCacheItem* item = 0; - QScopedPointer tempIconCacheItem; + HbIconCacheItem *item = 0; + QScopedPointer tempIconCacheItem; bool isIconCreated = false; QScopedPointer rasterIcon; @@ -345,7 +349,8 @@ return item; #endif } else { - rasterIcon.reset(new HbPixmapIconProcessor(finalIconKey, (HbIconLoader::IconLoaderOptions)multiPieceIconParams.options, format)); + rasterIcon.reset(new HbPixmapIconProcessor(finalIconKey, + static_cast(multiPieceIconParams.options), format)); } if (rasterIcon.data()) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbiconcacheitemcreator_p.h --- a/src/hbservers/hbthemeserver/hbiconcacheitemcreator_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbiconcacheitemcreator_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -64,12 +64,12 @@ { public: - static HbIconCacheItem* createCacheItem(const HbIconKey &key, + static HbIconCacheItem *createCacheItem(const HbIconKey &key, HbIconLoader::IconLoaderOptions options, const QString &format, HbRenderingMode currentRenderingMode, bool isMultiPiece = false); - static void createCacheItem(HbIconCacheItem& iconCacheItem, + static void createCacheItem(HbIconCacheItem &iconCacheItem, const HbIconKey &key, HbRenderingMode currentRenderingMode); @@ -81,8 +81,6 @@ bool allNvg, HbRenderingMode currentRenderingMode); - - static QString KSvg ; static QString KNvg ; static QString KPic ; diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbicondatacache_p.cpp --- a/src/hbservers/hbthemeserver/hbicondatacache_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbicondatacache_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,23 +36,28 @@ @hbserver \class HbIconDataCache \brief HbIconDataCache provides an implementation for the theme server's icon cache. - It acts as a central repository for storing the various details of all the icons cached in the server. - It provides various methods to insert new items, remove items as well as find existing cached items in the cache. + It acts as a central repository for storing the various details + of all the icons cached in the server. It provides various methods to insert new items, + remove items as well as find existing cached items in the cache. It also has methods to limit the cache size both on Gpu as well as Cpu shared memory. - Reference count based caching - On performing an Icon look up in the server, if the icon is not already cached, - the cache item is created and inserted into cache and its reference count is incremented. - If the same icon is requested by another application, the cached instance is returned and only the reference - count is incremented. Similarly, the refrence count is decremented whenever an icon is destroyed. + Reference count based caching - On performing an Icon look up in the server, + if the icon is not already cached, the cache item is created and inserted into cache + and its reference count is incremented. + If the same icon is requested by another application, the cached instance is returned + and only the reference count is incremented. + Similarly, the refrence count is decremented whenever an icon is destroyed. LRU policy is used for removal of icons from cache. - The cache maintains two separate doubly link lists to maintain the order of the least recently used icons created - in GPU memory as well as those created in the shared memory. Whenever, the reference count for a cached item becomes 0, + The cache maintains two separate doubly link lists to maintain the order + of the least recently used icons created in GPU memory as well as those created + in the shared memory. Whenever, the reference count for a cached item becomes 0, it is not deleted from the cache rather; the cached icon instance is appended to the LRU list. - Consider now that a scenario arrives when the cache has reached its max limit and there are some unused icons - (i.e. icons with reference count = 0) in the LRU list. Suppose at this point there is a new icon caching request. - In such a scenario, the unused icons, starting with those at the beginning of the LRU lists are removed from the cache, - one after the other, till the new icon can be accommodated. + Consider now that a scenario arrives when the cache has reached its max limit + and there are some unused icons (i.e. icons with reference count = 0) in the LRU list. + Suppose at this point there is a new icon caching request. + In such a scenario, the unused icons, starting with those at the beginning of the LRU lists + are removed from the cache one after the other, till the new icon can be accommodated. Description of data members // A list that maintains an ordered collection of least recently used icons in GPU @@ -115,7 +120,6 @@ HbIconDataCache::~HbIconDataCache() { clear(); - delete cache; } @@ -137,11 +141,11 @@ GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory) QHash::const_iterator itEnd(cache->constEnd()); - for (QHash < HbIconKey, - HbIconCacheItem* >::const_iterator iter = cache->constBegin(); + for (QHash::const_iterator iter = cache->constBegin(); iter != itEnd; ++iter) { - HbIconCacheItem* temp = iter.value(); + HbIconCacheItem *temp = iter.value(); if (temp->rasterIconData.type != INVALID_FORMAT) { switch (temp->rasterIconData.type) { case PIC : @@ -206,11 +210,11 @@ \a key denotes the unique identifier for the cache item that is to be searched in the cache. */ -HbIconCacheItem* HbIconDataCache::getCacheItem(const HbIconKey &key , +HbIconCacheItem *HbIconDataCache::getCacheItem(const HbIconKey &key, HbRenderingMode currentRenderingMode, bool isMultiIconPiece) { - HbIconCacheItem* item = 0; + HbIconCacheItem *item = 0; if (!cache->contains(key)) { return 0; @@ -248,19 +252,16 @@ if ((item->rasterIconData.type == INVALID_FORMAT) && (goodMemory && !isMultiIconPiece)) { if (item->vectorIconData.type == NVG) { - HbIconCacheItemCreator::createCacheItem(*item, key, currentRenderingMode); if (item->rasterIconData.type != INVALID_FORMAT) { currentGpuCacheSize += item->rasterIconDataCost; } } - //Debug Code for Test Purpose #ifdef HB_ICON_CACHE_DEBUG addedItemMem = item->rasterIconDataCost; #endif } - // If the Icon is present in CPU LRU list, then remove it from the list if (((item->cpuLink.next() != 0) || (item->cpuLink.prev() != 0)) || ((item == cpuLruList.front()) && (item == cpuLruList.back()))) { @@ -284,7 +285,6 @@ } #endif } - // If the Icon does not have CPU data and there is enough space to create // the icon in CPU cache now, we go ahead and create CPU shared data if ((item->vectorIconData.type == INVALID_FORMAT) && @@ -302,7 +302,8 @@ //Debug Code for Test Purpose #ifdef HB_ICON_CACHE_DEBUG addedItemRefCount = item->refCount; - qDebug() << "HbIconDataCache::getCacheItem: " << "Cache hit in Server-Cache for" << key.filename; + qDebug() << "HbIconDataCache::getCacheItem: " + << "Cache hit in Server-Cache for" << key.filename; qDebug() << "HbIconDataCache::getCacheItem: Server RefCount now = " << item->refCount; #endif @@ -314,16 +315,19 @@ Provides a mechanism for inserting items into the cache. Checks are first done to see whether item can be accomodated in the GPU memory. If so the Gpu limits are updated. Next it tries to cache the item in the Cpu. - If possible, the Cpu limits are updated. If niether is possible, a failure to insert is returned. - In case of success, the item is inserted into the cache and the reference count for the item is incremented by 1. + If possible, the Cpu limits are updated. If neither is possible, + a failure to insert is returned. + In case of success, the item is inserted into the cache and + the reference count for the item is incremented by 1. \a key denotes the unique identifier for the cache item that is to be inserted into the cache. \a item the cache item that is to be inserted into the cache. */ -bool HbIconDataCache::insert(const HbIconKey &key, HbIconCacheItem* item) +bool HbIconDataCache::insert(const HbIconKey &key, HbIconCacheItem *item) { - if (!item) + if (!item) { return false; + } // Check if Item can be accomdated in GPU cache bool gpuCaching = isItemCachableInGpu(item); @@ -334,7 +338,6 @@ if ((!gpuCaching) && (!cpuCaching)) { return false; } - // Item can be accomdated in GPU cache if (gpuCaching) { // Increment the GPU cache size @@ -359,17 +362,18 @@ currentCpuCacheSize += item->vectorIconDataCost; } else { // New item's icon data cost is more than available free CPU cahe size - // Check if some items, whose ref count is 0, can be removed to make way for new item + // Check if some items, whose ref count is 0, + // can be removed to make way for new item createCpuCacheSpace(item->vectorIconDataCost); currentCpuCacheSize += item->vectorIconDataCost; } } - if (currentCpuCacheSize > maxCpuCacheLimit) { currentCpuCacheSize = maxCpuCacheLimit; } } - QHash::iterator iter = cache->insert(key, const_cast(item)); + QHash::iterator iter = + cache->insert(key, const_cast(item)); if (iter == cache->end()) { return false; } @@ -385,7 +389,8 @@ } else if (cpuCaching) { addedItemMem = item->vectorIconDataCost; } - qDebug() << "HbIconDataCache::insert: " << "Item " << key.filename<<" inserted in Server-Cache"; + qDebug() << "HbIconDataCache::insert: " << "Item " << key.filename + << " inserted in Server-Cache"; qDebug() << "HbIconDataCache::insert: Server RefCount now = " << item->refCount; #endif @@ -395,18 +400,20 @@ /*! \fn HbIconDataCache::remove() Remove provides a mechanism for decrementing the reference count of a cached item. - In case the reference count becomes 0, the cache item instance is appended to the corresponding LRU list. - Actual removal of the cache item from the cache only occurs when the cache has reached a max limit and a new request for - insert comes. - \a key denotes the unique identifier for the cache item whose ref count is to be decremented in the cache. + In case the reference count becomes 0, + the cache item instance is appended to the corresponding LRU list. + Actual removal of the cache item from the cache only occurs + when the cache has reached a max limit and a new request for insert comes. + \a key denotes the unique identifier for the cache item whose + ref count is to be decremented in the cache. */ -bool HbIconDataCache::remove(const HbIconKey& key, bool keepInCache) +bool HbIconDataCache::remove(const HbIconKey &key, bool keepInCache) { if (key.filename.isEmpty() || !cache->contains(key)) { return false; } - HbIconCacheItem* item = (*cache)[(key)]; + HbIconCacheItem *item = (*cache)[(key)]; item->refCount--; //Debug Code for Test Purpose @@ -425,7 +432,6 @@ return true; } } - if (item->rasterIconData.type == OTHER_SUPPORTED_FORMATS) { if (keepInCache) { cpuLruList.insertBack(item); @@ -436,8 +442,6 @@ return true; } } - - //Debug Code for Test Purpose #ifdef HB_ICON_CACHE_DEBUG if (! enableCaching) { @@ -454,15 +458,12 @@ } } else { #endif - - //Debug Code for Test Purpose #ifdef HB_ICON_CACHE_DEBUG rasterLruListCount++; } #endif - if ((item->vectorIconData.type != INVALID_FORMAT) && item->refCount == 0) { //Debug Code for Test Purpose @@ -525,7 +526,6 @@ #else maxGpuCacheLimit = size; #endif - } /*! @@ -559,12 +559,13 @@ /*! \fn HbIconDataCache::contains() Provides a mecahnism for finding whether an item exists in cache. - Is different from the find function in that, this function simply checks whether an item is presentin cache, whereas find + Is different from the find function in that, + this function simply checks whether an item is presentin cache, whereas find also performs additional operations such as incrementing the reference count. \a key denotes the unique identifier for the cache item that is to be found into the cache. */ -bool HbIconDataCache::contains(const HbIconKey &key)const +bool HbIconDataCache::contains(const HbIconKey &key) const { return (cache->contains(key)); } @@ -575,7 +576,7 @@ \a key denotes the unique identifier for the cache item whose value is to be returned */ -HbIconCacheItem* HbIconDataCache::value(const HbIconKey &key)const +HbIconCacheItem *HbIconDataCache::value(const HbIconKey &key) const { if (cache->contains(key)) { return cache->value(key); @@ -584,23 +585,22 @@ } } - /*! \fn HbIconDataCache::isItemCachableInGpu() Checks if the new item can be accomdated in the Gpu memory. \a item is the new item to be cached BLOB is always cached in cpu so this function always returns false for such items. */ -bool HbIconDataCache::isItemCachableInGpu(const HbIconCacheItem* item)const +bool HbIconDataCache::isItemCachableInGpu(const HbIconCacheItem *item) const { - if (maxGpuCacheLimit <= 0 || item->rasterIconDataCost <= 0 || item->blobIconData.type != INVALID_FORMAT || - item->rasterIconData.type != SGIMAGE) { + if (maxGpuCacheLimit <= 0 || item->rasterIconDataCost <= 0 + || item->blobIconData.type != INVALID_FORMAT || item->rasterIconData.type != SGIMAGE) { return false; } // Item's GPU Icon's cost is greater than the max GPU Limit - if (item->rasterIconDataCost > maxGpuCacheLimit) + if (item->rasterIconDataCost > maxGpuCacheLimit) { return false; - + } return true; } @@ -610,7 +610,7 @@ \a item is the new item to be cached BLOB is always cached in cpu, never in gpu. */ -bool HbIconDataCache::isItemCachableInCpu(const HbIconCacheItem* item)const +bool HbIconDataCache::isItemCachableInCpu(const HbIconCacheItem *item) const { if (maxCpuCacheLimit <= 0) { return false; @@ -622,10 +622,10 @@ if (item->rasterIconDataCost <= (maxCpuCacheLimit - currentCpuCacheSize)) { return true; } else { - return (item->rasterIconDataCost <= (maxCpuCacheLimit - currentCpuCacheSize) + cpuLruListSize); + return (item->rasterIconDataCost <= (maxCpuCacheLimit - currentCpuCacheSize) + + cpuLruListSize); } } - if (item->vectorIconData.type != INVALID_FORMAT) { if (item->vectorIconDataCost <= 0 || item->vectorIconDataCost > maxCpuCacheLimit) { return false; @@ -633,7 +633,8 @@ if (item->vectorIconDataCost <= (maxCpuCacheLimit - currentCpuCacheSize)) { return true; } else { - return (item->vectorIconDataCost <= (maxCpuCacheLimit - currentCpuCacheSize) + cpuLruListSize); + return (item->vectorIconDataCost <= (maxCpuCacheLimit - currentCpuCacheSize) + + cpuLruListSize); } } return false; @@ -642,7 +643,8 @@ /*! \fn HbIconDataCache::createGpuCacheSpace() This method provides a way to remove the unused icons( icons with ref count =0. - It starts removing the icons from the cache, starting with those that are at the front of the Gpu LRU list. + It starts removing the icons from the cache, + starting with those that are at the front of the Gpu LRU list. It continues removal of items till there is enough space created to cache the new item in Gpu \a itemCost - cost of the new item to be cached in the Gpu memory @@ -653,16 +655,18 @@ // Keep removing items from the cache till there is // enough space to accomdate the new item int freedMemory = 0; - while (itemCost > (freedMemory)) { - HbIconCacheItem* itemToRemove = gpuLruList.removeFront(); + while (itemCost > freedMemory) { + HbIconCacheItem *itemToRemove = gpuLruList.removeFront(); + if ( itemToRemove == 0 ){ + return ; + } // Decrement the Size by the cost of the removed icon's data cost - //GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory) - //qDebug() << "HbIconDataCache : Calling SgImage Close. Cost = %d "<< itemToRemove->rasterIconDataCost; #ifdef HB_SGIMAGE_ICON #ifdef HB_ICON_CACHE_DEBUG - qDebug() << "HbIconDataCache : Calling SgImage Close. Cost = %d "<< itemToRemove->rasterIconDataCost; + qDebug() << "HbIconDataCache : Calling SgImage Close. Cost = %d " + << itemToRemove->rasterIconDataCost; #endif - HbSgImageRenderer::removeSgImageFromHash(itemToRemove->rasterIconData.sgImageData.id); + HbSgImageRenderer::removeSgImageFromHash(itemToRemove->rasterIconData.sgImageData.id); #endif itemToRemove->rasterIconData.type = INVALID_FORMAT; itemToRemove->gpuLink.setNext(0); @@ -674,7 +678,6 @@ if (currentGpuCacheSize < 0) { currentGpuCacheSize = 0; } - if (gpuLruListSize < 0) { gpuLruListSize = 0; } @@ -686,7 +689,6 @@ rasterLruListCount = 0; } #endif - // This is the case where Icon has no CPU data and // the GPU cached data has also been deleted to make way for new Icon // In such a case the Item can be removed from the Hash @@ -703,7 +705,8 @@ /*! \fn HbIconDataCache::createCpuCacheSpace() This method provides a way to remove the unused icons( icons with ref count =0). - It starts removing the icons from the cache, starting with those that are at the front of the CPU LRU list. + It starts removing the icons from the cache, + starting with those that are at the front of the CPU LRU list. It continues removal of items till there is enough space created to cache the new item in Cpu \a itemCost - cost of the new item to be cached in the Cpu memory @@ -715,7 +718,7 @@ // enough space to accomdate the new item GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory) while (itemCost > (maxCpuCacheLimit - currentCpuCacheSize)) { - HbIconCacheItem* itemToRemove = cpuLruList.removeFront(); + HbIconCacheItem *itemToRemove = cpuLruList.removeFront(); if (itemToRemove->rasterIconData.type == OTHER_SUPPORTED_FORMATS) { manager->free(itemToRemove->rasterIconData.pixmapData.offset); itemToRemove->rasterIconData.type = INVALID_FORMAT; @@ -736,14 +739,12 @@ updateCpuLruSize(-itemToRemove->vectorIconDataCost); } - itemToRemove->cpuLink.setNext(0); itemToRemove->cpuLink.setPrev(0); if (currentCpuCacheSize < 0) { currentCpuCacheSize = 0; } - if (cpuLruListSize < 0) { cpuLruListSize = 0; } @@ -756,11 +757,9 @@ vectorLruListCount = 0; } #endif - // This is the case where Icon has no CPU data and // the GPU cached data has also been deleted to make way for new Icon // In such a case the Item can be removed from the Hash - if ((itemToRemove->vectorIconData.type == INVALID_FORMAT) && (itemToRemove->rasterIconData.type == INVALID_FORMAT)) { cache->remove(cache->key(itemToRemove)); @@ -785,7 +784,7 @@ goodMemory = true; } -void HbIconDataCache::freeGpuRam(int bytes) +void HbIconDataCache::freeGpuRam(int bytes, bool useSwRendering) { goodMemory = false; if (bytes <= gpuLruListSize) { @@ -794,25 +793,26 @@ createGpuCacheSpace(gpuLruListSize); } + if (useSwRendering) { // Iterate through the cache and remove any active SgImages, before the context // is destroyed. QHash::const_iterator itEnd(cache->constEnd()); - for (QHash < HbIconKey, - HbIconCacheItem* >::const_iterator iter = cache->constBegin(); - iter != itEnd; - ++iter) { - HbIconCacheItem* temp = iter.value(); - if( temp->rasterIconData.type == SGIMAGE ){ + for (QHash::const_iterator iter = cache->constBegin(); + iter != itEnd; + ++iter) { + HbIconCacheItem *temp = iter.value(); + if( temp->rasterIconData.type == SGIMAGE ){ #ifdef HB_SGIMAGE_ICON - HbSgImageRenderer::removeSgImageFromHash(temp->rasterIconData.sgImageData.id); + HbSgImageRenderer::removeSgImageFromHash(temp->rasterIconData.sgImageData.id); #endif - temp->rasterIconData.type = INVALID_FORMAT; - temp->gpuLink.setNext(0); - temp->gpuLink.setPrev(0); - currentGpuCacheSize -= temp->rasterIconDataCost; - } + temp->rasterIconData.type = INVALID_FORMAT; + currentGpuCacheSize -= temp->rasterIconDataCost; } - + } + gpuLruList.removeAll(); + gpuLruListSize = 0; + } } /*! @@ -829,8 +829,8 @@ { QVector keys; QHash::const_iterator itEnd(cache->constEnd()); - for (QHash < HbIconKey, - HbIconCacheItem* >::const_iterator iter = cache->constBegin(); + for (QHash::const_iterator iter = cache->constBegin(); iter != itEnd; ++iter) { const HbIconKey *key = &iter.key(); @@ -845,10 +845,9 @@ #ifdef HB_ICON_CACHE_DEBUG void HbIconDataCache::cleanVectorLRUList() { - // remove all the items in cpu LRU list. while (cpuLruList.front()) { - HbIconCacheItem* itemToRemove = cpuLruList.removeFront(); + HbIconCacheItem *itemToRemove = cpuLruList.removeFront(); // update the member currentCpuCacheSize -= itemToRemove->vectorIconDataCost; @@ -868,7 +867,6 @@ vectorLruListCount = 0; } #endif - // remove the shared memory allocatedfor this item. releaseVectorItem(itemToRemove); @@ -878,7 +876,7 @@ } #endif // HB_ICON_CACHE_DEBUG -void HbIconDataCache::releaseVectorItem(HbIconCacheItem* releaseItem) +void HbIconDataCache::releaseVectorItem(HbIconCacheItem *releaseItem) { if (!releaseItem) { return; @@ -903,10 +901,9 @@ #ifdef HB_ICON_CACHE_DEBUG void HbIconDataCache::cleanRasterLRUList() { - // remove all the items from the gpu LRU list while (gpuLruList.front()) { - HbIconCacheItem* itemToRemove = gpuLruList.removeFront(); + HbIconCacheItem *itemToRemove = gpuLruList.removeFront(); // update the member currentGpuCacheSize -= itemToRemove->rasterIconDataCost; @@ -915,7 +912,6 @@ if (currentGpuCacheSize < 0) { currentGpuCacheSize = 0; } - if (gpuLruListSize < 0) { gpuLruListSize = 0; } @@ -926,7 +922,6 @@ rasterLruListCount = 0; } #endif - // release the shared memory (later raster memory)of this item. releaseRasterItem(itemToRemove); @@ -936,7 +931,7 @@ } #endif // HB_ICON_CACHE_DEBUG -void HbIconDataCache::releaseRasterItem(HbIconCacheItem* releaseItem) +void HbIconDataCache::releaseRasterItem(HbIconCacheItem *releaseItem) { if (!releaseItem) { return; @@ -947,30 +942,29 @@ releaseItem->rasterIconData.type = INVALID_FORMAT; } -void HbIconDataCache::removeFromCache(const HbIconKey &key, const HbIconCacheItem* releaseItem) +void HbIconDataCache::removeFromCache(const HbIconKey &key, const HbIconCacheItem *releaseItem) { if (!releaseItem) { return; } - if ((releaseItem->vectorIconData.type == INVALID_FORMAT) && - (releaseItem->rasterIconData.type == INVALID_FORMAT)) { + if (releaseItem->vectorIconData.type == INVALID_FORMAT + && releaseItem->rasterIconData.type == INVALID_FORMAT) { cache->remove(key); delete releaseItem; } } +int HbIconDataCache::gpuLRUSize() const +{ + return gpuLruListSize; +} #ifdef HB_ICON_CACHE_DEBUG int HbIconDataCache::count() const { return cache->count(); } -int HbIconDataCache::gpuLRUSize() const -{ - return gpuLruListSize; -} - int HbIconDataCache::freeVectorMemory() { return (maxCpuCacheLimit - currentCpuCacheSize); diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbicondatacache_p.h --- a/src/hbservers/hbthemeserver/hbicondatacache_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbicondatacache_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,19 +40,20 @@ HbIconCacheItem* getCacheItem(const HbIconKey &key , HbRenderingMode currentRenderingMode, bool isMultiIconPiece = false); - bool insert(const HbIconKey &key, HbIconCacheItem* item); + bool insert(const HbIconKey &key, HbIconCacheItem *item); bool remove(const HbIconKey& key, bool keepInCache = true); void setMaxGpuCacheSize(int size); void setMaxCpuCacheSize(int size); bool contains(const HbIconKey &key) const; HbIconCacheItem* value(const HbIconKey &key) const; - bool isItemCachableInGpu(const HbIconCacheItem* item)const; - bool isItemCachableInCpu(const HbIconCacheItem* item)const; + bool isItemCachableInGpu(const HbIconCacheItem *item)const; + bool isItemCachableInCpu(const HbIconCacheItem *item)const; void memoryGood(); - void freeGpuRam(int bytes); + void freeGpuRam(int bytes, bool useSwRendering); void freeUnusedGpuResources(); QVector getKeys(const QString &filename) const; + int gpuLRUSize() const; //Debug Code for Test Purpose #ifdef HB_ICON_CACHE_DEBUG void cleanVectorLRUList(); @@ -69,7 +70,6 @@ int cacheMissCount(); int rasterLruCount(); int vectorLruCount(); - int gpuLRUSize() const; #endif private: @@ -78,9 +78,9 @@ void createCpuCacheSpace(int itemCost); void updateGpuLruSize(int iconDataCost); void updateCpuLruSize(int iconDataCost); - void removeFromCache(const HbIconKey &key, const HbIconCacheItem* releaseItem); - void releaseVectorItem(HbIconCacheItem* releaseItem); - void releaseRasterItem(HbIconCacheItem* releaseItem); + void removeFromCache(const HbIconKey &key, const HbIconCacheItem *releaseItem); + void releaseVectorItem(HbIconCacheItem *releaseItem); + void releaseRasterItem(HbIconCacheItem *releaseItem); private: QHash *cache; diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbpixmapiconprocessor_p.cpp --- a/src/hbservers/hbthemeserver/hbpixmapiconprocessor_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbpixmapiconprocessor_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,10 +36,6 @@ #include "hbiconsource_p.h" #include "hbthemeserverutils_p.h" -#if defined (Q_OS_SYMBIAN) -#include -#include -#endif //Q_OS_SYMBIAN /*! @hbserver @@ -131,9 +127,9 @@ } else if (iconType == "PIC") { isIconCreated = renderPicToPixmap(iconPath); } else if (iconType == "NVG") { -#if defined (Q_OS_SYMBIAN) +#if defined (HB_NVG_CS_ICON) isIconCreated = renderNvgToPixmap(iconPath); -#endif //Q_OS_SYMBIAN +#endif //HB_NVG_CS_ICON } else { isIconCreated = renderOtherFormatsToPixmap(iconPath); } @@ -367,7 +363,39 @@ return true; } -#if defined (Q_OS_SYMBIAN) +#if defined (HB_NVG_CS_ICON) + +VGIColorBufferFormat HbPixmapIconProcessor::mapToVgiDisplayFormat( QImage::Format imageFormat ) const +{ + VGIColorBufferFormat format; + switch(imageFormat) + { + case QImage::Format_Mono: + case QImage::Format_RGB32: + case QImage::Format_ARGB32: + format = VGI_COLOR_BUFFER_FORMAT_ARGB8888; + break; + case QImage::Format_ARGB32_Premultiplied: + format = VGI_COLOR_BUFFER_FORMAT_ARGB8888_PRE; + break; + case QImage::Format_RGB16: + case QImage::Format_ARGB8565_Premultiplied: + case QImage::Format_RGB666: + case QImage::Format_ARGB6666_Premultiplied: + case QImage::Format_RGB555: + case QImage::Format_ARGB8555_Premultiplied: + break; + case QImage::Format_RGB888: + format = VGI_COLOR_BUFFER_FORMAT_RGB888; + break; + case QImage::Format_RGB444: + case QImage::Format_ARGB4444_Premultiplied: + case QImage::Format_Invalid: + break; + } + return format; +} + /** * HbNvgIconProcessor::renderNvgToPixmap() * This is used to render NVG data to a pixmap using the Software OpenVG @@ -376,6 +404,14 @@ bool HbPixmapIconProcessor::renderNvgToPixmap(const QString& iconPath) { bool isIconCreated = false; + + CNvgEngine* nvgengine = 0; + TRAPD(error, nvgengine = CNvgEngine::NewL()); + if (error != KErrNone) { + return isIconCreated; + } + QScopedPointer nvgEngine(nvgengine); + bool isDefaultSize = iconKey.size.isNull(); HbIconSource *source = HbThemeServerUtils::getIconSource(iconPath); QByteArray *sourceByteArray = source->byteArray(); @@ -391,6 +427,15 @@ size = renderSize.toSize(); TSize surfaceSize(TSize(size.width(), size.height())); +/* QImage img(size,QImage::Format_ARGB32_Premultiplied); + + VGIColorBufferFormat format; + TInt stride = img.bytesPerLine(); + TUint8* imageBuffer = img.bits(); // get the pointer to image buffer. + // Map Qimage display modes to the VGI display modes. + format = mapToVgiDisplayFormat(img.format()); + qDebug()<<"Format = " < bitmapData(new CFbsBitmap()); TInt err = bitmapData.data()->Create(surfaceSize, EColor16MA); @@ -398,33 +443,40 @@ return isIconCreated; } + //Reset the surface incase already present VGISymbianTerminate(); // Surface creation - err = VGISymbianInitialize( surfaceSize, VGI_COLORSPACE_SRGB ); + /*TInt*/ err = VGISymbianInitialize( surfaceSize, VGI_COLORSPACE_SRGB ); if( err != KErrNone) { return isIconCreated; } - QScopedPointer nvgEngine(CNvgEngine::NewL()); - //CNvgEngine* nvgEngine = CNvgEngine::NewL(); HbNvgAspectRatioSettings settings = mapKeyAspectRatioToNvgAspectRatio(iconKey.aspectRatioMode); nvgEngine.data()->SetPreserveAspectRatio(settings.nvgAlignStatusAndAspectRatio, settings.type); // Rendering onto active surface TPtr8 data ((unsigned char*)byteArray.data(), byteArray.length(), byteArray.length()); - err = nvgEngine.data()->DrawNvg(data, surfaceSize, bitmapData.data(), 0); + err = nvgEngine.data()->DrawNvg(data, surfaceSize, 0, 0); if(err !=KErrNone) { return isIconCreated; } //Copy the data from the surface +/* err = VGICopyToTarget(format, stride, imageBuffer, 0, NULL, VGI_COPY_TRANSPARENT_PIXELS); +#ifdef __DEBUG + qDebug() << "error code for VGICopyToTarget()"<< err; +#endif + //Get Pixmap from the Qimage. + pixmap = QPixmap::fromImage(img); */ + err = VGISymbianCopyToBitmap(bitmapData.data(), 0, VGI_COPY_TRANSPARENT_PIXELS); if(err !=KErrNone) { return isIconCreated; } //Get Pixmap from the Symbian Native format. pixmap = QPixmap::fromSymbianCFbsBitmap(bitmapData.data()); + isIconCreated = true; //Clean Up @@ -465,5 +517,5 @@ } return settings; } -#endif //Q_OS_SYMBIAN +#endif //HB_NVG_CS_ICON diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbpixmapiconprocessor_p.h --- a/src/hbservers/hbthemeserver/hbpixmapiconprocessor_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbpixmapiconprocessor_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,9 +29,14 @@ #include "hbiconprocessor_p.h" #include -#if defined (Q_OS_SYMBIAN) +#if defined (HB_NVG_CS_ICON) #include -#endif //Q_OS_SYMBIAN + +// Note: Cases of the following two directory names intentionally differ to +// match the cases of the corresponding directories in Symbian 4. +#include +#include +#endif //HB_NVG_CS_ICON QT_BEGIN_NAMESPACE class QSvgRenderer; @@ -41,13 +46,13 @@ class HbThemeServerSymbian; -#if defined (Q_OS_SYMBIAN) +#if defined (HB_NVG_CS_ICON) struct HbNvgAspectRatioSettings { TNvgAlignStatusType nvgAlignStatusAndAspectRatio; TNvgMeetOrSliceType type; }; -#endif //Q_OS_SYMBIAN +#endif //HB_NVG_CS_ICON class HbPixmapIconProcessor : public HbIconProcessor { @@ -71,11 +76,12 @@ bool renderPicToPixmap(const QString& iconPath); bool renderOtherFormatsToPixmap(const QString& iconPath); -#if defined (Q_OS_SYMBIAN) +#if defined (HB_NVG_CS_ICON) + VGIColorBufferFormat mapToVgiDisplayFormat(QImage::Format imageFormat) const; bool renderNvgToPixmap(const QString& iconPath); HbNvgAspectRatioSettings mapKeyAspectRatioToNvgAspectRatio( Qt::AspectRatioMode aspectRatio) const; -#endif //Q_OS_SYMBIAN +#endif //HB_NVG_CS_ICON private: QPixmap pixmap; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbsgimageiconprocessor_p.cpp --- a/src/hbservers/hbthemeserver/hbsgimageiconprocessor_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbsgimageiconprocessor_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -274,6 +274,7 @@ } int iconCount = multiPieceIconParams.multiPartIconList.count(); + GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); for (int i = 0; i < iconCount; i++) { HbIconFormatType type = multiPieceIconInfo[i].type; bool success = false; @@ -285,14 +286,10 @@ int pieceTopRight = position.x() + multiPieceIconParams.multiPartIconData.targets[i].width(); position.setX(consolidatedIconWidth - pieceTopRight); } - - - HbIconSource *source = HbThemeServerUtils::getIconSource(multiPieceIconParams.multiPartIconList[i]); - QByteArray *sourceByteArray = source->byteArray(); - if( !sourceByteArray ) { - return false; - } - byteArray = *sourceByteArray; + + byteArray = QByteArray::fromRawData((char*)manager->base() + multiPieceIconInfo[i].nvgData.offset, + multiPieceIconInfo[i].nvgData.dataSize); + success = renderNvg(byteArray, QRect(position, multiPieceIconParams.multiPartIconData.pixmapSizes[i]), (Qt::AspectRatioMode)multiPieceIconParams.aspectRatioMode, mirrored); diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserver.pro --- a/src/hbservers/hbthemeserver/hbthemeserver.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbthemeserver.pro Thu Jul 22 16:36:53 2010 +0100 @@ -26,6 +26,7 @@ TEMPLATE = app TARGET = hbthemeserver CONFIG -= app_bundle +DEFINES += HB_LIB_DIR=\"\\\"$${HB_LIB_DIR}\\\"\" DEFINES += HB_BUILD_DIR=\"\\\"$${HB_BUILD_DIR}\\\"\" # directories @@ -61,7 +62,9 @@ symbian { SOURCES += $$PWD/hbthemeserver_symbian.cpp + SOURCES += $$PWD/hbthemewatcher_symbian.cpp HEADERS += $$PWD/hbthemeserver_symbian_p_p.h + HEADERS += $$PWD/hbthemewatcher_symbian_p.h LIBS += -lapgrfx -lws32 -lavkon -lcone -leikcore -lNVGDecoder_SW -llibvgi -lfbscli -lefsrv nvg { @@ -95,12 +98,8 @@ # AllFiles is needed to be able to access icon and effect files in # an application's private folder for example. - TARGET.CAPABILITY = CAP_SERVER AllFiles - # TARGET.CAPABILITY += ProtServ TrustedUI - -} else { - SOURCES += $$PWD/hbthemeserver_generic.cpp - HEADERS += $$PWD/hbthemeserver_generic_p_p.h + TARGET.CAPABILITY = CAP_SERVER ProtServ + } QT = core gui svg network diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserver_generic.cpp --- a/src/hbservers/hbthemeserver/hbthemeserver_generic.cpp Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,1548 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbServers module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#include "hbthemeserver_generic_p_p.h" -#include "hbthemeserverapplication_p.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "hbthemecommon_p.h" -#include "hbmemoryutils_p.h" -#include "hbthemeserverutils_p.h" -#include "hbiconcacheitemcreator_p.h" -#include "hbiconloader_p.h" -#include "hbcache_p.h" -#include "hbdeviceprofiledatabase_p.h" -#include "hbpixmapiconimpl_p.h" -#include "hbpixmapiconprocessor_p.h" -#include "hblayeredstyleloader_p.h" -#include "hbthemesystemeffect_p.h" -#include "hbsharedmemorymanager_p.h" -#include "hbtypefaceinfodatabase_p.h" - -static const int CLOSE_TIMEOUT = 3000; - -/*! - @hbserver - \class HbThemeServerPrivate - \brief HbThemeServerPrivate implements the theme server -*/ - -#ifdef THEME_SERVER_TRACES -extern QLabel *testLabel; -#endif - -// 5 MB GPU & CPU cache size -#define GPU_CACHE_SIZE 0x500000 -#define CPU_CACHE_SIZE 0x500000 - -/*! - \fn HbThemeServerPrivate::HbThemeServerPrivate() - Constructor - \a parent -*/ -#ifdef QT_DEBUG -HbThemeServerPrivate::HbThemeServerPrivate(QWidget *parent): QMainWindow(parent), server(new QLocalServer(this)) -#else -HbThemeServerPrivate::HbThemeServerPrivate(): server(new QLocalServer(this)) -#endif -{ - iThemeSelectionClient = 0; - sessionList.clear(); -#ifdef QT_DEBUG - setWindowTitle("Theme Server"); - setCentralWidget(&statusLabel); -#endif - // renderMode set to SW mode by default - renderMode = ESWRendering; - // Using QScopedPointer so that it deallocates memory - // when std::badalloc exception occurs. - QScopedPointer tempIconCache(new HbIconDataCache()); - QScopedPointer tempCssCache(new HbCache()); - iconCache = tempIconCache.take(); - cssCache = tempCssCache.take(); - setMaxGpuCacheSize(GPU_CACHE_SIZE); - setMaxCpuCacheSize(CPU_CACHE_SIZE); - - connect(server, SIGNAL(newConnection()), this, SLOT(newClientConnected())); -} - -/*! - \fn HbThemeServerPrivate::~HbThemeServerPrivate() - Destructor -*/ -HbThemeServerPrivate::~HbThemeServerPrivate() -{ - server->close(); - delete server; // Order of Deletion needs to be maintain ,as the QLocalServer should delete first before deleting Server data so All sessions will be cleanup first. - delete iconCache; - delete cssCache; -} - -/*! - \fn HbThemeServerPrivate::start() - start the themeserver -*/ -bool HbThemeServerPrivate::start() -{ - // try max 2 times - bool success = listen() || listen(); - if (!success) { - qWarning() << "HbThemeServer: unable to start the server."; - } else { -#ifdef QT_DEBUG - statusLabel.setText("Theme Server Started"); -#endif - } - return success; -} - -bool HbThemeServerPrivate::listen() -{ - bool success = server->listen(THEME_SERVER_NAME); - if (!success) { - qWarning() << "HbThemeServer:" << server->errorString(); - if (server->serverError() == QAbstractSocket::AddressInUseError) { - stop(); - } - } - return success; -} - -/*! - \fn HbThemeServerPrivate::stop() - stop the themeserver -*/ -void HbThemeServerPrivate::stop() -{ - if (server) { - server->close(); - } - QLocalServer::removeServer(THEME_SERVER_NAME); -#ifdef QT_DEBUG - statusLabel.setText("Theme Server Stopped"); -#endif -} - -/*! - \fn HbThemeServerPrivate::insertIconCacheItem() - Insert item into the icon cache - \a key denotes the unique identifier for the cache item that is to be inserted into the cache. - \a item denotes the cache item that is to be inserted -*/ -bool HbThemeServerPrivate::insertIconCacheItem(const HbIconKey &key, HbIconCacheItem *item) -{ - return (iconCache->insert(key, item)); -} - -/*! - \fn HbThemeServerPrivate::insertCssCacheItem() - Insert item into the css cache - \a key denotes the unique identifier for the cache item that is to be inserted into the cache. - \a item denotes the cache item that is to be inserted -*/ -bool HbThemeServerPrivate::insertCssCacheItem(const QString &key, HbCacheItem *item) -{ - return (cssCache->insert(key, item)); -} - -/*! - \fn HbThemeServerPrivate::iconCacheItem() - Find an item in the icon cache - \a key denotes the unique identifier for the cache item that is to be found in the cache. -*/ -HbIconCacheItem *HbThemeServerPrivate::iconCacheItem(const HbIconKey &key) -{ - return(iconCache->getCacheItem(key, renderMode, false)); -} - -/*! - \fn HbThemeServerPrivate::cssCacheItem() - Find an item in the css cache - \a key denotes the unique identifier for the cache item that is to be found in the cache. -*/ -HbCacheItem *HbThemeServerPrivate::cssCacheItem(const QString &key) -{ - return(cssCache->cacheItem(key)); -} - -/*! - \fn HbThemeServerPrivate::setMaxGpuCacheSize() - Provides a mechanism for setting the Gpu cache limit - \a size denotes the cache limit in bytes e.g. size = 0x500000 -*/ -void HbThemeServerPrivate::setMaxGpuCacheSize(int size) -{ - iconCache->setMaxGpuCacheSize(size); -} - -/*! - \fn HbThemeServerPrivate::setMaxCpuCacheSize() - Provides a mechanism for setting the Cpu cache limit - \a size denotes the cache limit in bytes e.g. size = 0x500000 -*/ -void HbThemeServerPrivate::setMaxCpuCacheSize(int size) -{ - iconCache->setMaxCpuCacheSize(size); -} - -/*! - \fn HbThemeServerPrivate::removeIconCacheItem() - Remove an item from iconcache corresponding to key. - \a key denotes the unique identifier for the cache item that is to be removed from the cache. -*/ -void HbThemeServerPrivate::removeIconCacheItem(const HbIconKey &key) -{ - iconCache->remove(key); -} - -/*! - \fn HbThemeServerPrivate::removeCssCacheItem() - Remove item from css cache corresponding to key. - \a key denotes the unique identifier for the cache item that is to be removed from the cache. -*/ -void HbThemeServerPrivate::removeCssCacheItem(const QString &key) -{ - cssCache->remove(key); -} - -/*! - \fn HbThemeServerPrivate::clearIconCache() - Clears the icon cache -*/ -void HbThemeServerPrivate::clearIconCache() -{ - iconCache->clear(); -} - -/*! - \fn HbThemeServerPrivate::clearCssCache() - Clears the css cache -*/ -void HbThemeServerPrivate::clearCssCache() -{ - cssCache->clear(); -} - - -/*! - data.type = INVALID_FORMAT; - \fn HbThemeServerPrivate::handleThemeSelection() - Handle change of theme - \a newTheme -*/ -void HbThemeServerPrivate::handleThemeSelection(const QString &newTheme) -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << " theme=" << newTheme; -#endif - // Modify the QSettings to store the applied theme - QSettings settings(QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT)); - - // Clear cached icons and session data - clearIconCache(); - HbThemeServerSession *session; - foreach(session, sessionList) { - session->clearSessionIconData(); - } - - QString cleanThemeName = newTheme.trimmed(); - settings.remove("currenttheme"); //temporary - settings.setValue(CURRENT_THEME_KEY, cleanThemeName); - settings.sync(); - - // Register new system effects - HbThemeSystemEffect::handleThemeChange(cleanThemeName); - - HbThemeServerRequest requestType; - requestType = EThemeSelection; - QByteArray block; - QDataStream out(&block, QIODevice::WriteOnly); - out << (int)requestType; - out << cleanThemeName; - writeToClients(block); -} - -void HbThemeServerPrivate::handleContentUpdate(const QStringList &fileNames) -{ - // If list is empty clear all themed content - if (!fileNames.count()) { - // Clear icons - HbThemeServerSession *session; - foreach(session, sessionList) { - session->clearSessionIconData(); - } - iconCache->clear(); - - // Clear effects - HbThemeServerUtils::clearSharedEffects(); - - // Clear stylesheets - QHash::const_iterator itEnd(themePriorityItems.constEnd()); - for (QHash::const_iterator iter = themePriorityItems.constBegin(); - iter != itEnd; - ++iter) { - cssCache->cacheHandle().remove(iter.key()); - HbThemeServerSession *session; - foreach(session, sessionList) { - session->removeSessionCssItem(iter.key()); - } - } - themePriorityItems.clear(); - - return; - } - - // Else delete only specified files - for (int i=0; icacheHandle().remove(filename); - themePriorityItems.remove(filename); - HbThemeServerSession *session; - foreach(session, sessionList) { - session->removeSessionCssItem(filename); - } - break; - } - // Effect - if (HbThemeServerUtils::removeSharedEffect(filename)) { - break; - } - - // Icon - QVector keys = iconCache->getKeys(filename); - for (int j = 0; jremoveSessionIconItem(*keys.at(j)); - } - iconCache->remove(*keys.at(j),false); - } - } -} - -/*! - \fn HbThemeServerPrivate::writeToClients() - Write to all clients - \a block -*/ -void HbThemeServerPrivate::writeToClients(QByteArray &block) -{ - HbThemeServerSession *session; -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << "socketlist count: " << sessionList.count(); -#endif - foreach(session, sessionList) { - QLocalSocket * curSocket = session->clientConnection(); - if (iThemeSelectionClient != curSocket) { - curSocket->write(block); - } - } -} - -/*! - \fn HbThemeServerPrivate::setThemeSelectionClient() - Set the theme selection client - \a socket -*/ -void HbThemeServerPrivate::setThemeSelectionClient(QLocalSocket *socket) -{ - iThemeSelectionClient = socket; -} - -/*! - \fn HbThemeServerPrivate::newClientConnected() - Creates a new session with the server. -*/ -void HbThemeServerPrivate::newClientConnected() -{ - QLocalSocket * newClient = server->nextPendingConnection(); - if (newClient) { - HbThemeServerSession * newSession = - new HbThemeServerSession(newClient, this); - // Store list of client connected to server - sessionList.append(newSession); -#ifdef THEME_SERVER_TRACES - qDebug() << "Total No of Connection after addition = " << sessionList.count(); -#endif - connect(newClient, SIGNAL(disconnected()), this, SLOT(removeFromList())); - } -} - -/*! - \fn HbThemeServerPrivate::removeFromList() - Remove a session from list -*/ -void HbThemeServerPrivate::removeFromList() -{ - QList::const_iterator itEnd(sessionList.constEnd()); - - for (QList::const_iterator iter = sessionList.constBegin(); - iter != itEnd; - ++iter) { - if ((*iter)->clientConnection() == (QLocalSocket *)sender()) { - sessionList.removeOne((*iter)); - delete(*iter); - break; - } - } - - QTimer::singleShot(CLOSE_TIMEOUT, this, SLOT(clienDisconnected())); -} - -void HbThemeServerPrivate::clienDisconnected() -{ -#ifdef THEME_SERVER_TRACES - qDebug()<<"Total No of Connection after deletion = "<count(); -} - -int HbThemeServerPrivate::freeVectorMemory() -{ - return iconCache->freeVectorMemory(); -} - -int HbThemeServerPrivate::freeRasterMemory() -{ - return iconCache->freeRasterMemory(); -} - -int HbThemeServerPrivate::lastAddedRefCount() -{ - return iconCache->lastAddedRefCount(); -} - -int HbThemeServerPrivate::lastAddedItemMem() -{ - return iconCache->lastAddedItemMem(); -} - -int HbThemeServerPrivate::lastRemovedItemMem() -{ - return iconCache->lastRemovedItemMem(); -} - -int HbThemeServerPrivate::lastRemovedItemRfCount() -{ - return iconCache->lastRemovedItemRfCount(); -} - -bool HbThemeServerPrivate::enableCache(bool cacheIt) -{ - return iconCache->enableCache(cacheIt); -} - -int HbThemeServerPrivate::cacheHitCount() -{ - return iconCache->cacheHitCount(); -} - -int HbThemeServerPrivate::cacheMissCount() -{ - return iconCache->cacheMissCount(); -} - -int HbThemeServerPrivate::serverHeapSize() -{ - return 0; -} - -void HbThemeServerPrivate::cleanVectorLRUList() -{ - iconCache->cleanVectorLRUList(); -} - -void HbThemeServerPrivate::cleanRasterLRUList() -{ - iconCache->cleanRasterLRUList(); -} - -int HbThemeServerPrivate::rasterLruCount() -{ - return iconCache->rasterLruCount(); -} - -int HbThemeServerPrivate::vectorLruCount() -{ - return iconCache->vectorLruCount(); -} -#endif - -//*********************************** -//HbThemeServerSession - implementations -//*********************************** -/*! - @hbserver - \class HbThemeServerSession - \brief HbThemeServerSession implements the sessions associated with the server. - The Theme server maintains a list of sessions, each session corresponding to a client. - Each session in turn is responsible for keeping track of client specific resources. - In case of Icon caching, a session maintains a list of Icon keys. - A key is added to the list only if the corresponding cache item has been successfully inserted into cache - or if a previously cached icon is requested and successfully found in the cache. - In case of client crash or graceful exit of client, the server goes through its list of sessions, - finds the session corresponding to the client, removes the session from its session list and deletes the session. - In the session destructor, the session specific resources are cleaned up. - In case of icon caching, the list of icon keys is traversed and a remove operation is performed on the cache - items corresponding to these keys. On removal, the items reference count is decremented and in case the - reference count becomes 0, the cache item instance gets added to the back of the LRU list. - -*/ - -/*! - \fn HbThemeServerSession::HbThemeServerSession() - Constructor - \a aClientConnection indicates the local socket that is contained within this session - \a aServer denotes the handle to the theme server -*/ -HbThemeServerSession::HbThemeServerSession(QLocalSocket *aClientConnection, HbThemeServerPrivate *aServer) -{ - iServer = aServer; - iClientConnection = aClientConnection; - sessionIconData.clear(); - sessionCssData.clear(); - connect(iClientConnection, SIGNAL(readyRead()), this, SLOT(readDataFromClient())); - connect(iClientConnection, SIGNAL(disconnected()), iClientConnection, SLOT(deleteLater())); -} - -/*! - \fn HbThemeServerSession::~HbThemeServerSession() - Destructor -*/ -HbThemeServerSession::~HbThemeServerSession() -{ - //Remove icon related-session-specific data - QList::const_iterator itEnd(sessionIconData.constEnd()); - for (QList::const_iterator iter = sessionIconData.constBegin(); - iter != itEnd; - ++iter) { - iServer->removeIconCacheItem(*iter); - } - - //Remove css related-session-specific data - QList::const_iterator iterEnd(sessionCssData.constEnd()); - for (QList::const_iterator iter = sessionCssData.constBegin(); - iter != iterEnd; - ++iter) { - iServer->removeCssCacheItem(*iter); - } - sessionIconData.clear(); - sessionCssData.clear(); -} - -/*! - \fn HbThemeServerSession::clientConnection() - Returns a handle to the local socket contained by the session -*/ -QLocalSocket * HbThemeServerSession::clientConnection() -{ - return iClientConnection; -} - -/*! - \fn HbThemeServerSession::readDataFromClient() - Slot that is reponsible for reading data from the client - Is responsible for performing operations such as creating cache items and storing into cache - and writing back data to the client -*/ -void HbThemeServerSession::readDataFromClient() -{ -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO; -#endif - HbSharedIconInfo data; - data.type = INVALID_FORMAT; - HbThemeServerRequest requestType; - QByteArray inputByteArray = ((QLocalSocket *)sender())->readAll(); - if (inputByteArray.size() > 0) { - QDataStream inputDataStream(inputByteArray); - int clue; - inputDataStream >> clue; - requestType = (HbThemeServerRequest)clue; - -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << "recognizer: " << requestType; -#endif - -//Debug Code for Test Purpose -#ifdef HB_ICON_CACHE_DEBUG - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - outputDataStream << (int)requestType; -#endif - switch (requestType) { - case EStyleSheetLookup: { - QString fileName; - int priority; - HbLayeredStyleLoader::LayerPriority layerdPriority; - inputDataStream >> fileName; - inputDataStream >> priority; - layerdPriority = (HbLayeredStyleLoader::LayerPriority) priority; - QByteArray output = handleStyleSheetLookup((int) requestType, fileName, layerdPriority); - ((QLocalSocket *)sender())->write(output); - break; - } - case EWidgetMLLookup: { - QString filename; - QString section; - QString layout; - - inputDataStream >> filename; - inputDataStream >> layout; - inputDataStream >> section; - // handle the shared Widgetml look up. - QByteArray output = iServer->handleSharedWidgetMLLookup(filename, layout, section); - ((QLocalSocket *)sender())->write(output); - break; - } - case EDeviceProfileOffset: { - int offset = -1; - HbDeviceProfileDatabase *deviceProfileDatabase = - HbDeviceProfileDatabase::instance(HbMemoryManager::SharedMemory); - - if (deviceProfileDatabase) { - offset = deviceProfileDatabase->deviceProfilesOffset(); - } - // offset will be -1 if the deviceProfileDatabase is NULL. - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - outputDataStream << requestType; - outputDataStream << offset; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case EEffectLookupFilePath: - case EEffectAdd: { - QString fileName; - inputDataStream >> fileName; - QByteArray output = iServer->handleSharedEffectAddAndFileLookup((int) requestType, fileName); - ((QLocalSocket *)sender())->write(output); - break; - } - case EThemeSelection: { - QString themename; - QLocalSocket *themeSelectionClient = (QLocalSocket *)sender(); - inputDataStream >> themename; - iServer->setThemeSelectionClient(themeSelectionClient); - iServer->handleThemeSelection(themename); - break; - } - case EThemeContentUpdate: { - QStringList themedItems; - inputDataStream >> themedItems; - iServer->handleContentUpdate(themedItems); - HbThemeServerRequest requestType = EThemeContentUpdate; - QByteArray block; - QDataStream out(&block, QIODevice::WriteOnly); - out << (int)requestType; - out << themedItems; - iServer->writeToClients(block); - break; - } - case EThemeServerStop: { - //This segment is used by HbThemeApiWrapperUi. - //When no HbApplication is open and HbThemeserver has only HbThemeApiWrapperUi as client, making sessionListCount =1 - //HbThemeserver is closed otherwise warning is shown. - //QCoreApplication::quit() removes the UI of HbThemeServer. Destructor of HbThemeServer will be called where it was instantiated. - if (iServer->sessionListCount() == 1) { -#ifdef QT_DEBUG - iServer->close(); -#endif - ((QLocalSocket *)sender())->disconnectFromServer(); - QCoreApplication::quit(); - } else { - qWarning() << "Close all HbApplications before closing hbthemeserver!!"; - } - break; - } - case EIconLookup: { - QString filename; - QSizeF size; - int aspectRatioMode; - int mode; - bool mirrored; - int options; - QColor color; - inputDataStream >> filename; - inputDataStream >> size; - inputDataStream >> aspectRatioMode; - inputDataStream >> mode; - inputDataStream >> mirrored; - inputDataStream >> options; - inputDataStream >> color; - -#ifdef THEME_SERVER_TRACES - qDebug() << "image req at server: " << filename; -#endif - HbIconKey key(filename, size, (Qt::AspectRatioMode)aspectRatioMode, (QIcon::Mode)mode, mirrored, color, iServer->currentRenderingMode()); - QByteArray output = handleIconLookup(key, data, options); - ((QLocalSocket *)sender())->write(output); - break; - } - case EIconDefaultSize: - break; //todo - case EMultiPieceIcon: { - HbMultiIconParams frameItemParams; - inputDataStream >> frameItemParams.multiPartIconList; - inputDataStream >> frameItemParams.multiPartIconData.multiPartIconId; - - int noOfPieces = 1; - if (frameItemParams.multiPartIconData.multiPartIconId.contains("_3PV", Qt::CaseInsensitive) || - frameItemParams.multiPartIconData.multiPartIconId.contains("_3PH", Qt::CaseInsensitive)) { - noOfPieces = 3; - } else if (frameItemParams.multiPartIconData.multiPartIconId.contains("_9P", Qt::CaseInsensitive)) { - noOfPieces = 9; - } - - for (int i = 0; i < noOfPieces; i++) { - inputDataStream >> frameItemParams.multiPartIconData.sources[i]; - } - - for (int i = 0; i < noOfPieces; i++) { - inputDataStream >> frameItemParams.multiPartIconData.targets[i]; - } - - for (int i = 0; i < noOfPieces; i++) { - inputDataStream >> frameItemParams.multiPartIconData.pixmapSizes[i]; - } - - inputDataStream >> frameItemParams.size; - inputDataStream >> frameItemParams.aspectRatioMode; - inputDataStream >> frameItemParams.mode; - inputDataStream >> frameItemParams.mirrored; - inputDataStream >> frameItemParams.options; - inputDataStream >> frameItemParams.color; - -#ifdef THEME_SERVER_TRACES - qDebug() << "image req at server: " << frameItemParams.multiPartIconList; -#endif - - int index = frameItemParams.multiPartIconList[0].lastIndexOf("/"); - QString iconId = frameItemParams.multiPartIconList[0].left(index + 1); - HbSharedIconInfo stitchedData; - QT_TRY { - iconId.append(frameItemParams.multiPartIconData.multiPartIconId); - HbIconKey finalIconKey(iconId, frameItemParams.size, - (Qt::AspectRatioMode)frameItemParams.aspectRatioMode, - (QIcon::Mode)frameItemParams.mode, frameItemParams.mirrored, - frameItemParams.color, (HbRenderingMode)frameItemParams.renderMode); - - stitchedData.type = INVALID_FORMAT; - - if (!iconInfoFromSingleIcon(finalIconKey, stitchedData)) { - iconInfoFromMultiParts(frameItemParams, noOfPieces, finalIconKey, stitchedData); - } - } QT_CATCH(const std::bad_alloc &) { - stitchedData.type = INVALID_FORMAT; - } - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest request; - request = EMultiPieceIcon; - fillOutPutDataStream(outputDataStream, stitchedData, request); -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << " offset= " << stitchedData.pixmapData.offset << " format= " << stitchedData.pixmapData.format; - testLabel->setPixmap(QPixmap::fromImage( - QImage( - HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, stitchedData.pixmapData.offset), - stitchedData.pixmapData.width, - stitchedData.pixmapData.height, - stitchedData.pixmapData.format))); -#endif - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case EMultiIcon: { - QStringList fileList; - QVector sizeList; - QSizeF size; - int aspectRatioMode; - int mode; - bool mirrored; - int options; - QColor color; - inputDataStream >> fileList; - for (int i = 0; i < fileList.count(); i++) { - inputDataStream >> size; - sizeList << size; - } - inputDataStream >> aspectRatioMode; - inputDataStream >> mode; - inputDataStream >> mirrored; - inputDataStream >> options; - inputDataStream >> color; - -#ifdef THEME_SERVER_TRACES - qDebug() << "image req at server: " << fileList; -#endif - QByteArray output; - for (int i = 0; i < fileList.count(); i++) { - HbIconKey key(fileList[i], sizeList[i], - static_cast(aspectRatioMode), - static_cast(mode), mirrored, color, iServer->currentRenderingMode()); - output.append(handleIconLookup(key, data, options)); - } - - ((QLocalSocket *)sender())->write(output); - - break; - } - case ENotifyForegroundLost: { - //Nothing to do here when the app notifies it's foreground lost event - break; - } - //Debug Code for Test Purpose -#ifdef HB_ICON_CACHE_DEBUG - case ECacheIconCount: { - int count = iServer->cacheIconCount(); - outputDataStream << count; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ERasterMemLimit: { - int limit; - inputDataStream >> limit; - iServer->setMaxGpuCacheSize(limit); - break; - } - case EVectorMemLimit: { - int limit; - inputDataStream >> limit; - iServer->setMaxCpuCacheSize(limit); - break; - } - case EFreeRasterMem: { - int freeRastMem = iServer->freeRasterMemory(); - outputDataStream << freeRastMem; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case EFreeVectorMem: { - int freeVectMem = iServer->freeVectorMemory(); - outputDataStream << freeVectMem; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ELastAddedItemMem { - int lAddItemMem = iServer->lastAddedItemMem(); - outputDataStream << lAddItemMem; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ELastRemovedItemMem { - int lRemItemMem = iServer->lastRemovedItemMem(); - outputDataStream << lRemItemMem; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ELastRemovedItemRefCount: { - int lRemItemRfCnt = iServer->lastRemovedItemRfCount(); - outputDataStream << lRemItemRfCnt; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ELastAddedItemRefCount: { - int lAddItemRfCnt = iServer->lastAddedRefCount(); - outputDataStream << lAddItemRfCnt; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case EEnableCache: { - int enable ; - inputDataStream >> enable; - bool success = iServer->enableCache(enable); - outputDataStream << (int)success; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ECacheHit: { - int cacheHitCnt = iServer->cacheHitCount(); - outputDataStream << cacheHitCnt; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ECacheMiss: { - int cacheMissCnt = iServer->cacheMissCount(); - outputDataStream << cacheMissCnt; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ECleanRasterLRUList: { - iServer->cleanRasterLRUList(); - break; - } - case ECleanVectorLRUList: { - iServer->cleanVectorLRUList(); - break; - } - case EGpuLruCount: { - int rasterLruCount = iServer->rasterLruCount(); - outputDataStream << rasterLruCount; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case ECpuLruCount: { - int vectorLruCount = iServer->vectorLruCount(); - outputDataStream << vectorLruCount; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case EServerHeap: { - } -#endif -#ifdef HB_THEME_SERVER_MEMORY_REPORT - case ECreateMemoryReport: { - GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - static_cast(manager)->createReport(); - break; - } -#endif - case EUnloadIcon: { - QString filename; - QSizeF size; - int aspectRatioMode; - int mode; - bool mirrored; - int options; - QColor color; - inputDataStream >> filename; - inputDataStream >> size; - inputDataStream >> aspectRatioMode; - inputDataStream >> mode; - inputDataStream >> mirrored; - inputDataStream >> options; - inputDataStream >> color; - - HbIconKey key(filename, size, (Qt::AspectRatioMode)aspectRatioMode, - (QIcon::Mode)mode, mirrored, color, iServer->currentRenderingMode()); - iServer->removeIconCacheItem(key); - sessionIconData.removeOne(key); - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - outputDataStream << (int)requestType; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case EFreeSharedMem: { - int freeSharedMem = iServer->freeSharedMemory(); - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - outputDataStream << requestType; - outputDataStream << freeSharedMem; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - case EAllocatedSharedMem: { - int allocatedSharedMem = iServer->allocatedSharedMemory(); - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - outputDataStream << requestType; - outputDataStream << allocatedSharedMem; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - - case ETypefaceOffset: { - int offset = -1; - HbTypefaceInfoDatabase *typefaceDatabase = - HbTypefaceInfoDatabase::instance(HbMemoryManager::SharedMemory); - - if (typefaceDatabase) { - offset = typefaceDatabase->typefaceInfoVectorOffset(); - } - // offset will be -1 if the typefaceDatabase is NULL. - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - outputDataStream << requestType; - outputDataStream << offset; - ((QLocalSocket *)sender())->write(outputByteArray); - break; - } - - - default: - break; - } - } -} - -/*! - \fn HbThemeServerSession::iconInfoFromSingleIcon() - Checks for the cacheItem for a given key, if found gets the data relevant of the cacheItem. -*/ - -bool HbThemeServerSession::iconInfoFromSingleIcon(HbIconKey key, - HbSharedIconInfo &stitchedData) -{ - stitchedData.type = INVALID_FORMAT; - HbIconCacheItem * cacheItem = iServer->iconCacheItem(key); - if (cacheItem) { - getDataFromCacheItem(cacheItem, stitchedData); - return true; - } - return false; -} - -/*! - \fn HbThemeServerSession::createCacheItemData() - Creates a cacheItem of the given key and insert the item in to the list - else free the data allocated for the cache.. -*/ -bool HbThemeServerSession::createCacheItemData(HbIconKey key, int options , HbSharedIconInfo &data) -{ - HbIconCacheItem * cacheItemOfPiece = iServer->iconCacheItem(key); - if (cacheItemOfPiece) { - return true; - } - - QScopedPointer tempIconCacheItem; - bool insertKeyIntoSessionList = false; - data.type = INVALID_FORMAT; - QString format = HbThemeServerUtils::formatFromPath(key.filename); - - tempIconCacheItem.reset(HbIconCacheItemCreator::createCacheItem(key, - (HbIconLoader::IconLoaderOptions)options, - format, - iServer->currentRenderingMode(), - false)); - cacheItemOfPiece = tempIconCacheItem.data(); - if (cacheItemOfPiece) { - getDataFromCacheItem(cacheItemOfPiece, data); - if (data.type != INVALID_FORMAT) { - insertKeyIntoSessionList = iServer->insertIconCacheItem(key, cacheItemOfPiece); - if (!insertKeyIntoSessionList) { - //if insertion failed free the memory - freeDataFromCacheItem(cacheItemOfPiece); - data.type = INVALID_FORMAT; - } - } - } - tempIconCacheItem.take(); - return insertKeyIntoSessionList; -} - -/*! - \fn HbThemeServerSession::createStichedIconInfoOfParts() - Creates a consolidated icon of the available piece iconInfo. -*/ -bool HbThemeServerSession::createStichedIconInfoOfParts(QVector dataForParts, HbMultiIconParams params, - HbIconKey &finalIconKey, HbSharedIconInfo &stitchedData) -{ - HbIconCacheItem * cacheItem = iServer->iconCacheItem(finalIconKey); - if (cacheItem) { - return true; - } - bool insertKeyIntoSessionList = false; - stitchedData.type = INVALID_FORMAT; - QString format = HbThemeServerUtils::formatFromPath(params.multiPartIconList[0]); - - QScopedPointer tempIconProcessor(new HbPixmapIconProcessor(finalIconKey, - static_cast(params.options), format)); - HbPixmapIconProcessor * rasterIcon = tempIconProcessor.data(); - rasterIcon->createMultiPieceIconData(dataForParts, params); - - QScopedPointer tempIconCacheItem; - tempIconCacheItem.reset(HbIconCacheItemCreator::createCacheItem(finalIconKey, - static_cast(params.options), format, iServer->currentRenderingMode(),false)); - cacheItem = tempIconCacheItem.data(); - - cacheItem->rasterIconData = rasterIcon->sharedIconData(); - cacheItem->rasterIconDataCost = rasterIcon->sharedIconDataCost(); - stitchedData = cacheItem->rasterIconData; - if (stitchedData.type != INVALID_FORMAT) { - insertKeyIntoSessionList = iServer->insertIconCacheItem(finalIconKey, cacheItem); - if (!insertKeyIntoSessionList) { - //if insertion failed free the memory - freeDataFromCacheItem(cacheItem); - stitchedData.type = INVALID_FORMAT; - } - } - tempIconCacheItem.take(); - return insertKeyIntoSessionList; -} - - -/*! - \fn HbThemeServerSession::iconInfoFromMultiParts() - Creates a shared IconInfo of the piece files of a frame item and - tries to create a stiched icon of the same. -*/ -void HbThemeServerSession::iconInfoFromMultiParts(HbMultiIconParams params, - int noOfPieces, - HbIconKey &stichedKey, - HbSharedIconInfo &stitchedData) -{ - QVector keysInserted; - QVector dataForParts; - bool insertKeyIntoSessionList = false; - bool failedToCreateParts = false; - QString format; - try { - for (int i = 0; i < noOfPieces; i++) { - HbSharedIconInfo data; - bool iconPieceMirrored = false; - HbIconKey key(params.multiPartIconList.at(i), params.multiPartIconData.pixmapSizes[i], - static_cast(stichedKey.aspectRatioMode), - static_cast(stichedKey.mode), iconPieceMirrored, stichedKey.color,stichedKey.renderMode ); - insertKeyIntoSessionList = iconInfoFromSingleIcon(key, data); - if (!insertKeyIntoSessionList) { - insertKeyIntoSessionList = createCacheItemData(key, params.options, data); - } - if ((data.type == INVALID_FORMAT) || (!insertKeyIntoSessionList)) { - failedToCreateParts = true; - break; - } else { - //The session will only keep track of icons that were either successfully found or were - //successfully inserted in the cache. - keysInserted.append(key); - dataForParts.append(data); - sessionIconData.append(key); - } - }//end of for - } catch(std::exception &) { - failedToCreateParts = true; - } - - if ((failedToCreateParts) || (dataForParts.count() != noOfPieces) || (!insertKeyIntoSessionList)) { - //atLeast one of the icon did'nt get constructed , so move the cached piece icons to unused state and return - for (int i = 0; i < keysInserted.count(); i++) { - sessionIconData.removeOne(keysInserted.at(i)); - } - dataForParts.clear(); - stitchedData.type = INVALID_FORMAT; - return; - } -// Create a stitched icon of the available piece shared iconinfos - if ((dataForParts.count() == noOfPieces) && (!failedToCreateParts)) { - try { - if (createStichedIconInfoOfParts(dataForParts, params, stichedKey, stitchedData)) { - sessionIconData.append(stichedKey); - } - } catch(std::exception &) { - } - } -// Move the keys created for pieces to unused state*/ - for (int i = 0; i < keysInserted.count(); i++) { - sessionIconData.removeOne(keysInserted.at(i)); - } -} - -/*! - \fn HbThemeServerSession::clearSessionIconData() - Clears the session data of the icons found in the cache. -*/ -void HbThemeServerSession::clearSessionIconData() -{ - sessionIconData.clear(); -} - -void HbThemeServerSession::removeSessionIconItem(const HbIconKey &key) -{ - sessionIconData.removeAll(key); -} - -void HbThemeServerSession::removeSessionCssItem(const QString &key) -{ - sessionCssData.removeAll(key); -} - -/*! - \fn HbThemeServerSession::freeDataFromCacheItem() - Frees data from the cached item when insertion to the list fails. -*/ -void HbThemeServerSession::freeDataFromCacheItem(HbIconCacheItem* cacheItem) -{ - GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory) - if (cacheItem->rasterIconData.type != INVALID_FORMAT) { - switch (cacheItem->rasterIconData.type) { - case PIC : - manager->free(cacheItem->rasterIconData.picData.offset); - break; - case NVG : - manager->free(cacheItem->rasterIconData.nvgData.offset); - break; - case OTHER_SUPPORTED_FORMATS : - manager->free(cacheItem->rasterIconData.pixmapData.offset); - break; - default: - break; - } - } - if (cacheItem->vectorIconData.type != INVALID_FORMAT) { - switch (cacheItem->vectorIconData.type) { - case PIC : - manager->free(cacheItem->vectorIconData.picData.offset); - break; - case NVG : - manager->free(cacheItem->vectorIconData.nvgData.offset); - break; - case OTHER_SUPPORTED_FORMATS : - manager->free(cacheItem->vectorIconData.pixmapData.offset); - break; - default: - break; - } - } - if (cacheItem->blobIconData.type == BLOB) { - manager->free(cacheItem->blobIconData.blobData.offset); - } -} - -/*! - \fn HbThemeServerSession::fillOutPutDataStream() - Fills the Output data stream with the sharedIconInfo data. -*/ -void HbThemeServerSession::fillOutPutDataStream(QDataStream &outputDataStream, HbSharedIconInfo &data, HbThemeServerRequest request) -{ - outputDataStream << (int)request; - outputDataStream << (int)data.type; - - switch (data.type) { - case OTHER_SUPPORTED_FORMATS: - outputDataStream << data.pixmapData.offset; - outputDataStream << data.pixmapData.width; - outputDataStream << data.pixmapData.height; - outputDataStream << data.pixmapData.defaultWidth; - outputDataStream << data.pixmapData.defaultHeight; - outputDataStream << (int)data.pixmapData.format; - break; - /*case SVG:*/ - case PIC: { - outputDataStream << data.picData.offset; - outputDataStream << data.picData.dataSize; - outputDataStream << data.picData.defaultWidth; - outputDataStream << data.picData.defaultHeight; - break; - } - case NVG: { - outputDataStream << data.nvgData.offset; - outputDataStream << data.nvgData.dataSize; - break; - } - case BLOB: { - outputDataStream << data.blobData.offset; - outputDataStream << data.blobData.dataSize; - break; - } - default: - break; - } -} - -/*! - \fn HbThemeServerSession::getDataFromCacheItem() - Gets data from the cache Item. -*/ -void HbThemeServerSession::getDataFromCacheItem(HbIconCacheItem* cacheItem, HbSharedIconInfo &data) const -{ - if (cacheItem) { - if (cacheItem->rasterIconData.type != INVALID_FORMAT) { - data = cacheItem->rasterIconData; - } else if (cacheItem->vectorIconData.type != INVALID_FORMAT) { - data = cacheItem->vectorIconData; - } else if (cacheItem->blobIconData.type != INVALID_FORMAT) { - data = cacheItem->blobIconData; - } else { - data.type = INVALID_FORMAT; - } - } -} - -/** - * HbThemeServerPrivate::handleSharedWidgetMLLookup() - */ -QByteArray HbThemeServerPrivate::handleSharedWidgetMLLookup(const QString &fileName, const QString &layout, const QString §ion) -{ - int offset = HbThemeServerUtils::getSharedLayoutDefinition(fileName, layout, section); - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest request; - request = EWidgetMLLookup; - outputDataStream << (int)request; - outputDataStream << offset; - return outputByteArray; -} - -/** - * HbThemeServerPrivate::handleSharedEffectAddAndFileLookup() - */ -QByteArray HbThemeServerPrivate::handleSharedEffectAddAndFileLookup(int request, const QString &fileName) -{ - int offset = HbThemeServerUtils::getSharedEffect(fileName); - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - outputDataStream << request; - outputDataStream << offset; - return outputByteArray; -} - -/** - * HbThemeServerSession::handleStyleSheetLookup() - */ -QByteArray HbThemeServerSession::handleStyleSheetLookup(int request, const QString &fileName, HbLayeredStyleLoader::LayerPriority priority) -{ - int offset = -1; - HbCacheItem* cssItem = iServer->cssCacheItem(fileName); - bool insertKeyIntoSessionList = false; - if (cssItem) { - offset = cssItem->offset; - insertKeyIntoSessionList = true; - } else { - bool tryAgain = false; - do { - bool inSharedCache = false; - offset = HbThemeServerUtils::getSharedStylesheet(fileName, priority, &inSharedCache); - if (!inSharedCache) { - if (offset >= 0) { - HbCacheItem *cssItem = new HbCacheItem(offset, 0, fileName); - insertKeyIntoSessionList = iServer->insertCssCacheItem(fileName, cssItem); - if (priority == HbLayeredStyleLoader::Priority_Core && cssItem->refCount == 1) { - // This will make sure the requested stylesheet will always remain - // in the primary and secondary cache. - cssItem->incrementRefCount(); - } - if (priority == HbLayeredStyleLoader::Priority_Theme && cssItem->refCount == 1) { - iServer->themePriorityItems.insert(fileName,cssItem); - } - break; - } else if (offset == OUT_OF_MEMORY_ERROR && tryAgain == false) { - iServer->doCleanup(); - tryAgain = true; - } else if (offset == OUT_OF_MEMORY_ERROR && tryAgain == true) { - //try only once to free up memory. - tryAgain = false; - } - } - } while (tryAgain); - } - - if (insertKeyIntoSessionList) { - //The session will only keep track of cssFiles that were either successfully found or were - //successfully inserted in the cache. - sessionCssData.append(fileName); - } - - //write to client socket the offset of required stylesheet - //it can be -1 in case of error. - QByteArray output; - QDataStream outputDataStream(&output, QIODevice::WriteOnly); - - outputDataStream << request; - outputDataStream << offset; - - return output; -} - -/** - * HbThemeServerSession::handleIconLookup() - */ -QByteArray HbThemeServerSession::handleIconLookup(const HbIconKey &key, HbSharedIconInfo &data, int options) -{ - bool insertKeyIntoSessionList = false; - HbIconCacheItem * cacheItem = iServer->iconCacheItem(key); - QScopedPointer tempIconCacheItem; - - if (cacheItem) { - insertKeyIntoSessionList = true; //The item was found in the cache and ref count was incremented - if (cacheItem->rasterIconData.type != INVALID_FORMAT) { - data = cacheItem->rasterIconData; - } else if (cacheItem->vectorIconData.type != INVALID_FORMAT) { - data = cacheItem->vectorIconData; - } else if (cacheItem->blobIconData.type != INVALID_FORMAT) { - data = cacheItem->blobIconData; - } else { - data.type = INVALID_FORMAT; - } - } else { - QString format = HbThemeServerUtils::formatFromPath(key.filename); - QT_TRY { - tempIconCacheItem.reset(HbIconCacheItemCreator::createCacheItem(key, - (HbIconLoader::IconLoaderOptions)options, - format, - iServer->currentRenderingMode(), - false)); - cacheItem = tempIconCacheItem.data(); - if (cacheItem) { - if (cacheItem->rasterIconData.type != INVALID_FORMAT) { - data = cacheItem->rasterIconData; - } else if (cacheItem->vectorIconData.type != INVALID_FORMAT) { - data = cacheItem->vectorIconData; - } else if (cacheItem->blobIconData.type != INVALID_FORMAT) { - data = cacheItem->blobIconData; - } else { - data.type = INVALID_FORMAT; - } - if (data.type != INVALID_FORMAT) { - insertKeyIntoSessionList = iServer->insertIconCacheItem(key, cacheItem); - } - } - } QT_CATCH(const std::bad_alloc &) { - data.type = INVALID_FORMAT; - } - } - if (insertKeyIntoSessionList) { - //The session will only keep track of icons that were either successfully found or were - //successfully inserted in the cache. - sessionIconData.append(key); - } - - tempIconCacheItem.take(); - - QByteArray outputByteArray; - QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly); - HbThemeServerRequest request; - request = EIconLookup; - outputDataStream << (int)request; - outputDataStream << (int)data.type; - - if (data.type == OTHER_SUPPORTED_FORMATS) { - outputDataStream << data.pixmapData.offset; - outputDataStream << data.pixmapData.width; - outputDataStream << data.pixmapData.height; - outputDataStream << data.pixmapData.defaultWidth; - outputDataStream << data.pixmapData.defaultHeight; - outputDataStream << (int)data.pixmapData.format; - } else if (/*data.type == SVG || */data.type == PIC) { - outputDataStream << data.picData.offset; - outputDataStream << data.picData.dataSize; - outputDataStream << data.picData.defaultWidth; - outputDataStream << data.picData.defaultHeight; - } else if (data.type == NVG) { - outputDataStream << data.nvgData.offset; - outputDataStream << data.nvgData.dataSize; - } else if (data.type == BLOB) { - outputDataStream << data.blobData.offset; - outputDataStream << data.blobData.dataSize; - } -#ifdef THEME_SERVER_TRACES - qDebug() << Q_FUNC_INFO << " offset= " << data.pixmapData.offset << " format= " << data.pixmapData.format; - testLabel->setPixmap(QPixmap::fromImage( - QImage( - HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, data.pixmapData.offset), - data.pixmapData.width, - data.pixmapData.height, - data.pixmapData.format))); -#endif - - return outputByteArray; -} - -/** - * HbThemeServerPrivate::doCleanup() - * - * This function releases shared memory occupied by css-resources whose reference count is zero, - * so that subsequent css-requests could be fulfilled by the server. Those css-files whose reference - * count are zero, are already appended to the list maintained by the css-cache. Since these resources - * are not being referred to by any application, they can be removed from the cache and corresponding - * shared memory can be freed up. - */ -void HbThemeServerPrivate::doCleanup() -{ - HbThemeServerUtils::cleanupUnusedCss(cssCache); -} - -/** - * HbThemeServerPrivate::sessionListCount() - * Gives the list count of Sessions. - */ -int HbThemeServerPrivate::sessionListCount() const -{ - return sessionList.count(); -} - -/** - * HbThemeServerPrivate::freeSharedMemory() - * Gives the free shared memory. - */ -int HbThemeServerPrivate::freeSharedMemory() const -{ - GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - return static_cast(manager)->freeSharedMemory(); -} - -/** - * HbThemeServerPrivate::allocatedSharedMemory() - * Gives the allocated shared memory. - */ -int HbThemeServerPrivate::allocatedSharedMemory() const -{ - GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - return static_cast(manager)->allocatedSharedMemory(); -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserver_generic_p_p.h --- a/src/hbservers/hbthemeserver/hbthemeserver_generic_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,166 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (developer.feedback@nokia.com) -** -** This file is part of the HbServers module of the UI Extensions for Mobile. -** -** GNU Lesser General Public License Usage -** This file may be used under the terms of the GNU Lesser General Public -** License version 2.1 as published by the Free Software Foundation and -** appearing in the file LICENSE.LGPL included in the packaging of this file. -** Please review the following information to ensure the GNU Lesser General -** Public License version 2.1 requirements will be met: -** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at developer.feedback@nokia.com. -** -****************************************************************************/ - -#ifndef HBTHEMESERVER_GENERIC_P_H -#define HBTHEMESERVER_GENERIC_P_H - -#include -#include - -#include "hbicondatacache_p.h" -#include "hbcache_p.h" -#include "hblayeredstyleloader_p.h" - -class QLocalServer; -class QLocalSocket; -class HbThemeServerSession; -struct HbIconKey; - -#ifdef QT_DEBUG -class HbThemeServerPrivate : public QMainWindow -#else -class HbThemeServerPrivate : public QObject -#endif -{ - Q_OBJECT - -public: -#ifdef QT_DEBUG - HbThemeServerPrivate(QWidget *parent = 0); -#else - HbThemeServerPrivate(); -#endif - - ~HbThemeServerPrivate(); - bool start(); - void stop(); - - bool insertIconCacheItem(const HbIconKey &key, HbIconCacheItem *item); - HbIconCacheItem* iconCacheItem(const HbIconKey &key); - void setMaxGpuCacheSize(int size); - void setMaxCpuCacheSize(int size); - void removeIconCacheItem(const HbIconKey &key); - void clearIconCache(); - void handleThemeSelection(const QString &newtheme); - void handleContentUpdate(const QStringList &fileNames); - - QByteArray handleSharedEffectAddAndFileLookup(int request, const QString &fileName); - QByteArray handleSharedWidgetMLLookup(const QString &fileName, const QString &layout, const QString §ion); - void writeToClients(QByteArray &block); - void setThemeSelectionClient(QLocalSocket *socket); - - bool insertCssCacheItem(const QString &key, HbCacheItem *item); - HbCacheItem* cssCacheItem(const QString &key); - void removeCssCacheItem(const QString &key); - void clearCssCache(); - - void doCleanup(); - int sessionListCount() const; - - int freeSharedMemory() const; - int allocatedSharedMemory() const; - - HbRenderingMode currentRenderingMode() const; - void setCurrentRenderingMode(HbRenderingMode currentMode); - -//Debug Code for Test Purpose -#ifdef HB_ICON_CACHE_DEBUG - int cacheIconCount() const; - int memorySize(const QString &mem); - int freeVectorMemory(); - int freeRasterMemory(); - int lastAddedRefCount(); - int lastAddedItemMem(); - int lastRemovedItemMem(); - int lastRemovedItemRfCount(); - bool enableCache(bool cacheIt); - int cacheHitCount(); - int cacheMissCount(); - int serverHeapSize(); - void cleanRasterLRUList(); - void cleanVectorLRUList(); - int rasterLruCount(); - int vectorLruCount(); -#endif - -private slots: - void newClientConnected(); - void clienDisconnected(); - void removeFromList(); - bool listen(); - -public: - QHash themePriorityItems; - -private: -#ifdef QT_DEBUG - QLabel statusLabel; -#endif - QLocalServer *server; - QLocalSocket *iThemeSelectionClient; - QList sessionList; - HbIconDataCache *iconCache; - HbCache *cssCache; - HbRenderingMode renderMode; -}; - -class HbThemeServerSession : public QObject -{ - Q_OBJECT -public: - HbThemeServerSession(QLocalSocket *clientConnection, HbThemeServerPrivate *server); - ~HbThemeServerSession(); - QLocalSocket *clientConnection(); - void fillOutPutDataStream(QDataStream &outputDataStream, HbSharedIconInfo &data, HbThemeServerRequest request); - void getDataFromCacheItem(HbIconCacheItem* cacheItem, HbSharedIconInfo &data) const; - void freeDataFromCacheItem(HbIconCacheItem* cacheItem); - QByteArray handleStyleSheetLookup(int request, const QString &fileName, HbLayeredStyleLoader::LayerPriority priority); - QByteArray handleIconLookup(const HbIconKey &key, HbSharedIconInfo &data, int options); - bool iconInfoFromSingleIcon(HbIconKey key, HbSharedIconInfo &stitchedData); - bool createCacheItemData(HbIconKey key, int options, HbSharedIconInfo &data); - bool createStichedIconInfoOfParts(QVector dataForParts, - HbMultiIconParams params, - HbIconKey &finalIconKey, - HbSharedIconInfo &stitchedData); - void iconInfoFromMultiParts(HbMultiIconParams params, - int noOfPieces, - HbIconKey &stichedKey, - HbSharedIconInfo &stitchedData); - void clearSessionIconData(); - void removeSessionIconItem(const HbIconKey &key); - void removeSessionCssItem(const QString &key); - -public slots: - void readDataFromClient(); - -private: - HbThemeServerPrivate *iServer; - QLocalSocket *iClientConnection; - QList sessionIconData; - QList sessionCssData; -}; - -#endif // HBTHEMESERVER_GENERIC_P_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserver_symbian.cpp --- a/src/hbservers/hbthemeserver/hbthemeserver_symbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbthemeserver_symbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,13 +32,13 @@ #include "hbsharedmemorymanager_p.h" #include "hbtypefaceinfodatabase_p.h" - #include #include #include #include #include #include +#include #include #include #include @@ -63,15 +63,9 @@ static const TInt KThemeName = 0; -// Publish/Subscribe themeRequestProp specific -static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); -static _LIT_SECURITY_POLICY_C1(KThemeChangerPolicy,ECapabilityWriteDeviceData); - +const QString KOperatorCPath = "C:/resource/hb/prioritytheme/icons/"; +const QString KOperatorZPath = "Z:/resource/hb/prioritytheme/icons/"; -const QString operatorCPath = "C:/resource/hb/operatorTheme/icons/"; -const QString operatorZPath = "Z:/resource/hb/operatorTheme/icons/"; - -static HbThemeServerPrivate *TheServer = 0; bool HbThemeServerPrivate::gpuGoodMemoryState = true; // This is used as parent theme always regardless of the active theme @@ -93,7 +87,7 @@ HbThemeServerPrivate* self = new(ELeave) HbThemeServerPrivate(aActiveObjectPriority); CleanupStack::PushL(self); self->ConstructL(); - CleanupStack::Pop(); // self + CleanupStack::Pop(self); return self; } @@ -109,29 +103,14 @@ TInt error = iThemeProperty.Attach(KServerUid3, KThemeName ); User::LeaveIfError(error); - // Store the active theme name in a member string - iCurrentThemeName = HbThemeUtils::getThemeSetting(HbThemeUtils::CurrentThemeSetting); - - if (iCurrentThemeName.isEmpty()) { - iCurrentThemeName = HbThemeUtils::defaultTheme().name; - // Set the current theme also in the cenrep key that is used to notify clients. - HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, iCurrentThemeName); - } + QString currentTheme = HbThemeUtils::getThemeSetting(HbThemeUtils::CurrentThemeSetting); - // Cache ROM theme(name)s - QString romPath = "Z:\\resource\\hb\\themes\\icons\\"; - QDir dir(romPath); - romThemeNames = dir.entryList(QDir::Dirs); - - // Resolve the path of the current theme - resolveThemePath(iCurrentThemeName, iCurrentThemePath); - - // Register theme system effects in construction - // TODO: fix parameter - HbThemeSystemEffect::handleThemeChange(iCurrentThemeName); + // Store the active theme name in a member string + // and resolve the path of the current theme + QDir path(currentTheme); + iCurrentThemeName = path.dirName(); + iCurrentThemePath = path.absolutePath(); - // Open index file to prevent uninstallation of the active theme - openCurrentIndexFile(); cache = 0; cssCache = 0; @@ -147,40 +126,59 @@ } setMaxGpuCacheSize(GPU_CACHE_SIZE); setMaxCpuCacheSize(CPU_CACHE_SIZE); -#if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) +#if defined(HB_SGIMAGE_ICON) || defined(HB_NVG_CS_ICON) renderMode = EHWRendering; #else renderMode = ESWRendering; #endif - - // Process base theme index, it is used as parent index also when the current theme is something else - QString basePath; - resolveThemePath(HbThemeUtils::getThemeSetting(HbThemeUtils::BaseThemeSetting), basePath); - createThemeIndex(basePath, BaseTheme); - // Process operator Drive C theme index + + // Load theme indexes + UpdateThemeIndexes(); + + // Start the splash screen generator app. + QProcess::startDetached("hbsplashgenerator.exe"); +} + +void HbThemeServerPrivate::UpdateThemeIndexes(bool updateBase) +{ + // Start watching the current theme.index for uninstallation + if (!openCurrentIndexFile()) { + // theme doesn't exist activate default theme + QString defaultTheme = HbThemeUtils::getThemeSetting(HbThemeUtils::DefaultThemeSetting); + QDir path(defaultTheme); + iCurrentThemeName = path.dirName(); + iCurrentThemePath = path.absolutePath(); + } + + if (updateBase) { + // Process base theme index, it is used as parent index also when the current theme is something else + HbThemeServerUtils::createThemeIndex(HbThemeUtils::getThemeSetting(HbThemeUtils::BaseThemeSetting), BaseTheme); + } + // Process operator theme indexes QString operatorName = HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting); if (!operatorName.isEmpty()) { QString operatorPath; - operatorPath.append(operatorCPath); + operatorPath.append(KOperatorCPath); operatorPath.append(operatorName); - createThemeIndex(operatorPath, OperatorC); - // Process operator Drive Z theme index - QString operatorROMPath; - operatorROMPath.append(operatorZPath); - operatorROMPath.append(operatorName); - createThemeIndex(operatorROMPath, OperatorROM); + HbThemeServerUtils::createThemeIndex(operatorPath, OperatorC); + if (updateBase) { + // Process operator Drive Z theme index + QString operatorROMPath; + operatorROMPath.append(KOperatorZPath); + operatorROMPath.append(operatorName); + HbThemeServerUtils::createThemeIndex(operatorROMPath, OperatorROM); + } } + // Process current theme index - createThemeIndex(iCurrentThemePath, ActiveTheme); - - // Temporary hack for pre-loading app. background graphics in server startup to give more realistic - // results in performance tests. (Normally these graphics get loaded anyway when the first hb app is started.) -#ifndef HB_NVG_CS_ICON - QProcess::startDetached("hbiconpreloader.exe"); -#endif + HbThemeServerUtils::createThemeIndex(iCurrentThemePath, ActiveTheme); - // Start the splash screen generator app. - //QProcess::startDetached("hbsplashgenerator.exe"); + // Register theme system effects + // TODO: fix parameter + HbThemeSystemEffect::handleThemeChange(iCurrentThemeName); + + // Set the current theme also in the cenrep key that is used to notify clients. + HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting, iCurrentThemePath); } /** @@ -194,21 +192,18 @@ so no second parameter is passed to the CServer2 constructor. */ HbThemeServerPrivate::HbThemeServerPrivate(CActive::TPriority aActiveObjectPriority) - : CServer2( aActiveObjectPriority ) + : CServer2( aActiveObjectPriority ), iWatcher(0) { - // Set server pointer in static variable - TheServer = this; - // Set up the listener to listen for Publish events TRAPD(err, iListener = CHbThemeChangeNotificationListener::NewL(*this)); if (err) { qWarning( "HbThemeServerPrivate::HbThemeServerPrivate: CHbThemeChangeNotificationListener::NewL failed = %d", err ); } else { - TRAPD( err, iListener->startListening()); + TRAPD(err, iListener->startListeningL()); if (err) { qWarning( "HbThemeServerPrivate::HbThemeServerPrivate: iListener->startListening failed = %d", err ); } - } + } } /** @@ -226,81 +221,40 @@ } // Delete the listener for Publish/Subscribe delete iListener; -} - -HbThemeServerPrivate *HbThemeServerPrivate::Instance() -{ - return TheServer; -} - -void HbThemeServerPrivate::openCurrentIndexFile() -{ - // Open index file to prevent uninstallation of the active theme - if (!iCurrentThemePath.isEmpty() && iCurrentThemePath[0] != 'Z') { - QString indexFileName; - indexFileName.append(iCurrentThemePath); - indexFileName.append("\\index.theme"); - - currentIndexfile.setFileName(indexFileName); - if(!currentIndexfile.open(QIODevice::ReadOnly)) { - qWarning()<< "HbSymbianThemeServer: No Index file found in the new theme, How did this happen ??"; - } + // Delete file watcher + if (iWatcher) { + delete iWatcher; } } -bool HbThemeServerPrivate::resolveThemePath(const QString &themeName, QString &themePath) +/* + * Returns FALSE if file doesn't exist, TRUE otherwise + */ +bool HbThemeServerPrivate::openCurrentIndexFile() { - if(themeName == "hbdefault") { - themePath = ":\\themes\\icons\\hbdefault"; - return true; - } - - if (!themeName.isEmpty()) { - // Check for the theme's icon directory in different drives. - // ROM is checked first and then phone memory and memory card drives. - - QString themeLookupPath = "Z:\\resource\\hb\\themes\\icons\\"; - - if (romThemeNames.contains(themeName)) { - themeLookupPath.append(themeName); - themePath = themeLookupPath; - return true; + if (!iCurrentThemePath.isEmpty() && iCurrentThemePath[0] != 'z' && + iCurrentThemePath[0] != 'Z' && iCurrentThemePath[0] != ':') { + QString indexFileName; + indexFileName.append(iCurrentThemePath); + indexFileName.append("/index.theme"); + + QFile currentIndexfile(indexFileName); + if(!currentIndexfile.open(QIODevice::ReadOnly)) { + qWarning()<< "HbSymbianThemeServer: No Index file found in the new theme, How did this happen ??"; + return false; + } else { + currentIndexfile.close(); + if (!iWatcher) { + // Set up the file watcher for active theme changes + TRAP_IGNORE(iWatcher = CHbThemeWatcher::NewL(*this)); + } + // Start watching in case of mmc ejection + if (iWatcher) { + iWatcher->startWatchingL(indexFileName); + } } - - themeLookupPath.append(themeName); - QString filename(themeLookupPath); - filename.append("\\index.theme"); - QFile file; - - filename[0] = 'C'; - file.setFileName(filename); - if (file.open(QIODevice::ReadOnly)) { - themeLookupPath[0] = 'C'; - themePath = themeLookupPath; - file.close(); - return true; - } - - filename[0] = 'E'; - file.setFileName(filename); - if (file.open(QIODevice::ReadOnly)) { - themeLookupPath[0] = 'E'; - themePath = themeLookupPath; - file.close(); - return true; - } - - filename[0] = 'F'; - file.setFileName(filename); - if (file.open(QIODevice::ReadOnly)) { - themeLookupPath[0] = 'F'; - themePath = themeLookupPath; - file.close(); - return true; - } - } - return false; + return true; } /** @@ -308,53 +262,25 @@ */ void HbThemeServerPrivate::HandleThemeSelection( const QString& themeName) { - //Make a copy for ourselves - - - QString cleanThemeName = themeName.trimmed(); - - iCurrentThemeName = cleanThemeName; + QDir path(themeName.trimmed()); + iCurrentThemeName = path.dirName(); + iCurrentThemePath = path.absolutePath(); - QDir path(cleanThemeName); - if (!path.isAbsolute()) { - // Resolve the path of the current theme - resolveThemePath(iCurrentThemeName, iCurrentThemePath); - } - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: theme change request, new theme =" << cleanThemeName.toUtf8(); + qDebug() << "ThemeIndex: theme change request, new theme =" << themeName.toUtf8(); #endif - - currentIndexfile.close(); - // Open index file to prevent uninstallation of the active theme - openCurrentIndexFile(); - - // Process operator Drive C theme index - QString operatorName = HbThemeUtils::getThemeSetting(HbThemeUtils::OperatorNameSetting); - if (!operatorName.isEmpty()) { - QString operatorPath; - operatorPath.append(operatorCPath); - operatorPath.append(operatorName); - createThemeIndex(operatorPath, OperatorC); - } - // Process current theme index - createThemeIndex(iCurrentThemePath, ActiveTheme); - // Clear cached icons and session data clearIconCache(); iSessionIter.SetToFirst(); - while(iSessionIter != NULL) { + while(iSessionIter) { HbThemeServerSession &session = reinterpret_cast(*iSessionIter); session.ClearSessionData(); iSessionIter++; } - - // TODO: fix parameter - HbThemeSystemEffect::handleThemeChange(cleanThemeName); - - // Update settings and notify clients - HbThemeUtils::setThemeSetting(HbThemeUtils::CurrentThemeSetting,iCurrentThemeName); + + // Update current theme index + UpdateThemeIndexes(false); } /** @@ -423,16 +349,6 @@ return(cssCache->cacheItem(key)); } -void HbThemeServerPrivate::insertIconDefaultSizeCacheItem(const QString &key, const QSizeF &item) -{ - iconDefaultSizes.insert(key, item); -} - -QSizeF HbThemeServerPrivate::iconDefaultSizeCacheItem(const QString &key) -{ - return iconDefaultSizes.value(key); -} - /** * HbThemeServerPrivate::clearIconCache * @@ -526,12 +442,14 @@ cache->memoryGood(); } -void HbThemeServerPrivate::FreeGpuRam(int bytes) +void HbThemeServerPrivate::FreeGpuRam(int bytes, bool useSwRendering ) { gpuGoodMemoryState = false; - cache->freeGpuRam(bytes); + cache->freeGpuRam(bytes, useSwRendering); #ifdef HB_SGIMAGE_ICON + if (useSwRendering) { HbSgImageRenderer::global()->terminate(); + } #endif } @@ -695,11 +613,12 @@ return cache->vectorLruCount(); } +#endif + int HbThemeServerPrivate::gpuLRUSize() const { return cache->gpuLRUSize(); } -#endif /** * HbThemeServerPrivate::doCleanup() @@ -714,151 +633,6 @@ { HbThemeServerUtils::cleanupUnusedCss(cssCache); } - -void HbThemeServerPrivate::createThemeIndex(const QString &themePath, const HbThemeType &themetype) -{ - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: createThemeIndex" << themePath.toUtf8(); - #endif - QDir themeBasePath(themePath); - // Path is like "C:/resource/hb/themes/icons/sfwhitetheme" - QString themeName = themeBasePath.dirName(); - - QString filename(themeBasePath.absolutePath()); - int cutindex = filename.lastIndexOf("/",filename.lastIndexOf("/")-1)+1; - filename = filename.left(cutindex); - themeBasePath.setPath(filename); - filename.append(themeName); - filename.append(".themeindex"); - - if (themePath == ":\\themes\\icons\\hbdefault") { - themeBasePath.setPath(":/themes"); - filename = ":/themes/hbdefault.themeindex"; - themeName = "hbdefault"; - } - - QFile indexFile(filename); - - bool indexOK = false; - - if (indexFile.open(QIODevice::ReadOnly)) { - - indexOK = true; - - GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - - HbSharedChunkHeader *chunkHeader = (HbSharedChunkHeader*) manager->base(); - - qint64 byteSize = indexFile.size(); - - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: " << theme.toUtf8() << " index file size:" << byteSize; - #endif - - int offset = manager->alloc(byteSize); - if (offset >= 0) { - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: memory allocated for theme: " << theme.toUtf8(); - #endif - - // Read the theme index in the shared chunk - char *address = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, offset); - - indexFile.read(address, byteSize); - indexFile.close(); - - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: Reading themeindex for theme" << theme.toUtf8() << "... Done!"; - #endif - - // Verify theme index contents if it is not located in ROM, - // so that it does not have over-indexing offsets which might - // crash all the clients trying to read from it. - - if (themePath[0] != 'Z') { - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: Validating themeindex for theme" << theme.toUtf8(); - #endif - - HbThemeIndex index(address); - indexOK = index.validateItems(byteSize); - - #ifdef THEME_INDEX_TRACES - qDebug() << "ThemeIndex: Validating themeindex for theme" << theme.toUtf8() << " done! Result: " << indexOK; - #endif - } - - if (indexOK) { - // Allocate theme path string from shared memory - QByteArray themePathArray = themeBasePath.absolutePath().toLatin1(); - quint32 themePathOffset = manager->alloc(themePathArray.size()+1); - memcpy(HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, - themePathOffset), - themePathArray.data(), - themePathArray.size()+1); // +1 for '/0' - - // Allocate theme name string from shared memory - QByteArray themeNameArray = themeName.toLatin1(); - quint32 themeNameOffset = manager->alloc(themeNameArray.size()+1); - memcpy(HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, - themeNameOffset), - themeNameArray.data(), - themeNameArray.size()+1); // +1 for '/0' - - // Store offset to the index in chunk - switch (themetype) { - case BaseTheme: - // Release previously allocated content - manager->free(chunkHeader->baseThemePathOffset); - manager->free(chunkHeader->baseThemeNameOffset); - manager->free(chunkHeader->baseThemeIndexOffset); - // Base theme offsets - chunkHeader->baseThemePathOffset = themePathOffset; - chunkHeader->baseThemeNameOffset = themeNameOffset; - chunkHeader->baseThemeIndexOffset = offset; - break; - case OperatorC: - // Release previously allocated content - manager->free(chunkHeader->operatorThemeDriveCPathOffset); - manager->free(chunkHeader->operatorThemeDriveCNameOffset); - manager->free(chunkHeader->operatorThemeDriveCIndexOffset); - // Operator theme in C-drive offsets - chunkHeader->operatorThemeDriveCPathOffset = themePathOffset; - chunkHeader->operatorThemeDriveCNameOffset = themeNameOffset; - chunkHeader->operatorThemeDriveCIndexOffset = offset; - break; - case OperatorROM: - // Release previously allocated content - manager->free(chunkHeader->operatorThemeRomPathOffset); - manager->free(chunkHeader->operatorThemeRomNameOffset); - manager->free(chunkHeader->operatorThemeRomIndexOffset); - // Operator theme in ROM offsets - chunkHeader->operatorThemeRomPathOffset = themePathOffset; - chunkHeader->operatorThemeRomNameOffset = themeNameOffset; - chunkHeader->operatorThemeRomIndexOffset = offset; - break; - case ActiveTheme: - // Release previously allocated content - manager->free(chunkHeader->activeThemePathOffset); - manager->free(chunkHeader->activeThemeNameOffset); - manager->free(chunkHeader->activeThemeIndexOffset); - // Active theme offsets - chunkHeader->activeThemePathOffset = themePathOffset; - chunkHeader->activeThemeNameOffset = themeNameOffset; - chunkHeader->activeThemeIndexOffset = offset; - break; - default: - break; - } - } else { - // If the index contents were not OK, remove the index from the chunk - manager->free(offset); - } - } - } -} //********************************** //HbThemeServerSession @@ -922,10 +696,10 @@ TRAPD(err, DispatchMessageL(aMessage)); aMessage.Complete(err); + +#ifdef THEME_SERVER_TRACES QString er; er.setNum(err); - -#ifdef THEME_SERVER_TRACES qDebug() << "completed DispatchMessageL error code is " + er; #endif @@ -962,14 +736,6 @@ GetSharedIconInfoL(aMessage); break; - case EIconDefaultSize: - GetSharedIconDefaultSizeInfoL(aMessage); - break; - - case EThemeSelection: - HandleThemeSelectionL(aMessage); - break; - case EMultiPieceIcon: GetSharedMultiIconInfoL(aMessage); break; @@ -1097,12 +863,6 @@ aMessage.WriteL(1, out); break; } - case EGPULRUSize: { - TInt gpuLRUSize = iServer->gpuLRUSize(); - TPckg out(gpuLRUSize); - aMessage.WriteL(1, out); - break; - } case ERefCount: { TInt refCount = iServer->iconRefCount(aMessage); TPckg out(refCount); @@ -1150,6 +910,12 @@ break; } #endif + case EGPULRUSize: { + TInt gpuLRUSize = iServer->gpuLRUSize(); + TPckg out(gpuLRUSize); + aMessage.WriteL(1, out); + break; + } case EMemoryGood: { if(iServer->currentRenderingMode() == ESWRendering){ iServer->setCurrentRenderingMode(EHWRendering); @@ -1164,7 +930,7 @@ if(params.useSwRendering){ iServer->setCurrentRenderingMode(ESWRendering ); } - iServer->FreeGpuRam(params.bytesToFree); + iServer->FreeGpuRam(params.bytesToFree, params.useSwRendering); break; } @@ -1228,6 +994,7 @@ } #endif } + /** * HandleStyleSheetLookupL */ @@ -1240,7 +1007,7 @@ return; } - TBuf<256> fileName; + TFileName fileName; aMessage.ReadL(0, fileName, 0); TBuf<256> layerPriorityBuf; aMessage.ReadL(1, layerPriorityBuf, 0); @@ -1291,6 +1058,9 @@ aMessage.WriteL(2, data); } +static const TInt KMaxLayoutName = 256; +static const TInt KMaxSectionName = 256; + /** * HandleWidgetMLLookUp */ @@ -1300,11 +1070,11 @@ return; } - TBuf<256> fileName; + TFileName fileName; aMessage.ReadL(0, fileName, 0); - TBuf<256> layoutName; + TBuf layoutName; aMessage.ReadL(1, layoutName, 0); - TBuf<256> sectionName; + TBuf sectionName; aMessage.ReadL(2, sectionName, 0); QString wmlFileName((QChar*)fileName.Ptr(), fileName.Length()); @@ -1353,55 +1123,6 @@ aMessage.WriteL(1, data); } -void HbThemeServerSession::GetSharedIconDefaultSizeInfoL(const RMessage2 &aMessage) -{ - TIconParams params = ReadMessageAndRetrieveParams(aMessage); - - // Need to be allocated from heap or the leave in the end causes a crash - QScopedPointer filenamePtr(new QString((QChar*)params.fileName.Ptr(), params.fileName.Length())); - - // See if the icon's default size has been queried already earlier and - // can be found stored in the hash. - - QSizeF defSize = iServer->iconDefaultSizeCacheItem(*filenamePtr.data()); - - if (!defSize.isValid()) { - defSize = RetrieveIconDefaultSize(*filenamePtr.data()); - - // If the default size was retrieved, insert it in the hash for further lookups - if (defSize.isValid()) { - iServer->insertIconDefaultSizeCacheItem(*filenamePtr.data(), defSize); - } - } - - // Return the default size back to the client if it was resolved - if (defSize.isValid()) { - TPckg returnData(defSize); - aMessage.WriteL(1, returnData); -#ifdef THEME_SERVER_TRACES - qDebug() << "Completed aMessage.WriteL"; -#endif - } - // Otherwise leave with error code - else { - User::Leave(KErrNotFound); - } -} - -QSizeF HbThemeServerSession::RetrieveIconDefaultSize(const QString &filename) -{ - QSizeF ret; - - // Get icon source, previous icons sources are cached so if accessed again, - // they don't need to be loaded and parsed from a file always. - HbIconSource *source = HbThemeServerUtils::getIconSource(filename); - if (source) { - ret = source->defaultSize(); - } - - return ret; -} - /** * GetSharedIconInfoL */ @@ -1433,10 +1154,10 @@ } else { QT_TRY { QString format = HbThemeServerUtils::formatFromPath(key.filename); - QScopedPointer tempIconCacheItem(HbIconCacheItemCreator::createCacheItem( key, - (HbIconLoader::IconLoaderOptions)params.options, - format, - iServer->currentRenderingMode())); + QScopedPointer tempIconCacheItem( + HbIconCacheItemCreator::createCacheItem(key, + static_cast(params.options), + format, iServer->currentRenderingMode())); cacheItem = tempIconCacheItem.data(); if (cacheItem) { if (cacheItem->rasterIconData.type != INVALID_FORMAT) { @@ -1483,30 +1204,6 @@ } /** - * handleThemeSelectionL - */ -void HbThemeServerSession::HandleThemeSelectionL(const RMessage2& aMessage) -{ - TInt deslen = aMessage.GetDesLength(0); - RBuf buffer; - buffer.CreateL(deslen); - buffer.CleanupClosePushL(); - aMessage.ReadL(0, buffer, 0); - if (buffer.Length() == 0) { - User::Leave(ENonNumericString); - } - QString newTheme((QChar*)buffer.Ptr(), buffer.Length()); - CleanupStack::PopAndDestroy(); // close the buffer - - QString cleanThemeName = newTheme.trimmed(); - - if (cleanThemeName != iServer->iCurrentThemeName) { - iServer->HandleThemeSelection(cleanThemeName); - sessionData.clear(); - } -} - -/** * Panics the client */ void HbThemeServerSession::PanicClient(const RMessage2& aMessage, TInt aPanic) const @@ -1524,6 +1221,17 @@ return color; } +inline +QSize convert(const TSize &size) +{ + return QSize(size.iWidth, size.iHeight); +} +inline +QRect convert(const TRect &rect) +{ + return QRect(QPoint(rect.iTl.iX, rect.iTl.iY), QPoint(rect.iBr.iX, rect.iBr.iY)); +} + /** * HbThemeServerPrivate::GetSharedMultiIconInfoL Creates a consolidated icon of the frame item pieces , @@ -1544,12 +1252,12 @@ fullPath = fullPath.left(index + 1); iconId.prepend(fullPath); HbIconKey finalIconKey(iconId, - (QSizeF)params.size, - (Qt::AspectRatioMode)params.aspectRatioMode, - (QIcon::Mode)params.mode, - (bool)params.mirrored, + params.size, + static_cast(params.aspectRatioMode), + static_cast(params.mode), + params.mirrored, color, - (HbRenderingMode)params.renderMode); + static_cast(params.renderMode)); if (!IconInfoFromSingleIcon(finalIconKey, stitchedData)) { HbMultiIconParams frameItemParams; @@ -1561,20 +1269,20 @@ } frameItemParams.multiPartIconId = iconId; - frameItemParams.aspectRatioMode = (Qt::AspectRatioMode)params.aspectRatioMode; + frameItemParams.aspectRatioMode = params.aspectRatioMode; frameItemParams.colorflag = params.colorflag; - frameItemParams.mirrored = (bool)params.mirrored; + frameItemParams.mirrored = params.mirrored; frameItemParams.options = params.options; frameItemParams.rgba = params.rgba; - frameItemParams.mode = (QIcon::Mode)params.mode; - frameItemParams.size = (QSizeF)params.size; + frameItemParams.mode = params.mode; + frameItemParams.size = params.size; frameItemParams.color = color; frameItemParams.renderMode = params.renderMode; QT_TRY { for (int i = 0; i < noOfPieces; i++) { - frameItemParams.multiPartIconData.pixmapSizes[i] = (QSize &)params.pixmapSizes[i]; - frameItemParams.multiPartIconData.targets[i] = (QRect &)params.targets[i]; - frameItemParams.multiPartIconData.sources[i] = (QRect &)params.sources[i]; + frameItemParams.multiPartIconData.pixmapSizes[i] = convert(params.pixmapSizes[i]); + frameItemParams.multiPartIconData.targets[i] = convert(params.targets[i]); + frameItemParams.multiPartIconData.sources[i] = convert(params.sources[i]); QString pieceName((QChar*)params.multiPartIconList[i].Ptr(), params.multiPartIconList[i].Length()); frameItemParams.multiPartIconList.append(pieceName); } @@ -1971,15 +1679,15 @@ aMessage.ReadL(0, paramPckg, 0); QColor color = GetColorFromRgba(params.rgba, params.colorflag); - Qt::AspectRatioMode aspectRatioMode = (Qt::AspectRatioMode)params.aspectRatioMode; - QIcon::Mode mode = (QIcon::Mode)params.mode; + Qt::AspectRatioMode aspectRatioMode = static_cast(params.aspectRatioMode); + QIcon::Mode mode = static_cast(params.mode); TBool mirrored = params.mirrored; TInt iconCount = params.iconCount; for (int i = 0; i < iconCount; i++) { QString filename((QChar*)params.iconList[i].Ptr(), params.iconList[i].Length()); HbIconKey key(filename, params.sizeList[i], aspectRatioMode, mode, mirrored, color, - (HbRenderingMode)params.renderMode); + static_cast(params.renderMode)); iServer->CleanupSessionIconItem(key); sessionData.removeOne(key); } @@ -2061,7 +1769,7 @@ (Qt::AspectRatioMode)params.aspectRatioMode, (QIcon::Mode)params.mode, params.mirrored, color, (HbRenderingMode)params.renderMode); - HbIconCacheItem* cacheItem = cache->value(key);//iconCacheItem(key); + HbIconCacheItem* cacheItem = cache->value(key); if(cacheItem) refCount = cacheItem->refCount; else @@ -2071,132 +1779,3 @@ #endif #endif - -CHbThemeChangeNotificationListener* CHbThemeChangeNotificationListener::NewL(HbThemeServerPrivate& aObserver) -{ - CHbThemeChangeNotificationListener* self = new (ELeave) CHbThemeChangeNotificationListener(aObserver); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; -} - -CHbThemeChangeNotificationListener::CHbThemeChangeNotificationListener(HbThemeServerPrivate& aObserver) - :CActive(EPriorityStandard),iObserver(aObserver) -{ - -} - -void CHbThemeChangeNotificationListener::ConstructL() -{ - TInt err = RProperty::Define( KServerUid3, KNewThemeForThemeChanger, RProperty::ELargeText, KAllowAllPolicy, KThemeChangerPolicy ); - if ( err != KErrAlreadyExists ) { - User::LeaveIfError( err ); - } - err = themeRequestProp.Attach(KServerUid3, KNewThemeForThemeChanger ); - User::LeaveIfError(err); - - CActiveScheduler::Add(this); -} - -CHbThemeChangeNotificationListener::~CHbThemeChangeNotificationListener() -{ - stopListening(); -} - -void CHbThemeChangeNotificationListener::startListening() -{ - if (IsActive()) { - return; //do nothing if allready listening - } - - User::LeaveIfError(themeRequestProp.Attach(KServerUid3,KNewThemeForThemeChanger)); - //Subscribe for updates - themeRequestProp.Subscribe(iStatus); - - SetActive(); - -} - -void CHbThemeChangeNotificationListener::stopListening() -{ - Cancel(); // cancel - if(IsActive()) { // only if already listening - themeRequestProp.Close(); // Close the handle since it is not needed anymore - } -} - -/* - * Returns TRUE if parsing succeeded, FALSE otherwise - */ -bool CHbThemeChangeNotificationListener::parseData( TDesC& requestData, HbThemeServerRequest& etype, TDes& data) -{ - TInt result = 0; - const TChar delimiter = ':'; - // initialize return value as failed - bool bSuccess = false; - - result = requestData.Locate( delimiter ); - if( KErrNotFound != result ) { - TInt len = requestData.Length(); - const TDesC& typestr = requestData.Mid( 0, result); - TLex atype ( typestr ); - TInt iType; - atype.Val( iType ); - etype = static_cast(iType); - data.Copy( requestData.Mid( result + 1, len - result - 1 ) ); - bSuccess = true; - } else { - bSuccess = false; - } - - return bSuccess; -} - -void CHbThemeChangeNotificationListener::RunL() -{ - // Subscribe first to make sure we don't miss any - // when handling this one. - themeRequestProp.Subscribe(iStatus); - - SetActive(); - - TBuf<256> requestData; - TInt ret = themeRequestProp.Get(requestData); - switch (ret) { - case KErrNone: - { - QString qrequestData((QChar*)requestData.Ptr(),requestData.Length()); - HbThemeServerRequest etype = EInvalidServerRequest; - TBuf<256> data; - ///Parse the data from the Publisher - bool bSuccess = parseData( requestData, etype, data); - if( bSuccess && EThemeSelection == etype) { - QString str((QChar*)data.Ptr(),data.Length()); - str = str.trimmed(); - iObserver.HandleThemeSelection( str ); - } - } - break; - case KErrPermissionDenied: - qDebug() << "KErrPermissionDenied"; - break; - case KErrNotFound: - qDebug() << "KErrNotFound"; - break; - case KErrArgument: - qDebug() << "KErrArgument"; - break; - case KErrOverflow: - qDebug() << "KErrOverflow"; - break; - } -} - -void CHbThemeChangeNotificationListener::DoCancel() -{ - themeRequestProp.Cancel(); -} - - - diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserver_symbian_p_p.h --- a/src/hbservers/hbthemeserver/hbthemeserver_symbian_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbthemeserver_symbian_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,13 +38,16 @@ #include "hbthemecommon_symbian_p.h" #include "hbicondatacache_p.h" #include "hbcache_p.h" +#include "hbthemewatcher_symbian_p.h" #include #include +#include class HbThemeServerSession; struct HbIconKey; class HbIconSource; class CHbThemeChangeNotificationListener; +class CHbThemeWatcher; // reasons for server panic enum TPixmapServPanic { @@ -78,34 +81,28 @@ ~HbThemeServerPrivate(); CSession2 * NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const; - static HbThemeServerPrivate *Instance(); - public : // Function to panic the server static void PanicServer(TPixmapServPanic aPanic); - bool insertIconCacheItem(const HbIconKey &key, HbIconCacheItem * item); + bool insertIconCacheItem(const HbIconKey &key, HbIconCacheItem *item); HbIconCacheItem * iconCacheItem(const HbIconKey &key, bool isMultiPiece = false); void setMaxGpuCacheSize(int size); void setMaxCpuCacheSize(int size); void CleanupSessionIconItem(HbIconKey key); void clearIconCache(); - bool insertCssCacheItem(const QString& key, HbCacheItem * item); + bool insertCssCacheItem(const QString &key, HbCacheItem *item); HbCacheItem * cssCacheItem(const QString &key); void CleanupSessionCssItem(QString key); void clearCssCache(); void MemoryGood(); - void FreeGpuRam(int bytes); + void FreeGpuRam(int bytes, bool useSwRendering); void freeUnusedGpuResources(); - void insertIconDefaultSizeCacheItem(const QString &key, const QSizeF &item); - QSizeF iconDefaultSizeCacheItem(const QString &key); - void doCleanup(); static bool gpuMemoryState(); - void openCurrentIndexFile(); - bool resolveThemePath(const QString &themeName, QString &themePath); + bool openCurrentIndexFile(); HbRenderingMode currentRenderingMode() const; void setCurrentRenderingMode(HbRenderingMode currentMode); void HandleThemeSelection( const QString& themeName); @@ -113,7 +110,7 @@ int freeSharedMemory(); int allocatedSharedMemory(); int allocatedHeapMemory(); - + int gpuLRUSize() const; //Debug Code for Test Purpose #ifdef HB_ICON_CACHE_DEBUG int cacheIconCount() const; @@ -132,7 +129,6 @@ void cleanVectorLRUList(); int rasterLruCount(); int vectorLruCount(); - int gpuLRUSize() const; unsigned long freeGPUMemory(); unsigned long totalGPUMemory(); #if defined(Q_OS_SYMBIAN) @@ -141,24 +137,21 @@ #endif -private: - void createThemeIndex(const QString &themePath, const HbThemeType &themetype); - public: RProperty iThemeProperty; QString iCurrentThemeName; QString iCurrentThemePath; - QFile currentIndexfile; + private: void ConstructL(); + void UpdateThemeIndexes(bool updateBase = true); HbIconDataCache * cache; HbCache* cssCache; - QHash iconDefaultSizes; static bool gpuGoodMemoryState; HbRenderingMode renderMode; - QStringList romThemeNames; CHbThemeChangeNotificationListener * iListener; + CHbThemeWatcher *iWatcher; }; //********************************** @@ -176,13 +169,10 @@ void ServiceL(const RMessage2 & aMessage); void DispatchMessageL(const RMessage2 & aMessage); void GetSharedIconInfoL(const RMessage2 & aMessage); - void GetSharedIconDefaultSizeInfoL(const RMessage2 &aMessage); - QSizeF RetrieveIconDefaultSize(const QString &filename); void HandleStyleSheetLookupL(const RMessage2 & aMessage); void HandleWidgetMLLookupL(const RMessage2& aMessage); void HandleDeviceProfilesReqL(const RMessage2& aMessage); void HandleEffectAddAndFileLookupL(const RMessage2 &aMessage); - void HandleThemeSelectionL(const RMessage2 & aMessage); QColor GetColorFromRgba(TUint32 aRgba, bool aColorFlag); void GetSharedMultiIconInfoL(const RMessage2& aMessage); void GetMultiIconInfoL(const RMessage2& aMessage); @@ -190,7 +180,8 @@ void GetDataFromCacheItem(HbIconCacheItem* cacheItem, HbSharedIconInfo &data) const; void FreeDataFromCacheItem(HbIconCacheItem* cacheItem); bool IconInfoFromSingleIcon(HbIconKey key, HbSharedIconInfo &stitchedData); - bool CreateCacheItemData(HbIconKey key, int options, HbSharedIconInfo &data, bool isMultiPiece = false); + bool CreateCacheItemData(HbIconKey key, int options, HbSharedIconInfo &data, + bool isMultiPiece = false); bool CreateStichedIconInfoOfParts(QVector dataForParts, HbMultiIconParams params, HbIconKey &finalIconKey, @@ -220,36 +211,4 @@ QList sessionCssData; }; -//********************************** -//CHbThemeChangeNotificationListener -//********************************** -/** -This class represents a listener for Pub/Sub events sent from the clients. -Functions are provided to parse clients messages. -*/ -class CHbThemeChangeNotificationListener : public CActive -{ -public: - static CHbThemeChangeNotificationListener* NewL(HbThemeServerPrivate& aObserver); - virtual ~CHbThemeChangeNotificationListener(); - void startListening(); - void stopListening(); - -protected: // From CActive - void RunL(); - void DoCancel(); - -private: - CHbThemeChangeNotificationListener(HbThemeServerPrivate& aObserver); - void ConstructL(); - bool parseData( TDesC& requestData, HbThemeServerRequest& etype, TDes& data); - - -private: // data - RProperty themeRequestProp; - HbThemeServerPrivate& iObserver; -}; - - #endif // HBTHEMESERVER_SYMBIAN_P_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserverapplication.cpp --- a/src/hbservers/hbthemeserver/hbthemeserverapplication.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbthemeserverapplication.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,6 +30,7 @@ #include #include #include +#include #if defined (Q_OS_SYMBIAN) #include "hbthemecommon_symbian_p.h" @@ -48,7 +49,7 @@ bool HbThemeServerApplication::Options::start = false; bool HbThemeServerApplication::Options::stop = false; bool HbThemeServerApplication::Options::persistent = false; -QString HbThemeServerApplication::Options::error = QString(); +QString HbThemeServerApplication::Options::error; HbThemeServerApplication::HbThemeServerApplication(int &argc, char *argv[]) : QtSingleApplication(argc, argv), server(0) @@ -60,10 +61,6 @@ setStyle(new QWindowsStyle); #endif // QT_DEBUG -#if QT_VERSION >= 0x040601 - setAttribute(Qt::AA_S60DontConstructApplicationPanes); -#endif // QT_VERSION - // ignore command line arguments on Symbian #ifdef Q_OS_SYMBIAN Options::start = true; @@ -76,7 +73,8 @@ Options::start = args.removeAll(QLatin1String("-start")) || restart; Options::stop = args.removeAll(QLatin1String("-stop")) || restart; Options::persistent = args.removeAll(QLatin1String("-persistent")); - Options::help = args.removeAll(QLatin1String("-help")) || args.removeAll(QLatin1String("-h")) || !args.isEmpty() || wasEmpty; + Options::help = args.removeAll(QLatin1String("-help")) + || args.removeAll(QLatin1String("-h")) || !args.isEmpty() || wasEmpty; if (!args.isEmpty()) { Options::error = tr("Unknown option(s): '%1'").arg(args.join(QLatin1String(" "))); } @@ -93,21 +91,23 @@ #if defined (Q_OS_SYMBIAN) CEikonEnv * env = CEikonEnv::Static(); if ( env ) { - CApaWindowGroupName* wgName = CApaWindowGroupName::NewLC(env->WsSession()); + _LIT(KHbThemeServer, "HbThemeServer"); + CApaWindowGroupName *wgName = CApaWindowGroupName::NewLC(env->WsSession()); env->RootWin().SetOrdinalPosition(0, ECoeWinPriorityNeverAtFront); // avoid coming to foreground + env->WsSession().ComputeMode(RWsSession::EPriorityControlDisabled); + setPriority(); wgName->SetHidden(ETrue); // hides us from FSW and protects us from OOM FW etc. wgName->SetSystem(ETrue); // Allow only application with PowerManagement cap to shut us down - wgName->SetCaptionL(_L("HbThemeServer")); // TODO: use QCoreApplication::applicationName() + wgName->SetCaptionL(KHbThemeServer); wgName->SetAppUid(KNullUid); wgName->SetWindowGroupName(env->RootWin()); CleanupStack::PopAndDestroy(); - RThread::RenameMe(_L("HbThemeServer")); // TODO: use QCoreApplication::applicationName() + RThread::RenameMe(KHbThemeServer); + User::SetProcessCritical(User::ESystemCritical); + User::SetCritical(User::ESystemCritical); } #endif - // as for theme initialization, an instance needs to be created before starting the server - HbTheme::instance(); - // load resource libraries in order to make binary resources accessible bool result = loadLibrary(RESOURCE_LIB_NAME); #ifdef HB_DEVELOPER @@ -139,12 +139,34 @@ #endif // Q_OS_SYMBIAN } +static bool hb_loadLibraryHelper(const QString &name) +{ + QLibrary library(name); + // rely on dynamic loader (LD_LIBRARY_PATH) + bool result = library.load(); + if (!result) { + // try from prefix/lib dir + library.setFileName(QDir(HB_LIB_DIR).filePath(name)); + result = library.load(); + if (!result) { + // try from build/lib dir + QString path = QLatin1String(HB_BUILD_DIR) + QDir::separator() + QLatin1String("lib"); + library.setFileName(QDir(path).filePath(name)); + result = library.load(); + } + } +#ifdef THEME_SERVER_TRACES + if (!result) { + qDebug() << "hb_loadLibraryHelper():" << library.errorString(); + } +#endif + return result; +} + bool HbThemeServerApplication::loadLibrary(const QString &name) { // To load resources embedded in hb library - QLibrary library(name); - bool result = library.load(); - + bool result = hb_loadLibraryHelper(name); if (!result) { // Library may not be loaded, if it was built in debug mode and the name in debug mode is // different, change the name to debug version in that scenario @@ -156,8 +178,9 @@ #endif // On symbian library name in debug mode is same as that in release mode, // so no need to do anything for that - library.setFileName(alternateName); - result = library.load(); + if (alternateName != name) { + result = hb_loadLibraryHelper(alternateName); + } } #ifdef THEME_SERVER_TRACES if (result) { @@ -173,8 +196,9 @@ void HbThemeServerApplication::receiveMessage(const QString &message) { - if (!server) + if (!server) { return; + } if (message == STOP_MESSAGE) { server->stopServer(); @@ -182,20 +206,18 @@ } } -bool HbThemeServerApplication::acquireLock() { +bool HbThemeServerLocker::lock() +{ #ifdef Q_OS_SYMBIAN - // Guard against starting multiple copies of the server - Lock lock; Lock::State lockState; - for(;;) { - lockState = lock.acquire(); - if (lockState == Lock::Acquired) { - break; - } else if (lockState == Lock::Reserved) { + + Q_FOREVER { + lockState = mLock.acquire(); + if (lockState == Lock::Reserved) { // Process may be starting, wait for server object to be created - if (Lock::serverExists()) { + if (serverExists()) { #ifdef THEME_SERVER_TRACES - qDebug() << "HbThemeServer::main: serverExists!!!"; + qDebug() << "HbThemeServerLocker::lock: serverExists"; #endif break; } else { @@ -219,12 +241,17 @@ #else return true; #endif - - +} +void HbThemeServerApplication::setPriority() +{ +#ifdef Q_OS_SYMBIAN + RProcess().SetPriority(EPriorityHigh); +#endif } +#ifdef Q_OS_SYMBIAN +_LIT(KLockFileName, "lockFile"); -#ifdef Q_OS_SYMBIAN Lock::Lock() { // Using a file for interprocess lock @@ -232,11 +259,9 @@ if (mFs.Connect(NumMessageSlots) == KErrNone) { mFs.CreatePrivatePath(EDriveC); if (mFs.SetSessionToPrivate(EDriveC) == KErrNone) { - _LIT(KFileName, "lockFile"); - const TUint mode = EFileShareReadersOrWriters; - if (mFile.Create(mFs, KFileName, mode) == KErrAlreadyExists) { - mFile.Open(mFs, KFileName, mode); - } + RFile file; + file.Create(mFs, KLockFileName, EFileShareReadersOrWriters); + file.Close(); } } } @@ -245,20 +270,17 @@ Lock::State Lock::acquire() { State state = Error; - // If process holding the lock crashes, file server releases the lock - if (mFile.SubSessionHandle()) { - TInt error = mFile.Lock(0, 1); - if (error == KErrNone) { - state = Acquired; - } else if (error == KErrLocked) { - state = Reserved; - } + TInt status = mFile.Open(mFs, KLockFileName, EFileShareExclusive); + if (status == KErrNone) { + state = Acquired; + } else if (status == KErrInUse) { + state = Reserved; } return state; } // Check if Symbian server exists -bool Lock::serverExists() +bool HbThemeServerLocker::serverExists() { TFindServer findHbServer(KThemeServerName); TFullName name; diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserverapplication_p.h --- a/src/hbservers/hbthemeserver/hbthemeserverapplication_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbthemeserverapplication_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,7 @@ #ifndef HBTHEMESERVERAPPLICATION_P_H #define HBTHEMESERVERAPPLICATION_P_H -#include +#include class HbThemeServer; @@ -47,8 +47,7 @@ bool initialize(); int exec(); - - static bool acquireLock(); + static void setPriority(); public slots: void stop(); @@ -73,10 +72,15 @@ Error }; Lock(); - ~Lock(){close();} - void close(){mFile.Close(); mFs.Close();} + ~Lock(){ + close(); + } + void close() + { + mFile.Close(); + mFs.Close(); + } State acquire(); - static bool serverExists(); private: RFs mFs; @@ -84,4 +88,18 @@ }; #endif +// Guard against starting multiple copies of the server +class HbThemeServerLocker +{ +public: + HbThemeServerLocker() {} + bool lock(); +private: + static bool serverExists(); +private: +#ifdef Q_OS_SYMBIAN + Lock mLock; +#endif +}; + #endif // HBTHEMESERVERAPPLICATION_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserverutils.cpp --- a/src/hbservers/hbthemeserver/hbthemeserverutils.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbthemeserverutils.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -40,6 +41,7 @@ #include "hbiconsource_p.h" #include "hbwidgetloader_p.h" #include "hbwidgetloaderactions_p.h" +#include "hbthemeindex_p.h" //Hash of fileName-offset typedef QHash HbServerCache; @@ -143,7 +145,8 @@ * * Returns false in case Css file has some error or there is not enough memory */ -bool HbThemeServerUtils::parseCssFile(HbCss::Parser &parser, const QString &fileName, int &cssOffset) +bool HbThemeServerUtils::parseCssFile(HbCss::Parser &parser, const QString &fileName, + int &cssOffset) { bool retVal = false; // 1. Create a styleSheet in shared memory @@ -153,7 +156,8 @@ HbCss::StyleSheet *styleSheet = 0; try { cssOffset = manager->alloc(sizeof(HbCss::StyleSheet)); - styleSheet = new((char*)manager->base() + cssOffset) HbCss::StyleSheet(HbMemoryManager::SharedMemory); + styleSheet = new(static_cast(manager->base()) + cssOffset) + HbCss::StyleSheet(HbMemoryManager::SharedMemory); } catch (std::bad_alloc &) { if (cssOffset != -1) { // if manager->alloc in the previous try block suceeds but creation of @@ -184,11 +188,29 @@ Returns of the offset for the given filename,layout and section name. */ -int HbThemeServerUtils::getSharedLayoutDefinition(const QString & fileName, const QString &layout, const QString §ion) +int HbThemeServerUtils::getSharedLayoutDefinition(const QString &fileName, const QString &layout, + const QString §ion) { int layoutDefOffset = -1; + QStringRef nameKey(&fileName); + if (nameKey.at(0) == ':') { + //use only filename as a key. + int index = fileName.lastIndexOf('/'); + if (index >= 0) { + nameKey = fileName.rightRef((fileName.size() - 1) - index); + } + } // check in the cache. - QString key(fileName + layout + section); + QString key; + QChar separator('\0'); + key.reserve(nameKey.length() + 2 //separators + + layout.length() + section.length()); + key.append(nameKey) + .append(separator) + .append(layout) + .append(separator) + .append(section); + if (layoutDefsCache()->contains(key)) { layoutDefOffset = layoutDefsCache()->value(key); return layoutDefOffset; @@ -204,7 +226,6 @@ qDebug() << "Trying to load: " << fileName << "::" << layout << "::" << section; #endif // THEME_SERVER_TRACES - HbWidgetLoader::LayoutDefinition *layoutDef(0); GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); try { @@ -226,7 +247,8 @@ // no need to check if this item is already present in the // cache as the parsing of the file happens only once // in the server side. - HbSharedCache::instance()->add(HbSharedCache::LayoutDefinition, key, layoutDefOffset); + HbSharedCache::instance()->addLayoutDefinition(fileName, layout, section, + layoutDefOffset); } else { // load failed layoutDef->~LayoutDefinition(); @@ -308,7 +330,8 @@ HbEffectFxmlData *data = 0; try { effOffset = manager->alloc(sizeof(HbEffectFxmlData)); - data = new((char*)manager->base() + effOffset) HbEffectFxmlData(HbMemoryManager::SharedMemory); + data = new(static_cast(manager->base()) + effOffset) + HbEffectFxmlData(HbMemoryManager::SharedMemory); } catch (std::exception &) { if (effOffset != -1) { // if manager->alloc in the previous try block suceeds but creation of @@ -384,3 +407,152 @@ } } +void HbThemeServerUtils::createThemeIndex(const QString &themePath, const HbThemeType &themetype) +{ + #ifdef THEME_INDEX_TRACES + qDebug() << "ThemeIndex: createThemeIndex" << themePath.toUtf8(); + #endif + QDir themeBasePath(themePath); + // Path is like "C:/resource/hb/themes/icons/sfwhitetheme" + QString themeName = themeBasePath.dirName(); + + QString filename(themeBasePath.absolutePath()); + int cutindex = filename.lastIndexOf("/",filename.lastIndexOf("/")-1)+1; + filename = filename.left(cutindex); + themeBasePath.setPath(filename); + filename.append(themeName); + filename.append(".themeindex"); + + if (themePath == ":\\themes\\icons\\hbdefault") { + themeBasePath.setPath(":/themes"); + filename = ":/themes/hbdefault.themeindex"; + themeName = "hbdefault"; + } + + QFile indexFile(filename); + + bool indexOK = false; + + if (indexFile.open(QIODevice::ReadOnly)) { + + indexOK = true; + + GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); + + HbSharedChunkHeader *chunkHeader = (HbSharedChunkHeader*) manager->base(); + + qint64 byteSize = indexFile.size(); + + #ifdef THEME_INDEX_TRACES + qDebug() << "ThemeIndex: " << themeName.toUtf8() << " index file size:" << byteSize; + #endif + + int offset = manager->alloc(byteSize); + if (offset >= 0) { + #ifdef THEME_INDEX_TRACES + qDebug() << "ThemeIndex: memory allocated for theme: " << themeName.toUtf8(); + #endif + + // Read the theme index in the shared chunk + char *address = HbMemoryUtils::getAddress(HbMemoryManager::SharedMemory, offset); + + indexFile.read(address, byteSize); + indexFile.close(); + + #ifdef THEME_INDEX_TRACES + qDebug() << "ThemeIndex: Reading themeindex for theme" << themeName.toUtf8() << "... Done!"; + #endif + + // Verify theme index contents if it is not located in ROM, + // so that it does not have over-indexing offsets which might + // crash all the clients trying to read from it. + +#ifdef Q_OS_SYMBIAN // ROM check only for Symbian - verify always in other platforms. + if (themePath[0] != 'z' && themePath[0] != 'Z') { +#endif + #ifdef THEME_INDEX_TRACES + qDebug() << "ThemeIndex: Validating themeindex for theme" << themeName.toUtf8(); + #endif + + HbThemeIndex index(address); + indexOK = index.validateItems(byteSize); + + #ifdef THEME_INDEX_TRACES + qDebug() << "ThemeIndex: Validating themeindex for theme" << themeName.toUtf8() << " done! Result: " << indexOK; + #endif +#ifdef Q_OS_SYMBIAN + } +#endif + if (indexOK) { + // Allocate theme path string from shared memory + QByteArray themePathArray = themeBasePath.absolutePath().toLatin1(); + quint32 themePathOffset = manager->alloc(themePathArray.size()+1); + memcpy(HbMemoryUtils::getAddress( + HbMemoryManager::SharedMemory, + themePathOffset), + themePathArray.data(), + themePathArray.size()+1); // +1 for '/0' + + // Allocate theme name string from shared memory + QByteArray themeNameArray = themeName.toLatin1(); + quint32 themeNameOffset = manager->alloc(themeNameArray.size()+1); + memcpy(HbMemoryUtils::getAddress( + HbMemoryManager::SharedMemory, + themeNameOffset), + themeNameArray.data(), + themeNameArray.size()+1); // +1 for '/0' + + // Store offset to the index in chunk + switch (themetype) { + case BaseTheme: + // Release previously allocated content + manager->free(chunkHeader->baseThemePathOffset); + manager->free(chunkHeader->baseThemeNameOffset); + manager->free(chunkHeader->baseThemeIndexOffset); + // Base theme offsets + chunkHeader->baseThemePathOffset = themePathOffset; + chunkHeader->baseThemeNameOffset = themeNameOffset; + chunkHeader->baseThemeIndexOffset = offset; + break; + case OperatorC: + // Release previously allocated content + manager->free(chunkHeader->operatorThemeDriveCPathOffset); + manager->free(chunkHeader->operatorThemeDriveCNameOffset); + manager->free(chunkHeader->operatorThemeDriveCIndexOffset); + // Operator theme in C-drive offsets + chunkHeader->operatorThemeDriveCPathOffset = themePathOffset; + chunkHeader->operatorThemeDriveCNameOffset = themeNameOffset; + chunkHeader->operatorThemeDriveCIndexOffset = offset; + break; + case OperatorROM: + // Release previously allocated content + manager->free(chunkHeader->operatorThemeRomPathOffset); + manager->free(chunkHeader->operatorThemeRomNameOffset); + manager->free(chunkHeader->operatorThemeRomIndexOffset); + // Operator theme in ROM offsets + chunkHeader->operatorThemeRomPathOffset = themePathOffset; + chunkHeader->operatorThemeRomNameOffset = themeNameOffset; + chunkHeader->operatorThemeRomIndexOffset = offset; + break; + case ActiveTheme: + // Release previously allocated content + manager->free(chunkHeader->activeThemePathOffset); + manager->free(chunkHeader->activeThemeNameOffset); + manager->free(chunkHeader->activeThemeIndexOffset); + // Active theme offsets + chunkHeader->activeThemePathOffset = themePathOffset; + chunkHeader->activeThemeNameOffset = themeNameOffset; + chunkHeader->activeThemeIndexOffset = offset; + break; + default: + break; + } + } else { + // If the index contents were not OK, remove the index from the chunk + manager->free(offset); + } + } + } +} + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemeserverutils_p.h --- a/src/hbservers/hbthemeserver/hbthemeserverutils_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/hbthemeserverutils_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -45,18 +45,22 @@ public: static HbIconSource *getIconSource(const QString &filename); static QString formatFromPath(const QString &iconPath); - static int getSharedStylesheet(const QString &fileName, HbLayeredStyleLoader::LayerPriority priority, + static int getSharedStylesheet(const QString &fileName, + HbLayeredStyleLoader::LayerPriority priority, bool *inSharedCache = 0); static bool parseCssFile(HbCss::Parser &parser, const QString &fileName, int &cssOffset); static void cleanupUnusedCss(HbCache *cache); static int getSharedEffect(const QString &fileName); - static int getSharedLayoutDefinition(const QString & fileName, const QString &layout, const QString §ion); + static int getSharedLayoutDefinition(const QString & fileName, + const QString &layout, + const QString §ion); static void createDeviceProfileDatabase(); static bool removeSharedEffect(const QString &fileName); static void clearSharedEffects(); + static void createThemeIndex(const QString &themePath, const HbThemeType &themetype); + private: }; #endif // HBTHEMESERVERUTILS_P_H - diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemewatcher_symbian.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbthemeserver/hbthemewatcher_symbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,227 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hbthemewatcher_symbian_p.h" +#include "hbthemeserver_symbian_p_p.h" +#include "hbthemeutils_p.h" + +#include +#include +#include +#include + +// Publish/Subscribe themeRequestProp specific +static _LIT_SECURITY_POLICY_PASS(KAllowAllPolicy); +static _LIT_SECURITY_POLICY_C1(KThemeChangerPolicy,ECapabilityWriteDeviceData); + +CHbThemeWatcher::CHbThemeWatcher(HbThemeServerPrivate& aObserver) : CActive(EPriorityStandard), + iObserver(aObserver) +{ + CActiveScheduler::Add(this); +} + +void CHbThemeWatcher::ConstructL() +{ + User::LeaveIfError(iFs.Connect()); +} + +CHbThemeWatcher* CHbThemeWatcher::NewL(HbThemeServerPrivate& aObserver) +{ + CHbThemeWatcher* self = new (ELeave) CHbThemeWatcher(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +CHbThemeWatcher::~CHbThemeWatcher() +{ + Cancel(); + iFs.Close(); +} + +void CHbThemeWatcher::startWatchingL(const QString &file) +{ + // Cancel ongoing watch + if (IsActive()) { + Cancel(); + } + iFile = file; + + TBuf<256> fileToWatch(iFile.utf16()); + iFs.NotifyChange(ENotifyAll, iStatus, fileToWatch); + SetActive(); +} + +void CHbThemeWatcher::RunL() +{ + if (iStatus != KErrNone) { + return; + } + + if (QFile::exists(iFile)) { + // theme exists continue watching + TBuf<256> fileToWatch(iFile.utf16()); + iFs.NotifyChange(ENotifyAll, iStatus, fileToWatch); + SetActive(); + return; + } + + // theme doesn't exist, change active theme to default + iObserver.HandleThemeSelection(HbThemeUtils::getThemeSetting(HbThemeUtils::DefaultThemeSetting)); +} + +void CHbThemeWatcher::DoCancel() +{ + iFs.NotifyChangeCancel(iStatus); +} + +CHbThemeChangeNotificationListener* CHbThemeChangeNotificationListener::NewL(HbThemeServerPrivate& aObserver) +{ + CHbThemeChangeNotificationListener* self = new (ELeave) CHbThemeChangeNotificationListener(aObserver); + CleanupStack::PushL(self); + self->ConstructL(); + CleanupStack::Pop(self); + return self; +} + +CHbThemeChangeNotificationListener::CHbThemeChangeNotificationListener(HbThemeServerPrivate& aObserver) + :CActive(EPriorityStandard),iObserver(aObserver) +{ + +} + +void CHbThemeChangeNotificationListener::ConstructL() +{ + TInt err = RProperty::Define( KServerUid3, KNewThemeForThemeChanger, RProperty::ELargeText, KAllowAllPolicy, KThemeChangerPolicy ); + if ( err != KErrAlreadyExists ) { + User::LeaveIfError( err ); + } + err = themeRequestProp.Attach(KServerUid3, KNewThemeForThemeChanger ); + User::LeaveIfError(err); + + CActiveScheduler::Add(this); +} + +CHbThemeChangeNotificationListener::~CHbThemeChangeNotificationListener() +{ + stopListening(); +} + +void CHbThemeChangeNotificationListener::startListeningL() +{ + if (IsActive()) { + return; //do nothing if already listening + } + + User::LeaveIfError(themeRequestProp.Attach(KServerUid3,KNewThemeForThemeChanger)); + //Subscribe for updates + themeRequestProp.Subscribe(iStatus); + + SetActive(); + +} + +void CHbThemeChangeNotificationListener::stopListening() +{ + Cancel(); // cancel + if(IsActive()) { // only if already listening + themeRequestProp.Close(); // Close the handle since it is not needed anymore + } +} + +/* + * Returns TRUE if parsing succeeded, FALSE otherwise + */ +bool CHbThemeChangeNotificationListener::parseData(const TDesC& requestData, HbThemeServerRequest& etype, TDes& data) +{ + TInt result = 0; + const TChar delimiter = ':'; + // initialize return value as failed + bool bSuccess = false; + + result = requestData.Locate( delimiter ); + if( KErrNotFound != result ) { + TInt len = requestData.Length(); + const TDesC& typestr = requestData.Mid(0, result); + TLex atype(typestr); + TInt iType; + atype.Val( iType ); + etype = static_cast(iType); + data.Copy( requestData.Mid( result + 1, len - result - 1 ) ); + bSuccess = true; + } else { + bSuccess = false; + } + + return bSuccess; +} + +static const TInt KThemeChangeDataBufferSize = 256; + +void CHbThemeChangeNotificationListener::RunL() +{ + // Subscribe first to make sure we don't miss any + // when handling this one. + themeRequestProp.Subscribe(iStatus); + + SetActive(); + + TBuf requestData; + TInt ret = themeRequestProp.Get(requestData); + switch (ret) { + case KErrNone: + { + QString qrequestData((QChar*)requestData.Ptr(),requestData.Length()); + HbThemeServerRequest etype = EInvalidServerRequest; + TBuf data; + ///Parse the data from the Publisher + bool bSuccess = parseData( requestData, etype, data); + if( bSuccess && EThemeSelection == etype) { + QString str((QChar*)data.Ptr(), data.Length()); + str = str.trimmed(); + iObserver.HandleThemeSelection( str ); + } + } + break; + case KErrPermissionDenied: + qDebug() << "KErrPermissionDenied"; + break; + case KErrNotFound: + qDebug() << "KErrNotFound"; + break; + case KErrArgument: + qDebug() << "KErrArgument"; + break; + case KErrOverflow: + qDebug() << "KErrOverflow"; + break; + } +} + +void CHbThemeChangeNotificationListener::DoCancel() +{ + themeRequestProp.Cancel(); +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/hbthemewatcher_symbian_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbservers/hbthemeserver/hbthemewatcher_symbian_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,95 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbServers module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBTHEMEWATCHER_SYMBIAN_P_H +#define HBTHEMEWATCHER_SYMBIAN_P_H + +#include + +#include "hbthemecommon_p.h" + +#include +#include +#include + +class HbThemeServerPrivate; + +//********************************** +//CHbThemeWatcher +//********************************** +/** +This class is for watching changes in active theme e.g. ejection of the MMC. +*/ +class CHbThemeWatcher : public CActive +{ +public: + static CHbThemeWatcher* NewL(HbThemeServerPrivate& aObserver); + ~CHbThemeWatcher(); + void startWatchingL(const QString &file); + +protected: // From CActive + void RunL(); + void DoCancel(); + +private: + CHbThemeWatcher(HbThemeServerPrivate& aObserver); + void ConstructL(); + +private: // data + RFs iFs; + QString iFile; + HbThemeServerPrivate& iObserver; +}; + +//********************************** +//CHbThemeChangeNotificationListener +//********************************** +/** +This class represents a listener for Pub/Sub events sent from the clients. +Functions are provided to parse clients messages. +*/ +class CHbThemeChangeNotificationListener : public CActive +{ +public: + static CHbThemeChangeNotificationListener* NewL(HbThemeServerPrivate& aObserver); + virtual ~CHbThemeChangeNotificationListener(); + void startListeningL(); + void stopListening(); + +protected: // From CActive + void RunL(); + void DoCancel(); + +private: + CHbThemeChangeNotificationListener(HbThemeServerPrivate& aObserver); + void ConstructL(); + bool parseData(const TDesC& requestData, HbThemeServerRequest& etype, TDes& data); + +private: // data + RProperty themeRequestProp; + HbThemeServerPrivate& iObserver; +}; + +#endif // HBTHEMEWATCHER_SYMBIAN_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserver/main.cpp --- a/src/hbservers/hbthemeserver/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserver/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,6 +26,7 @@ #include "hbthemeserverapplication_p.h" #include #include +#include void showHelp(const QString &argv0, const QString &error = QString()) { @@ -46,7 +47,16 @@ int main(int argc, char *argv[]) { - if(!HbThemeServerApplication::acquireLock()) { + // Hiding theme server from the start up in first phase +#if QT_VERSION >= 0x040601 + QApplication::setAttribute(Qt::AA_S60DontConstructApplicationPanes); +#endif // QT_VERSION + + // We need to be up and running fast + HbThemeServerApplication::setPriority(); + + HbThemeServerLocker locker; + if(!locker.lock()) { return 0; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbservers/hbthemeserveroogmplugin/hbthemeserveroogmplugin.pro --- a/src/hbservers/hbthemeserveroogmplugin/hbthemeserveroogmplugin.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbservers/hbthemeserveroogmplugin/hbthemeserveroogmplugin.pro Thu Jul 22 16:36:53 2010 +0100 @@ -53,7 +53,7 @@ myrssrules = \ "START RESOURCE hbthemeserveroogmplugin.rss" \ - "TARGETPATH resource\plugins" \ + "TARGETPATH resource/plugins" \ "TARGET hbthemeserveroogmplugin.rsc" \ "END" diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/docml2bin/docml2bin.pro --- a/src/hbtools/docml2bin/docml2bin.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/docml2bin/docml2bin.pro Thu Jul 22 16:36:53 2010 +0100 @@ -30,10 +30,12 @@ DEPENDPATH += $${HB_SOURCE_DIR}/src/hbutils/document DEPENDPATH += $${HB_SOURCE_DIR}/src/hbcore/core DEPENDPATH += $${HB_SOURCE_DIR}/src/hbcore/utils +DEPENDPATH += $${HB_SOURCE_DIR}/src/hbcore/layouts #INCLUDEPATH += . INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbutils/document INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/core INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/utils +INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/layouts DEFINES += HB_BOOTSTRAPPED CONFIG += console CONFIG -= app_bundle @@ -42,6 +44,8 @@ DESTDIR = $${HB_BUILD_DIR}/bin # dependencies +HEADERS += $${HB_SOURCE_DIR}/src/hbcore/layouts/hbanchor.h +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/layouts/hbanchor.cpp HEADERS += $${HB_SOURCE_DIR}/src/hbcore/utils/hbfontspec.h SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbfontspec.cpp SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbxmlloaderabstractsyntax_p.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/docml2bin/main.cpp --- a/src/hbtools/docml2bin/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/docml2bin/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,12 +23,13 @@ ** ****************************************************************************/ +#include +#include +#include #include -#include #include #include - void showHelp() { std::cout << "docml2bin.exe usage:\n\n"; @@ -50,7 +51,7 @@ int main(int argc, char *argv[]) { - QApplication app(argc, argv, false); // GUIenabled=false + QCoreApplication app(argc, argv); if (argc <= 2) { showHelp(); @@ -126,7 +127,6 @@ } } } - return 0; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbbincssmaker/hbbincssmaker.pro --- a/src/hbtools/hbbincssmaker/hbbincssmaker.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/hbbincssmaker/hbbincssmaker.pro Thu Jul 22 16:36:53 2010 +0100 @@ -39,6 +39,7 @@ DEPENDPATH += $${HB_SOURCE_DIR}/src/hbcore/image DEPENDPATH += $${HB_SOURCE_DIR}/src/hbcore/style DEPENDPATH += $${HB_SOURCE_DIR}/src/hbcore/feedback +DEPENDPATH += $${HB_SOURCE_DIR}/src/hbcore/layouts INCLUDEPATH += . INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/core @@ -49,10 +50,12 @@ INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/image INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/style INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/feedback +INCLUDEPATH += $${HB_SOURCE_DIR}/src/hbcore/layouts QT = core gui svg QT += network CONFIG += console +CONFIG -= app_bundle # directories DESTDIR = $${HB_BUILD_DIR}/bin @@ -91,6 +94,15 @@ SOURCES += $${HB_SOURCE_DIR}/src/hbcore/cssparser/hbwidgetstyleloader_p.cpp SOURCES += $${HB_SOURCE_DIR}/src/hbcore/cssparser/hbstyleselector_p.cpp +# widgetml parsing. +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbwidgetloader.cpp +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbwidgetloaderactions_p.cpp +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbwidgetloadersyntax_p.cpp +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbxmlloaderbaseactions_p.cpp +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbxmlloaderabstractsyntax_p.cpp +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbxmlloaderbasesyntax_p.cpp +SOURCES += $${HB_SOURCE_DIR}/src/hbcore/utils/hbxmlloaderabstractactions_p.cpp + DEFINES += HB_BOOTSTRAPPED DEFINES += HB_BIN_CSS DEFINES -= HB_GESTURE_FW @@ -100,9 +112,12 @@ DEFINES += HB_PLUGINS_DIR=\"\\\"$${HB_PLUGINS_DIR}\\\"\" # Input +HEADERS += hbcssconverterutils_p.h +HEADERS += hboffsetmapbuilder_p.h + SOURCES += main.cpp -HEADERS += hbcssconverterutils_p.h SOURCES += hbcssconverterutils.cpp +SOURCES += hboffsetmapbuilder.cpp # installation !local { diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbbincssmaker/hbcssconverterutils.cpp --- a/src/hbtools/hbbincssmaker/hbcssconverterutils.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/hbbincssmaker/hbcssconverterutils.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,10 +24,14 @@ ****************************************************************************/ #include +#include +#include "hbstring_p.h" #include "hbcssconverterutils_p.h" #include "hbsharedmemorymanager_p.h" #include "hbsharedmemoryallocators_p.h" +static QHash strMap; + // Global list that stores pointers to the member variables where shared container instances // store offsets returned my memory allocator. // CSS converter utilizes it to automatically adjust the offsets if allocated cells are moved. @@ -55,10 +59,16 @@ registered.remove(offset); } - -QList HbCssConverterUtils::registeredOffsetHolders() +QMultiHash HbCssConverterUtils::registeredOffsetHolders() { - return registered.keys(); + QMultiHash holders; + holders.reserve(registered.size()); + QMap::const_iterator end = registered.constEnd(); + for (QMap::const_iterator i = registered.constBegin(); i != end; ++i) { + int *holder = i.key(); + holders.insertMulti(*holder, holder); + } + return holders; } void HbCssConverterUtils::unregisterAll() @@ -84,13 +94,14 @@ GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); HbSharedMemoryManager *shared = static_cast(manager); const char *chunkBase = static_cast(shared->base()); + const char *freedEnd = chunkBase + offset + size; + const int *freedStart = reinterpret_cast(chunkBase + offset); - QList offsetHolders = HbCssConverterUtils::registeredOffsetHolders(); - for (int i = 0; i= chunkBase + offset && (char*)holder < chunkBase + offset + size) { - HbCssConverterUtils::unregisterOffsetHolder(holder); - } + QMap::iterator freedHolders = + registered.lowerBound(const_cast(freedStart)); + while(freedHolders != registered.end() + && reinterpret_cast(freedHolders.key()) < freedEnd) { + freedHolders = registered.erase(freedHolders); } } } @@ -102,19 +113,23 @@ if (size > 0) { // Check if there were registered offset holders in the old cell // and register corresponding ones in the reallocated cell. - QList holders = HbCssConverterUtils::registeredOffsetHolders(); - GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); HbSharedMemoryManager *shared = static_cast(manager); - const char *chunkBase = static_cast(shared->base()); - - for (int i=0; i= chunkBase + offset && holderC < chunkBase + offset + size) { - HbCssConverterUtils::unregisterOffsetHolder(holder); - HbCssConverterUtils::registerOffsetHolder((int*)(holderC + newOffset - offset)); - } + const char *chunkBase = static_cast(shared->base()); + const char *freedEnd = chunkBase + offset + size; + const int *freedStart = reinterpret_cast(chunkBase + offset); + + QMap::iterator freedHolders = + registered.lowerBound(const_cast(freedStart)); + QList newHolders; + while(freedHolders != registered.end() + && reinterpret_cast(freedHolders.key()) < freedEnd) { + char *holderC = reinterpret_cast(freedHolders.key()); + newHolders.append(reinterpret_cast(holderC + newOffset - offset)); + freedHolders = registered.erase(freedHolders); + } + for (int i = 0; i < newHolders.size(); ++i) { + registerOffsetHolder(newHolders.at(i)); } } } @@ -128,63 +143,58 @@ { GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); HbSharedMemoryManager *shared = static_cast(manager); + strMap.clear(); - // Register shared cache pointer in chunk header as shared cache may also be moved in defragmentation - HbSharedChunkHeader *chunkHeader = static_cast(shared->base()); - HbCssConverterUtils::registerOffsetHolder(reinterpret_cast(&chunkHeader->sharedCacheOffset)); + // Register shared cache pointer in chunk header + //as shared cache may also be moved in defragmentation + HbSharedChunkHeader *chunkHeader = static_cast(shared->base()); + registerOffsetHolder(reinterpret_cast(&chunkHeader->sharedCacheOffset)); - QList offsetHolders = HbCssConverterUtils::registeredOffsetHolders(); + QMultiHash offsetHolders = registeredOffsetHolders(); // Create new buffer where the current chunk contents are defragmented - void *buffer = ::malloc(shared->size()); + char *buffer = static_cast(::malloc(shared->size())); int newCurrentOffset = 0; // Create new cell order and update offset holders - QMap::const_iterator i = cells.constBegin(); + QMap::const_iterator end = cells.constEnd(); - while (i != cells.constEnd()) { + for (QMap::const_iterator i = cells.constBegin(); i != end; ++i) { // Get the old cell int offset = i.key(); int size = i.value(); // Update registered offset holders - - // TODO: optimize this, now there's linear search for each cell! - for (int j=0; j values = offsetHolders.values(offset); + offsetHolders.remove(offset); + int newOffset = newCurrentOffset + sizeof(HbSharedChunkHeader); + for (int j = 0; j < values.size(); ++j) { + int *holder = values[j]; + *holder = newOffset; + offsetHolders.insertMulti(*holder, holder); + } newCurrentOffset += size; - i++; } - i = cells.constBegin(); newCurrentOffset = 0; - // Move allocated cells to a linear buffer - while (i != cells.constEnd()) { + for (QMap::const_iterator i = cells.constBegin(); i != end; ++i) { // Get the old cell int offset = i.key(); int size = i.value(); // Copy to new chunk - memcpy((char*)buffer + newCurrentOffset, (char*)shared->base() + offset, size); - + memcpy(buffer + newCurrentOffset, static_cast(shared->base()) + offset, size); newCurrentOffset += size; - i++; } // Free all cells from the shared chunk and move the defragmented buffer in the beginning of the chunk. // Note that chunk memory management is screwed up after this point, so no more allocations should be // done in it after this. - HbCssConverterUtils::unregisterAll(); + unregisterAll(); QList keys = cells.keys(); - for (int j=0; jfree(keys.at(j)); } @@ -202,3 +212,21 @@ // Return the next free address in the chunk return cssBinaryOffset + newCurrentOffset; } + +void HbCssConverterUtils::addSharedStringData(const QString &str, const HbString &hbstr) +{ + if (!strMap.contains(str)) { + strMap.insert(str, hbstr); + } +} + +HbString* HbCssConverterUtils::sharedStringData(const QString &str) +{ + HbString *ret = 0; + QHash::iterator i = strMap.find(str); + if (i != strMap.end()) { + ret = &i.value(); + } + return ret; +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbbincssmaker/hbcssconverterutils_p.h --- a/src/hbtools/hbbincssmaker/hbcssconverterutils_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/hbbincssmaker/hbcssconverterutils_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,6 +27,8 @@ #define HBCSSCONVERTERUTILS_P_H #include +#include +#include class HbCssConverterUtils { @@ -34,7 +36,7 @@ // Shared chunk offset management static void registerOffsetHolder(int *offset); static void unregisterOffsetHolder(int *offset); - static QList registeredOffsetHolders(); + static QMultiHash registeredOffsetHolders(); static void unregisterAll(); // Shared chunk allocation management @@ -43,6 +45,10 @@ static void cellMoved(int offset, int newOffset); static int defragmentChunk(); + //shared string management + static void addSharedStringData(const QString &str, const HbString &hbstr); + static HbString* sharedStringData(const QString &str); + private: HbCssConverterUtils(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbbincssmaker/hboffsetmapbuilder.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbtools/hbbincssmaker/hboffsetmapbuilder.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,133 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbTools module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#include "hboffsetmapbuilder_p.h" + +#include + +extern QTextStream err; + +/*! + Adds \a offsets for a \a className. \a fileInfo points to the layout css file. + \a offsets are indexed using CSSFileType - enum value. +*/ +bool HbOffsetMapBuilder::addWidgetOffsets(const QString &className, + const QFileInfo *fileInfo, + int offsets[]) +{ + bool retValue = true; + quint32 nameHash = HbSharedCache::hash(QStringRef(&className)); + HbBinMakerOffsetItem mapItem = _mapItems.value(nameHash, HbBinMakerOffsetItem()); + if (mapItem.isNull()) { + if (fileInfo) { + mapItem.name = fileInfo->absoluteFilePath(); + } + mapItem.widgetHash = nameHash; + mapItem.offsetCSS = offsets[CSSFile]; + mapItem.offsetColorCSS = offsets[ColorCSSFile]; + _mapItems.insert(nameHash, mapItem); + } else { + err << "duplicate hash value found!" << endl; + retValue = false; + } + return retValue; +} + +/*! + Adds \a widgetML layout offsets for a class, which hash is \a classNameHash. + Widget offsets for a class must already be added, before calling this method, + see \sa addWidgetOffsets. + Offsets for each layout is in \a layoutInfoList. \a filePath contains the path to the + widgetml file for the class. +*/ +bool HbOffsetMapBuilder::addWidgetMLOffsets(const QString &filePath, + quint32 classNameHash, + const QList &layoutInfoList) +{ + bool retValue = true; + QMap::iterator offsetItem = _mapItems.find(classNameHash); + if (offsetItem != _mapItems.end()) { + QSet hashCheck; + QList &layoutIndexTable = offsetItem.value().layoutIndexItemList; + Q_FOREACH(const LayoutItem &layoutInfo, layoutInfoList) { + HbLayoutIndexItem item; + item.layoutNameHash = HbSharedCache::hash(QStringRef(&layoutInfo.layout->layoutname)); + item.sectionNameHash = HbSharedCache::hash(QStringRef(&layoutInfo.layout->section)); + quint64 hash = (quint64(item.layoutNameHash) << 32) | item.sectionNameHash; + if (!hashCheck.contains(hash)) { + hashCheck.insert(hash); + } else { + err << "duplicate layout name hash found for: " << filePath << endl; + retValue = false; + break; + } + item.offset = layoutInfo.offset; + layoutIndexTable.append(item); + } + } + return retValue; +} + +/*! + dumps the contents of the offset map to bytearray. + +*/ +QByteArray HbOffsetMapBuilder::result() +{ + QByteArray dataArray; + + //first layoutindextable is locates after the offsetitem-array. + int currentLayoutIndexTableOffset = _mapItems.size() * sizeof(HbOffsetItem); + + //store offsetitems, update layout index table offset + foreach(const HbBinMakerOffsetItem &mapItem, _mapItems) { + HbOffsetItem tmp(mapItem); + if (!mapItem.layoutIndexItemList.isEmpty()) { + tmp.offsetLayoutIndexTable = currentLayoutIndexTableOffset; + currentLayoutIndexTableOffset += sizeof(quint32) // space for the size of the layoutindex table + + mapItem.layoutIndexItemList.size() + * sizeof(HbLayoutIndexItem); + } + dataArray.append(reinterpret_cast(&tmp), sizeof(HbOffsetItem)); + } + + //store layout index tables + QMap::iterator end = _mapItems.end(); + for(QMap::iterator i = _mapItems.begin(); i != end; ++i) { + HbBinMakerOffsetItem &mapItem = i.value(); + if (!mapItem.layoutIndexItemList.isEmpty()) { + qSort(mapItem.layoutIndexItemList); //sort for binary search. + //store the table size first. + quint32 size = mapItem.layoutIndexItemList.size(); + dataArray.append(reinterpret_cast(&size), sizeof(quint32)); + //store the layout-index items. + foreach(const HbLayoutIndexItem &layoutIndexItem, mapItem.layoutIndexItemList) { + dataArray.append(reinterpret_cast(&layoutIndexItem), + sizeof(HbLayoutIndexItem)); + } + } + } + return dataArray; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbbincssmaker/hboffsetmapbuilder_p.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbtools/hbbincssmaker/hboffsetmapbuilder_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbTools module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBOFFSETMAPBUILDER_P_H +#define HBOFFSETMAPBUILDER_P_H + +#include + +#include +#include +#include + +class QFileInfo; + +enum CSSFileType { + CSSFile = 0, + ColorCSSFile, + CSSFileTypeEnd +}; + +struct CSSLayoutInfo +{ + QString layoutname; + QString section; +}; + +struct LayoutItem +{ + LayoutItem(const CSSLayoutInfo* layout) : layout(layout), offset(-1) + { + Q_ASSERT(layout); + } + + const CSSLayoutInfo* layout; + int offset; +}; + +struct HbBinMakerOffsetItem : public HbOffsetItem +{ + QString name; + QList layoutIndexItemList; + bool isNull() const + { + return offsetCSS == -1 + && offsetColorCSS == -1 + && offsetLayoutIndexTable == -1; + } +}; + +class HbOffsetMapBuilder +{ +public: + HbOffsetMapBuilder() {} + + bool addWidgetOffsets(const QString &className, + const QFileInfo *fileInfo, + int offsets[]); + bool addWidgetMLOffsets(const QString &fileName, + quint32 classNameHash, + const QList &layoutInfoList); + + QByteArray result(); + int size() const { return _mapItems.count(); } + + QList items() const + { + return _mapItems.values(); + } + +private: + QMap _mapItems; +}; + +#endif // HBOFFSETMAPBUILDER_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbbincssmaker/main.cpp --- a/src/hbtools/hbbincssmaker/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/hbbincssmaker/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,10 +32,17 @@ #include #include #include +#include +#include // Global variables -QString AppName("hbbincssmaker"); +static const QString CSSFileExtension = ".css"; +static const QString WMLFileExtension = ".widgetml"; +static const QString ColorCSSEnding = "_color.css"; + +static const QString AppName = "hbbincssmaker"; static bool verboseOn = false; + QTextStream out(stdout); QTextStream verboseOut(stderr); QTextStream err(stderr); @@ -44,6 +51,17 @@ #define VERBOSEIF(test, statement) if(verboseOn && test) { verboseOut << statement; } #define VERBOSELN(statement) if(verboseOn) { verboseOut << statement << endl; } +struct WidgetMLParseInput +{ + QString filename; + QList layouts; + + void clear() + { + layouts.clear(); + filename.clear(); + } +}; void testDeclarations(const HbVector &decls) { @@ -115,72 +133,114 @@ } } -class CssMap +void testLayoutDef(const HbWidgetLoader::LayoutDefinition *layoutDef) +{ + VERBOSELN("anchor items count: " << layoutDef->anchorItems.count()); + for (int i = 0; i < layoutDef->anchorItems.count(); ++i) { + const HbWidgetLoader::AnchorItem &anchorItem = layoutDef->anchorItems.at(i); + VERBOSELN("srcId: " << anchorItem.srcId); + VERBOSELN("dstId: " << anchorItem.dstId); + VERBOSELN("prefLength text: " << anchorItem.prefText); + VERBOSELN("anchorId: " << anchorItem.anchorId); + } +} + +bool testCss() { -public: - CssMap() {} - void add(const QString &cssName, unsigned int offset) - { - HbOffsetItem mapItem = _mapItems.value(cssName, HbOffsetItem()); - if (mapItem.nameOffset < 0) { - mapItem.nameOffset = _cssNameBuffer.size(); - mapItem.offset = offset; - _cssNameBuffer.append(cssName.toLatin1()).append('\0'); - _mapItems.insert(cssName, mapItem); - } else { - err << "warning: duplicate cache key for " << cssName << endl; - } - } + GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); + HbSharedMemoryManager *shared = static_cast(manager); + HbSharedCache *cache = shared->cache(); - void registerOffsetHolders() { - foreach(const HbOffsetItem &mapItem, _mapItems) { - HbCssConverterUtils::registerOffsetHolder(const_cast(&mapItem.offset)); + for (int k = 0; k < cache->mOffsetItemCount; ++k) { + if (cache->mOffsetItems[k].offsetCSS >= 0) { + HbCss::StyleSheet *sheet = HbMemoryUtils::getAddress( + HbMemoryManager::SharedMemory, cache->mOffsetItems[k].offsetCSS); + VERBOSELN("Cssmap item " << k + << "- hash value: \"" << cache->mOffsetItems[k].offsetCSS << "\""); + // Tests the stylesheet offsets and prints info to verbose out + testStyleSheet(sheet); + + //test layout definition. + int tableSize = 0; + const HbLayoutIndexItem *ptr = cache->layoutIndexItemBegin( + cache->mOffsetItems[k].offsetLayoutIndexTable, &tableSize); + for (; tableSize > 0; --tableSize, ++ptr) { + HbWidgetLoader::LayoutDefinition *layoutDef = + HbMemoryUtils::getAddress( + HbMemoryManager::SharedMemory, ptr->offset); + testLayoutDef(layoutDef); + } } } + return true; +} - QByteArray data() const { - QByteArray dataArray; - int count = _mapItems.size(); - int adjustment = count * sizeof(HbOffsetItem); - foreach(const HbOffsetItem &mapItem, _mapItems) { - HbOffsetItem tmp(mapItem); - // Fix offsets in the items to be based on the beginning of the css map instead of - // the beginning of the css name buffer. - tmp.nameOffset += adjustment; - dataArray.append(reinterpret_cast(&tmp), sizeof(HbOffsetItem)); - } - dataArray.append(_cssNameBuffer); - return dataArray; - } - int size() const { return _mapItems.count(); } +/*! + Collects and return layout names from \a styleRules. + \a layoutSet - map of already found layoutnames and sections to prevent duplicate layouts + to be added. -private: - QMap _mapItems; - QByteArray _cssNameBuffer; -}; +*/ +QList collectLayoutNames( + QSet > &layoutSet, + const HbVector &styleRules) +{ + QList layouts; + layouts.append(CSSLayoutInfo()); -struct InputFile -{ - InputFile(const QString &cacheName, const QFileInfo &file) : cacheName(cacheName), file(file) - { + foreach(const HbCss::StyleRule &rule, styleRules) { + foreach(const HbCss::Declaration &decl, rule.declarations) { + if (decl.propertyId == HbCss::Property_Layout) { + if (decl.values.count() == 1) { + layouts.last().layoutname = decl.values.at(0).variant.toString(); + } + } else if (decl.propertyId == HbCss::Property_Section) { + if (decl.values.count() == 1) { + layouts.last().section = decl.values.at(0).variant.toString(); + } + } + } + const CSSLayoutInfo &infoRef = layouts.last(); + if (!infoRef.layoutname.isEmpty()) { + QPair layout = qMakePair(infoRef.layoutname, + infoRef.section); + //only add layout, if not already collected before. + if (!layoutSet.contains(layout)) { + layoutSet.insert(layout); + layouts.append(CSSLayoutInfo()); + } + } } - - QString cacheName; - QFileInfo file; -}; -typedef QList InputFileList; + layouts.removeLast(); + return layouts; +} -struct InputFileInfo +/*! + Collects all the layouts defined in \a stylesheet and add the result to \a input. + returns true, if at least one layout is found. +*/ +bool collectLayouts(const QString &cssFilePath, + HbCss::StyleSheet *styleSheet, + WidgetMLParseInput &input) { - QString base; - QString path; - QString prefix; -}; -typedef QList InputFileInfoList; - -bool operator < (const InputFile & if1, const InputFile & if2) -{ - return if1.file.size() > if2.file.size(); + input.clear(); + QSet > layoutSet; //for removing duplicate layout names. + foreach(const HbCss::WidgetStyleRules &rule, styleSheet->widgetRules) { + layoutSet.clear(); + input.layouts += collectLayoutNames(layoutSet, rule.styleRules); + input.layouts += collectLayoutNames(layoutSet, rule.portraitRules); + input.layouts += collectLayoutNames(layoutSet, rule.landscapeRules); + } + bool hasLayoutDef = false; + if (!input.layouts.isEmpty()) { + //if css contains at least 1 layout declaration, it might have .widgetml file. + QString filePath(cssFilePath); + filePath.replace(filePath.size() - CSSFileExtension.size(), + CSSFileExtension.size(), WMLFileExtension); + input.filename = filePath; + hasLayoutDef = true; + } + return hasLayoutDef; } void printHelp() @@ -206,103 +266,204 @@ return collected; } -InputFileList collectCssFiles(const QStringList &inputFilePaths) +QMap collectCssFiles(const QStringList &inputFilePaths) { QStringList filters; filters << "*.css"; - InputFileList inputFiles; + QMap cssFileMap; QFileInfoList inputPath; inputPath.append(QFileInfo()); Q_FOREACH(const QString &path, inputFilePaths) { inputPath[0].setFile(path); QFileInfoList allFiles = collectFiles(inputPath, filters); Q_FOREACH(const QFileInfo &info, allFiles) { - inputFiles.append(InputFile(info.fileName(), info)); + QMap::const_iterator i = cssFileMap.find(info.fileName()); + if (i == cssFileMap.end()) { + cssFileMap.insert(info.fileName(), info); + } else { + err << "duplicate css filenames found: " << i.value().absoluteFilePath() << + " & " << info.absoluteFilePath(); + } } } - return inputFiles; + return cssFileMap; } -bool writeCssBinary(const QStringList &inputFiles, const QString &targetFile) +/*! + Collects the css files from \a inputFiles, parses them to shared memory, stores + offsets to \a offsetMap. + returns true on success. +*/ +bool parseCss(const QStringList &inputFiles, HbOffsetMapBuilder &offsetMap) { if (inputFiles.isEmpty()) return false; - InputFileList cssFiles = collectCssFiles(inputFiles); - if (cssFiles.isEmpty()) return false; - qSort(cssFiles); + QMap cssFiles = collectCssFiles(inputFiles); HbCss::Parser parser; HbCss::StyleSheet *styleSheet = 0; bool success = false; - CssMap cssMap; + GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); - Q_FOREACH(const InputFile &inputFile, cssFiles) { - const QFileInfo &file = inputFile.file; - VERBOSE("processing " << file.absoluteFilePath() << "..."); - success = false; - int offset = manager->alloc(sizeof(HbCss::StyleSheet)); - if (offset >= 0) { - styleSheet = new (static_cast(manager->base()) + offset) - HbCss::StyleSheet(HbMemoryManager::SharedMemory); - parser.init(file.absoluteFilePath(), true); - success = parser.parse(styleSheet); - cssMap.add(inputFile.cacheName, offset); - VERBOSE("cache key = " << inputFile.cacheName << "..."); + while (!cssFiles.isEmpty()) { + QMap::iterator first = cssFiles.begin(); + QMap::iterator CSSFiles[CSSFileTypeEnd]; + + QString widgetName(first.key()); + if (widgetName.endsWith(ColorCSSEnding)) { + //color css file, find the layout css pair. + CSSFiles[ColorCSSFile] = first; + widgetName.remove(widgetName.size() - ColorCSSEnding.size(), + ColorCSSEnding.size()); + CSSFiles[CSSFile] = cssFiles.find(widgetName + CSSFileExtension); + } else { + //layout css file, find the color css pair. + CSSFiles[CSSFile] = first; + widgetName.remove(widgetName.size() - CSSFileExtension.size(), + CSSFileExtension.size()); + CSSFiles[ColorCSSFile] = cssFiles.find(widgetName + ColorCSSEnding); + } + int offsets[] = {-1, -1}; + + for (int i = 0; i < CSSFileTypeEnd; ++i) { + if (CSSFiles[i] != cssFiles.end()) { + const QFileInfo &file = CSSFiles[i].value(); + VERBOSE("processing " << file.absoluteFilePath() << "..."); + offsets[i] = manager->alloc(sizeof(HbCss::StyleSheet)); + if (offsets[i] >= 0) { + styleSheet = new (static_cast(manager->base()) + offsets[i]) + HbCss::StyleSheet(HbMemoryManager::SharedMemory); + parser.init(file.absoluteFilePath(), true); + success = parser.parse(styleSheet); + VERBOSE("cache key = " << CSSFiles[i].key() << "..."); + } + if (success) { + VERBOSELN("ok"); + } else { + VERBOSELN("failed"); + err << "Failed to parse: " << file.absoluteFilePath() << endl; + break; + } + } } + + const QFileInfo *info = 0; + QString tmp; + if (CSSFiles[CSSFile] != cssFiles.end()) { + tmp = CSSFiles[CSSFile].key(); + info = &CSSFiles[CSSFile].value(); + } + if (!offsetMap.addWidgetOffsets(widgetName, info, offsets)) { + return false; + } + + //remove processed files from the map. + cssFiles.erase(CSSFiles[ColorCSSFile]); + if (!tmp.isEmpty()) { + cssFiles.remove(tmp); + } + } + return success; +} + +/*! + Parses widgetml file and all the layouts using the info from \a parseInput for a widget, + which hash is \a widgetHash, add offsets to \a offsetMap. +*/ +bool parseWidgetML(HbOffsetMapBuilder &offsetMap, + quint32 widgetHash, + const WidgetMLParseInput &parseInput) +{ + HbWidgetLoader loader; + + VERBOSELN("processing: " << parseInput.filename); + QFile file(parseInput.filename); + if (!file.open(QFile::ReadOnly | QFile::Text)) { + VERBOSELN("unable to open file: " << parseInput.filename); + return false; + } + HbWidgetLoader::LayoutDefinition *layoutDef = 0; + int layoutDefOffset = -1; + bool success = true; + + GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); + QList layoutInfoList; + Q_FOREACH(const CSSLayoutInfo &info, parseInput.layouts) { + VERBOSE("layout: " << info.layoutname << ", " << "section: " << info.section << "..."); + + layoutDefOffset = manager->alloc(sizeof(HbWidgetLoader::LayoutDefinition)); + layoutDef = new(static_cast(manager->base()) + layoutDefOffset) + HbWidgetLoader::LayoutDefinition(HbMemoryManager::SharedMemory); + success = loader.loadLayoutDefinition(layoutDef, &file, info.layoutname, info.section); + if (success) { + layoutInfoList.append(LayoutItem(&info)); + layoutInfoList.last().offset = layoutDefOffset; VERBOSELN("ok"); } else { VERBOSELN("failed"); - err << "Failed to parse: " << file.absoluteFilePath() << endl; break; } + file.seek(0); + } + success = offsetMap.addWidgetMLOffsets(parseInput.filename, widgetHash, layoutInfoList); + return success; +} + +/*! + Parse all the widgetmls to shared memory for widget's found in \a offsetMap, + store the offsets to \a offsetMap. +*/ +bool parseWidgetML(HbOffsetMapBuilder &offsetMap) +{ + QList itemList = offsetMap.items(); + Q_FOREACH(const HbBinMakerOffsetItem &item, itemList) { + if (item.offsetCSS >= 0) { + HbCss::StyleSheet *sheet = HbMemoryUtils::getAddress( + HbMemoryManager::SharedMemory, item.offsetCSS); + WidgetMLParseInput file; + if (collectLayouts(item.name, sheet, file)) { + parseWidgetML(offsetMap, item.widgetHash, file); + } + } } - if (success) { - HbSharedMemoryManager *shared = static_cast(manager); - - // Create shared cache to shared memory. - QByteArray data(cssMap.data()); - - if (shared->createSharedCache(data.data(), data.size(), cssMap.size())) { + return true; +} - // Defragment the chunk contents before dumping it in a file - int endOffset = HbCssConverterUtils::defragmentChunk(); - - if (verboseOn) { - HbSharedCache *cache = shared->cache(); - - for (int k=0; kmOffsetItemCount; ++k) { - HbCss::StyleSheet *sheet = HbMemoryUtils::getAddress( - HbMemoryManager::SharedMemory, cache->mOffsetItems[k].offset); - - QString name(QLatin1String( ((char*)(cache->mOffsetItems)) + cache->mOffsetItems[k].nameOffset)); +bool writeCssBinary(const QStringList &inputFiles, const QString &targetFile) +{ + HbOffsetMapBuilder offsetMap; + if (!(parseCss(inputFiles, offsetMap) + && parseWidgetML(offsetMap))) { + return false; + } + GET_MEMORY_MANAGER(HbMemoryManager::SharedMemory); + HbSharedMemoryManager *shared = static_cast(manager); - VERBOSE("Cssmap item "); - VERBOSE(k); - VERBOSE("- name: \""); - VERBOSE(name); - VERBOSELN("\""); + // Create shared cache to shared memory. + QByteArray data(offsetMap.result()); + bool success = false; - // Tests the stylesheet offsets and prints info to verbose out - testStyleSheet(sheet); - } - } + if (shared->createSharedCache(data.data(), data.size(), offsetMap.size())) { + // Defragment the chunk contents before dumping it in a file + int endOffset = HbCssConverterUtils::defragmentChunk(); + if (verboseOn) testCss(); - VERBOSELN("writing the binary file"); - QFile binFile(targetFile); - if (!binFile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - err << "failed to open target binary file: " << binFile.fileName() << endl; - return false; - } - //int size = shared->size(); - if (binFile.write(static_cast(manager->base()), endOffset) >= 0) { + VERBOSELN("writing the binary file"); + QFile binFile(targetFile); + success = binFile.open(QIODevice::WriteOnly | QIODevice::Truncate); + if (success) { + success = (binFile.write(static_cast(manager->base()), endOffset) >= 0); + if (success) { VERBOSELN("Wrote target binary file: " << binFile.fileName()); } else { err << "failed to write to target binary file: " << binFile.fileName() << endl; } } else { - err << "failed to create shared cache." << endl; + err << "failed to open target binary file: " << binFile.fileName() << endl; } + } else { + err << "failed to create shared cache." << endl; } return success; } @@ -310,6 +471,7 @@ int main(int argc, char **argv) { QCoreApplication app(argc, argv); + int returnValue = 0; if(argc < 3) { printHelp(); @@ -335,15 +497,18 @@ if (targetFile.isEmpty()) { err << "target filename needed" << endl << endl; printHelp(); + returnValue = 1; } else { QString parentDir(QFileInfo(targetFile).absolutePath()); if (QDir::current().mkpath(parentDir)) { - writeCssBinary(inputFiles, targetFile); + if (!writeCssBinary(inputFiles, targetFile)) { + returnValue = 3; + } } else { err << "failed to create path: " << parentDir << endl; + returnValue = 2; } } } - return 0; + return returnValue; } - diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbthemeindexer/main.cpp --- a/src/hbtools/hbthemeindexer/main.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/hbthemeindexer/main.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -59,7 +59,9 @@ void createMirroredList(const QString &fullThemePath) { - std::cout << "Parsing mirrored list for theme " << fullThemePath.toStdString() << "\n"; + if (verboseOn) { + std::cout << "Parsing mirrored list for theme " << fullThemePath.toStdString() << "\n"; + } // Find mirrored.txt file QString filename = fullThemePath + "/mirrored.txt"; // Try to read file @@ -81,7 +83,9 @@ void createLockedList(const QString &fullThemePath) { - std::cout << "Parsing locked list for theme " << fullThemePath.toStdString() << "\n"; + if (verboseOn) { + std::cout << "Parsing locked list for theme " << fullThemePath.toStdString() << "\n"; + } // Find locked.txt file QString filename = fullThemePath + "/locked.txt"; // Try to read file @@ -154,10 +158,16 @@ if (itemData.flags & HbThemeIndexItemData::Mirrorable) { std::cout << "Icon is automatically mirrored\n"; } + } else if (itemData.itemType == HbThemeIndexItemData::ColorItem) { + std::cout << "Color value: " << itemData.colorValue << "\n"; + if (itemData.flags & HbThemeIndexItemData::Reference) { + std::cout << "Item is reference\n"; + } } if (itemData.flags & HbThemeIndexItemData::Locked) { std::cout << "Item is locked\n"; } + std::cout << "----------------------------------------------------------------\n\n"; } else { // Item already added in index with some other extension, do not add duplicates std::cout << "----------------------------------------------------------------\n"; @@ -302,6 +312,50 @@ return d1.itemNameHash < d2.itemNameHash; } +void indexColorVariables(const QString &filename) +{ + QFile file(filename); + + // Index only if given CSS file exists in theme. + if (file.open(QIODevice::ReadOnly | QIODevice::Text)) { + QTextStream in(&file); + + while(!in.atEnd()) { + QString line = in.readLine().trimmed(); + + if (line.startsWith("qtc_")) { + HbThemeIndexItemData itemData; + + // Extract name and value from line + QString name = line.mid(0, line.indexOf(':')).trimmed(); + QString value; + if (line.at(line.indexOf(':') + 1) == QChar('#')) { + // qtc_conv_list_received_normal:#B5B5B5; + int startIndex = line.indexOf('#'); + int endIndex = line.indexOf(';'); + value = line.mid(startIndex + 1, endIndex - startIndex - 1).trimmed(); + } else if (line.indexOf("var(") >= 0) { + // qtc_conv_list_received_normal:var(qtc_conv_list_sent_normal); + itemData.flags |= HbThemeIndexItemData::Reference; + int startIndex = line.indexOf("var(") + 4; + int endIndex = line.indexOf(')'); + value = line.mid(startIndex, endIndex - startIndex).trimmed(); + } + + itemData.itemNameHash = HbThemeIndex::hash(name); + itemData.itemType = HbThemeIndexItemData::ColorItem; + bool ok = false; + itemData.colorValue = (quint32)value.toUInt(&ok, 16); // Might cause compiler warning in 64 bit systems + appendItem(itemData, name); + } + } + file.close(); + } else if (verboseOn) { + std::cout << "No " << filename.toStdString() << " in theme!\n"; + } + return; +} + void processDir(const QDir &dir, const QString &themename, const QString targetName, bool subDir = false) { if (!subDir) { @@ -337,8 +391,25 @@ itemData.flags |= HbThemeIndexItemData::Mirrorable; appendItem(itemData, mirrored); } - QDir targetDir(targetName); - if (!targetDir.exists()) { + + // Read application and widget color group CSS files and index their content + // Temporary check + if (QFile::exists(dir.absolutePath() + "/style/" + themename + "/variables/color/hbapplicationcolorgroup.css") && + QFile::exists(dir.absolutePath() + "/style/" + themename + "/variables/color/hbwidgetcolorgroup.css")) { + if (verboseOn) { + std::cout << "Processing hbapplicationcolorgroup.css and hbwidgetcolorgroup.css"; + } + indexColorVariables(dir.absolutePath() + "/style/" + themename + "/variables/color/hbapplicationcolorgroup.css"); + indexColorVariables(dir.absolutePath() + "/style/" + themename + "/variables/color/hbwidgetcolorgroup.css"); + } else { + if (verboseOn) { + std::cout << "Processing hbcolorgroup.css"; + } + indexColorVariables(dir.absolutePath() + "/style/" + themename + "/variables/color/hbcolorgroup.css"); + } + + QDir targetDir; + if (!targetDir.exists(targetName)) { targetDir.mkpath(targetName); } QString filename = targetName + themename + ".themeindex"; @@ -380,11 +451,12 @@ void showHelp() { std::cout << "Themeindexer.exe usage:\n\n"; - std::cout << "hbthemeindexer [-v] -f filename OR -n themename -s themes source directory -t theme index file target directory\n\n"; + std::cout << "hbthemeindexer [-v] -f filename OR (-n themename) -s themes source directory -t theme index file target directory\n\n"; - std::cout << "-n \t\ttheme to be indexed (\".themeindex\").\n"; - std::cout << "-s \t\tthemes source directory is scanned recursively and all the"; - std::cout << "\t\t\trecognized resource files for given theme are aded in the theme index.\n"; + std::cout << "-n \t\ttheme to be indexed (\".themeindex\"). If omitted, all found\n"; + std::cout << "\t\tthemes are indexed.\n"; + std::cout << "-s \t\tthemes source directory is scanned recursively and all the recognized\n"; + std::cout << "\t\tresource files for given theme are aded in the theme index.\n"; std::cout << "-t \t\ttarget directory for the index file.\n"; std::cout << "-f \tfile which contains multiple themes to be indexed. Each in its own row.\n"; @@ -487,7 +559,7 @@ } } } else { - // Index only given theme + // Index only given dir targetname.replace('\\', '/'); // Check that targetname has / at the end @@ -495,7 +567,22 @@ targetname.append('/'); } - processDir(basedir, themename, targetname); + if (themename.isEmpty()) { + // Theme name not given, determine available themes + QDir icondir(basedir); + if (icondir.cd("icons")) { + QStringList entries = icondir.entryList(QDir::Dirs | QDir::NoDotAndDotDot); + foreach (const QString &entry, entries) { + QDir entrydir(icondir.filePath(entry)); + if (entrydir.exists("index.theme")) { + processDir(basedir, entrydir.dirName(), targetname); + } + } + } + } else { + // Process only given theme + processDir(basedir, themename, targetname); + } } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbtools/hbtools.pro --- a/src/hbtools/hbtools.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbtools/hbtools.pro Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,9 @@ TEMPLATE = subdirs -SUBDIRS += hbthemeindexer hbbincssmaker +SUBDIRS += hbthemeindexer +SUBDIRS += hbbincssmaker +SUBDIRS += docml2bin include($${HB_SOURCE_DIR}/src/hbcommon.pri) diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloader.cpp --- a/src/hbutils/document/hbdocumentloader.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloader.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -48,6 +48,9 @@ able to create your own custom widgets, you have to derive from this class and override \c createObject method. + See \c HbDocumentLoader::createBinary for information about DocML binary conversion + in build time. + Use the \c HbDocumentLoaderPlugin to add tool support for custom widgets. Example code: @@ -106,7 +109,7 @@ { QFile file( fileName ); - if( !file.open( QFile::ReadOnly | QFile::Text ) ) { + if( !file.open( QFile::ReadOnly ) ) { qWarning( "Unable to open file" ); if( ok ) { *ok = false; @@ -162,6 +165,16 @@ /*! Converts DocML document to binary document. + + You can also convert DocML files to binary format in build time by listing the files in "DOCML" + variable in the .pro file. This will create a binary docml file called .bin that + can be included to the resources (.qrc). + + Known issues: Currently the resource compiler gives warnings about missing binary files during + qmake. It's ok to ignore these warnings. + + For more information about DocML binary format, please refer to S60QtProgrammersGuide. + \param srcDevice source IO device to be processed. \param dstDevice destination IO device where to write to. \return true if conversion was ok. @@ -197,8 +210,11 @@ /*! - Inserts object tree to documentloader. You can pass as an input parameter + Inserts object tree to document loader. You can pass as an input parameter output of "load" mothod. + + Document loader does not take ownership of the objects. + \param roots root objects list. \return true if success, false otherwise. */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloader.h --- a/src/hbutils/document/hbdocumentloader.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloader.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,7 +40,7 @@ class HbMainWindow; class HbDocumentLoaderPrivate; -class HB_TOOLS_EXPORT HbDocumentLoader +class HB_UTILS_EXPORT HbDocumentLoader { public: HbDocumentLoader(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloader_p.cpp --- a/src/hbutils/document/hbdocumentloader_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloader_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -138,8 +138,6 @@ QDataStream stream( dstDevice ); stream << sectionsPositionList; stream << sectionsMetaDataPos; - - #ifdef DEBUG_TIMES debugPrintX("MYTRACE: DocML create binary, end: %d", debugTime.elapsed()); #endif @@ -155,7 +153,10 @@ #else bool result(true); + const bool originalTextMode = device->isTextModeEnabled(); + if (binarysyntax->isBinary(device)) { + device->setTextModeEnabled( false ); binarysyntax->setActions(actions); #ifdef DEBUG_TIMES debugTime.restart(); @@ -166,6 +167,7 @@ debugPrintX("MYTRACE: DocML load binary, end: %d", debugTime.elapsed()); #endif } else { + device->setTextModeEnabled( true ); syntax->setActions(actions); #ifdef DEBUG_TIMES debugTime.restart(); @@ -176,6 +178,7 @@ debugPrintX("MYTRACE: DocML load plain text, end: %d", debugTime.elapsed()); #endif } + device->setTextModeEnabled( originalTextMode ); return result; #endif } diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloaderactions_p.cpp --- a/src/hbutils/document/hbdocumentloaderactions_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloaderactions_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -100,7 +100,7 @@ return false; } - QObject *current = lookUp(type, name).first.data(); + QObject *current = lookUp(type, name).mObject.data(); if( current == 0 ) { HB_DOCUMENTLOADER_PRINT( QString( "Not supported object: " ) + type ); @@ -137,7 +137,7 @@ } ObjectMapItem item = lookUp(type, name, plugin); - QObject *current = item.first.data(); + QObject *current = item.mObject.data(); if( current == 0 ) { HB_DOCUMENTLOADER_PRINT( QString( "Not supported object: " ) + type ); @@ -149,7 +149,7 @@ parentAsWidget = static_cast(parent); } QGraphicsWidget *asWidget(0); - if (item.second == HbXml::WIDGET) { + if (item.mType == HbXml::WIDGET) { asWidget = static_cast(current); } @@ -172,54 +172,6 @@ return true; } -bool HbDocumentLoaderActions::pushSpacerItem( const QString &name, const QString &widget ) -{ - if ( name.isEmpty() ) { - HB_DOCUMENTLOADER_PRINT( QString( "SpacerItem needs to have a name" ) ); - return false; - } - - // find the widget which owns the spacer i.e. the parent - HbWidget *parent = 0; - - if( widget.isEmpty() ) { - bool isWidget = false; - parent = qobject_cast( findFromStack( &isWidget ) ); - if( !isWidget ) { - HB_DOCUMENTLOADER_PRINT( QString( "SPACERITEM: CANNOT SET SPACERITEM TO NON-HBWIDGET " ) ); - return false; - } - } else if( !( mObjectMap.contains( widget ) ) ) { - HB_DOCUMENTLOADER_PRINT( QString( "SPACERITEM: NO SUCH ITEM " ) + widget ); - return false; - } else { - ObjectMapItem &item = mObjectMap[ widget ]; - if (item.second == HbXml::WIDGET) { - parent = qobject_cast( item.first.data() ); - } - if( !parent ) { - HB_DOCUMENTLOADER_PRINT( QString( "SPACERITEM: CANNOT SET SPACERITEM TO NON-HBWIDGET " ) ); - return false; - } - } - - // look-up spacer item from widget - QGraphicsLayoutItem *current = parent->layoutPrimitive( name ); - if ( !current ) { - current = static_cast(HbWidgetBasePrivate::d_ptr(parent))->createSpacerItem(name); - } - - // add it onto stack for further processing - HbXml::Element e; - e.type = HbXml::SPACERITEM; - e.data = current; - mStack.append( e ); - HB_DOCUMENTLOADER_PRINT( QString( "ADD ELEMENT " ) + name ); - - return true; - -} - bool HbDocumentLoaderActions::pushConnect( const QString &srcName, const QString &signalName, const QString &dstName, const QString &slotName ) { @@ -237,14 +189,14 @@ return false; } - QObject *src = mObjectMap[ srcName ].first; + QObject *src = mObjectMap[ srcName ].mObject; if( !src ) { HB_DOCUMENTLOADER_PRINT( QString( "Unable to establish signal/slot connection, already destroyed " ) + srcName ); return false; } - QObject *dst = mObjectMap[ dstName ].first; + QObject *dst = mObjectMap[ dstName ].mObject; if( !dst ) { HB_DOCUMENTLOADER_PRINT( QString( "Unable to establish signal/slot connection, already destroyed " ) + dstName ); @@ -295,7 +247,7 @@ bool HbDocumentLoaderActions::pushRef( const QString &name, const QString &role ) { QObject *current = findFromStack(); - QObject *ref = mObjectMap[ name ].first.data(); + QObject *ref = mObjectMap[ name ].mObject.data(); if( ( current == 0 ) || ( ref == 0 ) ) { HB_DOCUMENTLOADER_PRINT( QString( "Wrong role name or role context" ) ); @@ -378,17 +330,14 @@ bool HbDocumentLoaderActions::setSizeHint(Qt::SizeHint hint, const HbXmlLengthValue &hintWidth, const HbXmlLengthValue &hintHeight, bool fixed) { - QGraphicsLayoutItem *current = findSpacerItemFromStackTop(); - if (!current) { - bool isWidget = false; - QObject* obj = findFromStack(&isWidget); - if( !obj || !isWidget ) { - HB_DOCUMENTLOADER_PRINT( QString( "Cannot set sizehint for non-QGraphicsWidget" ) ); - return false; - } - QGraphicsWidget *widget = static_cast(obj); - current = widget; + bool isWidget = false; + QObject* obj = findFromStack(&isWidget); + if( !obj || !isWidget ) { + HB_DOCUMENTLOADER_PRINT( QString( "Cannot set sizehint for non-QGraphicsWidget" ) ); + return false; } + QGraphicsWidget *widget = static_cast(obj); + qreal hintWidthVal, hintHeightVal; bool ok = true; @@ -407,28 +356,28 @@ case Qt::MinimumSize: if ( hintWidth.mType != HbXmlLengthValue::None ) { - current->setMinimumWidth(hintWidthVal); + widget->setMinimumWidth(hintWidthVal); } if ( hintHeight.mType != HbXmlLengthValue::None ) { - current->setMinimumHeight(hintHeightVal); + widget->setMinimumHeight(hintHeightVal); } break; case Qt::PreferredSize: if ( hintWidth.mType != HbXmlLengthValue::None ) { - current->setPreferredWidth(hintWidthVal); + widget->setPreferredWidth(hintWidthVal); } if ( hintHeight.mType != HbXmlLengthValue::None ) { - current->setPreferredHeight(hintHeightVal); + widget->setPreferredHeight(hintHeightVal); } break; case Qt::MaximumSize: if ( hintWidth.mType != HbXmlLengthValue::None ) { - current->setMaximumWidth(hintWidthVal); + widget->setMaximumWidth(hintWidthVal); } if ( hintHeight.mType != HbXmlLengthValue::None ) { - current->setMaximumHeight(hintHeightVal); + widget->setMaximumHeight(hintHeightVal); } break; @@ -437,14 +386,14 @@ } if (fixed) { - QSizePolicy policy = current->sizePolicy(); + QSizePolicy policy = widget->sizePolicy(); if ( hintWidth.mType != HbXmlLengthValue::None && hintWidthVal >= 0) { policy.setHorizontalPolicy(QSizePolicy::Fixed); } if ( hintHeight.mType != HbXmlLengthValue::None && hintHeightVal >= 0) { policy.setVerticalPolicy(QSizePolicy::Fixed); } - current->setSizePolicy(policy); + widget->setSizePolicy(policy); } return true; @@ -474,20 +423,16 @@ int *horizontalStretch, int *verticalStretch ) { - QGraphicsLayoutItem *current = findSpacerItemFromStackTop(); - if (!current) { - bool isWidget = false; - QObject* obj = findFromStack(&isWidget); - if( !obj || !isWidget ) { - HB_DOCUMENTLOADER_PRINT( QString( "Cannot set size policy for non-QGraphicsWidget" ) ); - return false; - } - QGraphicsWidget *widget = static_cast(obj); - current = widget; + bool isWidget = false; + QObject* obj = findFromStack(&isWidget); + if( !obj || !isWidget ) { + HB_DOCUMENTLOADER_PRINT( QString( "Cannot set size policy for non-QGraphicsWidget" ) ); + return false; } + QGraphicsWidget *widget = static_cast(obj); bool changed = false; - QSizePolicy sizePolicy = current->sizePolicy(); + QSizePolicy sizePolicy = widget->sizePolicy(); if ( horizontalPolicy && (*horizontalPolicy != sizePolicy.horizontalPolicy() ) ) { sizePolicy.setHorizontalPolicy( *horizontalPolicy ); @@ -509,14 +454,14 @@ } if ( changed ) { - current->setSizePolicy( sizePolicy ); + widget->setSizePolicy( sizePolicy ); } return true; } -bool HbDocumentLoaderActions::createAnchorLayout( const QString &widget ) +bool HbDocumentLoaderActions::createAnchorLayout( const QString &widget, bool modify ) { QGraphicsWidget *parent = 0; @@ -526,107 +471,158 @@ if( isWidget ) { parent = static_cast( parentObj ); } - } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].second == HbXml::WIDGET ) { - parent = static_cast( mObjectMap[ widget ].first.data() ); + } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].mType == HbXml::WIDGET ) { + parent = static_cast( mObjectMap[ widget ].mObject.data() ); } if ( !parent ) { HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: PARENT NOT FOUND" ) ); return false; } - mCurrentLayout = new HbAnchorLayout(); - - parent->setLayout( mCurrentLayout ); + if ( modify ) { + mCurrentLayout = parent->layout(); + if ( !mCurrentLayout ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO EXISTING LAYOUT" ) ); + return false; + } + } else { + mCurrentLayout = new HbAnchorLayout(); + parent->setLayout( mCurrentLayout ); + } return true; } -QGraphicsLayoutItem *findLayoutItem( const QGraphicsLayout &layout, const QString &layoutItemName ) -{ - QGraphicsLayoutItem *result = 0; - if ( layout.parentLayoutItem() ) { - QGraphicsItem *asGraphicsItem = layout.parentLayoutItem()->graphicsItem(); - if ( asGraphicsItem && asGraphicsItem->isWidget() ){ - HbWidget *asWidget = qobject_cast( static_cast(asGraphicsItem) ); - if( asWidget ) { - result = asWidget->layoutPrimitive( layoutItemName ); - } - } - } - return result; -} - -bool HbDocumentLoaderActions::addAnchorLayoutEdge( const QString &src, Hb::Edge srcEdge, - const QString &dst, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, const QString &spacer ) +bool HbDocumentLoaderActions::addAnchorLayoutItem( const QString &src, const QString &srcId, Hb::Edge srcEdge, + const QString &dst, const QString &dstId, Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, HbAnchor::Direction *dir, + const QString &anchorId ) { - if ( !spacer.isEmpty() ) { - // spacer is added - // divide original anchor definition into two. src->dst becomes src->spacer->dst - bool ok = true; - if ( src.isEmpty() ) { - // if the starting item is layout - // "layout --(spacing)--> item" - // becomes - // "layout --(spacing)--> spacer --(0)--> item" - ok &= addAnchorLayoutEdge( src, srcEdge, spacer, srcEdge, spacing ); - HbXmlLengthValue val(0, HbXmlLengthValue::Pixel); - ok &= addAnchorLayoutEdge( spacer, getAnchorOppositeEdge(srcEdge), dst, dstEdge, val ); - } else { - // if the starting item is not layout - // "item1 --(spacing)--> item2" - // becomes - // "item1 --(spacing)--> spacer --(0)--> item2" - ok &= addAnchorLayoutEdge( src, srcEdge, spacer, getAnchorOppositeEdge(srcEdge), spacing ); - HbXmlLengthValue val(0, HbXmlLengthValue::Pixel); - ok &= addAnchorLayoutEdge( spacer, srcEdge, dst, dstEdge, val ); - } - return ok; - } - QGraphicsLayoutItem *item1 = 0; QGraphicsLayoutItem *item2 = 0; HbAnchorLayout *layout = static_cast( mCurrentLayout ); - if ( src.isEmpty() ) { - item1 = layout; - } else if ( !( mObjectMap.contains( src ) ) ) { - item1 = findLayoutItem( *layout, src ); - } else { - if (mObjectMap[ src ].second == HbXml::WIDGET) { - item1 = static_cast( mObjectMap[ src ].first.data() ); + if ( !src.isNull() ) { + if ( src.isEmpty() ) { + item1 = layout; + } else if ( mObjectMap.contains( src ) && mObjectMap[ src ].mType == HbXml::WIDGET ) { + item1 = static_cast( mObjectMap[ src ].mObject.data() ); + } + if ( !item1 ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO SUCH ITEM " ) + src ); + return false; + } + } + + if ( !dst.isNull() ) { + if ( dst.isEmpty() ) { + item2 = layout; + } else if ( mObjectMap.contains( dst ) && mObjectMap[ dst ].mType == HbXml::WIDGET ) { + item2 = static_cast( mObjectMap[ dst ].mObject.data() ); + } + if ( !item2 ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO SUCH ITEM " ) + dst ); + return false; } } - if ( !item1 ) { - HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO SUCH ITEM " ) + src ); - return false; + + HbAnchor* anchor = 0; + if ( item1 && item2 ) { + anchor = new HbAnchor( item1, srcEdge, item2, dstEdge ); + } else if ( item1 ) { + anchor = new HbAnchor( item1, srcEdge, dstId, dstEdge ); + } else if ( item2 ) { + anchor = new HbAnchor( srcId, srcEdge, item2, dstEdge ); + } else { + anchor = new HbAnchor( srcId, srcEdge, dstId, dstEdge ); + } + + if ( minLength.mType != HbXmlLengthValue::None ) { + qreal minVal(0); + if ( !toPixels(minLength, minVal) ) { + delete anchor; + return false; + } else { + anchor->setMinimumLength( minVal ); + } + } + + if ( prefLength.mType != HbXmlLengthValue::None ) { + qreal prefVal(0); + if ( !toPixels(prefLength, prefVal) ) { + delete anchor; + return false; + } else { + anchor->setPreferredLength( prefVal ); + } } - if ( dst.isEmpty() ) { - item2 = layout; - } else if( !( mObjectMap.contains( dst ) ) ) { - item2 = findLayoutItem( *layout, dst ); - } else { - if (mObjectMap[ dst ].second == HbXml::WIDGET) { - item2 = static_cast( mObjectMap[ dst ].first.data() ); + if ( maxLength.mType != HbXmlLengthValue::None ) { + qreal maxVal(0); + if ( !toPixels(maxLength, maxVal) ) { + delete anchor; + return false; + } else { + anchor->setMaximumLength( maxVal ); } } - if ( !item2 ) { - HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO SUCH ITEM " ) + dst ); - return false; + + if ( policy ) { + anchor->setSizePolicy( *policy ); + } + + if ( dir ) { + anchor->setDirection( *dir ); + } + + if ( !anchorId.isEmpty() ) { + anchor->setAnchorId( anchorId ); } - qreal spacingVal(0); - if ( spacing.mType != HbXmlLengthValue::None && !toPixels(spacing, spacingVal) ) { + return layout->setAnchor( anchor ); +} + + +bool HbDocumentLoaderActions::setAnchorLayoutMapping( const QString &item, const QString &id, bool remove ) +{ + HbAnchorLayout *layout = static_cast( mCurrentLayout ); + QGraphicsWidget *widget = 0; + if ( item.isEmpty() && id.isEmpty() ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO ITEM NOR ID SPECIFIED" ) ); return false; } - layout->setAnchor( item1, srcEdge, item2, dstEdge, spacingVal ); + if ( !item.isEmpty() ) { + if ( mObjectMap.contains( item ) && mObjectMap[ item ].mType == HbXml::WIDGET ) { + widget = static_cast( mObjectMap[ item ].mObject.data() ); + } + if ( !widget ) { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO SUCH ITEM " ) + item ); + return false; + } + } + if ( remove ) { + if ( widget ) { + layout->removeMapping( widget ); + } + if ( !id.isEmpty() ) { + layout->removeMapping( id ); + } + } else { + if ( widget && !id.isEmpty() ) { + layout->setMapping( widget, id ); + } else { + HB_DOCUMENTLOADER_PRINT( QString( "ANCHORLAYOUT: NO ID SPECIFIED FOR" ) + item ); + return false; + } + } return true; } - -bool HbDocumentLoaderActions::createGridLayout( const QString &widget, const HbXmlLengthValue &spacing ) +bool HbDocumentLoaderActions::createGridLayout( const QString &widget, const HbXmlLengthValue &spacing, bool modify ) { QGraphicsWidget *parent = 0; @@ -636,28 +632,37 @@ if( isWidget ) { parent = static_cast( parentObj ); } - } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].second == HbXml::WIDGET ) { - parent = static_cast( mObjectMap[ widget ].first.data() ); + } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].mType == HbXml::WIDGET ) { + parent = static_cast( mObjectMap[ widget ].mObject.data() ); } if ( !parent ) { HB_DOCUMENTLOADER_PRINT( QString( "GRIDLAYOUT: PARENT NOT FOUND" ) ); return false; } - QGraphicsGridLayout* layout = new QGraphicsGridLayout(); + qreal spacingVal; + bool setSpacing(false); + if (spacing.mType != HbXmlLengthValue::None) { - qreal spacingVal; if ( toPixels(spacing, spacingVal) ) { - layout->setSpacing(spacingVal); + setSpacing = true; } else { - delete layout; return false; } } - - mCurrentLayout = layout; - parent->setLayout( mCurrentLayout ); - + if ( modify ) { + mCurrentLayout = parent->layout(); + if ( !mCurrentLayout ) { + HB_DOCUMENTLOADER_PRINT( QString( "GRIDLAYOUT: NO EXISTING LAYOUT" ) ); + return false; + } + } else { + mCurrentLayout = new QGraphicsGridLayout(); + parent->setLayout( mCurrentLayout ); + } + if ( setSpacing ) { + static_cast(mCurrentLayout)->setSpacing(spacingVal); + } return true; } @@ -681,8 +686,8 @@ if( src.isEmpty() ) { HB_DOCUMENTLOADER_PRINT( QString( "GRIDLAYOUT: TRY TO ADD EMPTY ITEM " ) + src ); return false; - } else if ( mObjectMap.contains( src ) && mObjectMap[ src ].second == HbXml::WIDGET ) { - item = static_cast( mObjectMap[ src ].first.data() ); + } else if ( mObjectMap.contains( src ) && mObjectMap[ src ].mType == HbXml::WIDGET ) { + item = static_cast( mObjectMap[ src ].mObject.data() ); } else { HB_DOCUMENTLOADER_PRINT( QString( "GRIDLAYOUT: NO SUCH ITEM " ) + src ); return false; @@ -861,10 +866,10 @@ bool HbDocumentLoaderActions::createLinearLayout( const QString &widget, Qt::Orientation *orientation, - const HbXmlLengthValue &spacing ) + const HbXmlLengthValue &spacing, + bool modify ) { QGraphicsWidget *parent = 0; - QGraphicsLinearLayout *layout = 0; if( widget.isEmpty() ) { bool isWidget = false; @@ -872,30 +877,45 @@ if ( isWidget ) { parent = static_cast( parentObj ); } - } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].second == HbXml::WIDGET ) { - parent = static_cast( mObjectMap[ widget ].first.data() ); + } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].mType == HbXml::WIDGET ) { + parent = static_cast( mObjectMap[ widget ].mObject.data() ); } if ( !parent ) { HB_DOCUMENTLOADER_PRINT( QString( "LINEARLAYOUT: PARENT NOT FOUND" ) ); return false; } - if( orientation ) { - layout = new QGraphicsLinearLayout( *orientation ); - } else { - layout = new QGraphicsLinearLayout(); + qreal spacingVal; + bool setSpacing(false); + + if (spacing.mType != HbXmlLengthValue::None) { + if ( toPixels(spacing, spacingVal) ) { + setSpacing = true; + } else { + return false; + } } - if ( spacing.mType != HbXmlLengthValue::None ) { - qreal spacingVal; - if ( !toPixels(spacing, spacingVal) ) { + if ( modify ) { + mCurrentLayout = parent->layout(); + if ( !mCurrentLayout ) { + HB_DOCUMENTLOADER_PRINT( QString( "LINEARLAYOUT: NO EXISTING LAYOUT" ) ); return false; } - layout->setSpacing(spacingVal); + if ( orientation ) { + static_cast(mCurrentLayout)->setOrientation(*orientation); + } + } else { + if( orientation ) { + mCurrentLayout = new QGraphicsLinearLayout(*orientation); + } else { + mCurrentLayout = new QGraphicsLinearLayout(); + } + parent->setLayout( mCurrentLayout ); } - - mCurrentLayout = layout; - parent->setLayout( mCurrentLayout ); + if ( setSpacing ) { + static_cast(mCurrentLayout)->setSpacing(spacingVal); + } return true; } @@ -919,8 +939,8 @@ if ( itemname.isEmpty() ) { HB_DOCUMENTLOADER_PRINT( QString( "LINEARLAYOUT: TRY TO ADD EMPTY ITEM " ) + itemname ); return false; - } else if ( mObjectMap.contains( itemname ) && mObjectMap[ itemname ].second == HbXml::WIDGET ) { - item = static_cast( mObjectMap[ itemname ].first.data() ); + } else if ( mObjectMap.contains( itemname ) && mObjectMap[ itemname ].mType == HbXml::WIDGET ) { + item = static_cast( mObjectMap[ itemname ].mObject.data() ); } else { HB_DOCUMENTLOADER_PRINT( QString( "LINEARLAYOUT: NO SUCH ITEM " ) + itemname ); return false; @@ -1005,7 +1025,7 @@ return ok; } -bool HbDocumentLoaderActions::createStackedLayout( const QString &widget ) +bool HbDocumentLoaderActions::createStackedLayout( const QString &widget, bool modify ) { QGraphicsWidget *parent = 0; @@ -1015,17 +1035,24 @@ if( isWidget ) { parent = static_cast( parentObj ); } - } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].second == HbXml::WIDGET ) { - parent = static_cast( mObjectMap[ widget ].first.data() ); + } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].mType == HbXml::WIDGET ) { + parent = static_cast( mObjectMap[ widget ].mObject.data() ); } if ( !parent ) { HB_DOCUMENTLOADER_PRINT( QString( "STACKEDLAYOUT: PARENT NOT FOUND" ) ); return false; } - mCurrentLayout = new HbStackedLayout(); - - parent->setLayout( mCurrentLayout ); + if ( modify ) { + mCurrentLayout = parent->layout(); + if ( !mCurrentLayout ) { + HB_DOCUMENTLOADER_PRINT( QString( "STACKEDLAYOUT: NO EXISTING LAYOUT" ) ); + return false; + } + } else { + mCurrentLayout = new HbStackedLayout(); + parent->setLayout( mCurrentLayout ); + } return true; } @@ -1044,8 +1071,8 @@ if( itemname.isEmpty() ) { HB_DOCUMENTLOADER_PRINT( QString( "STACKEDLAYOUT: TRY TO ADD EMPTY ITEM " ) + itemname ); return false; - } else if ( mObjectMap.contains( itemname ) && mObjectMap[ itemname ].second == HbXml::WIDGET ) { - item = static_cast( mObjectMap[ itemname ].first.data() ); + } else if ( mObjectMap.contains( itemname ) && mObjectMap[ itemname ].mType == HbXml::WIDGET ) { + item = static_cast( mObjectMap[ itemname ].mObject.data() ); } else { HB_DOCUMENTLOADER_PRINT( QString( "STACKEDLAYOUT: NO SUCH ITEM " ) + itemname ); return false; @@ -1068,8 +1095,8 @@ if( isWidget ) { parent = static_cast( parentObj ); } - } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].second == HbXml::WIDGET ) { - parent = static_cast( mObjectMap[ widget ].first.data() ); + } else if ( mObjectMap.contains( widget ) && mObjectMap[ widget ].mType == HbXml::WIDGET ) { + parent = static_cast( mObjectMap[ widget ].mObject.data() ); } if ( !parent ) { HB_DOCUMENTLOADER_PRINT( QString( "NULL LAYOUT: PARENT NOT FOUND" ) ); @@ -1087,7 +1114,18 @@ bool HbDocumentLoaderActions::setWidgetRole( QGraphicsWidget *parent, QGraphicsWidget *child, const QString &role) { - return mFactory.setWidgetRole(parent, child, role); + bool roleTransfersOwnership = false; + + // updates roleTransfersOwnership only on succesfull execution + const bool result = mFactory.setWidgetRole(parent, child, role, roleTransfersOwnership); + + if ( roleTransfersOwnership ) { + // remove ownership from own data structure + ObjectMapItem &item = mObjectMap[child->objectName()]; + item.mOwned = false; + } + + return result; } bool HbDocumentLoaderActions::setObjectRole( diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloaderactions_p.h --- a/src/hbutils/document/hbdocumentloaderactions_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloaderactions_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -64,7 +64,6 @@ bool pushObject( const QString& type, const QString &name ); bool pushWidget( const QString& type, const QString &name, const QString &role, const QString &plugin ); - bool pushSpacerItem( const QString &name, const QString &widget ); bool pushConnect( const QString &srcName, const QString &signalName, const QString &dstName, const QString &slotName ); bool pushProperty( const char *propertyName, const HbXmlVariable &variable ); bool pushRef( const QString &name, const QString &role ); @@ -85,12 +84,17 @@ bool setSizeHint(Qt::SizeHint hint, const HbXmlLengthValue &hintWidth, const HbXmlLengthValue &hintHeight, bool fixed); bool setToolTip( const HbXmlVariable &tooltip ); - bool createAnchorLayout( const QString &widget ); - bool addAnchorLayoutEdge( const QString &src, Hb::Edge srcEdge, - const QString &dst, Hb::Edge dstEdge, - const HbXmlLengthValue &spacing, const QString &spacer = QString() ); + bool createAnchorLayout( const QString &widget, bool modify ); + bool addAnchorLayoutItem( const QString &src, const QString &srcId, Hb::Edge srcEdge, + const QString &dst, const QString &dstId, Hb::Edge dstEdge, + const HbXmlLengthValue &minLength, + const HbXmlLengthValue &prefLength, + const HbXmlLengthValue &maxLength, + QSizePolicy::Policy *policy, HbAnchor::Direction *dir, + const QString &anchorId ); + bool setAnchorLayoutMapping( const QString &item, const QString &id, bool remove ); - bool createGridLayout( const QString &widget, const HbXmlLengthValue &spacing ); + bool createGridLayout( const QString &widget, const HbXmlLengthValue &spacing, bool modify ); bool addGridLayoutCell( const QString &src, int row, int column, int *rowspan, int *columnspan, Qt::Alignment *alignment ); bool setGridLayoutRowProperties( int row, int *rowStretchFactor, Qt::Alignment *alignment ); @@ -110,7 +114,8 @@ bool createLinearLayout( const QString &widget, Qt::Orientation *orientation, - const HbXmlLengthValue &spacing ); + const HbXmlLengthValue &spacing, + bool modify ); bool addLinearLayoutItem( const QString &itemname, int *index, int *stretchfactor, @@ -123,7 +128,7 @@ const HbXmlLengthValue &right, const HbXmlLengthValue &bottom ); - bool createStackedLayout( const QString &widget ); + bool createStackedLayout( const QString &widget, bool modify ); bool addStackedLayoutItem( const QString &itemname, int *index ); bool createNullLayout( const QString &widget ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloaderfactory_p.cpp --- a/src/hbutils/document/hbdocumentloaderfactory_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloaderfactory_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -76,6 +76,8 @@ #include #include #include +#include +#include enum HbDocumentLoaderFactoryWidgetRoles { HbWidgetRoleUnknown, // needs to be the first one = 0 @@ -238,6 +240,8 @@ CHECK_OBJECT_0(HbGridViewItem) CHECK_OBJECT_0(HbDataFormViewItem) CHECK_OBJECT_0(HbTreeViewItem) + CHECK_OBJECT_0(HbTumbleView) + CHECK_OBJECT_0(HbTumbleViewItem) #if QT_VERSION >= 0x040600 && defined(HBUTILS_WEBKIT) CHECK_OBJECT_0(QGraphicsWebView) #endif @@ -257,11 +261,18 @@ \param parent parent widget. \param child child widget. \param role desired role for child widget. + \param roleTransfersOwnership Must be updated to 'true' if owership of the child is + moved to the parent, but the graphicsitem parent is not \return true upon success, false on failure. */ bool HbDocumentLoaderFactory::setWidgetRole( - QGraphicsWidget *parent, QGraphicsWidget *child, const QString &role) + QGraphicsWidget *parent, + QGraphicsWidget *child, + const QString &role, + bool &roleTransfersOwnership ) { + roleTransfersOwnership = false; + if (role.isEmpty()) { child->setParentItem(parent); return true; @@ -316,6 +327,7 @@ if (view) { child->setParentItem(parent); view->setToolBar(qobject_cast(child)); + roleTransfersOwnership = true; } } break; @@ -326,6 +338,7 @@ success = (view != 0); if (view) { view->setMenu(qobject_cast(child)); + roleTransfersOwnership = true; } } break; @@ -336,6 +349,7 @@ success = (menu != 0); if (menu) { menu->addMenu(qobject_cast(child)); + roleTransfersOwnership = true; } } break; diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloaderfactory_p.h --- a/src/hbutils/document/hbdocumentloaderfactory_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloaderfactory_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,7 +40,7 @@ HbDocumentLoaderFactory(); virtual ~HbDocumentLoaderFactory(); QObject *create(const QString& type, const QString& name); - bool setWidgetRole(QGraphicsWidget *parent, QGraphicsWidget *child, const QString &role); + bool setWidgetRole(QGraphicsWidget *parent, QGraphicsWidget *child, const QString &role, bool &roleTransfersOwnership ); bool setObjectRole(QObject *parent, QObject *child, const QString &role); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloaderplugin.h --- a/src/hbutils/document/hbdocumentloaderplugin.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloaderplugin.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,7 +39,7 @@ }; Q_DECLARE_INTERFACE(HbDocumentLoaderPluginInterface, "com.nokia.hb.HbDocumentLoaderPlugin/1.0") -class HB_TOOLS_EXPORT HbDocumentLoaderPlugin : public QObject, public HbDocumentLoaderPluginInterface +class HB_UTILS_EXPORT HbDocumentLoaderPlugin : public QObject, public HbDocumentLoaderPluginInterface { Q_OBJECT Q_INTERFACES(HbDocumentLoaderPluginInterface) diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloadersyntax_p.cpp --- a/src/hbutils/document/hbdocumentloadersyntax_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloadersyntax_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,7 +39,7 @@ // Document loader version number #define VERSION_MAJOR 1 -#define VERSION_MINOR 1 +#define VERSION_MINOR 2 #define MIN_SUPPORTED_VERSION_MAJOR 0 #define MIN_SUPPORTED_VERSION_MINOR 1 @@ -89,6 +89,18 @@ } }; +static bool toFontSpecRole(const QString &roleString, HbFontSpec::Role &role) +{ + bool success(false); + int enumInt = HbFontSpec::staticMetaObject.enumerator( + HbFontSpec::staticMetaObject.indexOfEnumerator("Role")).keyToValue(roleString.toLatin1()); + if (enumInt >= 0) { + success = true; + role = static_cast(enumInt); + } + return success; +} + /* \class HbDocumentLoaderSyntax \internal @@ -138,24 +150,22 @@ { HB_DOCUMENTLOADER_PRINT( "GENERAL LAYOUT START ITEM: ANCHOR ITEM" ); if( mReader.name() == lexemValue( AL_ANCHOR ) ) { + result = readAnchorLayoutStartItem(false); + } else if( mReader.name() == lexemValue( AL_MAPPING ) ) { + const QString item = attribute( AL_MAPPING_ITEM ); + const QString id = attribute( AL_MAPPING_ID ); + const QString action = attribute( ATTR_ACTION ); + bool remove = false; + if ( !action.isEmpty() ) { + if (!action.compare("remove", Qt::CaseInsensitive)) { + remove = true; + } else if (action.compare("set", Qt::CaseInsensitive)) { + qWarning() << "Invalid anchoritem action, line " << mReader.lineNumber(); + return false; + } + } - const QString src = attribute( AL_SRC_NAME ); - const QString dst = attribute( AL_DST_NAME ); - const QString srcEdgeStr = attribute( AL_SRC_EDGE ); - const QString dstEdgeStr = attribute( AL_DST_EDGE ); - const QString spacing = attribute( AL_SPACING ); - const QString spacer = attribute( AL_SPACER ); - HbXmlLengthValue spacingVal; - result = true; - if( !spacing.isEmpty() ) { - result = toLengthValue( spacing, spacingVal ); - } - Hb::Edge srcEdge, dstEdge; - result &= getAnchorEdge( srcEdgeStr, srcEdge ); - result &= getAnchorEdge( dstEdgeStr, dstEdge ); - if ( result ) { - result = mActions->addAnchorLayoutEdge( src, srcEdge, dst, dstEdge, spacingVal, spacer ); - } + result = mActions->setAnchorLayoutMapping( item, id, remove ); } break; } @@ -653,7 +663,8 @@ case HbXml::SPACERITEM: { HB_DOCUMENTLOADER_PRINT( "GENERAL START ITEM: SPACERITEM" ); - result = processSpacerItem(); + qWarning() << "spaceritem is deprecated " << mReader.lineNumber(); + result = true; break; } case HbXml::CONNECT: @@ -762,29 +773,26 @@ return true; } -bool HbDocumentLoaderSyntax::processSpacerItem() -{ - const QString name = attribute( ATTR_NAME ); - const QString widget = attribute( ATTR_WIDGET ); - - bool pushOK = mActions->pushSpacerItem( name, widget ); - if( !pushOK ) { - qWarning() << "Error in object processing, line " << mReader.lineNumber(); - return false; - } - return true; -} - bool HbDocumentLoaderSyntax::processLayout() { bool result = false; const QString layout_type = attribute( ATTR_TYPE ); const QString widget = attribute( ATTR_WIDGET ); + const QString action = attribute( ATTR_ACTION ); + bool modify = false; + if ( !action.isEmpty() ) { + if (!action.compare("modify", Qt::CaseInsensitive)) { + modify = true; + } else if (action.compare("create", Qt::CaseInsensitive)) { + qWarning() << "Invalid layout action, line " << mReader.lineNumber(); + return false; + } + } if( layout_type == lexemValue( LAYOUT_ANCHOR ) ) { mCurrentLayoutType = LAYOUT_ANCHOR; - result = mActions->createAnchorLayout( widget ); + result = mActions->createAnchorLayout( widget, modify ); } else if( layout_type == lexemValue( LAYOUT_GRID ) ) { @@ -796,7 +804,7 @@ result = toLengthValue( spacing, spacingValue ); } if (result) { - result = mActions->createGridLayout( widget, spacingValue ); + result = mActions->createGridLayout( widget, spacingValue, modify ); } } else if( layout_type == lexemValue( LAYOUT_LINEAR ) ) { @@ -826,13 +834,13 @@ result = toLengthValue( spacing, spacingValue ); } if (result) { - result = mActions->createLinearLayout( widget, orient_p, spacingValue ); + result = mActions->createLinearLayout( widget, orient_p, spacingValue, modify ); } } else if( layout_type == lexemValue( LAYOUT_STACK ) ) { mCurrentLayoutType = LAYOUT_STACK; - result = mActions->createStackedLayout( widget ); + result = mActions->createStackedLayout( widget, modify ); } else if( layout_type == lexemValue( LAYOUT_NULL ) ) { @@ -882,6 +890,7 @@ } if (result) { mCurrentContainerNames << propertyName; + qDeleteAll(mCurrentContainer); mCurrentContainer.clear(); } } else { @@ -943,27 +952,6 @@ return true; } -static bool convertSizePolicy_Policy( const QString& policyS, QSizePolicy::Policy *&policy ) -{ - if ( policyS.isEmpty() ) { - return false; - } - - const QMetaObject *meta = &QSizePolicy::staticMetaObject; - const int enumIndex = meta->indexOfEnumerator("Policy"); - Q_ASSERT( enumIndex != -1 ); - QMetaEnum metaEnum = meta->enumerator(enumIndex); - const QByteArray byteArray = policyS.toUtf8(); - const int policyI = metaEnum.keyToValue(byteArray.data()); - - if ( policyI == -1 ) { - return false; - } - - policy = (QSizePolicy::Policy *)new int(policyI); - return true; -} - bool HbDocumentLoaderSyntax::processVariable() { bool result = false; @@ -1007,34 +995,42 @@ result = true; - QSizePolicy::Policy *hPol = 0; + QSizePolicy::Policy hPol; + QSizePolicy::Policy *hPolP = 0; if ( !horizontalPolicyS.isEmpty() ) { - result = convertSizePolicy_Policy( horizontalPolicyS, hPol ); + result = toSizePolicy( horizontalPolicyS, hPol ); + hPolP = &hPol; } - QSizePolicy::Policy *vPol = 0; + QSizePolicy::Policy vPol; + QSizePolicy::Policy *vPolP = 0; if ( result && !verticalPolicyS.isEmpty() ) { - result = convertSizePolicy_Policy( verticalPolicyS, vPol ); + result = toSizePolicy( verticalPolicyS, vPol ); + vPolP = &vPol; } - int *hStretch = 0; + int hStretch; + int *hStretchP = 0; if ( result && !horizontalStretchS.isEmpty() ) { const int intValue = horizontalStretchS.toInt( &result ); if ( result ) { if ( intValue >= 0 && intValue < 256 ) { - hStretch = new int( intValue ); + hStretch = intValue; + hStretchP = &hStretch; } else { result = false; } } } - int *vStretch = 0; + int vStretch; + int *vStretchP = 0; if ( result && !verticalStretchS.isEmpty() ) { const int intValue = verticalStretchS.toInt( &result ); if ( result ) { if ( intValue >= 0 && intValue < 256 ) { - vStretch = new int( intValue ); + vStretch = intValue; + vStretchP = &vStretch; } else { result = false; } @@ -1042,12 +1038,8 @@ } if ( result ) { - result = mActions->setSizePolicy( hPol, vPol, hStretch, vStretch ); + result = mActions->setSizePolicy( hPolP, vPolP, hStretchP, vStretchP ); } - delete hPol; - delete vPol; - delete hStretch; - delete vStretch; if (!result) { qWarning() << "Invalid size policy, line " << mReader.lineNumber(); @@ -1192,13 +1184,7 @@ } else if ( type == lexemValue( TYPE_BOOL ) ) { bool *boolVal = new bool(); const QString value = attribute( ATTR_VALUE ); - if (value == lexemValue( VALUE_BOOL_TRUE ) ) { - *boolVal = true; - } else if (value == lexemValue( VALUE_BOOL_FALSE ) ) { - *boolVal = false; - } else { - ok = false; - } + ok = toBool( value, *boolVal ); if (ok) { variable.mType = HbXmlVariable::BOOL; variable.mParameters.append(boolVal); @@ -1396,14 +1382,3 @@ + QString::number( MIN_SUPPORTED_VERSION_MINOR ) + QString( ")" ) ); } -bool HbDocumentLoaderSyntax::toFontSpecRole(const QString &roleString, HbFontSpec::Role &role) -{ - bool success(false); - int enumInt = HbFontSpec::staticMetaObject.enumerator( - HbFontSpec::staticMetaObject.indexOfEnumerator("Role")).keyToValue(roleString.toLatin1()); - if (enumInt >= 0) { - success = true; - role = static_cast(enumInt); - } - return success; -} diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/document/hbdocumentloadersyntax_p.h --- a/src/hbutils/document/hbdocumentloadersyntax_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/document/hbdocumentloadersyntax_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -61,7 +61,6 @@ bool processDocument(); bool processObject(); bool processWidget(); - bool processSpacerItem(); bool processLayout(); bool processConnect(); bool processContainer(); @@ -86,8 +85,6 @@ bool readContainerStartItem(); bool readContainerEndItem(); - static bool toFontSpecRole(const QString &roleString, HbFontSpec::Role &role); - }; #endif // HBDOCUMENTLOADERSYNTAX_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/hbutils.pro --- a/src/hbutils/hbutils.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbutils/hbutils.pro Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ DEFINES += HBUTILS_WEBKIT } -DEFINES += BUILD_HB_TOOLS HB_PLUGINS_DIR=\"\\\"$${HB_PLUGINS_DIR}\\\"\" +DEFINES += BUILD_HB_UTILS HB_PLUGINS_DIR=\"\\\"$${HB_PLUGINS_DIR}\\\"\" INCLUDEPATH += . DEPENDPATH += . @@ -44,10 +44,11 @@ # components include(document/document.pri) +include(theme/theme.pri) CONVENIENCE_HEADERS += $${HB_BUILD_DIR}/include/hbutils/hbutils.h CONVENIENCE_HEADERS += $$files($${HB_BUILD_DIR}/include/hbutils/Hb*) -HEADERS += $$PUBLIC_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS +HEADERS += $$PUBLIC_HEADERS $$RESTRICTED_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS # dependencies hbAddLibrary(hbcore/HbCore) @@ -61,10 +62,13 @@ pubheaders.files = $$PUBLIC_HEADERS pubheaders.path = $${HB_INCLUDE_DIR}/hbutils + restheaders.files = $$RESTRICTED_HEADERS + restheaders.path = $${HB_INCLUDE_DIR}/hbutils/restricted + convheaders.files = $$CONVENIENCE_HEADERS convheaders.path = $${HB_INCLUDE_DIR}/hbutils - INSTALLS += target pubheaders convheaders + INSTALLS += target pubheaders restheaders convheaders win32:INSTALLS += dlltarget } diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/theme/hbthemeservices.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbutils/theme/hbthemeservices.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbUtils module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + + + +/*! + @proto + @hbutils + \class HbThemeServices + \brief HbThemeServices class is used to set and get current theme. + + HbThemeServices class has static functions to change and query current theme. +*/ + +#include "hbthemeservices_r.h" +#include "hbthemeutils_p.h" + +#ifdef Q_OS_SYMBIAN +#include +#include "hbthemecommon_symbian_p.h" +#else +#include "hbthemeclient_p.h" +#endif + +/*! + Sets the active theme that is used with the Hb applications. HbTheme changed() signal will be emitted if theme change is + applied succesfully. In addition to the active theme content loading also the underlying priority themes will be updated + during the theme change. + + Depending on the platform setTheme functionality might by restricted. + + \param themePath, absolute path to the folder where themes index.theme file is located. +*/ +void HbThemeServices::setTheme(const QString &themePath) +{ +#ifdef Q_OS_SYMBIAN + RProperty themeRequestProp; + + User::LeaveIfError( themeRequestProp.Attach( KServerUid3, KNewThemeForThemeChanger ) ); + + TBuf<256> newThemenameChangeRequest; + _LIT(KThemeRequestFormatter, "%d:%S"); + TBuf<256> newThemename(themePath.utf16()); + newThemenameChangeRequest.Format(KThemeRequestFormatter, EThemeSelection, &newThemename); + themeRequestProp.Set(newThemenameChangeRequest); + themeRequestProp.Close(); +#else + HbThemeClient::global()->setTheme(themePath); +#endif +} + +/*! + Returns the absolute path to the active theme. + + \return absolute path to the folder where the index.theme file of the active theme is located. +*/ +const QString HbThemeServices::themePath() +{ + QString path(""); + HbThemeIndexInfo info = HbThemeUtils::getThemeIndexInfo(ActiveTheme); + if (info.address) { + path.append(info.path); + path.append("/icons/"); + path.append(info.name); + } + return path; +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/theme/hbthemeservices_r.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbutils/theme/hbthemeservices_r.h Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,42 @@ +/**************************************************************************** +** +** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +** All rights reserved. +** Contact: Nokia Corporation (developer.feedback@nokia.com) +** +** This file is part of the HbUtils module of the UI Extensions for Mobile. +** +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this file. +** Please review the following information to ensure the GNU Lesser General +** Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** If you have questions regarding the use of this file, please contact +** Nokia at developer.feedback@nokia.com. +** +****************************************************************************/ + +#ifndef HBTHEMESERVICES_R_H +#define HBTHEMESERVICES_R_H + +#include + +QT_BEGIN_NAMESPACE +class QString; +QT_END_NAMESPACE + +class HB_UTILS_RESTRICTED_EXPORT HbThemeServices +{ +public: + static void setTheme(const QString &themePath); + static const QString themePath(); +}; + +#endif // HBTHEMESERVICES_R_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbutils/theme/theme.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/hbutils/theme/theme.pri Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,32 @@ +# +############################################################################# +## +## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# + +INCLUDEPATH += $$PWD +DEPENDPATH += $$PWD + +RESTRICTED_HEADERS += $$PWD/hbthemeservices_r.h + +SOURCES += $$PWD/hbthemeservices.cpp diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataform.cpp --- a/src/hbwidgets/dataform/hbdataform.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataform.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,19 +23,20 @@ ** ****************************************************************************/ -#include -#include -#include #include "hbdataform_p.h" #include "hbdataformviewitem_p.h" #include "hbdataitemcontainer_p.h" #include "hbdatagroup_p.h" #include "hbdatagroup_p_p.h" -#include #include "hbdataformheadingwidget_p.h" #include "hbdataformmodelitem_p.h" #include "hbtreemodeliterator_p.h" +#include +#include +#include +#include + #include #include @@ -43,16 +44,16 @@ @beta @hbwidgets \class HbDataForm - \brief HbDataForm represents hierarchical dataitems in the form of groups,pages and - items. - The HbDataForm class provides a default view implementation of dataform. - A HbDataForm implements a hierarchical representation of data items from a model. + \brief HbDataForm represents hierarchical dataitems in form of form pages, groups, group pages + and data items. + HbDataForm implements a hierarchical representation of view items for each model items from + HbDataFormModel. HbDataForm implements the interfaces defined by the HbAbstractItemView class to allow - it to display data provided by models derived from the QAbstractItemModel class. + it to display data provided by models which are derived from QAbstractItemModel class. It is simple to construct a dataform displaying data from a model. The user has to create - HbDataFormModel and create the hierarchy of HbDataFormModelItems .The hierarchy is + HbDataFormModel and create the hierarchy of HbDataFormModelItems.The hierarchy is similar to the following. - HbDataForm @@ -70,55 +71,101 @@ - HbDataItem - HbDataItem - HbDataItem + - HbDataGroup3 + - HbDataItem + - HbDataItem + - HbDataItem + - HbDataItem + - HbDataItem - HbDataItem can be the child of HbDataForm, HbDataFormPage,HbDataGroup and + HbDataItem can be the child of HbDataForm, HbDataFormPage, HbDataGroup and HbDataGroupPage. An instance of HbDataForm has to be created and model should be set - to the form using setModel(HbDataFormModel) API. - The properties of each DataItem node can be set using HbDataFormModelItem convenient - API's. These data are parsed while the visualization instance of each item is created and - set on each item. + to the form using setModel( ) API. + The properties of each data item node can be set using HbDataFormModelItem convenient + API's like setContentWidgetData( ). These model data are parsed and set while the visualization + instance of each item is created. - The model/view architecture ensures that the contents of the data view are updated as the + The model/view architecture ensures that the view contents are updated as and when the data in model changes. - Items that have children can be in expanded (children are visible) or collapsed - (children are hidden) state. DataItems of type HbDataFormPage, HbDataGroup and - HbDataGroupPage can be expanded and collapsed. HbDataItem of type FormPageItem, - GroupItem, GroupPageItem can only have children. Each item in model is represented by an - instance of HbDataFormViewItem. HbDataForm uses HbDataFormViewItem prototype to instantiate - the HbDataForm items. HbDataFormViewItem can be subclassed for customization purposes. + Only model items that can have children can be in expanded (childrens are visible) or + collapsed (childrens are hidden) state. Model items of type HbDataFormModelItem::FormPageItem, + HbDataFormModelItem::GroupItem and HbDataFormModelItem::GroupPageItem can be expanded + or collapsed. Which in turn means that these types of model item can only have children. + Each item in model is represented by either an instance of HbDataFormViewItem or classes which + are derived from HbDataFormViewItem. HbDataFormViewItem can be subclassed for + customization purposes. - The Model hierarchy can be created using the convenient API's provided on model class like - appendDataFormPage , appendDataFormGroup ,appendDataFormGroupPage and - appendDataFormItem. All of these will return HbDataFormModelItem instance correspoding - to each type on which user can set item specific data. Otherwise each HbDataFormModelItem can - be created individually by passing the corresponding type of item (GroupItem, GroupPageItem, - FormPageItem) and create the tree of HbDataFormModelItem using setParent API - or by passing the parent HbDataFormModelItem in constructor. Later the top level - HbDataFormModelItem can be added inside the model. + The Model hierarchy can be created using the convenient API's provided in model class like + appendDataFormPage(), appendDataFormGroup(), appendDataFormGroupPage() and + appendDataFormItem(). All these API's return HbDataFormModelItem instance corresponding + to each HbDataFormModelItem::DataItemType type on which user can set item + specific(content widget) data. Otherwise each HbDataFormModelItem can be created individually + by passing the corresponding type of item (GroupItem, GroupPageItem, FormPageItem) and create + the tree of HbDataFormModelItem using setParent API or by passing the parent + HbDataFormModelItem in constructor. Later the top level HbDataFormModelItem can be added in + model. - After doing the setModel, the visualization gets created . Only the items inside the expanded - group or group page instances are created. When an item's visualization is created , - DataForm emits activated(constQModelIndex&) signal. The application can get - HbDataFormViewItem and content widget from DataForm using QModelIndex. + After setting model in HbDataForm using setModel(), the visualization gets created. + Only the items inside the expanded form page, group or group page are created. When an item's + visualization is created, HbDataForm emits itemShown(constQModelIndex&) signal. The application + can connect to this signal and when corresponding slot is called then application can get + HbDataFormViewItem instance and even content widget instance. Use HbAbstractItemView::itemByIndex() + to get HbDataFormViewItem instance. Use HbDataFormViewItem::dataItemContentWidget() to get + content widget instance. - The signal emitted by HbDataForm - \li activated(const QModelIndex &index) Emitted when the HbDataFormViewItem corresponding to + The signals emitted by HbDataForm + \li itemShown(const QModelIndex &index) Emitted when the HbDataFormViewItem corresponding to \a index is shown. User can connect to this signal and can fetch the instance of HbDataFormViewItem from HbDataForm using the API dataFormViewItem(const QModelIndex &index). - \li dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) emitted when the - HbDataFormModel is updated \atopLeft and \abottomRight will be same since every node has only one column. - User can connect to this signal and can fetch the instance of HbDataFormViewItem from HbDataForm - using the API dataFormViewItem(const QModelIndex &index) or user can fetch HbDataFormModelItem using API - itemFromIndex(const QModelIndex &index) in HbDataFormModel .When user updates model using - setContentWidgetData API provided in HbDataFormModelItem class, then DataForm takes care of updating the - corresponding item's visualization. + This signal is only emitted for model items of type greater than HbDataFormModelItem::GroupPageItem + + The user can also provide connection information to correspoding content widget of each + HbDataFormModelItem using API + addConnection(HbDataFormModelItem* item, const char* signal, QObject* receiver, const char* slot) + provided in HbDataForm. The connection will be established when the item visualization is created. + Using addConnection() API user can also connect to hbdialog's signals(for ex: aboutToClose) in case + of popup items like radio button list item and multi selection list item. Below code snippet demonstrates + the same: - The user can also provide connection information to correspoding content widget of each HbDataFormModelItem - using API addConnection(HbDataFormModelItem* item, const char* signal, QObject* receiver, consta char* slot) - provided in HbDataForm class.The connection will be established when the item visualization is created . - similar way removeConnection(HbDataFormModelItem *item, const char* signal, QObject *receiver, const char* slot) - and removeAllConnection() API can be used. Connection can be established or removed even at runtime also. + \code + HbDataFormModelItem *days = model->appendDataFormItem(HbDataFormModelItem::MultiselectionItem, + QString("Days"), themeGeneral); + QStringList multiItems; + multiItems<<"Sunday"<<"Monday"<<"Tuesday"<<"Wednesday"<<"Thursday"<<"Friday"; + days->setContentWidgetData(QString("items"), multiItems); + QList selected; + selected<<2<<3; + days->setContentWidgetData(QString("selectedItems"), selected); + days->setContentWidgetData(QString("items"), multiItems); + form->addConnection(days, SIGNAL(aboutToShow()), this, SLOT(aboutToShow())); + form->addConnection(days, SIGNAL(aboutToHide()()), this, SLOT(aboutToHide()())); + form->addConnection(days, SIGNAL(aboutToClose()), this, SLOT(aboutToClose())); + form->addConnection(days, SIGNAL(finished(HbAction*)), this, SLOT(finished(HbAction*))); + + \endcode + + Similar way + removeConnection(HbDataFormModelItem *item, const char* signal, QObject *receiver, const char* slot) + and removeAllConnection() API can be used. Connection can be established or removed even at runtime. + An example of how to make connection and setting the content widget property: + + \code + HbDataForm *form = new HbDataForm(); + model = new HbDataFormModel(); + + HbDataFormModelItem *sliderItem = + model->appendDataFormItem(HbDataFormModelItem::SliderItem, QString("slider")); + //Set the content widget properties. In this case its HbSlider. + sliderItem->setContentWidgetData("maximum", 200); + sliderItem->setContentWidgetData("minimum", 0); + sliderItem->setContentWidgetData("value", 100); + //Make a connection to HbSlider valueChanged signal. + form->addConnection(sliderItem, SIGNAL(valueChanged(int)), this, SLOT(sliderValueChanged(int))); + + form->setModel(model); + setWidget(form); + \endcode An example of how to create HbDataForm: \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,31} @@ -134,20 +181,20 @@ \sa HbDataFormViewItem, HbDataFormModel, HbDataFormModelItem Creating Custom Item: + Application developer can create custom DataItem by deriving from HbDataFormViewItem and setting this as - prototype(setItemProtoType() API). - Application has to override virtual API's createCustomWidget() , restore()and save(). - createCustomWidget() API should return the corresponding custom HbWidget which can also be a compound widget. - Signal connection for child widgets inside the compound widget should taken care by the application. - restore() API will be called by the framework when the model data is changed. - So restore() should take care of updating the visual items with correspoding data from model. - save() API should update the model.App developer should connect respective widgets SIGNALs to SLOT save() + prototype using setItemProtoType() API. Application has to override virtual API's createCustomWidget(), + restore()and save(). createCustomWidget() API should return the corresponding custom HbWidget which + can also be a compound widget. Signal connection for child widgets inside the compound widget should + be taken care by the application. restore() API will be called by the framework when the model data + is changed. So restore() should take care of updating the visual items with correspoding data from model. + save() API should update the model. App developer should connect respective widgets SIGNALs to SLOT save() and update the data to model . */ /*! - \fn void HbAbstractItemView::activated(const QModelIndex &index) + \fn void HbAbstractItemView::itemShown(const QModelIndex &index) This signal is emitted when HbDataFormViewItem corresponding to \a index is shown. @@ -165,8 +212,6 @@ d->q_ptr = this; d->init(); setVerticalScrollBarPolicy(ScrollBarAlwaysOff); - //d->mHeadingWidget->createPrimitives(); - //static_cast(container())->setFormHeading(d->mHeadingWidget); } /*! @@ -192,15 +237,13 @@ /*! \reimp - Scrolls the view so that the item represented by \a index comes at the middle of - screen. By default HbDataForm does not scrolls. Application developer is supposed to - call this API if he wants this behaviour. User can connect to activated signal and then + Scrolls the view so that the item represented by \a index position is changed as per \a hint + parameter. By default HbDataForm does not scrolls. Application developer is supposed to + call this API if he wants this behaviour. User can connect to itemShown signal and then can call this API. */ void HbDataForm::scrollTo(const QModelIndex &index, ScrollHint hint) { - //Q_D(HbDataForm); - //d->revealItem(d->mContainer->itemByIndex(index), PositionAtCenter); HbAbstractItemView::scrollTo(index, hint); } @@ -208,9 +251,10 @@ /*! @beta - Sets the item referred to by \a index to either collapse or expanded, + Sets the item referred to by \a index to either collapse or expanded state, depending on the value of \a expanded. If \a expanded is true then child item are - supposed to be visible. + supposed to be visible and in that case itemShown will be emitted for all the + new data items which were created. \sa isExpanded */ @@ -226,16 +270,21 @@ if (item) { item->setExpanded(expanded); } - - d->mContainer->setItemTransientStateValue(index, "expanded", expanded); - d->mContainer->setModelIndexes(); + // If view item is not yet created then set the ItemTransientState so that + // when ever it gets created expansion state will be considered . This is valid for formPage group + // and group page . Itemstate for the leaf items also will be set but does not have any + // significance since these items cannot expand( do not have children ) + + else { + d->mContainer->setItemTransientStateValue(index, "expanded", expanded); + } } } /*! @beta - Returns true if the model item \a index is expanded otherwise returns false. + Returns true if the model item at \a index is expanded otherwise returns false. \sa setExpanded */ @@ -256,7 +305,9 @@ Sets the heading of HbDataForm with the \a heading provided. Heading is displayed on top of the HbDataForm. Heading is non-focusable. - \sa heading + \sa heading + \sa setDescription + \sa description */ void HbDataForm::setHeading(const QString &heading) { @@ -292,7 +343,9 @@ Returns heading of HbDataForm. - \sa setHeading + \sa setHeading + \sa setDescription + \sa description */ QString HbDataForm::heading() const { @@ -311,6 +364,8 @@ below heading. Description is non-focusable. \sa description + \sa setHeading + \sa heading */ void HbDataForm::setDescription(const QString &description) { @@ -347,6 +402,8 @@ Returns description of HbDataForm. \sa setDescription + \sa setHeading + \sa heading */ QString HbDataForm::description() const { @@ -412,7 +469,6 @@ /*! \reimp */ - void HbDataForm::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { Q_UNUSED(bottomRight); @@ -487,7 +543,7 @@ } /*! - @alpha + @beta This API can be used to connect with the signal of HbDataFormViewItem's content widget. For example: If HbDataFormModelItem is of type DataItemType::SliderItem then user @@ -506,7 +562,8 @@ \param receiver Instance of object whose slot will be called \param slot Slot of \a receiver which will get called when signal is emitted - \sa removeConnection + \sa removeConnection + \sa removeAllConnection */ void HbDataForm::addConnection(HbDataFormModelItem * item, const char* signal, @@ -515,7 +572,7 @@ { Q_D(HbDataForm); ItemSignal itemSignal; - itemSignal.reciever = receiver; + itemSignal.receiver = receiver; itemSignal.signal = signal; itemSignal.slot = slot; d->mConnectionList.insertMulti(item, itemSignal); @@ -523,12 +580,13 @@ } /*! - @alpha + @beta This API can be used to remove the signal connection which was established using the addConnection API. - \sa addConnection + \sa addConnection + \sa removeAllConnection */ void HbDataForm::removeConnection(HbDataFormModelItem * item, const char* signal, @@ -540,12 +598,13 @@ } /*! - @alpha + @beta - Removes the connection of all the contentwidget of all the items which has been established . - The connection information stored inside DataForm also cleared. + Removes the connection of all the contentwidget of all the items which has been established. + The connection information stored inside data form is also cleared. - \sa removeAllConnection + \sa removeConnection + \sa addConnection */ void HbDataForm::removeAllConnection() { @@ -554,11 +613,11 @@ } /*! - @alpha + @beta - Removes the all connections of the contentwidget of HbDataFormModelItem's corresponding - visual Item ( HbdataFormViewItem).The connection information of correspoding - HbDataFormModelItem stored inside DataForm also cleared. + Removes all connections to the contentwidget of HbDataFormModelItem's corresponding + visual Item ( HbdataFormViewItem ).The connection information of correspoding + HbDataFormModelItem stored inside data form also cleared. \sa removeAllConnection */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataform.h --- a/src/hbwidgets/dataform/hbdataform.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataform.h Thu Jul 22 16:36:53 2010 +0100 @@ -72,6 +72,7 @@ void removeAllConnection(); void removeAllConnection(HbDataFormModelItem *item); + signals: void itemShown(const QModelIndex &index); @@ -92,7 +93,7 @@ Q_DECLARE_PRIVATE_D(d_ptr, HbDataForm) Q_DISABLE_COPY(HbDataForm) Q_PRIVATE_SLOT(d_func(), void _q_page_changed(int)) - Q_PRIVATE_SLOT(d_func(), void _q_item_displayed(const QModelIndex&)) + friend class HbDataFormViewItem; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataform_p.cpp --- a/src/hbwidgets/dataform/hbdataform_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataform_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,7 +25,9 @@ #include "hbdataform_p.h" #include +#include "hbdataformviewitem_p.h" #include "hbdataitemcontainer_p.h" +#include "hbdatagroup_p_p.h" #include #include #include @@ -81,32 +83,83 @@ void HbDataFormPrivate::_q_page_changed(int index) { Q_Q(const HbDataForm); - QStringListModel *model = static_cast( + + QModelIndex childIndex = pageModelIndex(index); + //QModelIndex childIndex = q->model()->index(index,0); + HbDataFormModelItem::DataItemType itemType = + static_cast( + (childIndex.data(HbDataFormModelItem::ItemTypeRole)).toInt()); + + if(mHeadingWidget->mPageCombo) { + if(mHeadingWidget->mPageCombo->currentIndex() != index) { + QObject::disconnect(mHeadingWidget->mPageCombo,SIGNAL(currentIndexChanged(int)), + q,SLOT(_q_page_changed(int))); + mHeadingWidget->mPageCombo->setCurrentIndex(index); + QObject::connect(mHeadingWidget->mPageCombo,SIGNAL(currentIndexChanged(int)), + q,SLOT(_q_page_changed(int))); + } + } + + /* QStringListModel *model = static_cast( mHeadingWidget->mPageCombo->model()); - QModelIndex changedIndex = model->index(index, 0); - if(changedIndex.isValid()) { - if(changedIndex.row() != mHeadingWidget->mActivePage) { - QModelIndex prevPageIndex = q->model()->index(mHeadingWidget->mActivePage,0); - QModelIndex newPageIndex = q->model()->index(changedIndex.row(),0); + QModelIndex changedIndex = model->index(index, 0);*/ + if(itemType == HbDataFormModelItem::FormPageItem) { + if(index != mHeadingWidget->mActivePage) { + QModelIndex prevPageIndex = pageModelIndex( mHeadingWidget->mActivePage ); + QModelIndex newPageIndex = pageModelIndex( index ); if(prevPageIndex.isValid()) { HbDataGroup *prevPage = static_cast( q->itemByIndex(prevPageIndex)); if(prevPage) { - prevPage->setExpanded(false); + HbDataGroupPrivate::d_ptr(prevPage)->setExpanded(false); + } else { + mContainer->setItemTransientStateValue(prevPageIndex, "expanded", false); + } } if(newPageIndex.isValid()) { HbDataGroup *newPage = static_cast( q->itemByIndex(newPageIndex)); if(newPage) { - newPage->setExpanded(true); + HbDataGroupPrivate::d_ptr(newPage)->setExpanded(true); + } else { + mContainer->setItemTransientStateValue(newPageIndex, "expanded", true); } } - mHeadingWidget->mActivePage = changedIndex.row(); + mHeadingWidget->mActivePage = index; } } } +/* + Function to return valid modelIndex for corresponding formpage combo index. +*/ +QModelIndex HbDataFormPrivate::pageModelIndex(int index) const +{ + const Q_Q(HbDataForm); + int pageIndex = -1; + QModelIndex modelIndex; + + // Make sure that the child is groupPage type and current item is group. + if( index >= 0) { + + HbDataFormModelItem *groupModelItem = static_cast(q->model())->invisibleRootItem(); + int childCount = groupModelItem->childCount(); + + for( int i = 0; i < childCount; i++) { + HbDataFormModelItem *child = groupModelItem->childAt(i); + if( child->type() == HbDataFormModelItem::FormPageItem ) { + pageIndex ++; + // get the index of groupPage + if(pageIndex == index) { + modelIndex = static_cast(q->model())->indexFromItem(child); + break; + } + } + } + } + return modelIndex; +} /*! Creates a DataForm Page \a page in DataForm . @@ -128,7 +181,7 @@ if(!mHeadingWidget->mPageCombo) { mHeadingWidget->createPrimitives(); mHeadingWidget->mPageCombo = new HbComboBox(mHeadingWidget); - HbStyle::setItemName(mHeadingWidget->mPageCombo,"dataForm_Combo"); + HbStyle::setItemName(mHeadingWidget->mPageCombo,"dataForm_Combo"); QEvent polishEvent(QEvent::Polish); QCoreApplication::sendEvent(mHeadingWidget->mPageCombo, &polishEvent); // setFormHeading to the layout @@ -164,37 +217,39 @@ Q_Q(HbDataForm); if(mHeadingWidget && mHeadingWidget->mPageCombo) { + // if we are emoving the current page if(mHeadingWidget->mPageCombo->currentText() == page){ - if(mHeadingWidget->mActivePage != 0) { + // if we are removing the last page then set the current page as 0th + if( mHeadingWidget->mPageCombo->findText(page) + 1 == mHeadingWidget->mPageCombo->count()) { mHeadingWidget->mPageCombo->setCurrentIndex(0); - } - else { - mHeadingWidget->mPageCombo->setCurrentIndex(mHeadingWidget->mActivePage+1); + } else {// set next page as the curent page + mHeadingWidget->mPageCombo->setCurrentIndex(mHeadingWidget->mPageCombo->findText(page) + 1); } } } - QObject::disconnect(mHeadingWidget->mPageCombo,SIGNAL(currentIndexChanged(int)), + QObject::disconnect(mHeadingWidget->mPageCombo,SIGNAL(currentIndexChanged(int)), q,SLOT(_q_page_changed(int))); - mHeadingWidget->mPageCombo->removeItem(mHeadingWidget->mPageCombo->findText(page)); - mHeadingWidget->mActivePage = mHeadingWidget->mPageCombo->currentIndex(); + mHeadingWidget->mPageCombo->removeItem(mHeadingWidget->mPageCombo->findText(page)); + mHeadingWidget->mActivePage = mHeadingWidget->mPageCombo->currentIndex(); - QObject::connect(mHeadingWidget->mPageCombo,SIGNAL(currentIndexChanged(int)), + QObject::connect(mHeadingWidget->mPageCombo,SIGNAL(currentIndexChanged(int)), q,SLOT(_q_page_changed(int))); + mHeadingWidget->callPolish(); } -void HbDataFormPrivate::_q_item_displayed(const QModelIndex &index) +/*void HbDataFormPrivate::_q_item_displayed(const QModelIndex &index) { Q_Q( HbDataForm); emit q->itemShown(index); emit q->activated(index); qWarning("activated signal will not be emitted when items are created ," "instead itemShown SIGNAL should be used"); -} +}*/ -void HbDataFormPrivate::makeConnection(QModelIndex index) +void HbDataFormPrivate::makeConnection(QModelIndex index, HbWidget* widget) { Q_Q( HbDataForm); if(!index.isValid()){ @@ -205,21 +260,17 @@ if(modelItem){ QList signalList = mConnectionList.values(modelItem); if(signalList.count() > 0){ - HbDataFormViewItem *viewItem = static_cast(q->itemByIndex(index)); - if(viewItem){ - HbWidget *contentWidget = viewItem->dataItemContentWidget(); - if(contentWidget){ - foreach(ItemSignal signal, signalList) { - QObject *objct = signal.reciever; - QString signalName = signal.signal; - QString slot = signal.slot; - // Make connection - if(objct) { - QObject::connect(contentWidget, signalName.toAscii().data(), - objct,slot.toAscii().data()); - } - + if(widget){ + foreach(const ItemSignal& signal, signalList) { + QObject *objct = signal.receiver; + QString signalName = signal.signal; + QString slot = signal.slot; + // Make connection + if(objct) { + QObject::connect(widget, signalName.toAscii().data(), + objct,slot.toAscii().data()); } + } } } @@ -227,9 +278,10 @@ } } + void HbDataFormPrivate::removeConnection(HbDataFormModelItem * modelItem, QString signal, - QObject *reciever, + QObject *receiver, QString slot) { Q_Q( HbDataForm); @@ -242,17 +294,17 @@ static_cast(q->model())->indexFromItem(modelItem); HbDataFormViewItem *viewItem = static_cast(q->itemByIndex(index)); if(viewItem){ - HbWidget *contentWidget = viewItem->dataItemContentWidget(); + HbWidget *contentWidget = HbDataFormViewItemPrivate::d_ptr(viewItem)->mContentWidget; if(contentWidget){ //foreach(ItemSignal signalItem, signalList) { for(int i = 0; i < signalList.count() ;i++){ ItemSignal signalItem = signalList.at(i); - if(reciever == signalItem.reciever && + if(receiver == signalItem.receiver && signal == signalItem.signal && slot == signalItem.slot){ // disconnect QObject::disconnect(contentWidget, signal.toAscii().data(), - reciever,slot.toAscii().data()); + receiver,slot.toAscii().data()); signalList.removeAt(i); for(int j = 0; j < signalList.count(); j++){ mConnectionList.insertMulti(modelItem, signalList.at(j)); @@ -269,7 +321,7 @@ void HbDataFormPrivate::connectNow(HbDataFormModelItem * modelItem, QString signal, - QObject *reciever, + QObject *receiver, QString slot) { Q_Q( HbDataForm); @@ -277,14 +329,13 @@ if(q->model()) { QModelIndex index = static_cast(q->model())->indexFromItem(modelItem); if(modelItem){ - HbDataFormViewItem *viewItem =static_cast( q->itemByIndex(index) ); - if(viewItem){ - HbWidget *contentWidget = viewItem->dataItemContentWidget(); - // Make connection - if(contentWidget){ - QObject::connect(contentWidget, signal.toAscii().data(), - reciever,slot.toAscii().data()); - } + HbDataFormViewItem *viewItem =static_cast( q->itemByIndex(index) ); + if(viewItem){ + if(HbDataFormViewItemPrivate::d_ptr(viewItem)->mContentWidget) { + // Make connection + QObject::connect(HbDataFormViewItemPrivate::d_ptr(viewItem)->mContentWidget, signal.toAscii().data(), + receiver,slot.toAscii().data()); + } } } } @@ -303,13 +354,13 @@ QModelIndex index = static_cast(q->model())->indexFromItem(item); HbDataFormViewItem *viewItem = static_cast (q->itemByIndex(index)); if(viewItem){ - HbWidget *contentWidget = viewItem->dataItemContentWidget(); + HbWidget *contentWidget = HbDataFormViewItemPrivate::d_ptr(viewItem)->mContentWidget; // disconnect signal and remove signal from list for(int i = 0;i(q->model())->indexFromItem(modelItem); HbDataFormViewItem *viewItem =static_cast( q->itemByIndex(index)); if(viewItem){ - HbWidget *contentWidget = viewItem->dataItemContentWidget(); + HbWidget *contentWidget = HbDataFormViewItemPrivate::d_ptr(viewItem)->mContentWidget; // disconnect signal and remove signal from list for(int i = 0;iactivated(modelIndex); +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataform_p.h --- a/src/hbwidgets/dataform/hbdataform_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataform_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,7 +44,7 @@ struct ItemSignal { - QObject *reciever; + QObject *receiver; QString signal; QString slot; }; @@ -62,17 +62,20 @@ void addFormPage(const QString& page); void removeFormPage(const QString& page); void _q_page_changed(int index); - void _q_item_displayed(const QModelIndex &index); - void makeConnection(QModelIndex index); + + //void _q_item_displayed(const QModelIndex &index); + QModelIndex pageModelIndex(int index) const; + void makeConnection(QModelIndex index, HbWidget* widget); void connectNow(HbDataFormModelItem * modelItem, QString signal, - QObject *reciever, QString slot); + QObject *receiver, QString slot); void removeConnection(HbDataFormModelItem * item, QString signal, - QObject *reciever, + QObject *receiver, QString slot); void removeAllConnection(); void removeAllConnection(HbDataFormModelItem *item); inline HbTreeModelIterator *treeModelIterator() const; + void emitActivated(const QModelIndex &modelIndex); public: HbDataFormHeadingWidget* mHeadingWidget; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataformmodel.cpp --- a/src/hbwidgets/dataform/hbdataformmodel.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataformmodel.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,12 +23,12 @@ ** ****************************************************************************/ +#include "hbdataformmodel_p.h" +#include "hbdataformmodelitem_p.h" + #include #include -#include "hbdataformmodel_p.h" -#include "hbdataformmodelitem_p.h" - /* \internal @@ -122,12 +122,21 @@ HbDataFormModel is derived from QAbstractItemModel. So applications can use, QAbstractItemModel API's to create their datamodel. HbDataFormModel also provides - convenience API's specific to HbDataForm. These convinience API's are useful in creating - form page, group, group page and data item. + convenience API's specific to HbDataForm. These convenience API's are useful in creating + FormPageItem, GroupItem, GroupPageItem and data item. A HbDataForm can be used to display the contents of the model. - HbDataFormModel also has Apis to return modelindex of the items and vice-versa. + HbDataFormModel also has APIs to return modelindex of the items and vice-versa. So applications can individually modify the items data and set it to the HbDataForm. + + The signals emitted by HbDataFormModel + \li dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) emitted when the + HbDataFormModel is updated \atopLeft and \abottomRight will be same since every node has only one column. + User can connect to this signal and can fetch the instance of HbDataFormViewItem from HbDataForm + using the API dataFormViewItem(const QModelIndex &index) or user can fetch HbDataFormModelItem using API + itemFromIndex(const QModelIndex &index) in HbDataFormModel .When user updates model using + setContentWidgetData API provided in HbDataFormModelItem class, then DataForm takes care of updating the + corresponding item's visualization. */ /*! @@ -142,6 +151,9 @@ HbDataFormModelItemPrivate::d_ptr(d->mRoot)->setModel(this); } +/*! + Destructor. +*/ HbDataFormModel::~HbDataFormModel() { Q_D(HbDataFormModel); @@ -152,7 +164,7 @@ /*! @beta - Appends FormPageItem and return pointer to newly created HbDataFormModelItem. + Appends FormPageItem and returns pointer to newly created HbDataFormModelItem. The parent of FormPageItem is always model's root item. The DataItemType is set as FormPageItem. @@ -239,7 +251,7 @@ This is a convenience API. If user wants then he can create HbDataFormModelItem individually and then add that item in model using this API. If the \a data is of FormpageItemtype then parent is not considered. FormPage Items are always added - to rootItem. Also GroupPage Item has to be inserted in GroupItem. + to rootItem. Also GroupPageItem has to be inserted only in GroupItem. \a data Child item to be inserted. \a parent Parent of DataFormViewItem @@ -418,7 +430,7 @@ } /*! - \reimp + \reimp */ bool HbDataFormModel::removeRows(int row, int count, const QModelIndex &index) { @@ -432,7 +444,7 @@ } /*! - \reimp + \reimp Column value should be 0 as DataForm has only one column.If the value is not 0 function returns invalid index. If index is not valid then rootItem's index is considered. @@ -626,7 +638,8 @@ return QModelIndex(); } -/*! @beta +/*! + @beta Returns the HbDataFormModelItem at given \a row and with given parent /a index. */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataformmodelitem.cpp --- a/src/hbwidgets/dataform/hbdataformmodelitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataformmodelitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,14 +23,13 @@ ** ****************************************************************************/ -#include - #include "hbdataformmodelitem_p.h" -#include "hbdataformmodelitem.h" -#include "hbdataformmodel.h" #include "hbdataformmodel_p.h" -class QAbstractItemModel; +#include +#include + +#include HbDataFormModelItemPrivate::HbDataFormModelItemPrivate(): @@ -63,7 +62,12 @@ } } - +void HbDataFormModelItemPrivate::setContentWidgetData( + const QString& propertyName ,const QVariant &value) +{ + mProperties.remove(propertyName); + mProperties.insert(propertyName,value); +} QAbstractItemModel* HbDataFormModelItemPrivate::model() const { return mModel; @@ -82,7 +86,7 @@ - ringtone_general - unknowncaller_ringtone_general, - Then sample code to create above model and data it to dataForm would be, + Then sample code to create above model and data it to data form would be, \code HbDataForm* form = new HbDataForm(); @@ -104,20 +108,20 @@ /*! \enum HbDataFormModelItem::Roles - This enum defines the Roles supported by dataForm.Any data from application + This enum defines the Roles supported by dataForm. Any data from application can be added through these Roles. */ /*! \var HbDataFormModelItem::LabelRole - LabelRole: This Role is used for data label of the DataFormViewItem + LabelRole: This Role is used for data item label/heading of HbDataFormViewItem. */ /*! \var HbDataFormModelItem::ItemTypeRole - ItemTypeRole: This Role is used for data itemType of the HbDataFormModelItem + ItemTypeRole: This Role is used for data item type of the HbDataFormModelItem */ @@ -135,13 +139,6 @@ */ /*! - \var HbDataFormModelItem::DescriptionRole - DescriptionRole: This Role will add a description text in model item visualization. This role - is valid only for GroupItem and data items ( > GroupPageItem ). - - */ - -/*! \enum HbDataFormModelItem::DataItemType This enum defines itemtypes supported in dataform. @@ -157,7 +154,7 @@ /*! \var HbDataFormModelItem::GroupItem - GroupItem is used for grouping diffrent group pages or grouping data items under one group + GroupItem is used for grouping different group pages or grouping data items under one group heading. */ @@ -176,13 +173,6 @@ */ /*! - - \var HbDataFormModelItem::VolumeSliderItem - VolumeSliderItem: This itemType is for volume slider type of data item - - */ - -/*! \var HbDataFormModelItem::CheckBoxItem CheckBoxItem: This itemType is for check box type of data item @@ -192,8 +182,8 @@ \var HbDataFormModelItem::TextItem TextItem: This itemType is for text type of data item The TextItem by default has maximum 4 rows. - Application can configure thisvalue using HbLineEdit Property maxRows. - This Property Value has to be set using SetContentWidgetData API. + Application can configure this value using HbLineEdit Property maxRows. + This Property Value has to be set using setContentWidgetData() API. */ @@ -249,14 +239,14 @@ RadioButtonListItem will appear in three display modes - automatic : radioButtonList item appear as embedded( inline) if it contains less than four items and + - Automatic : radioButtonList item appear as embedded( inline) if it contains less than four items and if more than three items then selected items are displayed as text on a PushButton and when pushbutton clicked it lunches popup. Automatic mode is set as the default mode. - embedded : Application can set these items as always embedded(inline) by setting the property "displayMode" + - Embedded : Application can set these items as always embedded(inline) by setting the property "displayMode" with value of property as "embedded" - popup : Application can set these items as always popup by setting the property "displayMode" + - Popup : Application can set these items as always popup by setting the property "displayMode" with value of property as "popup" HbDataFormModelItem *radioItem = model->appendDataItem(HbDataFormModelItem::RadioButtonListItem, QString("Caller Tone")); @@ -272,14 +262,14 @@ MultiSelectionListItem will appear in three display modes - automatic : radioButtonList item appear as embedded( inline) if it contains less than four items and + - Automatic : radioButtonList item appear as embedded( inline) if it contains less than four items and if more than three items then selected items are displayed as text on a PushButton and when pushbutton clicked it lunches popup. Automatic mode is set as the default mode. - embedded : Application can set these items as always embedded(inline) by setting the property "displayMode" + - Embedded : Application can set these items as always embedded(inline) by setting the property "displayMode" with value of property as "embedded" - popup : Application can set these items as always popup by setting the property "displayMode" + - Popup : Application can set these items as always popup by setting the property "displayMode" with value of property as "popup" HbDataFormModelItem *radioItem = model->appendDataItem(HbDataFormModelItem::MultiSelectionListItem, QString("Caller Tone")); @@ -331,8 +321,11 @@ d_ptr(new HbDataFormModelItemPrivate()) { Q_D(HbDataFormModelItem); - d->q_ptr = this ; - d->mParentItem = const_cast(parent); + d->q_ptr = this ; + if( parent ) { + d->mParentItem = const_cast(parent); + d->mParentItem->appendChild(this); + } setData(ItemTypeRole, type); setData(LabelRole, label); } @@ -345,7 +338,10 @@ { Q_D(HbDataFormModelItem); d->q_ptr = this ; - d->mParentItem = const_cast(parent); + if( parent ){ + d->mParentItem = const_cast(parent); + d->mParentItem->appendChild(this); + } } /*! @@ -367,6 +363,7 @@ /*! @beta + Adds the given \a child to the children list of current item. \sa insertChild, insertChildren @@ -386,7 +383,8 @@ } else { d->mChildItems.append(child); - } + } + } } @@ -416,6 +414,7 @@ /*! @beta + Inserts the given list of \a items starting from the given \a row. \sa insertChild, appendChild @@ -443,6 +442,7 @@ /*! @beta + Removes the child item at the given \a index. The item at \a index is deleted. @@ -450,30 +450,33 @@ */ void HbDataFormModelItem::removeChild(int index) { + if( ( index < 0 ) || ( index >= childCount() ) ) { + return; + } Q_D(HbDataFormModelItem); - HbDataFormModel* model = static_cast(d->mModel); - if(model) { - model->d_func()->rowsAboutToBeRemoved(this, index, index); + + HbDataFormModelItem *item = d->mChildItems.at(index); + if( item ) { + int childCount = item->childCount(); + for ( int childIndex = 0; childIndex < childCount ;childIndex++) { + item->removeChild(0); + } + if( model ) { + model->d_func()->rowsAboutToBeRemoved(this, index, index); + } HbDataFormModelItem *item = d->mChildItems.takeAt(index); - if ( item ) { - delete item; - item = 0; - } - model->d_func()->rowsRemoved(); - } - else { - HbDataFormModelItem *item = d->mChildItems.takeAt(index); - if ( item ) { - delete item; - item = 0; + delete item; + item = 0; + if( model ) { + model->d_func()->rowsRemoved(); } } - } /*! @beta + Removes the given no of \a count of childitems from the given \a startindex. The items are deleted. @@ -481,22 +484,22 @@ */ void HbDataFormModelItem::removeChildren(int startIndex, int count) { - Q_D(HbDataFormModelItem); + if( ( startIndex < 0 ) || ( startIndex > childCount() ) || ( count <= 0 )) { + return; + } + + if( startIndex + count > childCount() ) { + return; + } - HbDataFormModel* model = static_cast(d->mModel); - model->d_func()->rowsAboutToBeRemoved(this, startIndex, startIndex + count -1); - for(int index = 0; index < count ;index++) { - HbDataFormModelItem *item = d->mChildItems.takeAt(0); - if ( item ) { - delete item; - item = 0; - } - } - model->d_func()->rowsRemoved(); + for(int index = 0; index < count ;index++) { + removeChild(startIndex); + } } /*! @beta + Returns the child item at the given \a index. Returns 0 if \a index passed in greater than count or less than 0. @@ -513,6 +516,7 @@ /*! @beta + Returns index of the given \a child. \sa childAt @@ -536,6 +540,7 @@ /*! @beta + Returns the data for the given \a role. Returns empty string if DescriptionRole is queried for items other then GroupItem and data item. */ @@ -565,6 +570,7 @@ /*! @beta + Sets the given \a value of variant to the given \a role. */ void HbDataFormModelItem::setData(int role ,const QVariant &value) @@ -613,17 +619,16 @@ - TextItem: HbLineEdit property should be used - ToggleValueItem: HbPushButton(text and additionalText) property should be used - RadioButtonListItem: HbRadioButtonList property should be used - - MultiselectionItem: HbListDialog property should be used + - MultiselectionItem: HbListWidget property should be used - ComboBoxItem: HbComboBox property should be used */ void HbDataFormModelItem::setContentWidgetData( const QString& propertyName ,const QVariant &value) { Q_D(HbDataFormModelItem); - d->mProperties.remove(propertyName); - d->mProperties.insert(propertyName,value); + d->setContentWidgetData(propertyName, value); + d->mDirtyProperty = propertyName; - HbDataFormModel *data_model = static_cast(d->mModel); if(data_model) { QModelIndex index = data_model->indexFromItem(this); @@ -633,6 +638,7 @@ /*! @beta + Returns the property \a value for the given \a propertyName. */ QVariant HbDataFormModelItem::contentWidgetData(const QString& propertyName ) const @@ -640,8 +646,10 @@ Q_D(const HbDataFormModelItem); return d->mProperties.value(propertyName); } + /*! @beta + Returns all properties with values which was set in HbDataFormModelItem. */ QHash HbDataFormModelItem::contentWidgetData() const @@ -649,10 +657,12 @@ Q_D(const HbDataFormModelItem); return d->mProperties; } + /*! @beta + Sets \a parent as a parent to this item. - It only sets the parent pointer. It doesnt put the item in the + It only sets the parent pointer. It does not put the item in the hierarchy. */ void HbDataFormModelItem::setParent(HbDataFormModelItem* parent) @@ -663,6 +673,7 @@ /*! @beta + Returns the parent of the this data item. */ HbDataFormModelItem* HbDataFormModelItem::parent() const @@ -673,6 +684,7 @@ /*! @beta + Sets \a type as a DataItemType for this data item. */ void HbDataFormModelItem::setType(HbDataFormModelItem::DataItemType type) @@ -682,6 +694,7 @@ /*! @beta + Returns the DataItemType of the this item. */ HbDataFormModelItem::DataItemType HbDataFormModelItem::type() const @@ -691,6 +704,7 @@ /*! @beta + Sets the \a label to the item. This is valid only if the type is other than FormPageItem, GroupItem and GroupPageItem. */ @@ -701,6 +715,7 @@ /*! @beta + Returns the label of the item. */ QString HbDataFormModelItem::label() const @@ -710,6 +725,7 @@ /*! @beta + Sets the \a icon to the item. This is valid only if the type is other than FormPageItem, GroupItem and GroupPageItem. */ @@ -720,6 +736,7 @@ /*! @beta + Returns the icon of the item. */ QString HbDataFormModelItem::icon() const @@ -727,14 +744,9 @@ return data(Qt::DecorationRole).toString(); } -/* -QHash HbDataFormModelItem::getContentWidgetValues() -{ - Q_D(const HbDataFormModelItem); - return d->mProperties; -}*/ +/*! + @beta -/*! Sets whether the item is enabled. If enabled is true, the item is \a enabled, meaning that the user can interact with the item @@ -759,7 +771,8 @@ } /*! - Returns true if the item is enabled; otherwise returns false. + @beta + Returns true if the item is enabled otherwise returns false. */ bool HbDataFormModelItem::isEnabled() const { @@ -768,6 +781,7 @@ } /*! + @beta Returns item flags for this item. */ Qt::ItemFlags HbDataFormModelItem::flags() const @@ -777,7 +791,7 @@ } /*! - @proto + @beta Sets the \a description to the item. This is valid only if the type is GroupItem or DataItem. Its not valid for GroupPageItem and FormPageItem. */ @@ -787,7 +801,7 @@ } /*! - @proto + @beta Returns the description of the item. */ QString HbDataFormModelItem::description() const diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataformmodelitem_p.h --- a/src/hbwidgets/dataform/hbdataformmodelitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataformmodelitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -22,12 +22,15 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ -#include + +#ifndef HBDATAFORMMODELITEM_P_H +#define HBDATAFORMMODELITEM_P_H -#include "hbdataformmodelitem.h" -#include "hbdataformmodel.h" #include "hbdataformmodel_p.h" +#include +#include + class QAbstractItemModel; class HbDataFormModelItemPrivate @@ -41,6 +44,7 @@ void setModel(const QAbstractItemModel *model); QAbstractItemModel* model() const; + void setContentWidgetData(const QString& propertyName ,const QVariant &value); public: @@ -62,5 +66,7 @@ Q_ASSERT(item); return item->d_func(); } -}; +}; +#endif //HBDATAFORMMODELITEM_P_H + diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataformviewitem.cpp --- a/src/hbwidgets/dataform/hbdataformviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataformviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,16 +23,16 @@ ** ****************************************************************************/ - -#include -#include +#include "hbdataformviewitem.h" +#include "hbdataformviewitem_p.h" +#include "hbabstractitemcontainer_p_p.h" #include "hbdataformmodelitem_p.h" -#include "hbdataformviewitem_p.h" #include "hbdataform_p.h" #include "hbdatagroup_p.h" +#include "hbstyleoptiondataformviewitem_p.h" -#include "hbtapgesture.h" +#include #ifdef HB_EFFECTS #include "hbeffect.h" @@ -43,8 +43,9 @@ /*! @beta @hbwidgets - \class HbDataFormViewItem represents an item/view in HbDataForm. Each HbDataFormModelItem - added inside a model is represented using HbDataFormViewItem instance. + \class HbDataFormViewItem + \brief HbDataFormViewItem represents an item view in HbDataForm corresponding to model item. + Each HbDataFormModelItem added inside model is represented using HbDataFormViewItem instance. HbDataFormViewItem have different visualization based upon the HbDataFormModelItem::DataItemType: @@ -60,16 +61,17 @@ creating HbDataFormModelItem, is added in a group combo box. User can switch between different group page using this combo. - DataItems: Any type other then FormPageItem, GroupItem and GroupPageItem is treated as - a data item. Data item contains label and the content widget. Data item content - widget can be set using HbDataFormModelItem::ItemTypeRole and label of data items - can be set using HbDataFormModelItem::LabelRole. Data items can not have any - children. They are always placed at the leaf. + a data item. Data item can contain label, description, icon and content widget. Data items + can not have any children. They are always placed at the leaf. Data item content widget + can be set using HbDataFormModelItem::ItemTypeRole, label of data items can be set using + HbDataFormModelItem::LabelRole, description of data item can be set using + HbDataFormModelItem::DescriptionRole. If HbDataFormViewItem represents a GroupItem then it can be expanded and collapsed. If group is expanded then all the child items are shown. If user wants to create a custom data item then he has to derive from this class and set that - as a protoype for HbDataForm using HbAbstractItemView::setItemPrototype API. While creating + as a prototype for HbDataForm using HbAbstractItemView::setItemPrototype API. While creating data for custom data items user should pass value greater than or equal to DataItemType::CustomItemBase. When visualization is created and if data item type is custom item then createCustomWidget() is called. User has to override this API and pass the @@ -159,7 +161,7 @@ /*! \reimp - Creates HbDataFormViewItem. This function is called form HbAbstractItemContainer + Creates HbDataFormViewItem. This function is called from HbAbstractItemContainer when model is getting parsed for creating items. */ @@ -169,13 +171,12 @@ } /*! \reimp - Returns true if \a model index is supported by HbDataFormViewItem, otherwise returns false. - This function is called for every item on the prototype list (, if several prototypes exist) - until item is found, which can create item for \a index. The prototype list is gone - through from end to the beginning. - \sa HbAbstractItemView::setItemPrototype(HbAbstractViewItem *prototype), HbAbstractItemView::setItemPrototype(const QList &prototypes) + Returns true if \a model index is supported by HbDataFormViewItem prototype, otherwise returns false. + This function is called for every item on the prototype list (if several prototypes exist) + until item is found, which can create view item for \a index. - + \sa HbAbstractItemView::setItemPrototype(HbAbstractViewItem *prototype) + \sa HbAbstractItemView::setItemPrototype(const QList &prototypes) */ bool HbDataFormViewItem::canSetModelIndex(const QModelIndex &index) const { @@ -194,7 +195,7 @@ /*! \reimp - Updates child graphics items to represent current state and content. In case when + Updates child graphics items to represent current state and content stored in model. In case when HbDataFormViewItem represents data item and DataItemType is set to custom item, then createCustomWidget is called. User can override createCustomWidget and can pass his own custom widget. @@ -239,7 +240,15 @@ // Establish Signal Connections set in HbDataFormModel to th contentWidget of this item HbDataFormPrivate::d_ptr( static_cast(d->mSharedData->mItemView))->makeConnection( - d->mIndex.operator const QModelIndex & ()); + d->mIndex.operator const QModelIndex & (),d->mContentWidget); + //update only the background primitive + HbStyleOptionDataFormViewItem options; + initStyleOption(&options); + if( d->mBackgroundItem ) { + style()->updatePrimitive( + d->mBackgroundItem, HbStyle::P_DataItem_background, &options ); + } + } /*! @@ -276,10 +285,12 @@ } /*! - @alpha + @beta + Restores the data from the model and assign to the widget. - The property for restoring and saving the data need to be initialized when the - data item is created. + The content widget property for restoring and saving the data need to be initialized when the + data item is created. If model item type is custom, then application developer has to override + this API in order to get notification when data is changed in model. \sa save */ @@ -330,10 +341,12 @@ } /*! - @alpha - Saves the current data of the content widget in data item to the model . + @beta + + Saves the current data of the content widget in data item to the model. The property for restoring and saving the data need to be initialized when the - data item is created. + data item is created. If model item type is custom, then application developer has to override + this API in order to save the content widget value in model. \sa restore */ @@ -356,11 +369,15 @@ } /*! - @alpha + @beta This is a virtual function which by default returns NULL. This function must be overridden in case user wants to create a data item of type custom item. The user is supposed to pass - the widget which is wants to display in data item. + the widget which he wants to display in data item. + If content widget grabs pan gesture and user wants data form to be scrollable even panning + is done on disabled content widget then user is supposed to ungrab pan gesture when content + widget is disabled. And again grab pan gesture when state of content widget is changed to + enabled. */ HbWidget* HbDataFormViewItem::createCustomWidget() { @@ -369,9 +386,10 @@ /*! \reimp - Sets the item to either collapse or expanded, depending on the value of \a expanded. + Sets the item to either collapse or expanded state, depending on the value of \a expanded. The function calls setModelIndexes which inturn will make the child items visible/invisible - accordingly. This API is valid if HbDataFormViewItem represents a GroupItem. + accordingly. This API is valid only if HbDataFormViewItem represents a FormPageItem, GroupItem + or GroupPageItem. \sa isExpanded */ @@ -381,7 +399,11 @@ // Expansion is valid only for group ,form page and group page if( d->mType < HbDataFormModelItem::SliderItem ) { static_cast(this)->setExpanded(expanded); - } + } else { + HbAbstractItemContainer *container = qobject_cast( + static_cast( d->mSharedData->mItemView->contentWidget( ) ) ); + container->setItemTransientStateValue(d->mIndex, "expanded", expanded); + } } /*! @@ -395,48 +417,53 @@ Q_D( const HbDataFormViewItem); // Expansion is valid only for group ,form page and group page if( d->mType < HbDataFormModelItem::SliderItem ) { - HbDataGroup *group = qobject_cast(const_cast(this)); + HbDataGroup *group = qobject_cast< HbDataGroup *>(const_cast(this)); if( group ) { return group->isExpanded(); - } else { - return false; } } + if(d->mSharedData->mItemView) { + HbAbstractItemContainer *container = qobject_cast( + static_cast( d->mSharedData->mItemView->contentWidget( ) ) ); + if(container) { + return container->itemTransientState(d->mIndex).value("expanded").toBool(); + } + } return false; } /*! - This API is valid only if HbDataFormViewItem represents a data item. Returns the - content widget of data item. For example if data item is of type SliderItem then - this API will return the instance of HbSlider. - If user wants to connect to some signals of content widget in data item then this - API can be used to fetch the instance of the widget. It will return the instance only - if data item is visible. User can connect to HbDataForm::activated() signal - and when this item is visible then he can query the content widget using this API. + @beta + + Returns the content widget of data item. For example if data item is of type SliderItem + then this API will return the instance of HbSlider. If user wants to connect to some + signals of content widget in data item then this API can be used to fetch the instance + of the widget. It will return the instance only if data item is visible. User can connect + to HbDataForm::itemShown() signal and when this item is visible then he can query the + content widget using this API. */ HbWidget* HbDataFormViewItem::dataItemContentWidget()const { Q_D(const HbDataFormViewItem); - HbWidget *widget = d->mContentWidget;; + HbWidget *widget = d->mContentWidget; - switch( d->mType ) { - case HbDataFormModelItem::RadioButtonListItem: - { + if(d->mContentWidget) { + switch( d->mType ) { + case HbDataFormModelItem::RadioButtonListItem:{ widget = static_cast(d->mContentWidget)->createRadioButton(); } break; - case HbDataFormModelItem::MultiselectionItem: - { + case HbDataFormModelItem::MultiselectionItem:{ widget = NULL; } break; - case HbDataFormModelItem::ToggleValueItem: - { + case HbDataFormModelItem::ToggleValueItem:{ widget = static_cast(d->mContentWidget)->contentWidget(); } break; - default: + default: break; + } } return widget; } @@ -453,6 +480,9 @@ Q_UNUSED(animate); } +/*! + \reimp +*/ void HbDataFormViewItem::initStyleOption(HbStyleOptionDataFormViewItem *option) const { Q_D( const HbDataFormViewItem ); @@ -463,6 +493,9 @@ option->description = d->mDescription; } +/*! + \reimp +*/ void HbDataFormViewItem::showEvent(QShowEvent * event) { Q_D( const HbDataFormViewItem ); @@ -473,5 +506,29 @@ } } +/*! + \reimp + */ +QVariant HbDataFormViewItem::itemChange( GraphicsItemChange change, const QVariant &value ) +{ + Q_D( HbDataFormViewItem ); + switch ( static_cast( change ) ) { + case QGraphicsItem::ItemEnabledHasChanged: { + HbStyleOptionDataFormViewItem options; + initStyleOption(&options); + if( d->mBackgroundItem ) { + style()->updatePrimitive( + d->mBackgroundItem, HbStyle::P_DataItem_background, &options ); + } + //We are skipping call to abstractviewitem::itemChange here because updateChildItems is + //called in that function which will again create data view item primitives. + return HbWidget::itemChange( change, value ); + } + default: + break; + } + return HbAbstractViewItem::itemChange( change, value ); +} + #include "moc_hbdataformviewitem.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataformviewitem.h --- a/src/hbwidgets/dataform/hbdataformviewitem.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataformviewitem.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBDATAFORMITEM_H -#define HBDATAFORMITEM_H +#ifndef HBDATAFORMVIEWITEM_H +#define HBDATAFORMVIEWITEM_H #include @@ -41,6 +41,8 @@ public: + + explicit HbDataFormViewItem(QGraphicsItem *parent = 0); virtual ~HbDataFormViewItem(); @@ -55,7 +57,7 @@ void setExpanded(bool expanded); bool isExpanded() const; - + HbWidget* dataItemContentWidget()const; public slots: @@ -77,9 +79,10 @@ void initStyleOption(HbStyleOptionDataFormViewItem *option) const; void showEvent(QShowEvent * event); + QVariant itemChange( GraphicsItemChange change, const QVariant &value ); private: Q_DECLARE_PRIVATE_D(d_ptr, HbDataFormViewItem) }; -#endif //HBDATAFORMITEM_H +#endif //HBDATAFORMVIEWITEM_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataformviewitem_p.cpp --- a/src/hbwidgets/dataform/hbdataformviewitem_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataformviewitem_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -45,7 +45,7 @@ #include #include -#include +//#include #ifdef HB_GESTURE_FW #include @@ -72,6 +72,11 @@ mModel->itemFromIndex( mViewItem->modelIndex( ) ) ); QObject::connect(this,SIGNAL(valueChanged(QPersistentModelIndex, QVariant)),mViewItem, SIGNAL(itemModified(QPersistentModelIndex, QVariant))); + + // make the connetions added by application + HbDataFormPrivate* form_priv = HbDataFormPrivate::d_ptr( + static_cast(mViewItem->itemView())); + form_priv->makeConnection(mViewItem->modelIndex() , mButton); } HbToggleItem::~HbToggleItem() @@ -116,10 +121,12 @@ QString additionalTxt = mModelItem->contentWidgetData( QString("additionalText") ).toString(); QString txt = mModelItem->contentWidgetData(QString("text")).toString(); + HbDataFormModelItemPrivate *modelItem_priv = HbDataFormModelItemPrivate::d_ptr(mModelItem); + // Don't want to emit datachanged for this property so calling private function + modelItem_priv->setContentWidgetData( QString("additionalText"), txt ); + // will emit datachanged mModelItem->setContentWidgetData( QString("text"), additionalTxt ); emit valueChanged(mViewItem->modelIndex(), additionalTxt); - // HbPushButton will not be updated with Additional Text when modelChanged signal is emitted - mModelItem->setContentWidgetData( QString("additionalText"), txt ); } /* @@ -165,6 +172,7 @@ if(!mRadioButtonList) { mRadioButtonList = new HbRadioButtonList(); mRadioButtonList->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); + //mRadioButtonList->setClampingStyle(HbScrollArea::StrictClamping); mRadioButtonList->setItems( mItems ); if( mSelected != -1 ) { @@ -175,6 +183,11 @@ // only when dialog closed QObject::connect( mRadioButtonList, SIGNAL(itemSelected(int)), this, SLOT(updateModel(int)) ); + + // make the connetions added by application + HbDataFormPrivate* form_priv = HbDataFormPrivate::d_ptr( + static_cast(mViewItem->itemView())); + form_priv->makeConnection(mViewItem->modelIndex() , mRadioButtonList); } return mRadioButtonList; @@ -199,6 +212,16 @@ if( dynamicPropertyName == "items" || dynamicPropertyName == "displayMode" ) { // store the items locally mItems = property("items").toStringList(); + if(mItems.count() == 0) { + mItems = mModelItem->contentWidgetData(QString("items")).toStringList(); + } + if(mItems.count() == 0) { + //clear the current slection if all items are deleted + updateModel(-1); + }/* else { + // if new items are populated make the current slection to 0 + updateModel(0); + }*/ // in case of automatic, displayMode (embedded, automatic or popup) will change // if new items are populated or mode should be changed if mode is set // explicitly by application at runtime @@ -232,6 +255,8 @@ createRadioButton(); layout->addItem(mRadioButtonList); mRadioButtonList->setScrollDirections(0); + //Ungrab the pan gesture because we do not want radio button list to scroll + mRadioButtonList->ungrabGesture(Qt::PanGesture); } void HbRadioItem::makePopup() @@ -306,7 +331,6 @@ { if(!mButton) { mButton = new HbPushButton(); - mButton->setTextAlignment(Qt::AlignLeft); QObject::connect(mButton, SIGNAL(clicked()), this, SLOT(buttonClicked())); layout->addItem( mButton ); } @@ -323,13 +347,23 @@ this, SLOT(updateModel(int)) ); selectItem(); mDialog = new HbDialog(); + QObject::connect(mDialog, SIGNAL(finished(HbAction*)), this, SIGNAL(finished(HbAction*))); + QObject::connect(mDialog, SIGNAL(aboutToShow()), this, SIGNAL(aboutToShow())); + QObject::connect(mDialog, SIGNAL(aboutToHide()), this, SIGNAL(aboutToHide())); + QObject::connect(mDialog, SIGNAL(aboutToClose()), this, SIGNAL(aboutToClose())); mDialog->setTimeout(HbPopup::NoTimeout); mDialog->setAttribute(Qt::WA_DeleteOnClose); - mDialog->setContentWidget(mRadioButtonList); - mDialog->addAction(new HbAction(QString("Ok"))); - mDialog->addAction(new HbAction(QString("Cancel"))); - mDialog->open(this,SLOT(dialogClosed(HbAction*))); - mRadioButtonList->setSelected(mSelected); + mDialog->setDismissPolicy(HbPopup::NoDismiss); + mDialog->setModal(true); + mDialog->setContentWidget(mRadioButtonList); + HbAction *ok = new HbAction(QString("Ok")); + mDialog->addAction(ok); + HbAction *cancel = new HbAction(QString("Cancel")); + connect(ok, SIGNAL(triggered()), mDialog,SLOT(accept())); + mDialog->addAction(cancel); + mDialog->connect(cancel, SIGNAL(triggered()), mDialog, SLOT(reject())); + mRadioButtonList->setSelected(mSelected); + mDialog->open(this,SLOT(dialogClosed(int))); } } @@ -337,7 +371,9 @@ void HbRadioItem::updateModel( int index ) { mSelected = index; - emit valueChanged(mViewItem->modelIndex(), mItems.at(index)); + if( index > -1 && mItems.count() < index ) { + emit valueChanged(mViewItem->modelIndex(), mItems.at(index)); + } // Disconnect modelchanged signal since visualization is already updated by user // so if not disconnected , this will trigger visualization change again disconnect( mModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), @@ -354,13 +390,13 @@ } -void HbRadioItem::dialogClosed(HbAction* action) +void HbRadioItem::dialogClosed(int code) { - if(( action ) && ( action->text() == "Ok" )) { + if(code == HbDialog::Accepted && mRadioButtonList) { // store the selected item to model updateModel(mRadioButtonList->selected()); } - // dont change selection incase of "Cancel" button click . + // don't change selection incase of "Cancel" button click . mRadioButtonList = 0; mDialog = 0; } @@ -403,7 +439,7 @@ // get selection model model = mMultiListWidget->selectionModel(); if(model) { - // disconnect so that the visualization does not get changed when selction + // disconnect so that the visualization does not get changed when selection // model changes QObject::disconnect(model, SIGNAL(selectionChanged( const QItemSelection , const QItemSelection )), @@ -423,8 +459,8 @@ for ( int i = 0; i < mSelectedItems.count() ; i++ ) { int selectionindex = mSelectedItems.at( i ).toInt(); if( selectionindex< mItems.count()) { - if( i > 0) {// dont add ; in the starting of the string - newValue.append( ";" ); + if( i > 0) {// don't add ; in the starting of the string + newValue.append( "," ); } newValue.append( mItems.at( mSelectedItems.at( i ).toInt() ) ); } @@ -445,6 +481,10 @@ // create ListWidget if not yet created if(!mMultiListWidget) { mMultiListWidget = new HbListWidget(); + QObject::connect(mMultiListWidget, SIGNAL(activated(HbListWidgetItem *)), this, SIGNAL(activated(HbListWidgetItem *))); + QObject::connect(mMultiListWidget, SIGNAL(pressed(HbListWidgetItem *)), this, SIGNAL(pressed(HbListWidgetItem *))); + QObject::connect(mMultiListWidget, SIGNAL(released(HbListWidgetItem *)), this, SIGNAL(released(HbListWidgetItem *))); + QObject::connect(mMultiListWidget, SIGNAL(longPressed(HbListWidgetItem *, const QPointF &)), this, SIGNAL(longPressed(HbListWidgetItem *, const QPointF &))); layout->addItem(mMultiListWidget); } @@ -456,6 +496,9 @@ mMultiListWidget->addItem(mItems.at(index)); } mMultiListWidget->setScrollDirections(0); + //ungrab pan gesture because we do not want embedded multi selection list + //to scroll + mMultiListWidget->ungrabGesture( Qt::PanGesture ); } void HbMultiSelectionItem::makePopup() @@ -470,7 +513,6 @@ // and popup will be launched when button is clicked if(!mButton) { mButton = new HbPushButton(); - mButton->setTextAlignment(Qt::AlignLeft); layout->addItem(mButton); } QObject::connect(mButton, SIGNAL(clicked()), this, SLOT(launchMultiSelectionList())); @@ -551,17 +593,27 @@ { if(!mSelectionDialog ) { mSelectionDialog = new HbSelectionDialog(); + QObject::connect(mSelectionDialog, SIGNAL(aboutToShow()),this ,SIGNAL(aboutToShow())); + QObject::connect(mSelectionDialog, SIGNAL(aboutToHide()),this ,SIGNAL(aboutToHide())); + QObject::connect(mSelectionDialog, SIGNAL(aboutToClose()),this ,SIGNAL(aboutToClose())); + QObject::connect(mSelectionDialog, SIGNAL(finished(HbAction*)),this ,SIGNAL(finished(HbAction*))); mSelectionDialog->setSelectionMode( HbAbstractItemView::MultiSelection ); mSelectionDialog->setStringItems( mItems, -1 ); mSelectionDialog->setSelectedItems( mSelectedItems ); mSelectionDialog->setAttribute(Qt::WA_DeleteOnClose); - mSelectionDialog->open(this,SLOT(dialogClosed(HbAction*))); + mSelectionDialog->open(this,SLOT(dialogClosed(int))); + + // make the connetions added by application + HbDataFormPrivate* form_priv = HbDataFormPrivate::d_ptr( + static_cast(mViewItem->itemView())); + form_priv->makeConnection(mViewItem->modelIndex() , mSelectionDialog); } } -void HbMultiSelectionItem::dialogClosed(HbAction* action) +void HbMultiSelectionItem::dialogClosed(int code) { - if(( action ) && ( action->text() == "Ok" )) { + + if(code == HbDialog::Accepted) { //fetch the selected items mSelectedItems = mSelectionDialog->selectedItems(); QString newValue(""); @@ -575,7 +627,7 @@ mSelectedItems.append(selection.at(i)); newValue.append(mSelectionDialog->stringItems().at(selection.at(i))); if( i != selection.count() - 1 ) { - newValue.append( ";" ); + newValue.append( "," ); } } mButton->setText( newValue ); @@ -830,7 +882,7 @@ //update description of either data item or data group QString description = model_item->description(); if( type == HbDataFormModelItem::GroupItem ) { - HbDataGroupPrivate::d_ptr(static_cast(q))->setDescription(description); + static_cast(q)->setDescription(description); } else if ( type > HbDataFormModelItem::GroupPageItem ) { setDescription(description); } @@ -854,6 +906,7 @@ itemFlags |= QGraphicsItem::ItemIsFocusable; q->setFocusPolicy(q->prototype()->focusPolicy()); q->setProperty("state", "normal"); + q->setEnabled(true); q->grabGesture(Qt::TapGesture); } } else { @@ -861,12 +914,27 @@ itemFlags &= ~QGraphicsItem::ItemIsFocusable; q->setFocusPolicy(Qt::NoFocus); q->setProperty("state", "disabled"); + q->setEnabled(false); q->ungrabGesture(Qt::TapGesture); } } if( mContentWidget ) { mContentWidget->setEnabled(enabled); + //If slider is disabled then still panning should be possible. + if( ( mType == HbDataFormModelItem::SliderItem ) || + ( mType == HbDataFormModelItem::VolumeSliderItem ) ) { + HbSlider *slider = static_cast( mContentWidget ); + if( enabled ) { + //grab pan gesture + slider->primitive(HbStyle::P_SliderElement_touchgroove)->toGraphicsObject()->grabGesture( + Qt::PanGesture); + } else { + //ungrab pan gesture + slider->primitive(HbStyle::P_SliderElement_touchgroove)->toGraphicsObject()->ungrabGesture( + Qt::PanGesture); + } + } } } @@ -916,11 +984,10 @@ void HbDataFormViewItemPrivate::createContentWidget() { Q_Q(HbDataFormViewItem); - + QObject::connect(q, SIGNAL(itemShown(const QModelIndex&)), - mSharedData->mItemView, SIGNAL(activated(const QModelIndex&))); - QObject::connect(q, SIGNAL(itemShown(const QModelIndex&)), - mSharedData->mItemView, SIGNAL(itemShown(const QModelIndex&))); + mSharedData->mItemView, SIGNAL(itemShown(const QModelIndex&))); + switch( mType ) { // following are standard data item case HbDataFormModelItem::SliderItem: @@ -999,10 +1066,10 @@ mBackgroundItem, HbStyle::P_DataItem_background, &options ); } - if ( mContentWidget ) { - QEvent polishEvent( QEvent::Polish ); - QCoreApplication::sendEvent( mContentWidget, &polishEvent ); - } + //if ( mContentWidget ) { + // QEvent polishEvent( QEvent::Polish ); + // QCoreApplication::sendEvent( mContentWidget, &polishEvent ); + //} } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdataformviewitem_p.h --- a/src/hbwidgets/dataform/hbdataformviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdataformviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,8 +38,10 @@ class HbAction; class HbDialog; class HbListWidget; +class HbListWidgetItem; class QGraphicsLinearLayout; class QItemSelection; +class HbAction; QT_FORWARD_DECLARE_CLASS(QGraphicsLinearLayout) @@ -91,7 +93,7 @@ public slots: void updateModel( int index ); void buttonClicked(); - void dialogClosed(HbAction* action); + void dialogClosed(int code); void makeEmbedded(); void makePopup(); void changeMode(); @@ -99,6 +101,12 @@ void resetSelection(); signals: void valueChanged(QPersistentModelIndex, QVariant); + + //popup signals + void finished(HbAction*); + void aboutToShow(); + void aboutToHide(); + void aboutToClose(); private: HbRadioButtonList* mRadioButtonList; @@ -127,7 +135,7 @@ public slots: void launchMultiSelectionList( ); - void dialogClosed(HbAction*); + void dialogClosed(int code); void updateModel( const QItemSelection & selected, const QItemSelection &deselected ); void makeEmbedded(); void makePopup(); @@ -135,6 +143,14 @@ void makeSelection(); signals: void valueChanged(QPersistentModelIndex, QVariant); + void aboutToShow(); + void aboutToHide(); + void aboutToClose(); + void finished(HbAction*); + void activated(HbListWidgetItem *item); + void pressed(HbListWidgetItem *item); + void released(HbListWidgetItem *item); + void longPressed(HbListWidgetItem *item, const QPointF &coords); private: @@ -178,7 +194,7 @@ QString description() const; void updateData(); - void setEnabled(bool enabled); + virtual void setEnabled(bool enabled); public: static HbDataFormViewItemPrivate *d_ptr(HbDataFormViewItem *item) { Q_ASSERT(item); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdatagroup_p.cpp --- a/src/hbwidgets/dataform/hbdatagroup_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdatagroup_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,16 +23,15 @@ ** ****************************************************************************/ +#include "hbdatagroup_p_p.h" +#include "hbdatagroupheadingwidget_p.h" +#include "hbdataform_p.h" +#include "hbstyleoptiondatagroup_p.h" +#include "hbabstractitemcontainer_p_p.h" + #include #include -#include "hbdatagroupheadingwidget_p.h" -#include "hbstyleoptiondatagroup_p.h" -#include "hbabstractitemcontainer_p_p.h" -#include "hbdataform_p.h" -#include "hbdatagroup_p_p.h" - - #include #include @@ -44,6 +43,7 @@ mPageComboBackgroundItem( 0 ) { } + HbDataGroupPrivate::HbDataGroupPrivate( const HbDataGroupPrivate &source ): HbDataFormViewItemPrivate( source ), mPageCombo( source.mPageCombo ), @@ -51,6 +51,7 @@ mPageComboBackgroundItem( source.mPageComboBackgroundItem ) { } + HbDataGroupPrivate::~HbDataGroupPrivate( ) { } @@ -59,64 +60,201 @@ { } -void HbDataGroupPrivate::expand( bool expanded ) +bool HbDataGroupPrivate::setExpanded( bool expanded ) +{ + Q_Q(HbDataGroup); + HbAbstractItemContainer *container = 0; + HbDataFormModelItem::DataItemType itemType = + static_cast( + mIndex.data(HbDataFormModelItem::ItemTypeRole).toInt()); + //emit activated signal for newly expanded group page + if(expanded && (itemType == HbDataFormModelItem::GroupPageItem || + itemType == HbDataFormModelItem::FormPageItem)) { + q->emitActivated(q->modelIndex()); + } + if(mSharedData->mItemView) { + container = qobject_cast( + static_cast(mSharedData->mItemView->contentWidget())); + if(container->itemTransientState(mIndex).value("expanded") == expanded || !mSharedData->mItemView) { + return true; + } + // expand function sets correct expansion itemstate for this item and its children + changeExpansionState(expanded); + + // if some one exlicitly calls setExpanded for data group then primitives needs to be updated. + if(itemType == HbDataFormModelItem::GroupItem){ + if(mPageCombo) { + if(expanded) { + HbStyle::setItemName(mPageCombo,"dataGroup_Combo"); + HbStyle::setItemName(mPageComboBackgroundItem,"dataGroup_ComboBackground"); + + } else { + + HbStyle::setItemName(mPageCombo,""); + HbStyle::setItemName(mPageComboBackgroundItem,""); + q->setProperty("groupPage", ""); + mPageString.clear(); + delete mPageCombo; + mPageCombo = 0; + delete mPageComboBackgroundItem; + mPageComboBackgroundItem = 0; + QEvent polishEvent(QEvent::Polish); + QCoreApplication::sendEvent(q, &polishEvent); + } + } + } + // setModelIndexes will be create or delete items according to the + // itemTransient state set using expand function call above + container->setModelIndexes(mIndex.operator const QModelIndex & ()); + } + q->updatePrimitives(); + return true; + +} + +void HbDataGroupPrivate::setEnabled( bool enabled ) { + Q_Q(HbDataGroup); + + QGraphicsItem::GraphicsItemFlags itemFlags = q->flags( ); + Qt::ItemFlags indexFlags = mIndex.flags( ); + + if ( indexFlags & Qt::ItemIsEnabled ) { + if ( !( itemFlags & QGraphicsItem::ItemIsFocusable ) ) { + itemFlags |= QGraphicsItem::ItemIsFocusable; + q->setFocusPolicy( q->prototype( )->focusPolicy( ) ); + q->setProperty( "state", "normal" ); + q->setEnabled( true ); + q->grabGesture( Qt::TapGesture ); + } + } else { + if ( itemFlags & QGraphicsItem::ItemIsFocusable ) { + itemFlags &= ~QGraphicsItem::ItemIsFocusable; + q->setFocusPolicy( Qt::NoFocus ); + q->setProperty( "state", "disabled" ); + q->setEnabled( false ); + q->ungrabGesture( Qt::TapGesture ); + } + } + + if( mGroupHeading ) { + mGroupHeading->setEnabled(enabled); + mGroupHeading->updatePrimitives(); + } +} + +// This function gets called for group item or for grouppage item . It returs the corresponding page index . +// The relevance of this function is when some items are inserted before group page inside a group. +// returns -1 if not valid index. +int HbDataGroupPrivate::pageIndex(const QModelIndex &index) const +{ + const Q_Q(HbDataGroup); + int pageIndex = -1; + HbDataFormModelItem::DataItemType indexType = static_cast( + index.data( HbDataFormModelItem::ItemTypeRole).toInt( ) ); + + // Make sure that the child is groupPage type and current item is group. + if( (indexType == HbDataFormModelItem::GroupPageItem) || (indexType == HbDataFormModelItem::FormPageItem) ) { + HbDataFormModelItem *modelItem = + static_cast((q->itemView())->model())->itemFromIndex( + q->modelIndex( )); + HbDataFormModelItem *groupModelItem = 0; + // get the group modelItem pointer depending upon the type + if( modelItem->type() == HbDataFormModelItem::GroupItem ) { + groupModelItem = modelItem; + } else if( modelItem->type() == HbDataFormModelItem::GroupPageItem ) { + groupModelItem = modelItem->parent(); + } else if (modelItem->type() == HbDataFormModelItem::FormPageItem ) { + groupModelItem = static_cast(q->itemView()->model())->invisibleRootItem(); + } + + int childCount = groupModelItem->childCount(); + for( int i = 0; i < childCount; i++) { + HbDataFormModelItem *child = groupModelItem->childAt(i); + if( (child->type() == HbDataFormModelItem::GroupPageItem ) || (child->type() == HbDataFormModelItem::FormPageItem)) { + pageIndex ++; + // get the index of groupPage + QModelIndex childIndex = static_cast(q->itemView()->model())->indexFromItem(child); + if(childIndex == index) { + break;// we got the page index + } + } + } + } + return pageIndex; +} + +QModelIndex HbDataGroupPrivate::pageModelIndex(int index) const +{ + const Q_Q(HbDataGroup); + int pageIndex = -1; + QModelIndex modelIndex; + + // Make sure that the child is groupPage type and current item is group. + if( index >= 0) { + + HbDataFormModelItem *modelItem = + static_cast((q->itemView())->model())->itemFromIndex( + q->modelIndex( )); + HbDataFormModelItem *groupModelItem = 0; + // get the group modelItem pointer depending upon the type + if( modelItem->type() == HbDataFormModelItem::GroupItem ) { + groupModelItem = modelItem; + } else if( modelItem->type() == HbDataFormModelItem::GroupPageItem ) { + groupModelItem = modelItem->parent(); + } + + int childCount = groupModelItem->childCount(); + + for( int i = 0; i < childCount; i++) { + + HbDataFormModelItem *child = groupModelItem->childAt(i); + if( child->type() == HbDataFormModelItem::GroupPageItem ) { + pageIndex ++; + // get the index of groupPage + if(pageIndex == index) { + modelIndex = static_cast(q->itemView()->model())->indexFromItem(child); + break; + + } + } + } + } + return modelIndex; +} + + + +void HbDataGroupPrivate::changeExpansionState( bool expanded ) +{ + Q_Q(HbDataGroup); + // get container for setting item state HbAbstractItemContainer *container = qobject_cast( static_cast( mSharedData->mItemView->contentWidget( ) ) ); HbDataFormModelItem::DataItemType itemType = static_cast( ( mIndex.operator const QModelIndex & ( )).data( HbDataFormModelItem::ItemTypeRole).toInt( ) ); - if(container->itemTransientState(mIndex).value( "expanded" ) == expanded ) { + if(container->itemTransientState(mIndex).value( "expanded" ) == expanded ) { return; } if( !expanded ) { - - //collapsing all the expanded child Types. - QModelIndex index = mIndex.operator const QModelIndex & ( ); - QModelIndex childIndex = index.child(0,0); - while(childIndex.isValid()) { - - HbDataFormModelItem::DataItemType childType = static_cast( - childIndex.data(HbDataFormModelItem::ItemTypeRole).toInt()); - - if(childType <= HbDataFormModelItem::GroupPageItem) { - HbDataGroup* group_Item = - static_cast(mSharedData->mItemView->itemByIndex( - childIndex)); - if(group_Item && group_Item->isExpanded()) { - HbDataGroupPrivate::d_ptr(group_Item)->expand(false); - - } - } - QModelIndex nextChild = index.child(childIndex.row() +1 ,0); - childIndex = nextChild; - } - if( mGroupHeading ) { mGroupHeading->mExpanded = false; } - } else { //expand - + // here we are checking only for HbDataGroup since for HbDataFormPage expansion will happen through + // setModelIndexes. For group we need to expand the current active grouppage . if(itemType == HbDataFormModelItem::GroupItem){ - HbDataFormModelItem *modelItem = static_cast( - mSharedData->mItemView->model())->itemFromIndex(mIndex.operator const QModelIndex & ()); - QModelIndex childIndex = (mIndex.operator const QModelIndex & ()).child(0,0); - HbDataFormModelItem::DataItemType childType = static_cast( - childIndex.data(HbDataFormModelItem::ItemTypeRole).toInt()); - if( childType == HbDataFormModelItem::GroupPageItem ) { - QVariant pageIndex = modelItem->contentWidgetData(QString("currentPage")); - int activePage; - if(!pageIndex.isValid()) { - activePage = 0; - } else { - activePage = pageIndex.toInt(); - } - //get the group page index - QModelIndex groupPageIndex = mIndex.child(activePage,0); + int page = activePage(); + if(page != -1) { + QModelIndex groupPageIndex = pageModelIndex(page); + if(groupPageIndex.isValid()) { + // set transient state for group page so that when it gets created then its + // child items are also created container->setItemTransientStateValue(groupPageIndex, "expanded", true); + q->emitActivated(groupPageIndex); } } if (mGroupHeading ) { @@ -124,24 +262,25 @@ } } } - + // save the item state for this item. All the cild item state are saved above container->setItemTransientStateValue(mIndex, "expanded", expanded); } -QString HbDataGroupPrivate::groupPage() const +/*QString HbDataGroupPrivate::groupPage() const { return mPageString; } - +*/ void HbDataGroupPrivate::setGroupPage( const QString &page ) { Q_Q(HbDataGroup); if( !mPageCombo ) { + // This is the first groupPgae getting added so create the combobox to add the page mPageCombo = new HbComboBox( q ); - mPageString = " "; + mPageString = ' '; q->setProperty("groupPage", page); HbStyle::setItemName(mPageCombo,"dataGroup_Combo"); @@ -162,8 +301,11 @@ if(!list.contains(page)) { mPageCombo->addItem(page); mPageString = page; - } - mPageCombo->setCurrentIndex(activePage()); + } + int pageIndex = activePage(); + if(pageIndex!= -1) { + mPageCombo->setCurrentIndex(pageIndex); + } QObject::connect(mPageCombo,SIGNAL(currentIndexChanged(int)), q ,SLOT(pageChanged(int))); @@ -171,40 +313,71 @@ void HbDataGroupPrivate::removeGroupPage(const QString &page) { + if(mPageCombo) { + // if we are removing the last page then set current page as 0 + if( mPageCombo->findText(page) + 1 == mPageCombo->count()) { + mPageCombo->setCurrentIndex(0); + } else {// set next page as the currrent page + mPageCombo->setCurrentIndex(mPageCombo->findText(page) + 1); + } + // remove the text from ombobox mPageCombo->removeItem(mPageCombo->findText(page)); } } +/* +int HbDataGroupPrivate::pageChanged(const QModelIndex &modelIndex) +{ + +}*/ int HbDataGroupPrivate::activePage( ) { Q_Q( HbDataGroup ); + // Here we need to find which page has the itemTransientState true, + // which in turn will be the active page. If no page is set as true , then + // make the 0th page as expanded ie itemTransientState as true + // This function can be called from Group or GroupPage items + QModelIndex groupIndex ; HbDataFormModelItem *modelItem = static_cast((q->itemView())->model())->itemFromIndex( q->modelIndex( )); - int page = 0; - if(modelItem){ - page = modelItem->contentWidgetData(QString("currentPage")).toInt(); + HbDataFormModelItem *groupModelItem = 0; + // get the group modelItem pointer depending upon the type + if( modelItem->type() == HbDataFormModelItem::GroupItem ) { + groupModelItem = modelItem; + } else if( modelItem->type() == HbDataFormModelItem::GroupPageItem ) { + groupModelItem = modelItem->parent(); } - return page; -} - -void HbDataGroupPrivate::setActivePage(int pageindex) -{ - Q_Q( HbDataGroup ); - - HbDataFormModelItem *modelItem = - static_cast((q->itemView())->model())->itemFromIndex( - q->modelIndex()); - - QObject::disconnect( mSharedData->mItemView->model(), SIGNAL( dataChanged( QModelIndex,QModelIndex ) ), - mSharedData->mItemView, SLOT( dataChanged( QModelIndex,QModelIndex ) ) ); - - modelItem->setContentWidgetData(QString("currentPage"),pageindex); - - QObject::connect( mSharedData->mItemView->model(), SIGNAL( dataChanged( QModelIndex,QModelIndex ) ), - mSharedData->mItemView, SLOT( dataChanged( QModelIndex,QModelIndex ) ) ); + int childCount = groupModelItem->childCount(); + //int activePage = 0; + // get container for setting item state + HbAbstractItemContainer *container = qobject_cast( + static_cast( mSharedData->mItemView->contentWidget( ) ) ); + int currentPage = -1; + bool somePageExpanded = false; + for( int i = 0; i < childCount; i++) { + // Make sure that the child is groupPage type. + HbDataFormModelItem *child = groupModelItem->childAt(i); + if( child->type() == HbDataFormModelItem::GroupPageItem ) { + // Here we are not using i as the page index since there can other types of children in the same level + // so need a seperate variable for this + currentPage ++; + + // get the index of groupPage + QModelIndex pageIndex = static_cast(q->itemView()->model())->indexFromItem(child); + if(container->itemTransientState(pageIndex).value("expanded").toBool()) { + somePageExpanded = true; + break; + } + + } + } + if(!somePageExpanded && currentPage != -1) {// This means pages are present and no page is expanded so expand first page + currentPage = 0; + } + return currentPage; } void HbDataGroupPrivate::setHeading( const QString &heading ) @@ -263,54 +436,35 @@ bool HbDataGroup::setExpanded( bool expanded ) { Q_D(HbDataGroup); - HB_SD(HbAbstractViewItem); - HbAbstractItemContainer *container = 0; - - if(d->mSharedData->mItemView) { - container = qobject_cast( - static_cast(d->mSharedData->mItemView->contentWidget())); - if(container->itemTransientState(d->mIndex).value("expanded") == expanded || !sd->mItemView) { - return true; - } - d->expand(expanded); - - - //if some one exlicitly calls setExpanded for data group then primitives needs to be - //updated. - HbDataFormModelItem::DataItemType itemType = + if(d->mSharedData->mItemView){ + HbDataFormModelItem *modelItem = static_cast( + d->mSharedData->mItemView->model())->itemFromIndex(modelIndex()); + HbDataFormModelItem::DataItemType contentWidgetType = static_cast( - d->mIndex.data(HbDataFormModelItem::ItemTypeRole).toInt()); - if(itemType == HbDataFormModelItem::GroupItem){ - if(d->mPageCombo) { - if(expanded) { - - HbStyle::setItemName(d->mPageCombo,"dataGroup_Combo"); - HbStyle::setItemName(d->mPageComboBackgroundItem,"dataGroup_ComboBackground"); - //HbStyle::setItemName(d->mGroupDescriptionItem, "dataGroup_Description"); - - } else { - - HbStyle::setItemName(d->mPageCombo,""); - HbStyle::setItemName(d->mPageComboBackgroundItem,""); - //HbStyle::setItemName(d->mGroupDescriptionItem, ""); - setProperty("groupPage", ""); - d->mPageString.clear(); - delete d->mPageCombo; - d->mPageCombo = 0; - delete d->mPageComboBackgroundItem; - d->mPageComboBackgroundItem = 0; - //delete d->mGroupDescriptionItem; - //d->mGroupDescriptionItem = 0; - - QEvent polishEvent(QEvent::Polish); - QCoreApplication::sendEvent(this, &polishEvent); + (d->mIndex.data(HbDataFormModelItem::ItemTypeRole)).toInt()); + if( contentWidgetType == HbDataFormModelItem::GroupItem ) { + d->setExpanded(expanded); + } else if (contentWidgetType == HbDataFormModelItem::GroupPageItem) { + //We need to change even the combobox state also so call pageChanged fuction + if(modelItem) { + int page = d->pageIndex(d->mIndex); + if(page != -1) { + pageChanged(page); + } + } + } else if(contentWidgetType == HbDataFormModelItem::FormPageItem) { + if(modelItem) { + int formPageIndex = d->pageIndex(d->mIndex); + if( formPageIndex!= -1) { + HbDataFormPrivate::d_ptr( + static_cast(d->mSharedData->mItemView))->_q_page_changed(formPageIndex); } } } - container->setModelIndexes(d->mIndex.operator const QModelIndex & ()); - } - updatePrimitives(); - return true; + return true; + } else { + return false; + } } bool HbDataGroup::isExpanded() const @@ -319,11 +473,7 @@ HbDataFormModelItem::DataItemType contentWidgetType = static_cast( (d->mIndex.data(HbDataFormModelItem::ItemTypeRole)).toInt()); - if( contentWidgetType == HbDataFormModelItem::GroupItem ) { - if(d->mGroupHeading) { - return d->mGroupHeading->mExpanded; - } - } else if ( contentWidgetType == HbDataFormModelItem::GroupPageItem ) { + if( contentWidgetType < HbDataFormModelItem::SliderItem ) { HbAbstractItemContainer *container = qobject_cast( static_cast(d->mSharedData->mItemView->contentWidget())); if(container) { @@ -331,7 +481,6 @@ } } return false; - } void HbDataGroup::updateGroupPageName(int index , const QString &page) @@ -343,6 +492,7 @@ } } } + void HbDataGroup::updatePrimitives() { Q_D(HbDataGroup); @@ -371,42 +521,103 @@ } } +/*! + \reimp + */ +QVariant HbDataGroup::itemChange( GraphicsItemChange change, const QVariant &value ) +{ + switch ( static_cast( change ) ) { + case QGraphicsItem::ItemEnabledHasChanged: { + updatePrimitives( ); + //We are skipping call to abstractviewitem::itemChange here because updateChildItems is + //called in that function which will again create data group primitives. + return HbWidget::itemChange( change, value ); + } + default: + break; + } + return HbDataFormViewItem::itemChange( change, value ); +} void HbDataGroup::pageChanged(int index) { Q_D(HbDataGroup); - QStringListModel *model = (QStringListModel*)d->mPageCombo->model(); - QModelIndex changedIndex = model->index(index, 0); + + HbDataFormModelItem::DataItemType itemType = + static_cast( + (d->mIndex.data(HbDataFormModelItem::ItemTypeRole)).toInt()); + + if(!itemView()) { return; } - if(changedIndex.isValid()) { - // Get Previous Active Group Page - QModelIndex previousPageIndex = modelIndex().child(d->activePage(),0); - if(changedIndex.row() != d->activePage()) {// If the page is different - // Collapse previous group page - HbDataGroup* previousPage = static_cast(itemView()->itemByIndex(previousPageIndex)); - d->setActivePage(changedIndex.row()); - if(previousPage) { - previousPage->setExpanded(false); - } - // Expand current selected page set as active page - QModelIndex currentPageIndex = modelIndex().child(changedIndex.row(),0); - if(currentPageIndex.isValid()) { - HbDataGroup* currentPage = static_cast( - (itemView())->itemByIndex(currentPageIndex)); - if(currentPage) { - currentPage->setExpanded(true); - } - } - } else {//If selected page is same then expand it if it is not expanded already - HbDataGroup* currentPage = static_cast( - (itemView())->itemByIndex(previousPageIndex)); - if(currentPage && !currentPage->isExpanded()) { - currentPage->setExpanded(true); + + HbAbstractItemContainer *container = qobject_cast( + static_cast(d->mSharedData->mItemView->contentWidget())); + + // Get Previous Active Group Page + QModelIndex previousPageIndex; + QModelIndex currentPageIndex; + HbDataGroup* group = this; + // this function can get called for both group and grouppage + // active grouppage is always stored in group modelitem so get the next index and + // activepage according to group + + int previous_page = d->activePage(); + if(previous_page != -1) { + previousPageIndex = d->pageModelIndex(previous_page); + } + currentPageIndex = d->pageModelIndex(index); + + if(itemType == HbDataFormModelItem::GroupPageItem) { + // need to fetch group (parent) for getting previus page and active page + group = static_cast(itemView()->itemByIndex(modelIndex().parent())); + if(HbDataGroupPrivate::d_ptr(group)->mPageCombo) { + if(HbDataGroupPrivate::d_ptr(group)->mPageCombo->currentIndex() != index) { + + // combobox has to be changed explicitly here since the call happened on GroupPage item + QObject::disconnect(HbDataGroupPrivate::d_ptr(group)->mPageCombo,SIGNAL(currentIndexChanged(int)), + group ,SLOT(pageChanged(int))); + HbDataGroupPrivate::d_ptr(group)->mPageCombo->setCurrentIndex(index); + QObject::connect(d->mPageCombo,SIGNAL(currentIndexChanged(int)), + group ,SLOT(pageChanged(int))); } } } + + if(index != HbDataGroupPrivate::d_ptr(group)->activePage()) {// If the page is different + + // Collapse previous group page + if(previousPageIndex.isValid()) { + HbDataGroup* previousPage = static_cast(itemView()->itemByIndex(previousPageIndex)); + //HbDataGroupPrivate::d_ptr(group)->setActivePage(index); + + if(previousPage) { + HbDataGroupPrivate::d_ptr(previousPage)->setExpanded(false); + }else { + container->setItemTransientStateValue(previousPageIndex, "expanded", false); + } + } + + // Expand current selected page set as active page + if(currentPageIndex.isValid()) { + HbDataGroup* currentPage = static_cast( + (itemView())->itemByIndex(currentPageIndex)); + if(currentPage) { + HbDataGroupPrivate::d_ptr(currentPage)->setExpanded(true); + } else { + container->setItemTransientStateValue(currentPageIndex, "expanded", true); + } + } + } else {//If selected page is same then expand it if it is not expanded already + HbDataGroup* currentPage = static_cast( + (itemView())->itemByIndex(previousPageIndex)); + if(currentPage && !currentPage->isExpanded()) { + HbDataGroupPrivate::d_ptr(currentPage)->setExpanded(true); + } else { + container->setItemTransientStateValue(currentPageIndex, "expanded", true); + } + } } @@ -419,6 +630,17 @@ { Q_D(HbDataGroup); HB_SD(HbAbstractViewItem); + if( d->mIndex.isValid( ) ) { + d->mType = static_cast( + d->mIndex.data(HbDataFormModelItem::ItemTypeRole).toInt( ) ); + } + + if( d->mSharedData && d->mSharedData->mItemView ) { + d->mModel = static_cast( d->mSharedData->mItemView->model( ) ); + d->mModelItem = d->mModel->itemFromIndex( modelIndex( ) ); + } + HbAbstractItemContainer *container = qobject_cast( + static_cast(d->mSharedData->mItemView->contentWidget())); HbDataFormModelItem::DataItemType contentWidgetType = static_cast( @@ -444,7 +666,19 @@ if(!groupDescription.isEmpty()) { setDescription(groupDescription); } - + + //update visualization based on whether item is enabled or disabled + HbDataFormModel* data_model = static_cast( itemView( )->model( ) ); + HbDataFormModelItem *model_item = + static_cast( data_model->itemFromIndex( d->mIndex ) ); + d->setEnabled( model_item->isEnabled( ) ); + + if(container) { + if(container->itemTransientState(d->mIndex).value("expanded").toBool()) { + container->setItemTransientStateValue(d->mIndex, "expanded", false); + setExpanded(true); + } + } } else if( contentWidgetType == HbDataFormModelItem::GroupPageItem){ QModelIndex parentIndex = d->mIndex.parent(); @@ -461,7 +695,7 @@ formPageName); } - HbAbstractViewItem::updateChildItems(); + HbAbstractViewItem::updateChildItems(); } @@ -494,7 +728,7 @@ // TODO: remove this, temporary workaround to return size zero incase of no contentwidget QSizeF HbDataGroup::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const { - //TODO: remove this + //TODO: remove this QSizeF size; HbDataFormModelItem::DataItemType itemType = static_cast( @@ -521,3 +755,11 @@ Q_UNUSED(animate); } +void HbDataGroup::emitActivated(const QModelIndex &index )const +{ + HbDataForm *form = static_cast(itemView()); + if(form) { + HbDataFormPrivate::d_ptr(form)->emitActivated(index); + } +} + diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdatagroup_p.h --- a/src/hbwidgets/dataform/hbdatagroup_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdatagroup_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -57,6 +57,7 @@ virtual void updateChildItems( ); virtual bool canSetModelIndex( const QModelIndex &index ) const; void polish( HbStyleParameters& params ); + void emitActivated(const QModelIndex &index)const; public slots: void updatePrimitives( ); @@ -67,9 +68,12 @@ void initStyleOption( HbStyleOptionDataGroup *option ); virtual QSizeF sizeHint( Qt::SizeHint which, const QSizeF &constraint ) const; virtual void pressStateChanged( bool value, bool animate ); + virtual QVariant itemChange( GraphicsItemChange change, const QVariant &value ); private: Q_DECLARE_PRIVATE_D( d_ptr, HbDataGroup ) }; #endif // HBDATAGROUP_H + + diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdatagroup_p_p.h --- a/src/hbwidgets/dataform/hbdatagroup_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdatagroup_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -42,16 +42,19 @@ ~HbDataGroupPrivate( ); void init( ); - void expand( bool expanded ); + void changeExpansionState( bool expanded ); void setHeading( const QString &heading ); QString heading( ) const; - QString groupPage() const; + //QString groupPage() const; void setGroupPage(const QString &page); void removeGroupPage(const QString &page); int activePage(); - void setActivePage(int pageindex); + bool setExpanded( bool expanded ); + void setEnabled( bool enabled ); + int pageIndex(const QModelIndex &index) const ; + QModelIndex pageModelIndex(int index) const ; public: static HbDataGroupPrivate *d_ptr( HbDataGroup *item ) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdatagroupheadingwidget_p.cpp --- a/src/hbwidgets/dataform/hbdatagroupheadingwidget_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdatagroupheadingwidget_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,8 +26,10 @@ #include "hbdatagroupheadingwidget_p.h" #include "hbdataformviewitem_p.h" #include -#include +#include "hbdatagroup_p.h" +#include "hbdatagroup_p_p.h" #include +#include #include #ifdef HB_GESTURE_FW @@ -43,8 +45,10 @@ mDescriptionItem(0), mParent(0), mExpanded(false), - mDown(false) + mDown(false), + mLongPressed(false) { + #ifdef HB_GESTURE_FW grabGesture( Qt::TapGesture ); #endif @@ -58,7 +62,8 @@ } void HbDataGroupHeadingWidget::createPrimitives() -{ +{ + QObject::connect(mParent, SIGNAL(longPressed(const QPointF )), this, SLOT(longPressed(const QPointF ))); if(!mBackgroundItem) { mBackgroundItem = style()->createPrimitive(HbStyle::P_DataGroup_background, this); } @@ -177,19 +182,26 @@ void HbDataGroupHeadingWidget::gestureEvent(QGestureEvent *event) { Hb::InteractionModifiers modifiers = 0; - + if (event->gesture(Qt::TapGesture)) { + HbDataGroupPrivate::d_ptr(static_cast(mParent))->tapTriggered( event ); + } if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { switch(tap->state()) { case Qt::GestureStarted: { + if (scene()) + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); + mDown = true; + mLongPressed = false; HbStyleOptionDataGroupHeadingWidget settingGroupOption; initStyleOption(&settingGroupOption); if(mBackgroundItem) { - style()->updatePrimitive( - mBackgroundItem, HbStyle::P_DataGroup_background, &settingGroupOption); - } + style()->updatePrimitive( + mBackgroundItem, HbStyle::P_DataGroup_background, &settingGroupOption); + } modifiers = Hb::ModifierExpandedItem; HbWidgetFeedback::triggered(this, Hb::InstantPressed, modifiers); break; @@ -199,12 +211,13 @@ { modifiers = 0; - if(mDown && rect().contains(mapFromScene(event->mapToGraphicsScene(tap->position())))) { + if(mDown && !mLongPressed && rect().contains(mapFromScene(event->mapToGraphicsScene(tap->position())))) { static_cast(mParent)->setExpanded( !static_cast(mParent)->isExpanded()); modifiers |= Hb::ModifierExpandedItem; - mDown = false; } + mDown = false; + HbStyleOptionDataGroupHeadingWidget settingGroupOption; initStyleOption(&settingGroupOption); if(mBackgroundItem) { @@ -213,6 +226,10 @@ } HbWidgetFeedback::triggered(this, Hb::InstantReleased, modifiers); + + if (scene()) { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + } break; } case Qt::GestureCanceled: @@ -227,6 +244,10 @@ } HbWidgetFeedback::triggered(this, Hb::InstantReleased, modifiers); + + if (scene()) { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + } break; } @@ -235,5 +256,13 @@ break; } } + +} + + +void HbDataGroupHeadingWidget::longPressed(const QPointF &position) +{ + Q_UNUSED(position); + mLongPressed = true; } #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/dataform/hbdatagroupheadingwidget_p.h --- a/src/hbwidgets/dataform/hbdatagroupheadingwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/dataform/hbdatagroupheadingwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -51,6 +51,9 @@ enum { Type = HbPrivate::ItemType_DataGroupHeadingWidget }; int type() const { return Type; } +public slots: + void longPressed(const QPointF &position); + #ifndef HB_GESTURE_FW void mousePressEvent(QGraphicsSceneMouseEvent *event); void mouseReleaseEvent( QGraphicsSceneMouseEvent * event ); @@ -70,6 +73,7 @@ bool mDown; QString mHeading; QString mDescription; + bool mLongPressed; }; #endif // HBDATAGROUPHEADINGWIDGET_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/devicedialogs/hbdevicemessagebox.cpp --- a/src/hbwidgets/devicedialogs/hbdevicemessagebox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/devicedialogs/hbdevicemessagebox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,7 +24,6 @@ ****************************************************************************/ #include -#include #include #include "hbdevicemessagebox.h" #include "hbdevicemessagebox_p.h" @@ -42,6 +41,7 @@ TRACE_ENTRY for(int i = 0; i < NumActions; i++) { mDefaultActions[i] = 0; + mActions[i].mAction = 0; } TRACE_EXIT } @@ -80,12 +80,25 @@ TRACE_EXIT } +void HbDeviceMessageBoxPrivate::initAction(int index) +{ + if (!mActions[index].mAction) { + if (!mDefaultActions[index]) { + mDefaultActions[index] = new QAction(0); + } + mActions[index].mAction = mDefaultActions[index]; + connect(mActions[index].mAction, SIGNAL(changed()), SLOT(actionChanged())); + } +} + void HbDeviceMessageBoxPrivate::initProperties() { for(int i = 0; i < NumProperties; i++) { mProperties[i].mFlags = NoFlags; } - clearActions(); + for(int i = 0; i < NumActions; i++) { + clearAction(mActions[i]); + } QString text; q_ptr->setText(text); @@ -93,42 +106,73 @@ q_ptr->setIconVisible(true); q_ptr->setAnimationDefinition(text); + bool useActions[NumActions]; + for(int i = 0; i < NumActions; i++) { + useActions[i] = false; + } + switch(mProperties[Type].mValue.toInt()) { + case HbMessageBox::MessageTypeNone: + q_ptr->setIconVisible(false); + // Fall trough case HbMessageBox::MessageTypeInformation: case HbMessageBox::MessageTypeWarning: q_ptr->setDismissPolicy(HbPopup::TapAnywhere); q_ptr->setTimeout(timeoutValue(HbPopup::StandardTimeout)); - // Use default primary button, secondary button is empty - if (!mDefaultActions[AcceptButton]) { - mDefaultActions[AcceptButton] = new HbAction(0); - } - mActions[AcceptButton].mAction = mDefaultActions[AcceptButton]; + // HbMessageBox sets by default accept button to "Ok", reject button is empty + mProperties[StandardButtons].mValue.setValue(static_cast(HbMessageBox::Ok)); + useActions[AcceptButton] = true; break; case HbMessageBox::MessageTypeQuestion: q_ptr->setTimeout(HbPopup::NoTimeout); q_ptr->setDismissPolicy(HbPopup::NoDismiss); - // Use default primary and secondary buttons - for(int i = 0; i < NumActions; i++) { - if (!mDefaultActions[i]) { - mDefaultActions[i] = new HbAction(0); - } - mActions[i].mAction = mDefaultActions[i]; - } + // HbMessageBox sets by default accept button to "Ok", reject button is empty. + // Set default buttons to yes/no + setProperty(StandardButtons, HbMessageBox::Yes|HbMessageBox::No); + useActions[AcceptButton] = true; + useActions[RejectButton] = true; break; default: Q_ASSERT(false); } + + for(int i = 0; i < NumActions; i++) { + if (useActions[i]) { + initAction(i); + } + } } void HbDeviceMessageBoxPrivate::setAction(ActionSelector select, QAction *action) { TRACE_ENTRY Action &dialogAction = mActions[select]; + bool saveTriggered = dialogAction.mTriggered; + clearAction(dialogAction); + dialogAction.mTriggered = saveTriggered; dialogAction.mFlags = Modified; dialogAction.mAction = action; + if (dialogAction.mAction) { + connect(dialogAction.mAction, SIGNAL(changed()), SLOT(actionChanged())); + } TRACE_EXIT } +void HbDeviceMessageBoxPrivate::setStandardButtons(HbMessageBox::StandardButtons buttons) +{ + // Create actions for buttons. These will be signaled on button press. + int buttonCount = qMin(static_cast(NumActions), countBits(buttons)); + int i = 0; + for(; i < buttonCount; i++) { + initAction(i); + } + // Clear extra actions + for(; i < NumActions; i++) { + clearAction(mActions[i]); + } + setProperty(StandardButtons, buttons); +} + // Send properties to server void HbDeviceMessageBoxPrivate::sendToServer(bool show) { @@ -152,6 +196,7 @@ static const char * const propertyNames[] = { "type", + "standardButtons", "text", "iconName", "iconVisible", @@ -216,14 +261,16 @@ return false; } -// Clear actions -void HbDeviceMessageBoxPrivate::clearActions() +// Clear action +void HbDeviceMessageBoxPrivate::clearAction(Action &action) { - for(int i = 0; i < NumActions; i++) { - mActions[i].mAction = 0; - mActions[i].mFlags = NoFlags; - mActions[i].mTriggered = false; + if (action.mAction) { + disconnect(action.mAction, SIGNAL(changed()), this, SLOT(actionChanged())); } + action.mAction = 0; + action.mFlags = NoFlags; + action.mTriggered = false; + } void HbDeviceMessageBoxPrivate::close() @@ -264,6 +311,18 @@ TRACE_EXIT } +void HbDeviceMessageBoxPrivate::actionChanged() +{ + QObject *action = sender(); + for(int i = 0; i < NumActions; i++) { + if (mActions[i].mAction == action) { + mActions[i].mFlags = Modified; + scheduleUpdateEvent(); + break; + } + } +} + void HbDeviceMessageBoxPrivate::setProperty(PropertySelector propertySelector, int value) { Property &property = mProperties[propertySelector]; @@ -317,6 +376,16 @@ return timeoutValues[timeout].value; } +int HbDeviceMessageBoxPrivate::countBits(unsigned int value) +{ + int count = 0; + while(value) { + count += value & 1; + value >>= 1; + } + return count; +} + HbDeviceMessageBoxPrivate::ActionSelector HbDeviceMessageBoxPrivate::actionSelector( HbDeviceMessageBox::ActionRole role) { @@ -338,27 +407,53 @@ @stable @hbwidgets \class HbDeviceMessageBox - \brief HbDeviceMessageBox displays a message to the user, on top of any running applications, which the user must acknowledge to dismiss. + \brief HbDeviceMessageBox displays a message box on top of any running applications. - HbDeviceMessageBox is a device dialog version of HbMessageBox. It displays a message box with text, icon or animation and optional reply button(s). - It differs from HbMessageBox by excluding functions which handle concrete UI-component related information. + HbDeviceMessageBox is a device dialog version of HbMessageBox. It displays a message box + with text, icon or animation and optional accept and reject buttons. It is not a widget. + The message box is displayed by a device dialog service which HbDeviceMessageBox is a + client of. Device dialogs are shown on top of any running applications and are always modal by nature. - A device message box is launched when exec() is called for an synchronous dialog or show() is called for an asynchronous - dialog. The launched dialog can be updated by the setter metods. Because updating a dialog - requires interprocess communication, it is advisable to fully construct the device message box before - calling show(). The device message box is closed when the user dismisses it by pressing a button, when - the client calls close(), or when the dialog timeout expires. If the system must close the device message - box while it is executing, it will have the same effect as having the message box's secondary action + A device message box is lauched by a show(). A new message box is lauched every time show() + is called. aboutToClose() signal is emitted when the box has closed. There is also syncronous + exec() function which launches a message box and waits for it close. exec() is not compatible + with gestures and cannot be used from applications that have an user interface. + + After message box has been launched, updating it's properties causes interprocess + communication. Therefore it's best to construct the message box fully before + calling show(). Changing a property while a message box is displayed, causes the property + to be updated to the displayed widget automatically next time event loop is entered + or updated values can be sent immediately by calling update(). + + Message box buttons are represented by two actions. Left button corrensponds to accept + action and the right one to reject action. triggered() signal of action is emitted when + corresponding button is pressed. Changing action text changes corresponding button text. + Icons on buttons are not suppported. - Static convenience functions are provided for launching message boxes. - Dialogs created by them contain default property values appropriate for - the message box type and their contents cannot be updated. Information and - warning convenience methods return immediately. Question waits for a message box - to close. + Device message box is closed when user dismisses it, when HbDeviceMessageBox::close() is + called, timeout expires and message box closes itself or system closes the message box for + some reason. aboutToClose() signal is always emitted after the box has closed. + + Static convenience functions are provided for launching message boxes. They launch message boxes + containing default properties appropriate for the message box type and their contents cannot + be updated. Information and warning convenience methods return immediately. Question waits for + a message box to close and is not compatible with gestures. - Supported icon animation formats are following: + Four types of message boxes are predefined. The type determines a set of default properties that + are set on construction. Below is a table listing types and their default properties. + + + + + + + + +
    HbDeviceMessageBox types and default properties
    TypeIconButtonsTimeoutDismiss policySound
    NoneNo icon"Ok" buttonStandard timeoutTap anywhereNo sound
    InformationInfo icon"Ok" buttonStandard timeoutTap anywhereInfo sound
    WarningWarning icon"Ok" buttonStandard timeoutTap anywhereWarn sound
    QuestionQuestion icon"Yes" and "No" buttonsNo timeoutButton pressQuestion sound
    + + In place of an icon, message box may conatain an animation. Supported icon animation formats are: - GIF (.gif) - MNG (.mng) - Frame animations (.axml) @@ -375,7 +470,7 @@ } \endcode - Alter the appearance of the message box with the methods provided by the class. + Modify appearance of a message box with the methods provided by the class. \code // Code below modifies the default properties of the message box. @@ -385,11 +480,19 @@ QString fileName("note_warning"); messageBox.setIconName(fileName); + // Change button text + messageBox.action(HbDeviceMessageBox::AcceptButtonRole)->setText("Ok"); + messageBox.action(HbDeviceMessageBox::RejectButtonRole)->setText("Cancel"); + + // Set new actions (buttons) QAction acceptAction("Ok", 0); messageBox.setAction(&acceptAction, HbDeviceMessageBox::AcceptButtonRole); QAction rejectAction("Cancel", 0); messageBox.setAction(&rejectAction, HbDeviceMessageBox::RejectButtonRole); + // Set standard buttons + messageBox.setStandardButtons(HbMessageBox::Ok|HbMessageBox::Cancel); + // Beware, application may exit during exec(). // Beware, exec() is not compatible with gestures. QAction *result = messageBox.exec(); @@ -430,8 +533,8 @@ /*! \fn void HbDeviceMessageBox::aboutToClose(); - This signal is emitted when the device message box is about to be closed i.e. - when the question type of message is replied to by the user. + This signal is emitted when the message box has closed. If a button was pressed, + corresponding action's triggered() signal is emitted before this signal. */ /*! @@ -440,7 +543,7 @@ */ /*! \var HbDeviceMessageBox::ActionRole HbDeviceMessageBox::InvalidRole - No action. + No role. */ /*! \var HbDeviceMessageBox::ActionRole HbDeviceMessageBox::AcceptButtonRole @@ -468,7 +571,7 @@ /*! Constructor. - \param text Text can be set in the constructor. + \param text Message box text. \param type Type of the message box. \param parent An optional parameter. */ @@ -494,7 +597,12 @@ } /*! - Executes the dialog asynchronously. + Shows a message box and returns immediately without waiting for it to close. Closing of the + message box is indicated by aboutToClose() signal. Button presses are indicated by + QAction::triggered() signals. The message box can be updated while showing by property + setters. + + \sa update(), aboutToClose() */ void HbDeviceMessageBox::show() { @@ -504,10 +612,10 @@ } /*! - Updates changed properties of a launched message box to device dialog service using - interprocess communication. Has no effect if show() has not been called or dialog has - closed already. Calling show() is optional as updating any property schedules an event - and the dialog is updated next time Qt event loop executes. + Updates changed properties to a showing message box via interprocess communication. + Has no effect if show() has not been called or the message box has closed already. + Calling update() is optional as setting any property schedules an event and the + showing message box is updated next time Qt event loop executes. \sa show() */ @@ -517,7 +625,7 @@ } /*! - Closes the dialog if the dialog is shown asynchronously. + Closes a message box shown asynchronously. */ void HbDeviceMessageBox::close() { @@ -529,10 +637,10 @@ /*! Executes the dialog synchronously. - Returns a pointer to the action that was activated by the user, i.e. dialog's - accept or reject action. Return 0 if object was deleted during a call. + Returns a pointer to an action corresponding to a button pressed. Returns 0 if no button + was pressed (the dialog closed for other reason). - This functions starts a new event loop. Consider following caveats before using it + This functions starts a new event loop. Consider following caveats before using it. Stack usage increases. Depending on application program flow, several event loops may get instantiated on top of each other. Application event processing continues while exec() executes. When it returns application state may have changed. For example some @@ -589,7 +697,8 @@ /*! Sets message box type. All message box properties are reset to a default values for the type. - A show() must be called to launch a message box after setMessageBoxType() has been called. + Type of a showing message box cannot be changed on the fly. show() must be called to launch + a new message box after setMessageBoxType() has been called. \param type Message box type. @@ -618,9 +727,39 @@ } /*! + Sets message box buttons to standard buttons. + + \param buttons Message box buttons. A combination of flags, + eg. HbMessageBox::Yes | HbMessageBox::No. Button flags are scanned starting from lsb. + First button found goes to accept position and so forth. + + \sa standardButtons() +*/ +void HbDeviceMessageBox::setStandardButtons(HbMessageBox::StandardButtons buttons) +{ + TRACE_ENTRY + d_ptr->setStandardButtons(buttons); + d_ptr->scheduleUpdateEvent(); + TRACE_EXIT +} + +/*! + Returns standard buttons set to a message box. A default value for question message box is + HbMessageBox::Yes|HbMessageBox::No. For all other message box types the default is + HbMessageBox::Ok. + + \sa setStandardButtons() +*/ +HbMessageBox::StandardButtons HbDeviceMessageBox::standardButtons() const +{ + return static_cast + (d_ptr->mProperties[HbDeviceMessageBoxPrivate::StandardButtons].mValue.toInt()); +} + +/*! Convenience method for showing question message box and waiting for it to close. - This functions starts a new event loop. Consider following caveats before using it + This functions starts a new event loop. Consider following caveats before using it. Stack usage increases. Depending on application program flow, several event loops may get instantiated on top of each other. Application event processing continues while question() executes. When it returns application state may have changed. For example some @@ -630,11 +769,11 @@ has an user interface, please don't use this function. Instead connect to signals and use asynchronous show(). - \param text - text shown in message box. - \param acceptButtonText Accept button text. If string is null, a default button is used. - \param rejectButtonText Reject button text. If string is null, a default button is used. + \param text Message box text. + \param acceptButtonText Accept button text. If string is null, a default (Yes) button is used. + \param rejectButtonText Reject button text. If string is null, a default (No) button is used. - Returns true if user triggered accept action, otherwise false. + Returns true if user pressed accept button, otherwise false. \sa show() */ @@ -646,12 +785,12 @@ TRACE_STATIC_ENTRY HbDeviceMessageBox messageBox(HbMessageBox::MessageTypeQuestion); messageBox.setText(text); - + messageBox.setStandardButtons(HbMessageBox::Yes|HbMessageBox::No); if (!acceptButtonText.isNull()) { - messageBox.setAction(new QAction(acceptButtonText, &messageBox), AcceptButtonRole); + messageBox.action(AcceptButtonRole)->setText(acceptButtonText); } if (!rejectButtonText.isNull()) { - messageBox.setAction(new QAction(rejectButtonText, &messageBox), RejectButtonRole); + messageBox.action(RejectButtonRole)->setText(rejectButtonText); } messageBox.exec(); TRACE_EXIT @@ -660,10 +799,42 @@ } /*! + Convenience method for showing question message box and waiting for it to close. + + This functions starts a new event loop. Consider following caveats before using it. + Stack usage increases. Depending on application program flow, several event + loops may get instantiated on top of each other. Application event processing continues while + question() executes. When it returns application state may have changed. For example some + objects may have been deleted or application may have exited. + + Note that starting an event loop isn't compatible with gestures. Therefore if an application + has an user interface, please don't use this function. Instead connect to signals and use + asynchronous show(). + + \param text Message box text. + \param buttons Specifies message box buttons. See setStandardButtons() for format. + + Returns true if user pressed accept button, otherwise false. + + \sa show() +*/ +bool HbDeviceMessageBox::question(const QString &text, HbMessageBox::StandardButtons buttons) +{ + TRACE_STATIC_ENTRY + HbDeviceMessageBox messageBox(HbMessageBox::MessageTypeQuestion); + messageBox.setText(text); + messageBox.setStandardButtons(buttons); + messageBox.exec(); + TRACE_EXIT + // Return true if accept action was triggered + return messageBox.isAcceptAction(messageBox.triggeredAction()); +} + +/*! Convenience method for showing information message box. Launches a message box and returns immediately. - \param text - text shown in message box. + \param text Message box text. */ void HbDeviceMessageBox::information(const QString &text) { @@ -676,7 +847,7 @@ Convenience method for showing warning message box. Launches a message box and returns immediately. - \param text - text shown in message box. + \param text Message box text. */ void HbDeviceMessageBox::warning(const QString &text) { @@ -702,7 +873,7 @@ } /*! - Sets an action into the device message box. Action role is either an + Sets an action into device message box. Action role is either an accept (left button in left-to-right layout) or reject (right button). Action can be null which removes corresponding button from the message box. Only text of the action is shown in the message box button. Icon @@ -710,11 +881,11 @@ the action. HbDeviceMessageBox constructor sets a default accept and reject actions into - question message box. Information and warning message boxes have only accept - action by default. Default actions are owned and deleted by the message box. + question message box. Other message boxes have only accept action by default. + Default actions are owned and deleted by the message box. \param action Action or null. Ownership does not transfer. - \param role Selects an action to set. + \param role Selects an action. \sa action() */ @@ -731,11 +902,11 @@ } /*! - Sets text of the message dialog. + Sets message box text. Supported text formats are the same as HbMessageBox::setText(). - \param text Message text. + \param text Message box text. - \sa text() + \sa text(), HbMessageBox::setText() */ void HbDeviceMessageBox::setText(const QString &text) { @@ -745,7 +916,7 @@ } /*! - Returns text of the dialog. + Returns message box text. \sa setText() */ @@ -804,10 +975,9 @@ } /*! - Sets the timeout property in milliseconds. - If timeout <= 0 then the note is permanent and not closed automatically. + Sets message box timeout. - \param timeout Timeout in milliseconds. + \param timeout Timeout in milliseconds. 0 denotes no timeout (infinite). \sa timeout() setTimeout(HbPopup::DefaultTimeout) */ @@ -819,8 +989,8 @@ } /*! - This is a convenience overload of \a timeout() for setting HbPopup::DefaultTimeout values - to achive common look & feel. + Sets timeout to one of HbPopup::DefaultTimeout values. Helps achieving + common look and feel of message boxes. \param timeout Timeout as an enumerated constant. @@ -834,9 +1004,9 @@ } /*! - Returns the timeout property in milliseconds. - If this property is not set the default is HbPopup::StandardTimeout except for - HbMessageBox::MessageTypeQuestion type of message box for which default is HbPopup::NoTimeout. + Returns message box timeout in milliseconds. Default value depends on message box type. + Question message box has a default of HbPopup::NoTimeout. All other boxes, the default is + HbPopup::StandardTimeout. \sa setTimeout() */ @@ -846,9 +1016,9 @@ } /*! - Sets the dismiss policy for the dialog. + Sets message box dismiss policy. - \param dismissPolicy Dismiss policy of the message box. + \param dismissPolicy Dismiss policy. \sa dismissPolicy() */ @@ -860,9 +1030,8 @@ } /*! - Returns the dismiss policy of the dialog. - Default is HbPopup::TapAnywhere except for HbMessageBox::MessageTypeQuestion type of - message box for which default is HbPopup::NoDismiss. + Returns dismiss policy of a message box. Default depends on message box type. + Question box has default HbPopup::NoDismiss and all other boxes HbPopup::TapAnywhere. \sa setDismissPolicy() */ @@ -873,7 +1042,7 @@ } /*! - Sets animation definition to a dialog. Animation's logical name has to be set + Sets animation a message box. Animation's logical name has to be set using setIcon(). Animation definition files must be stored to a place where they can be accessed by device dialog service. diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/devicedialogs/hbdevicemessagebox.h --- a/src/hbwidgets/devicedialogs/hbdevicemessagebox.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/devicedialogs/hbdevicemessagebox.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,6 @@ #include class HbDeviceMessageBoxPrivate; -class HbAction; class QAction; class HB_WIDGETS_EXPORT HbDeviceMessageBox : public QObject @@ -39,6 +38,7 @@ Q_OBJECT Q_PROPERTY(HbMessageBox::MessageBoxType messageBoxType READ messageBoxType WRITE setMessageBoxType) + Q_PROPERTY(HbMessageBox::StandardButtons standardButtons READ standardButtons WRITE setStandardButtons) Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(QString iconName READ iconName WRITE setIconName) Q_PROPERTY(bool iconVisible READ iconVisible WRITE setIconVisible) @@ -54,18 +54,19 @@ public: explicit HbDeviceMessageBox( - HbMessageBox::MessageBoxType type = HbMessageBox::MessageTypeInformation, + HbMessageBox::MessageBoxType type = HbMessageBox::MessageTypeNone, QObject *parent = 0); explicit HbDeviceMessageBox(const QString &text, - HbMessageBox::MessageBoxType type = HbMessageBox::MessageTypeInformation, + HbMessageBox::MessageBoxType type = HbMessageBox::MessageTypeNone, QObject *parent=0); virtual ~HbDeviceMessageBox(); static bool question( const QString &text, - const QString &acceptButtonText = QString(), - const QString &rejectButtonText = QString()); - + const QString &acceptButtonText, + const QString &rejectButtonText); + static bool question(const QString &text, HbMessageBox::StandardButtons buttons = + HbMessageBox::Yes|HbMessageBox::No); static void information(const QString &text); static void warning(const QString &text); @@ -79,6 +80,9 @@ void setMessageBoxType(HbMessageBox::MessageBoxType type); HbMessageBox::MessageBoxType messageBoxType() const; + void setStandardButtons(HbMessageBox::StandardButtons buttons); + HbMessageBox::StandardButtons standardButtons() const; + void setText(const QString &text); QString text() const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/devicedialogs/hbdevicemessagebox_p.h --- a/src/hbwidgets/devicedialogs/hbdevicemessagebox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/devicedialogs/hbdevicemessagebox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -38,6 +38,7 @@ enum PropertySelector { Type, + StandardButtons, Text, IconName, IconVisible, @@ -77,15 +78,18 @@ void exec(); void init(); + void initAction(int index); void initProperties(); void setAction(ActionSelector select, QAction *action); + void setStandardButtons(HbMessageBox::StandardButtons buttons); void sendToServer(bool show = false); bool propertiesModified() const; - void clearActions(); + void clearAction(Action &action); void setProperty(PropertySelector propertySelector, int value); void setProperty(PropertySelector propertySelector, const QString &value); static int timeoutValue(HbPopup::DefaultTimeout timeout); + static int countBits(unsigned int value); static ActionSelector actionSelector(HbDeviceMessageBox::ActionRole role); void scheduleUpdateEvent(); @@ -93,6 +97,7 @@ public slots: void triggerAction(QVariantMap data); + void actionChanged(); public: // data HbDeviceMessageBox *q_ptr; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/devicedialogs/hbdevicemessageboxsymbian.cpp --- a/src/hbwidgets/devicedialogs/hbdevicemessageboxsymbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/devicedialogs/hbdevicemessageboxsymbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -80,6 +80,7 @@ EType = EFirstIntProperty, EIconVisible, ETimeout, + EStandardButtons, EDismissPolicy, ELastIntProperty = EDismissPolicy, EFirstStringProperty, @@ -100,12 +101,14 @@ void SetPropertyValue(TPropertyId aId, TInt aValue); void SetButtonNull(CHbDeviceMessageBoxSymbian::TButtonId aButtonId, bool aValue); void SetButtonTextL(CHbDeviceMessageBoxSymbian::TButtonId aButtonId, const TDesC &aValue); + void SetStandardButtons(TUint aButtons); void SendToServerL(bool aShow = false); void Close(); bool WaitForClosed(); static const TPtrC PropertyName(TPropertyId aId); static TPropertyId ButtonPropertyId(TPropertyId aId, CHbDeviceMessageBoxSymbian::TButtonId aButtonId); static HBufC *CreateActionDataLC(TBool aNull, const TDesC &text); + static TInt CountBits(TUint aValue); public: // MHbDeviceDialogObserver void DataReceived(CHbSymbianVariantMap& aData); @@ -250,12 +253,21 @@ mProperties[EIconVisible].Set(ETrue); switch(aType) { + case CHbDeviceMessageBoxSymbian::ENone: + mProperties[EIconVisible].Set(EFalse); + // Fall through case CHbDeviceMessageBoxSymbian::EInformation: case CHbDeviceMessageBoxSymbian::EWarning: { const TInt KStandardTimeout = 3000; // 3s mProperties[ETimeout].Set(KStandardTimeout); const TInt KTapAnywhere = 0x03; // HbPopup::TapAnywhere mProperties[EDismissPolicy].Set(KTapAnywhere); + // Initialize standard buttons but do not send to server as + // HbMessageBox sets standard buttons by default + const TInt KStandardButtons = 0x00000400; // Ok + mProperties[EStandardButtons].Set(KStandardButtons); + mProperties[EStandardButtons].SetModified(false); + mProperties[EStandardButtons].SetValid(false); // Plugin has accept button by default mProperties[ERejectText].SetNullAction(true); @@ -266,6 +278,10 @@ mProperties[ETimeout].Set(KNoTimeout); const TInt KNoDismiss = 0; // HbPopup::NoDismiss mProperties[EDismissPolicy].Set(KNoDismiss); + // Initialize standard buttons and send to server as + // HbMessageBox currently sets standard buttons to "Ok" by default + const TInt KStandardButtons = 0x00002000|0x00010000; // Yes|No + mProperties[EStandardButtons].Set(KStandardButtons); break; } default: @@ -314,6 +330,35 @@ mProperties[id].SetL(aValue); } +// Set standard buttons property +void CHbDeviceMessageBoxPrivate::SetStandardButtons(TUint aButtons) +{ + static const CHbDeviceMessageBoxSymbian::TButtonId buttonIds[] = { + CHbDeviceMessageBoxSymbian::EAcceptButton, CHbDeviceMessageBoxSymbian::ERejectButton + }; + const TInt KNumButtonIds = sizeof(buttonIds) / sizeof(buttonIds[0]); + TInt buttonCount = Min(KNumButtonIds, CountBits(aButtons)); + // Mark buttons present + TInt i = 0; + for(; i < buttonCount; i++) { + TPropertyId id = ButtonPropertyId(EAcceptText, buttonIds[i]); + // Set property value but don't send to server + mProperties[id].SetNullAction(false); + mProperties[id].SetValid(false); + mProperties[id].SetModified(false); + } + // Mark extra buttons not present + for(; i < KNumButtonIds; i++) { + TPropertyId id = ButtonPropertyId(EAcceptText, buttonIds[i]); + // Set property value but don't send to server + mProperties[id].SetNullAction(true); + mProperties[id].SetValid(false); + mProperties[id].SetModified(false); + } + SetPropertyValue(EStandardButtons, aButtons); + +} + // Send properties to server. Show or update. void CHbDeviceMessageBoxPrivate::SendToServerL(bool aShow) { @@ -361,11 +406,15 @@ if (aShow) { mReceivedButton = CHbDeviceMessageBoxSymbian::EInvalidButton; error = mDeviceDialog->Show(KDeviceDialogType, *parameters, this); - User::LeaveIfError(error); + if (error != KErrNone) { + User::Leave(error); // error can be positive or negative + } mShowCalled = true; } else { error = mDeviceDialog->Update(*parameters); - User::LeaveIfError(error); + if (error != KErrNone) { + User::Leave(error); // error can be positive or negative + } } CleanupStack::PopAndDestroy(); // parameters } @@ -396,6 +445,7 @@ L"type", L"iconVisible", L"timeout", + L"standardButtons", L"dismissPolicy", L"text", L"iconName", @@ -440,6 +490,17 @@ return actionData; } +// Count number of bits on +TInt CHbDeviceMessageBoxPrivate::CountBits(TUint aValue) +{ + TInt count = 0; + while(aValue) { + count += aValue & 1; + aValue >>= 1; + } + return count; +} + // Observer, data received from device message box void CHbDeviceMessageBoxPrivate::DataReceived(CHbSymbianVariantMap& aData) { @@ -516,8 +577,9 @@ change, e.g. objects may get deleted. Preferred way is to use asynchoronous ShowL() instead. Device message box is closed when user dismisses it, when Close() - is called, timeout triggers or system closes the dialog. Default return value is a reject - button. The default is returned in all other cases than user pressing an accept button. + is called, timeout triggers or system closes the dialog. Default return value is + CHbDeviceMessageBoxSymbian::EInvalidButton. The default is returned in all other cases + than user pressing an accept or reject button. Static convenience functions are provided for ease of use. Message boxes created by these static functions contain a default set of properties depending on the message box type and their @@ -555,7 +617,7 @@ _LIT(KText, "Accept connection ?"); CHbDeviceMessageBoxSymbian::TButtonId selection = - CHbDeviceMessageBoxSymbian::QuestionL(KText, KNullDesC, KNullDesC); + CHbDeviceMessageBoxSymbian::QuestionL(KText); if (selection == CHbDeviceMessageBoxSymbian::EAcceptButton) { // user pressed yes } @@ -614,6 +676,10 @@ Predefined device message boxes. */ /*! + \var CHbDeviceMessageBoxSymbian::TType CHbDeviceMessageBoxSymbian::ENone + Message box with no icon and audio defined by default. +*/ +/*! \var CHbDeviceMessageBoxSymbian::TType CHbDeviceMessageBoxSymbian::EInformation Information message box. */ @@ -631,6 +697,10 @@ Selects message box button. */ /*! + \var CHbDeviceMessageBoxSymbian::TButtonId CHbDeviceMessageBoxSymbian::EInvalidButton + No button. +*/ +/*! \var CHbDeviceMessageBoxSymbian::TButtonId CHbDeviceMessageBoxSymbian::EAcceptButton Accept button. */ @@ -700,10 +770,9 @@ Beware that Symbian event processing is running while the function executes. For example application may have exited when the function returns. - \param aText Message box text. - \param aAcceptButtonText Accept button text. If text is empty, default text is used. - \param aRejectButtonText Reject button text. If text is empty, default text is used. + \param aAcceptButtonText Accept button text. If text is empty, a default (Yes) button is used. + \param aRejectButtonText Reject button text. If text is empty, a default (No) button is used. */ EXPORT_C CHbDeviceMessageBoxSymbian::TButtonId CHbDeviceMessageBoxSymbian::QuestionL( const TDesC& aText, const TDesC& aAcceptButtonText, const TDesC& aRejectButtonText) @@ -711,6 +780,7 @@ CHbDeviceMessageBoxSymbian* messageBox = NewL(EQuestion); CleanupStack::PushL(messageBox); messageBox->SetTextL(aText); + messageBox->SetStandardButtons(0x00002000|0x00010000); // Yes|No if (aAcceptButtonText.Length()) { messageBox->SetButtonTextL(EAcceptButton, aAcceptButtonText); } @@ -723,6 +793,33 @@ } /*! + Static convenience function to create and show a question device message box. Waits for + the message box to close and returns button selected. If message box was closed for other + reason than button press, returns EInvalidButton. + + Beware that Symbian event processing is running while the function executes. For example + application may have exited when the function returns. + + \param aText Message box text. + \param aStandardButtons Specifies message box buttons. If 0, default buttons "Yes" and "No" are + used. See SetStandardButtons() for format. +*/ +EXPORT_C CHbDeviceMessageBoxSymbian::TButtonId CHbDeviceMessageBoxSymbian::QuestionL( + const TDesC& aText, TUint aStandardButtons) +{ + CHbDeviceMessageBoxSymbian* messageBox = NewL(EQuestion); + CleanupStack::PushL(messageBox); + messageBox->SetTextL(aText); + if (!aStandardButtons) { + aStandardButtons = 0x00002000|0x00010000; // Yes|No + } + messageBox->SetStandardButtons(aStandardButtons); + TButtonId buttonId = messageBox->ExecL(); + CleanupStack::PopAndDestroy(); // messageBox + return buttonId; +} + +/*! Static convenience function to create and show an information device message box. \param aText Message box text. @@ -1038,6 +1135,32 @@ } /*! + Sets message box buttons to standard buttons. + + \param aButtons Message box buttons. A combination of flags, + eg. HbMessageBox::Yes | HbMessageBox::No. Button flags are scanned starting from lsb. + First button found goes to accept position and so forth. + + \sa StandardButtons() +*/ +EXPORT_C void CHbDeviceMessageBoxSymbian::SetStandardButtons(TUint aButtons) +{ + return d->SetStandardButtons(aButtons); +} + +/*! + Returns standard buttons set to a message box. A default value for question message box is + HbMessageBox::Yes|HbMessageBox::No. For all other message box types the default is + HbMessageBox::Ok. + + \sa SetStandardButtons() +*/ +EXPORT_C TUint CHbDeviceMessageBoxSymbian::StandardButtons() const +{ + return d->mProperties[CHbDeviceMessageBoxPrivate::EStandardButtons].IntValue(); +} + +/*! Sets message box observer. The observer is called when message box closes. \param aObserver Pointer to observer or null. diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/devicedialogs/hbdevicemessageboxsymbian.h --- a/src/hbwidgets/devicedialogs/hbdevicemessageboxsymbian.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/devicedialogs/hbdevicemessageboxsymbian.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,6 +37,7 @@ { public: enum TType { + ENone, EInformation, EQuestion, EWarning @@ -50,12 +51,13 @@ public: - IMPORT_C static CHbDeviceMessageBoxSymbian* NewL(TType aType = EInformation, + IMPORT_C static CHbDeviceMessageBoxSymbian* NewL(TType aType = ENone, MHbDeviceMessageBoxObserver *aObserver = 0); IMPORT_C ~CHbDeviceMessageBoxSymbian(); IMPORT_C static TButtonId QuestionL(const TDesC& aText, const TDesC& aAcceptButtonText, const TDesC& aRejectButtonText); + IMPORT_C static TButtonId QuestionL(const TDesC& aText, TUint aStandardButtons = 0); IMPORT_C static void InformationL(const TDesC& aText); IMPORT_C static void WarningL(const TDesC& aText); @@ -76,8 +78,8 @@ IMPORT_C void SetAnimationDefinitionL(const TDesC& aAnimationDefinition); IMPORT_C TPtrC AnimationDefinition() const; - void SetIconVisible(TBool aVisible); - TBool IconVisible() const; + IMPORT_C void SetIconVisible(TBool aVisible); + IMPORT_C TBool IconVisible() const; IMPORT_C void SetTimeout(TInt aTimeout); IMPORT_C TInt Timeout() const; @@ -91,6 +93,9 @@ IMPORT_C void SetButton(TButtonId aButton, TBool aEnable); IMPORT_C TBool HasButton(TButtonId aButton) const; + IMPORT_C void SetStandardButtons(TUint aButtons); + IMPORT_C TUint StandardButtons() const; + IMPORT_C void SetObserver(MHbDeviceMessageBoxObserver *aObserver); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/devicedialogs/hbdevicenotificationdialogsymbian.cpp --- a/src/hbwidgets/devicedialogs/hbdevicenotificationdialogsymbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/devicedialogs/hbdevicenotificationdialogsymbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -97,7 +97,10 @@ AddVariantL(KKeyTouchActivation, &iEnable, CHbSymbianVariant::EBool); AddVariantL(KKeyTimeOut, &iTimeout, CHbSymbianVariant::EInt); AddVariantL(KKeyTitleTextWrapping, &iWrap, CHbSymbianVariant::EInt); - User::LeaveIfError(iDeviceDialog->Show(KPluginIdentifier, *iVariantMap, this)); + TInt error = iDeviceDialog->Show(KPluginIdentifier, *iVariantMap, this); + if (error != KErrNone) { + User::Leave(error); // error can be positive or negative + } } void CHbDeviceNotificationDialogSymbianPrivate::UpdateL() @@ -105,7 +108,10 @@ AddVariantL(KKeyTouchActivation, &iEnable, CHbSymbianVariant::EBool); AddVariantL(KKeyTimeOut, &iTimeout, CHbSymbianVariant::EInt); AddVariantL(KKeyTitleTextWrapping, &iWrap, CHbSymbianVariant::EInt); - User::LeaveIfError(iDeviceDialog->Update(*iVariantMap)); + TInt error = iDeviceDialog->Update(*iVariantMap); + if (error != KErrNone) { + User::Leave(error); // error can be positive or negative + } } void CHbDeviceNotificationDialogSymbianPrivate::Close() @@ -196,6 +202,10 @@ same rules as for the HbDeviceNotificationDialog apply. Dialog is shown when show() is called. It is recommended that the dialog data is initialized before calling ShowL() or UpdateL() methods, because those methods use interprocess communication. + Two timeout constants are provided for setting the dialog timeout: KHbShortNotificationDialogTimeout and + KHbLongNotificationDialogTimeout. The first is equivalent to HbPopup::ConfirmationNoteTimeout and the latter + is equivalent to HbPopup::StandardTimeout. + \code Following code snippet creates a device notification dialog containing title, text and icon. @@ -234,11 +244,42 @@ _LIT(KDialogTitle, "Dialog title"); _LIT(KDialogIcon, "note_info.svg"); - iDialog = CHbDeviceNotificationDialogSymbian::NewL(this); - iDialog->SetTextL(KDialogText); - iDialog->SetTitleL(KDialogTitle); - iDialog->SetIconNameL(KDialogIcon); - iDialog->ShowL(); + class DialogObserver : public MHbDeviceNotificationDialogObserver + { + public: + DialogObserver() {} + ~DialogObserver() { delete iDialog; } + void ShowDialog(); + ... + private: + virtual void NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog); + virtual void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog, TInt aCompletionCode); + private: + CHbDeviceNotificationDialogSymbian* iDialog; + }; + + void DialogObserver::NotificationDialogActivated(const CHbDeviceNotificationDialogSymbian* aDialog) + { + CEikonEnv::Static()->InfoMsg(_L("Device notification dialog activated")); + delete aDialog; + aDialog = 0; + } + + void NotificationDialogClosed(const CHbDeviceNotificationDialogSymbian* aDialog, TInt aCompletionCode) + { + CEikonEnv::Static()->InfoMsg(_L("Device notification dialog deactivated")); + delete aDialog; + aDialog = 0; + } + + void DialogObserver::ShowDialog() + { + iDialog = CHbDeviceNotificationDialogSymbian::NewL(this); + iDialog->SetTextL(KDialogText); + iDialog->SetTitleL(KDialogTitle); + iDialog->SetIconNameL(KDialogIcon); + iDialog->ShowL(); + } \endcode CHbDeviceNotificationDialogSymbian supports. @@ -267,10 +308,10 @@ set definition file and animation's logical name. _LIT(KAnimationDefinitionXML, "C:\animation.axml"); - _LITK(KLogicalIconName, "frame_anim_looping"); + _LIT(KLogicalIconName, "frame_anim_looping"); iDialog->SetAnimationDefinitionL(KAnimationDefinitionXML); - iDialog->SetIconNameL(KIconName); + iDialog->SetIconNameL(KLogicalIconName); iDialog->ShowL(); \endcode \sa HbIconAnimationManager::addDefinitionFile @@ -476,7 +517,7 @@ is not called. \param aTimeout - Set timeout for dialog. - Default value is HbPopup::StandardTimeout (3000 ms). + Default value is KHbLongNotificationDialogTimeout (3000 ms). \sa ShowL(), UpdateL() */ EXPORT_C void CHbDeviceNotificationDialogSymbian::SetTimeout(TInt aTimeout) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/devicedialogs/hbdeviceprogressdialogsymbian.cpp --- a/src/hbwidgets/devicedialogs/hbdeviceprogressdialogsymbian.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/devicedialogs/hbdeviceprogressdialogsymbian.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -156,8 +156,10 @@ CleanupStack::PopAndDestroy(); // actionData } iButton.iFlags.iPressed = false; - User::LeaveIfError(iDeviceDialog->Show(KPluginIdentifier, *iVariantMap, this)); - + TInt error = iDeviceDialog->Show(KPluginIdentifier, *iVariantMap, this); + if (error != KErrNone) { + User::Leave(error); // error can be positive or negative + } iVisible = ETrue; } @@ -235,9 +237,11 @@ CleanupStack::PopAndDestroy(); // actionData } - User::LeaveIfError(iDeviceDialog->Update(*map)); - delete map; - map = 0; + TInt error = iDeviceDialog->Update(*map); + delete map; map = 0; + if (error != KErrNone) { + User::Leave(error); // error can be positive or negative + } } void CHbDeviceProgressDialogSymbianPrivate::DataReceived(CHbSymbianVariantMap& aData) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbabstractedit.cpp --- a/src/hbwidgets/editors/hbabstractedit.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbabstractedit.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,13 +36,13 @@ #include "hbmenu.h" #include "hbaction.h" #include "hbselectioncontrol_p.h" -#include "hbmeshlayout_p.h" #include "hbsmileyengine_p.h" #include "hbinputeditorinterface.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #include "hbtextmeasurementutility_p.h" #include "hbtapgesture.h" #include "hbpangesture.h" +#include "hbnamespace_p.h" #include #include "hbpopup.h" @@ -54,6 +54,7 @@ #include #include #include +#include /*! \class HbAbstractEdit @@ -136,6 +137,13 @@ */ /*! + \fn void anchorTapped(const QString &anchor) + + This signal is emitted when a tap gesture happens on a word which has anchor attached. + +*/ + +/*! \fn QString HbAbstractEdit::toPlainText() const Returns the contents as plain text. @@ -176,7 +184,7 @@ { Q_D(HbAbstractEdit); if (d->selectionControl) { - d->selectionControl->detachEditor(); + d->selectionControl->detachEditorFromDestructor(); } } @@ -194,6 +202,8 @@ */ bool HbAbstractEdit::event(QEvent* event) { + Q_D(HbAbstractEdit); + if(event->type() == QEvent::DynamicPropertyChange) { const QString p = static_cast(event)->propertyName(); if(p == "SmileyIcon") { @@ -216,7 +226,15 @@ d->cursorChanged(HbValidator::CursorChangeFromContentUpdate); } + } else { //HbEvent handler + if (event->type() == HbEvent::InputMethodFocusIn) { + d->setInputFocusEnabled(true); + + } else if (event->type() == HbEvent::InputMethodFocusOut) { + d->setInputFocusEnabled(false); + } } + return HbWidget::event(event); } @@ -236,6 +254,10 @@ return QVariant(block.text()); case Qt::ImCurrentSelection: return QVariant(d->cursor.selectedText()); + case Qt::ImMaximumTextLength: + return QVariant(); // No limit. + case Qt::ImAnchorPosition: + return QVariant(qBound(0, d->cursor.anchor() - block.position(), block.length())); default: return QVariant(); } @@ -323,7 +345,7 @@ d->_q_contentsChanged(); } - if(hasFocus()) { + if(d->hasInputFocus()) { d->cursorOn = true; } d->ensureCursorVisible(); @@ -364,9 +386,7 @@ d->acceptKeyPressEvent(event); if (!(d->interactionFlags & Qt::TextEditable)) { - d->repaintOldAndNewSelection(d->selectionCursor); d->cursorChanged(HbValidator::CursorChangeFromContentUpdate); - //ensureCursorVisible(); event->ignore(); return; } @@ -473,15 +493,9 @@ if (d->interactionFlags & Qt::NoTextInteraction) return; - update(d->selectionRect()); - - if (d->interactionFlags & Qt::TextEditable) { - d->setBlinkingCursorEnabled(true); - } else { - d->cursorOn = (d->interactionFlags & Qt::TextSelectableByKeyboard); - } - - d->openInputPanel(); + // It sets the cursor the focus item's depending on if + // the input panel is connceted or not + d->setInputFocusEnabled(d->hasInputFocus()); event->accept(); } @@ -498,8 +512,9 @@ if (d->interactionFlags & Qt::NoTextInteraction) return; - d->setBlinkingCursorEnabled(false); - d->repaintOldAndNewSelection(d->selectionCursor); + // It sets the cursor the focus item's depending on if + // the input panel is connceted or not + d->setInputFocusEnabled(d->hasInputFocus()); event->accept(); } @@ -551,7 +566,7 @@ deselect(); - if(hasFocus() && !isReadOnly() && !panel()) { + if(d->hasInputFocus() && !isReadOnly() && !panel()) { d->closeInputPanel(); } } @@ -652,6 +667,10 @@ d->setTextInteractionFlags(f); setFlag(QGraphicsItem::ItemAcceptsInputMethod, !value); + + if (value && d->hasInputFocus()) { + d->closeInputPanel(); + } } /*! @@ -683,26 +702,35 @@ void HbAbstractEdit::updatePrimitives() { Q_D(HbAbstractEdit); - HbWidget::updatePrimitives(); + + if (d->polished && !d->updatePrimitivesInProgress) { + + d->updatePrimitivesInProgress = true; + + HbWidget::updatePrimitives(); - if (d->scrollArea) { - d->doc->setTextWidth(d->scrollArea->size().width()); - if(d->placeholderDoc) { - d->placeholderDoc->setTextWidth(d->scrollArea->size().width()); + if (d->scrollArea) { + if(!qFuzzyCompare(d->doc->textWidth(), d->scrollArea->size().width())){ + d->doc->setTextWidth(d->scrollArea->size().width()); + if(d->placeholderDoc) { + d->placeholderDoc->setTextWidth(d->scrollArea->size().width()); + } + } } + QRectF canvasGeom(QRectF(QPointF(0,0),d->doc->size())); + if(d->scrollArea) { + canvasGeom.setHeight(qMax(d->scrollArea->size().height(), d->doc->size().height())); + } + + d->canvas->setGeometry(canvasGeom); + + d->ensureCursorVisible(); + if (d->selectionControl) { + d->selectionControl->updatePrimitives(); + } + + d->updatePrimitivesInProgress=false; } - QRectF canvasGeom(QRectF(QPointF(0,0),d->doc->size())); - if(d->scrollArea) { - canvasGeom.setHeight(qMax(d->scrollArea->size().height(), d->doc->size().height())); - } - //Changed from setGeometry() to setPreferredSize() because it causes - //weird input behavior otherwise. - d->canvas->setPreferredSize(canvasGeom.size()); - d->ensureCursorVisible(); - if (d->selectionControl) { - d->selectionControl->updatePrimitives(); - } - } /*! @@ -787,6 +815,7 @@ void HbAbstractEdit::documentSizeChanged(const QSizeF &size) { Q_UNUSED(size) + updateGeometry(); updatePrimitives(); } @@ -823,13 +852,11 @@ // QTextCursor operator!= compares only position if ( cursor.position() != d->cursor.position() || cursor.anchor() != d->cursor.anchor() ) { - const QTextCursor oldCursor = d->cursor; d->cursor = cursor; d->updateCurrentCharFormat(); d->ensureCursorVisible(); - d->repaintOldAndNewSelection(oldCursor); d->cursorChanged(HbValidator::CursorChangeFromContentSet); } } @@ -919,13 +946,8 @@ return; setCursorPosition(cursorPos); - const QTextCursor oldSelection = d->cursor; d->cursor.select(QTextCursor::WordUnderCursor); - emit selectionChanged(oldSelection, d->cursor); - d->repaintOldAndNewSelection(oldSelection); d->cursorChanged(HbValidator::CursorChangeFromMouse); - //TODO: focus is in VKB so needs to re-focus to editor -// setFocus(); } /*! @@ -935,10 +957,7 @@ void HbAbstractEdit::selectAll() { Q_D(HbAbstractEdit); - const QTextCursor oldSelection = d->cursor; d->cursor.select(QTextCursor::Document); - emit selectionChanged(oldSelection, d->cursor); - d->repaintOldAndNewSelection(oldSelection); d->cursorChanged(HbValidator::CursorChangeFromMouse); } @@ -949,9 +968,8 @@ void HbAbstractEdit::deselect() { Q_D(HbAbstractEdit); - const QTextCursor oldSelection = d->cursor; d->cursor.clearSelection(); - emit selectionChanged(oldSelection, d->cursor); + d->cursorChanged(HbValidator::CursorChangeFromMouse); } /*! @@ -1013,10 +1031,10 @@ if (source->hasFormat(QLatin1String("application/x-qrichtext"))) { QString richtext = QString::fromUtf8(source->data(QLatin1String("application/x-qrichtext"))); richtext.prepend(QLatin1String("")); - fragment = QTextDocumentFragment::fromHtml(filterInputText(richtext), d->doc); + fragment = QTextDocumentFragment::fromHtml(richtext, d->doc); hasData = true; } else if (source->hasHtml()) { - fragment = QTextDocumentFragment::fromHtml(filterInputText(source->html()), d->doc); + fragment = QTextDocumentFragment::fromHtml(source->html(), d->doc); hasData = true; } else #endif //QT_NO_TEXTHTMLPARSER @@ -1092,15 +1110,8 @@ { Q_D(HbAbstractEdit); - if(d->validator) { - delete d->validator; - d->validator = 0; - } - - if(validator) { - d->validator = validator; - d->initValidator(); - } + d->validator = validator; + d->initValidator(); } /*! @@ -1124,7 +1135,6 @@ void HbAbstractEdit::moveCursor(QTextCursor::MoveOperation op, QTextCursor::MoveMode mode) { Q_D(HbAbstractEdit); - //const QTextCursor oldCursor = d->cursor; d->cursor.movePosition(op, mode); d->updateCurrentCharFormat(); @@ -1133,7 +1143,6 @@ QTextCursor previousCursor(d->cursor); previousCursor.setPosition(d->previousCursorAnchor); previousCursor.setPosition(d->previousCursorPosition, QTextCursor::KeepAnchor); - d->repaintOldAndNewSelection(previousCursor); d->cursorChanged(HbValidator::CursorChangeFromOperation); } @@ -1285,50 +1294,58 @@ Q_D(HbAbstractEdit); HbMenu *menu = createContextMenu(); + QTextBlock block = d->cursor.block(); + QTextLayout *layout = block.layout(); + if(layout && !layout->preeditAreaText().isEmpty()) + { + // there's pre-edit text present, it needs to be commited 1st + if(qApp->inputContext()) { + qApp->inputContext()->reset(); + } + } + if (!menu) { menu = new HbMenu(); } - menu->setAttribute(Hb::InputMethodNeutral); - if (d->cursor.hasSelection() && d->canCut()) { connect( - menu->addAction("Cut"), SIGNAL(triggered()), + menu->addAction(hbTrId("txt_common_menu_cut")), SIGNAL(triggered()), this, SLOT(cut())); } if (d->cursor.hasSelection() && d->canCopy()) { connect( - menu->addAction("Copy"), SIGNAL(triggered()), + menu->addAction(hbTrId("txt_common_menu_copy")), SIGNAL(triggered()), this, SLOT(copy())); } if (!d->cursor.hasSelection() && !d->doc->isEmpty() && d->canCopy()){ connect( - menu->addAction("Select"), SIGNAL(triggered()), + menu->addAction(hbTrId("txt_common_menu_select")), SIGNAL(triggered()), this, SLOT(selectClickedWord())); connect( - menu->addAction("Select all"), SIGNAL(triggered()), + menu->addAction(hbTrId("txt_common_menu_select_all_contents")), SIGNAL(triggered()), this, SLOT(selectAll())); } if (d->canPaste()) { connect( - menu->addAction("Paste"), SIGNAL(triggered()), + menu->addAction(hbTrId("txt_common_menu_paste")), SIGNAL(triggered()), this, SLOT(paste())); } if (d->cursor.hasSelection()) { connect( - menu->addAction("Deselect"), SIGNAL(triggered()), + menu->addAction(hbTrId("txt_common_menu_deselect")), SIGNAL(triggered()), this, SLOT(deselect())); } if (d->canFormat()) { connect( - menu->addAction("Format"), SIGNAL(triggered()), + menu->addAction(hbTrId("txt_common_menu_format")), SIGNAL(triggered()), this, SLOT(format())); } emit aboutToShowContextMenu(menu, d->tapPosition); if(menu->actions().count() > 0){ - d->minimizeInputPanel(); +// d->minimizeInputPanel(); menu->setPreferredPos(position); menu->show(); } @@ -1681,15 +1698,23 @@ QPointF pos = mapFromScene(event->mapToGraphicsScene(tap->position())); switch(tap->state()) { case Qt::GestureStarted: + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + if (!tap->property(HbPrivate::ThresholdRect.latin1()).toRect().isValid()) { + tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); + } + d->tapPosition = pos; HbWidgetFeedback::triggered(this, Hb::InstantPressed); break; case Qt::GestureUpdated: if(tap->tapStyleHint() == HbTapGesture::TapAndHold) { - d->longTapGesture(pos); + d->openInputPanel(); + d->longTapGesture(pos); } break; case Qt::GestureFinished: + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + if(tap->tapStyleHint() == HbTapGesture::TapAndHold) { } else { d->tapGesture(pos); @@ -1701,6 +1726,8 @@ break; case Qt::GestureCanceled: + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + break; default: break; @@ -1716,16 +1743,8 @@ */ QString HbAbstractEdit::filterInputText(const QString &text) { - HbEditorInterface editorInterface(this); - HbInputFilter *inputFilter = editorInterface.filter(); - if (!text.isEmpty() && inputFilter) { - QString filteredText; - foreach(QChar c, text) { - if (inputFilter->filter(c)) { - filteredText.append(c); - } - } - return filteredText; - } - return text; + Q_D(HbAbstractEdit); + QString filteredText(text); + d->filterInputText(filteredText); + return filteredText; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbabstractedit.h --- a/src/hbwidgets/editors/hbabstractedit.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbabstractedit.h Thu Jul 22 16:36:53 2010 +0100 @@ -110,6 +110,7 @@ void cursorPositionChanged(int oldPos, int newPos); void selectionChanged(const QTextCursor &oldCursor, const QTextCursor& newCursor); void aboutToShowContextMenu(HbMenu *contextMenu, const QPointF &pos); + void anchorTapped(const QString &anchor); public slots: void updatePrimitives(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbabstractedit_p.cpp --- a/src/hbwidgets/editors/hbabstractedit_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbabstractedit_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,15 +39,17 @@ #include "hbstyleoption_p.h" #include "hbscrollarea.h" #include "hbvalidator.h" -#include "hbmeshlayout_p.h" #include "hbmenu.h" #include "hbselectioncontrol_p.h" #include "hbcolorscheme.h" #include "hbsmileyengine_p.h" #include "hbtextmeasurementutility_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #include "hbinputeditorinterface.h" #include "hbinputvkbhost.h" +#include "hbinputmethod.h" +#include "hbinputfocusobject.h" + #include #include @@ -95,6 +97,7 @@ HbEditItem(HbAbstractEdit *parent) : HbWidget(parent), edit(parent) { + setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); }; virtual ~HbEditItem() {}; @@ -198,7 +201,8 @@ wasGesture(false), smileysEnabled(false), smileyEngine(0), - formatDialog(0) + formatDialog(0), + updatePrimitivesInProgress(false) { } @@ -211,6 +215,8 @@ Q_Q(HbAbstractEdit); canvas = new HbEditItem(q); + canvas->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); + setContent(Qt::RichText, QString()); @@ -238,6 +244,7 @@ q->setFlag(QGraphicsItem::ItemIsFocusable); q->setFlag(QGraphicsItem::ItemAcceptsInputMethod); q->setFlag(QGraphicsItem::ItemSendsScenePositionChanges); + q->setFlag(QGraphicsItem::ItemHasNoContents, false); q->setFocusPolicy(Qt::StrongFocus); q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -248,28 +255,6 @@ void HbAbstractEditPrivate::updatePaletteFromTheme() { - Q_Q(HbAbstractEdit); - - // TODO: remove once these color dissapear from hbcolorgroup.css - QColor textColor = HbColorScheme::color("qtc_editor_normal"); - QColor selectedColor = HbColorScheme::color("qtc_editor_selected"); - QColor selectedBackground = HbColorScheme::color("qtc_editor_marker_normal"); - QPalette pal = q->palette(); - - if (textColor.isValid()) { - pal.setColor(QPalette::Text, textColor); - } - - if (selectedColor.isValid()) { - pal.setColor(QPalette::HighlightedText, selectedColor); - } - - if (selectedBackground.isValid()) { - pal.setColor(QPalette::Highlight, selectedBackground); - } - q->setPalette(pal); - - // The link color is used from application's palette QColor linkColor = HbColorScheme::color("qtc_view_link_normal"); QColor linkVisitedColor = HbColorScheme::color("qtc_view_visited_normal"); @@ -390,8 +375,12 @@ void HbAbstractEditPrivate::setCursorPosition(int pos, QTextCursor::MoveMode mode) { + if (cursor.isNull()) { + cursor = QTextCursor(doc); + } + cursor.setPosition(pos, mode); - + ensureCursorVisible(); cursorChanged(HbValidator::CursorChangeFromMouse); } @@ -510,13 +499,12 @@ return false; } - const QTextCursor oldCursor = cursor; + //const QTextCursor oldCursor = cursor; bool visualNavigation = cursor.visualNavigation(); cursor.setVisualNavigation(true); cursor.movePosition(op, mode); cursor.setVisualNavigation(visualNavigation); cursorChanged(HbValidator::CursorChangeFromOperation); - repaintOldAndNewSelection(oldCursor); return true; } @@ -596,13 +584,11 @@ void HbAbstractEditPrivate::setTextInteractionFlags(Qt::TextInteractionFlags flags) { - Q_Q(HbAbstractEdit); - if (flags == interactionFlags) return; interactionFlags = flags; - if (q->hasFocus()) { + if (hasInputFocus()) { setBlinkingCursorEnabled(flags & Qt::TextEditable); } } @@ -649,14 +635,15 @@ Q_Q(HbAbstractEdit); if (cursor.hasSelection()) { - if (selectionControl) { - selectionControl->showHandles(); - q->update(); - } + selectionControl = HbSelectionControl::attachEditor(q); + selectionControl->showHandles(); } else if (selectionControl){ selectionControl->hideHandles(); - q->update(); } + + QTextCursor oldSelection(selectionCursor); + selectionCursor = cursor; + repaintOldAndNewSelection(oldSelection); } void HbAbstractEditPrivate::_q_scrollStarted() @@ -761,7 +748,6 @@ } emit q->selectionChanged(selectionCursor, cursor); - selectionCursor = cursor; } void HbAbstractEditPrivate::acceptKeyPressEvent(QKeyEvent *event) @@ -792,7 +778,7 @@ if (cursor.hasSelection()) { QAbstractTextDocumentLayout::Selection selection; selection.cursor = cursor; - QPalette::ColorGroup cg = q->hasFocus() ? QPalette::Active : QPalette::Inactive; + QPalette::ColorGroup cg = hasInputFocus() ? QPalette::Active : QPalette::Inactive; selection.format.setBackground(ctx.palette.brush(cg, QPalette::Highlight)); selection.format.setForeground(ctx.palette.brush(cg, QPalette::HighlightedText)); @@ -995,7 +981,7 @@ QTextLayout *layout = cursor.block().layout(); int cursorPos = hitTest(tapPos, Qt::ExactHit); - if (cursorPos == -1) { + if (layout && cursorPos == -1) { cursorPos = cursor.position() + layout->preeditAreaText().length(); } @@ -1078,7 +1064,6 @@ if (removeSelection && cursor.hasSelection()) { const QTextCursor oldCursor = cursor; cursor.clearSelection(); - repaintOldAndNewSelection(oldCursor); emit q->selectionChanged(oldCursor, cursor); } @@ -1094,14 +1079,27 @@ } else { // Currently focused widget to listen to InputContext before updating the cursor position sendMouseEventToInputContext(point); + + // translate the point to have the Y ccordinate inside the viewport + QPointF translatedPoint(point); + if(translatedPoint.y() < viewPortRect().top()) { + translatedPoint.setY(viewPortRect().top() + 1); + } else if(translatedPoint.y() > viewPortRect().bottom()){ + translatedPoint.setY(viewPortRect().bottom() - 1); + } + // need to get the cursor position again since input context can change the document - newCursorPos = hitTest(point, Qt::FuzzyHit); + newCursorPos = hitTest(translatedPoint, Qt::FuzzyHit); setCursorPosition(newCursorPos); if (interactionFlags & Qt::TextEditable) { updateCurrentCharFormat(); } - cursorChanged(HbValidator::CursorChangeFromMouse); + + QString anchor(q->anchorAt(translatedPoint)); + if(!anchor.isEmpty()) { + emit q->anchorTapped(anchor); + } } } @@ -1172,6 +1170,22 @@ } } +void HbAbstractEditPrivate::filterInputText(QString &text) const +{ + Q_Q(const HbAbstractEdit); + HbEditorInterface editorInterface(const_cast(q)); + HbInputFilter *inputFilter = editorInterface.filter(); + + if (!text.isEmpty() && inputFilter) { + for(int i(text.length() - 1); i>=0; --i) { + if (!inputFilter->filter(text.at(i))) { + text.remove(i,1); + } + } + } +} + + Qt::Alignment HbAbstractEditPrivate::alignmentFromString(const QString &text) { Qt::Alignment align(0); @@ -1229,16 +1243,27 @@ sendInputPanelEvent(QEvent::CloseSoftwareInputPanel); } -#include "hbinputeditorinterface.h" -#include "hbinputvkbhost.h" - -void HbAbstractEditPrivate::minimizeInputPanel() +bool HbAbstractEditPrivate::hasInputFocus() const { - Q_Q(HbAbstractEdit); + Q_Q(const HbAbstractEdit); + + HbInputMethod* inputMethod = HbInputMethod::activeInputMethod(); + if (inputMethod && inputMethod->focusObject() && + qobject_cast(inputMethod->focusObject()->object()) == q) { + return true; + } + return false; +} - HbEditorInterface ei(q); - HbVkbHost* vkbHost = ei.vkbHost(); - vkbHost->minimizeKeypad(); +void HbAbstractEditPrivate::setInputFocusEnabled(bool enable) +{ + QGraphicsItem *focusItem = focusPrimitive(HbWidget::FocusHighlightActive); + if (focusItem) { + focusItem->setVisible(enable); + } + + setBlinkingCursorEnabled(enable); + repaintOldAndNewSelection(selectionCursor); } #include "moc_hbabstractedit.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbabstractedit_p.h --- a/src/hbwidgets/editors/hbabstractedit_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbabstractedit_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -137,7 +137,8 @@ void sendInputPanelEvent(QEvent::Type type); void openInputPanel(); void closeInputPanel(); - void minimizeInputPanel(); + bool hasInputFocus() const; + void setInputFocusEnabled(bool enable); int contentLength() const; bool hasAcceptableInput() const; @@ -150,6 +151,7 @@ const QStyleOptionGraphicsItem &option) const; void updatePlaceholderDocProperties(); + void filterInputText(QString &text) const; void _q_updateRequest(QRectF rect); void _q_updateBlock(QTextBlock block); @@ -170,7 +172,7 @@ QTextCursor cursor; QTextCursor selectionCursor; - HbValidator* validator; + QPointer validator; bool imEditInProgress; int imPosition; int imAdded; @@ -209,13 +211,13 @@ HbFormatDialogPointer formatDialog; QTextCursor nextCharCursor; + bool updatePrimitivesInProgress; private: static HbAbstractEditPrivate *d_ptr(HbAbstractEdit *edit) { Q_ASSERT(edit); return edit->d_func(); } - friend class HbEditScrollArea; friend class HbFormatDialog; friend class HbFormatDialogPrivate; // To be able to unit test private features diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbdatetimeedit.cpp --- a/src/hbwidgets/editors/hbdatetimeedit.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbdatetimeedit.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -24,11 +24,13 @@ ****************************************************************************/ #include +#include #include "hblineedit.h" #include "hbdatetimevalidator_p.h" #include "hbdatetimeedit.h" #include "hbdatetimeedit_p.h" +#include "hbevent.h" /*! @alpha @@ -233,13 +235,14 @@ /*! \reimp */ -void HbDateTimeEdit::focusOutEvent(QFocusEvent *event) +bool HbDateTimeEdit::event(QEvent* event) { - HbAbstractEdit::focusOutEvent(event); - Q_D(HbDateTimeEdit); - if(d->validator->fixDate(&d->cursor, true)) { - // fixing so restore focus to editor - setFocus(event->reason()); + + if (event->type() == HbEvent::InputMethodFocusOut) { + d->validator->fixDate(&d->cursor, true); } + + return HbLineEdit::event(event); } + diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbdatetimeedit.h --- a/src/hbwidgets/editors/hbdatetimeedit.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbdatetimeedit.h Thu Jul 22 16:36:53 2010 +0100 @@ -65,12 +65,13 @@ void setTimeFormat(const QLocale& locale = QLocale()); void setDateTimeFormat(const QLocale& locale = QLocale()); + bool event(QEvent* event); + protected: HbDateTimeEdit (HbDateTimeEditPrivate &dd, QGraphicsItem *parent); void setMaxLength (int length); void setText (const QString &text); - void focusOutEvent(QFocusEvent *event); private: Q_DISABLE_COPY(HbDateTimeEdit) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbdatetimeedit_p.cpp --- a/src/hbwidgets/editors/hbdatetimeedit_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbdatetimeedit_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -124,3 +124,5 @@ } HbLineEditPrivate::_q_textChanged(); } + +#include diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbdatetimeedit_p.h diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hblineedit.cpp --- a/src/hbwidgets/editors/hblineedit.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hblineedit.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,14 +30,16 @@ #include "hbscrollarea.h" #ifdef HB_TEXT_MEASUREMENT_UTILITY #include "hbtextmeasurementutility_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #endif //HB_TEXT_MEASUREMENT_UTILITY +#include "hbevent.h" #include #include #include #include #include +#include /*! \class HbLineEdit @@ -283,7 +285,8 @@ { Q_D(HbLineEdit); - if(d->echoMode == HbLineEdit::PasswordEchoOnEdit && d->clearOnEdit) { + if((!e->commitString().isEmpty() || e->replacementLength()) && + d->echoMode == HbLineEdit::PasswordEchoOnEdit && d->clearOnEdit) { d->doc->clear(); d->passwordText.clear(); d->clearOnEdit = false; @@ -311,6 +314,21 @@ HbAbstractEdit::inputMethodEvent(e); } + +/*! + \reimp +*/ +QVariant HbLineEdit::inputMethodQuery(Qt::InputMethodQuery property) const +{ + switch(property) { + case Qt::ImMaximumTextLength: + return QVariant(maxLength()); + default: + return HbAbstractEdit::inputMethodQuery(property); + } +} + + /*! \reimp */ @@ -357,7 +375,7 @@ Q_D(HbLineEdit); if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { - emit editingFinished(); + d->editingFinished(); } if(d->forwardKeyEvent(event)) { @@ -594,7 +612,14 @@ */ bool HbLineEdit::canInsertFromMimeData(const QMimeData *source) const { - return source->hasText() && !source->text().isEmpty(); + Q_D(const HbLineEdit); + if(source->hasText() && !source->text().isEmpty()) { + QString text(source->text()); + d->filterInputText(text); + return !text.isEmpty(); + } else { + return false; + } } /*! @@ -628,15 +653,7 @@ */ void HbLineEdit::focusOutEvent(QFocusEvent * event) { - Q_D(HbLineEdit); - - if(echoMode() == HbLineEdit::PasswordEchoOnEdit) { - setPlainText(d->passwordString(d->passwordText)); - } - - HbAbstractEdit::focusOutEvent(event); - - emit editingFinished(); + HbAbstractEdit::focusOutEvent(event); } /*! @@ -644,13 +661,6 @@ */ void HbLineEdit::focusInEvent(QFocusEvent * event) { - Q_D(HbLineEdit); - - if(echoMode() == HbLineEdit::PasswordEchoOnEdit) { - // we need to clear the editor when typing starts - d->clearOnEdit = true; - } - HbAbstractEdit::focusInEvent(event); } @@ -683,6 +693,29 @@ } /*! + \reimp +*/ +bool HbLineEdit::event(QEvent* event) +{ + Q_D(HbLineEdit); + + if (event->type() == HbEvent::InputMethodFocusIn) { + if(echoMode() == HbLineEdit::PasswordEchoOnEdit) { + // we need to clear the editor when typing starts + d->clearOnEdit = true; + } + d->showCustomAutoCompPopup(); + } else if (event->type() == HbEvent::InputMethodFocusOut) { + d->hideCustomAutoCompPopup(); + d->editingFinished(); + } + + return HbAbstractEdit::event(event); +} + + + +/*! @proto Returns true if vertical font streach mode is active. @@ -708,3 +741,35 @@ } return HbAbstractEdit::eventFilter(obj, event); } + +/*! + set content of custum auto-complate pupup. + */ +void HbLineEdit::setAutoCompleteContent(QGraphicsLayoutItem *content) +{ + Q_D(HbLineEdit); + + if (!d->mCustomAutoCompPopup) { + d->createCustomAutoCompPopup(); + repolish(); + } + + if (d->mCustomAutoCompContent!=content) { + if (d->mCustomAutoCompContent) { + delete d->mCustomAutoCompContent; + } + + d->mCustomAutoCompContent = content; + + if (content->isLayout()) { + d->mCustomAutoCompPopup->setLayout(static_cast(content)); + } else { + QGraphicsLinearLayout *linLayout = new QGraphicsLinearLayout(Qt::Horizontal, + d->mCustomAutoCompPopup); + linLayout->addItem(content); + } + if (hasFocus()) { + d->showCustomAutoCompPopup(); + } + } +} diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hblineedit.h --- a/src/hbwidgets/editors/hblineedit.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hblineedit.h Thu Jul 22 16:36:53 2010 +0100 @@ -94,6 +94,10 @@ bool adjustFontSizeToFitHeight() const; void setAdjustFontSizeToFitHeight(bool active); + bool event(QEvent* event); + + void setAutoCompleteContent(QGraphicsLayoutItem *content); + public slots: void setText(const QString &text); @@ -106,6 +110,7 @@ HbLineEdit(HbLineEditPrivate &dd, QGraphicsItem *parent); void inputMethodEvent(QInputMethodEvent *event); + QVariant inputMethodQuery(Qt::InputMethodQuery) const; void keyPressEvent(QKeyEvent *event); void keyReleaseEvent(QKeyEvent *event); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hblineedit_p.cpp --- a/src/hbwidgets/editors/hblineedit_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hblineedit_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,6 @@ #include "hblineedit_p.h" #include "hblineedit.h" -#include "hbmeshlayout_p.h" #include "hbcolorscheme.h" #include @@ -58,7 +57,9 @@ clearOnEdit(false), emitTextChanged(true), adjustFontSizeToFitHeight(false), - stretchedToLineCount(-1) + stretchedToLineCount(-1), + mCustomAutoCompContent(0), + mCustomAutoCompPopup(0) { } @@ -79,12 +80,29 @@ scrollArea->setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); defaultWrapMode = doc->defaultTextOption().wrapMode(); // cannot be changed. q->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); - q->setBackgroundItem(HbStyle::P_LineEdit_frame_normal); + setBackgroundItem(HbStyle::P_LineEdit_frame_normal); q->setFocusHighlight(HbStyle::P_LineEdit_frame_highlight,HbWidget::FocusHighlightActive); updateWrappingMode(); Q_ASSERT(scrollArea); scrollArea->installEventFilter(q); // needed for resize event processing + + // createCustomAutoCompPopup(); +} + +void HbLineEditPrivate::createCustomAutoCompPopup() +{ + Q_Q(HbLineEdit); + + mCustomAutoCompPopup = new HbPopup(q); + mCustomAutoCompPopup->setVisible(false); + mCustomAutoCompPopup->setFlag(QGraphicsItem::ItemIsPanel, true); + mCustomAutoCompPopup->setActive(false); + mCustomAutoCompPopup->setFocusPolicy(Qt::NoFocus); + mCustomAutoCompPopup->setBackgroundFaded(false); + mCustomAutoCompPopup->setDismissPolicy(HbPopup::NoDismiss); + mCustomAutoCompPopup->setTimeout(HbPopup::NoTimeout); + HbStyle::setItemName(mCustomAutoCompPopup, QString("autoCompletePopup")); } void HbLineEditPrivate::updatePaletteFromTheme() @@ -177,6 +195,12 @@ if(adjustFontSizeToFitHeight) { readjustStretchFont(); } + + if (doc->isEmpty()) { + hideCustomAutoCompPopup(); + } else { + showCustomAutoCompPopup(); + } } void HbLineEditPrivate::_q_textChange(int position, int charsRemoved,int charsAdded) @@ -297,11 +321,10 @@ QString HbLineEditPrivate::echoString(const QString &text) { - Q_Q(HbLineEdit); QString retText(text); - if(echoMode == HbLineEdit::Password || (echoMode == HbLineEdit::PasswordEchoOnEdit && !q->hasFocus())) { + if(echoMode == HbLineEdit::Password || (echoMode == HbLineEdit::PasswordEchoOnEdit && !hasInputFocus())) { retText = passwordString(text); } else if (echoMode == HbLineEdit::NoEcho) { retText.clear(); @@ -395,4 +418,36 @@ } } +void HbLineEditPrivate::showCustomAutoCompPopup() +{ + if (mCustomAutoCompContent) { + Q_ASSERT(mCustomAutoCompPopup); + + if (!mCustomAutoCompPopup->isVisible() && !doc->isEmpty()) { + mCustomAutoCompPopup->show(); + } + } +} + +void HbLineEditPrivate::hideCustomAutoCompPopup() +{ + if (mCustomAutoCompContent) { + Q_ASSERT(mCustomAutoCompPopup); + + if (mCustomAutoCompPopup->isVisible()) { + mCustomAutoCompPopup->hide(); + } + } +} + +void HbLineEditPrivate::editingFinished() +{ + Q_Q(HbLineEdit); + + if(q->echoMode() == HbLineEdit::PasswordEchoOnEdit) { + q->setPlainText(passwordString(passwordText)); + } + emit q->editingFinished(); +} + #include "moc_hblineedit.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hblineedit_p.h --- a/src/hbwidgets/editors/hblineedit_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hblineedit_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -73,6 +73,11 @@ int linesToBeVisible() const; void onResizeFontChange(); void setVisibleRows(int rowCount); + void editingFinished(); + + void createCustomAutoCompPopup(); + void showCustomAutoCompPopup(); + void hideCustomAutoCompPopup(); int maxLength; int minimumRows; @@ -85,6 +90,8 @@ bool adjustFontSizeToFitHeight; int stretchedToLineCount; + QGraphicsLayoutItem *mCustomAutoCompContent; + HbPopup *mCustomAutoCompPopup; }; #endif // HBLINEEDIT_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbselectioncontrol_p.cpp --- a/src/hbwidgets/editors/hbselectioncontrol_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbselectioncontrol_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -91,6 +91,7 @@ void panGestureFinished (HbPanGesture *gesture); void show(); void _q_aboutToChangeView(); + void detachEditor(bool updateAtthachedEditorState); public: @@ -126,8 +127,13 @@ createPrimitives(); q->setVisible(false); - q->setFlag(QGraphicsItem::ItemIsFocusable,false); - q->setFlag(QGraphicsItem::ItemIsPanel,true); + QGraphicsItem::GraphicsItemFlags itemFlags = q->flags(); +#if QT_VERSION >= 0x040600 + itemFlags |= QGraphicsItem::ItemSendsGeometryChanges; +#endif + itemFlags &= ~QGraphicsItem::ItemIsFocusable; + itemFlags |= QGraphicsItem::ItemIsPanel; + q->setFlags(itemFlags); q->setFocusPolicy(Qt::NoFocus); q->setActive(false); @@ -466,6 +472,21 @@ } } +void HbSelectionControlPrivate::detachEditor(bool updateAtthachedEditorState) +{ + Q_Q(HbSelectionControl); + if (mEdit) { + q->hideHandles(); + reparentHandles(q); + if (updateAtthachedEditorState) { + mEdit->disconnect(q); + mEdit->d_func()->selectionControl = 0; + mEdit->deselect(); + } + mEdit = 0; + mTopLevelAncestor = 0; + } +} HbSelectionControl::HbSelectionControl() : HbWidget(*new HbSelectionControlPrivate(),0) @@ -510,17 +531,14 @@ void HbSelectionControl::detachEditor() { Q_D(HbSelectionControl); - if (d->mEdit) { - hideHandles(); - d->reparentHandles(this); - d->mEdit->disconnect(this); - d->mEdit->d_func()->selectionControl = 0; - d->mEdit->deselect(); - d->mEdit = 0; - d->mTopLevelAncestor = 0; - } + d->detachEditor(true); } +void HbSelectionControl::detachEditorFromDestructor() +{ + Q_D(HbSelectionControl); + d->detachEditor(false); +} void HbSelectionControl::hideHandles() { @@ -597,7 +615,7 @@ switch(tap->state()) { case Qt::GestureStarted: if (d->mEdit) { - HbWidgetFeedback::triggered(d->mEdit, Hb::InstantPressed); + HbWidgetFeedback::triggered(this, Hb::InstantPressed); } break; case Qt::GestureUpdated: @@ -605,7 +623,7 @@ case Qt::GestureFinished: if (d->mEdit) { d->tapGestureFinished(pos); - HbWidgetFeedback::triggered(d->mEdit, Hb::InstantReleased); + HbWidgetFeedback::triggered(this, Hb::InstantReleased); } break; case Qt::GestureCanceled: @@ -630,7 +648,7 @@ case Qt::GestureFinished: if (d->mEdit) { d->panGestureFinished(pan); - HbWidgetFeedback::triggered(d->mEdit, Hb::InstantReleased); + HbWidgetFeedback::triggered(this, Hb::InstantReleased); } break; case Qt::GestureCanceled: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbselectioncontrol_p.h --- a/src/hbwidgets/editors/hbselectioncontrol_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbselectioncontrol_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -58,6 +58,7 @@ static HbSelectionControl* attachEditor(HbAbstractEdit *edit); void detachEditor(); + void detachEditorFromDestructor(); void hideHandles(); void showHandles(); bool event(QEvent *event); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbsmileyengine_p.cpp --- a/src/hbwidgets/editors/hbsmileyengine_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbsmileyengine_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -157,6 +157,9 @@ void HbSmileyEnginePrivate::insertSmileys( QTextCursor cursor, bool insertOne) { + QTextCursor initialCursor = cursor; + initialCursor.beginEditBlock(); + QString regexpStr; foreach (QString pattern, mSmileyTheme.patterns()) { regexpStr += QRegExp::escape(pattern) + "|"; @@ -172,6 +175,7 @@ } cursor = mDocument->find(rx, cursor); } + initialCursor.endEditBlock(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbsmileyengine_p.h --- a/src/hbwidgets/editors/hbsmileyengine_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbsmileyengine_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,8 +31,8 @@ #include class HbSmileyEnginePrivate; -QT_FORWARD_DECLARE_CLASS(QTextDocument); -QT_FORWARD_DECLARE_CLASS(QTextCursor); +QT_FORWARD_DECLARE_CLASS(QTextDocument) +QT_FORWARD_DECLARE_CLASS(QTextCursor) class HB_AUTOTEST_EXPORT HbSmileyEngine : public QObject { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbsmileyengine_p_p.h --- a/src/hbwidgets/editors/hbsmileyengine_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbsmileyengine_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,7 +33,7 @@ #include class HbIconAnimator; -QT_FORWARD_DECLARE_CLASS(QTextDocument); +QT_FORWARD_DECLARE_CLASS(QTextDocument) struct HbSmileyDataType { HbSmileyDataType():cursor(0),animator(0),scaleFactor(1){} diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbtextedit.cpp --- a/src/hbwidgets/editors/hbtextedit.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbtextedit.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,7 +31,7 @@ #ifdef HB_TEXT_MEASUREMENT_UTILITY #include "hbtextmeasurementutility_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" #endif //HB_TEXT_MEASUREMENT_UTILITY /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbtextedit.h --- a/src/hbwidgets/editors/hbtextedit.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbtextedit.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,9 +37,7 @@ Q_OBJECT Q_PROPERTY(QString plainText READ toPlainText WRITE setPlainText USER true) - Q_PROPERTY(bool lined - READ isLined - WRITE setLined) + Q_PROPERTY(bool lined READ isLined WRITE setLined) public: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/editors/hbtextedit_p.cpp --- a/src/hbwidgets/editors/hbtextedit_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/editors/hbtextedit_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -58,7 +58,7 @@ mTextBaseLinePen.setWidthF((qreal)1.0); q->setScrollable(true); - q->setBackgroundItem(HbStyle::P_TextEdit_frame_normal); + setBackgroundItem(HbStyle::P_TextEdit_frame_normal); q->setFocusHighlight(HbStyle::P_TextEdit_frame_highlight,HbWidget::FocusHighlightActive); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/hbwidgets.pro --- a/src/hbwidgets/hbwidgets.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/hbwidgets.pro Thu Jul 22 16:36:53 2010 +0100 @@ -24,10 +24,7 @@ ############################################################################# TEMPLATE = lib TARGET = $$hbLibraryTarget(HbWidgets) -QT = core \ - gui \ - svg \ - network +QT = core gui svg network DEFINES += BUILD_HB_WIDGETS # directories @@ -42,11 +39,10 @@ include(sliders/sliders.pri) include(widgets/widgets.pri) include(dataform/dataform.pri) + CONVENIENCE_HEADERS += $${HB_BUILD_DIR}/include/hbwidgets/hbwidgets.h CONVENIENCE_HEADERS += $$files($${HB_BUILD_DIR}/include/hbwidgets/Hb*) -HEADERS += $$PUBLIC_HEADERS \ - $$PRIVATE_HEADERS \ - $$CONVENIENCE_HEADERS +HEADERS += $$PUBLIC_HEADERS $$RESTRICTED_HEADERS $$PRIVATE_HEADERS $$CONVENIENCE_HEADERS # dependencies hbAddLibrary(hbcore/HbCore) @@ -55,13 +51,17 @@ !local { target.path = $${HB_LIB_DIR} win32:dlltarget.path = $${HB_BIN_DIR} + pubheaders.files = $$PUBLIC_HEADERS pubheaders.path = $${HB_INCLUDE_DIR}/hbwidgets + + restheaders.files = $$RESTRICTED_HEADERS + restheaders.path = $${HB_INCLUDE_DIR}/hbwidgets/restricted + convheaders.files = $$CONVENIENCE_HEADERS convheaders.path = $${HB_INCLUDE_DIR}/hbwidgets - INSTALLS += target \ - pubheaders \ - convheaders + + INSTALLS += target pubheaders restheaders convheaders win32:INSTALLS += dlltarget } @@ -70,10 +70,12 @@ symbian { defFilePath = defs - + TARGET.EPOCALLOWDLLDATA = 1 TARGET.CAPABILITY = CAP_GENERAL_DLL TARGET.UID3 = 0x20022FCC + + LIBS += -lsystemtoneservice # DEPLOYMENT_PLUGIN += qjpeg # TODO: Removed because this is already in qt.sis and that caused problems DEFINES += SYMBIAN_TARGET_ICON_CACHE_SIZE # TODO: what's this? why not use Q_OS_SYMBIAN? diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractitemcontainer_p.cpp --- a/src/hbwidgets/itemviews/hbabstractitemcontainer_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractitemcontainer_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,6 @@ #include "hbabstractviewitem.h" #include "hbabstractitemview.h" -#include "hbabstractitemview_p.h" #include "hbmodeliterator.h" #include @@ -279,7 +278,7 @@ } int itemsAdded = 0; - // in practise following conditions must apply: itemview is empty and scrollTo() has been called. + // in practize following conditions must apply: itemview is empty and scrollTo() has been called. // Starts populating items from given mFirstItemIndex if ( !index.isValid() && mFirstItemIndex.isValid()) { @@ -289,7 +288,7 @@ mFirstItemIndex = QModelIndex(); } - + while (itemsAdded < amount) { index = mItemView->modelIterator()->nextIndex(index); if (!index.isValid()) { @@ -362,35 +361,29 @@ HbAbstractViewItem* HbAbstractItemContainerPrivate::item(const QModelIndex &index) const { int itemCount = mItems.count(); - for (int i = 0; i < itemCount; ++i) { - // This could use binary search as model indexes are in sorted. - if (mItems.at(i)->modelIndex() == index) { - return mItems.at(i); - } - } - - // TODO: The lower (commented out) part of the code is an optimized version of the above. - // However, there are problems with TreeView's deep models concerning the optimized version. - // The optimized version should be fixed and taken into use later on. + if (index.isValid()) { + if (itemCount > 0) { + HbModelIterator *iterator = mItemView->modelIterator(); + int positionFirstIndex = iterator->indexPosition(mItems.first()->modelIndex()); - /* - int itemCount = mItems.count(); - if (itemCount > 0) { - if (index.isValid()) { - int itemIndex = mItemView->indexPosition(index) - mItemView->indexPosition(mItems.first()->modelIndex()); - return mItems.value(itemIndex); - } else { - for (int i = 0; i < itemCount; ++i) { - // This could use binary search as model indexes are in sorted. - HbAbstractViewItem *item = mItems.at(i); - if (item->modelIndex() == index) { + // when new items are inserted, they will appear in the end of container before a model index is assigned to them + if (positionFirstIndex >= 0) { + int positionIndex = iterator->indexPosition(index); + HbAbstractViewItem *item = mItems.value(positionIndex - positionFirstIndex); + if ( item + && item->modelIndex() == index) { return item; } } } + } else { + // searching items e.g. removed from model + for (int i = 0; i < itemCount; ++i) { + if (!mItems.at(i)->modelIndex().isValid()) { + return mItems.at(i); + } + } } - */ - return 0; } @@ -487,11 +480,7 @@ if (!delta.isNull()) { q->setPos(q->pos() - delta); - if (mItemView) { - // this will force the HbScrollArea to adjust the content correctly. Adjustment - // is not done in the setPos generated event handling by default to speed up scrolling. - HbAbstractItemViewPrivate::d_ptr(mItemView)->adjustContent(); - } + adjustContent(); } } } @@ -1184,7 +1173,7 @@ newSize.setWidth(d->mItemView->size().width()); } } - + resize(newSize); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractitemcontainer_p_p.h --- a/src/hbwidgets/itemviews/hbabstractitemcontainer_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractitemcontainer_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -31,6 +31,7 @@ #include "hbabstractviewitem.h" #include "hbabstractitemview.h" #include "hbmodeliterator.h" +#include "hbabstractitemview_p.h" #include @@ -78,7 +79,7 @@ void increaseBufferSize(int amount); void decreaseBufferSize(int amount); - HbAbstractViewItem* item(const QModelIndex &index) const; + virtual HbAbstractViewItem* item(const QModelIndex &index) const; void doRemoveItem(HbAbstractViewItem *item, const QModelIndex &index, bool animate = false); @@ -95,6 +96,8 @@ inline HbModelIterator *modelIterator() const; + inline void adjustContent() const; + mutable QList mPrototypes; QList mItemStateList; QHash > mItemStates; @@ -119,6 +122,15 @@ } } +void HbAbstractItemContainerPrivate::adjustContent() const +{ + if (mItemView) { + // this will force the HbScrollArea to adjust the content correctly. Adjustment + // is not done in the setPos generated event handling by default to speed up scrolling. + HbAbstractItemViewPrivate::d_ptr(mItemView)->adjustContent(); + } +} + Q_DECLARE_METATYPE(HbAbstractItemContainerPrivate::StateItem) #endif /* HBABSTRACTITEMCONTAINERPRIVATE_H */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractitemview.cpp --- a/src/hbwidgets/itemviews/hbabstractitemview.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractitemview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,10 +23,10 @@ ** ****************************************************************************/ +#include "hbabstractitemview.h" #include "hbabstractitemview_p.h" #include "hbabstractitemcontainer_p_p.h" -#include #include #include #include @@ -76,7 +76,7 @@ \fn void HbAbstractItemView::pressed(const QModelIndex &index) This signal is emitted when a touch down event is received within - Abstract view item that is representing \a index. + view item that is representing \a index. See also released() and activated(). */ @@ -84,10 +84,11 @@ /*! \fn void HbAbstractItemView::released(const QModelIndex &index) - This signal is emitted when a touch release event is received within + This signal is emitted when a release event is received within Abstract view item that is representing \a index. See also pressed() and activated(). + \sa HbAbstractViewItem::released(const QPointF &position) */ /*! @@ -137,18 +138,58 @@ */ /*! + \enum HbAbstractItemView::ScrollHint + + Enumeration specifies positions on the view, onto which an item can be scrolled. + + \sa scrollTo(const QModelIndex &index, HbAbstractItemView::ScrollHint hint = EnsureVisible) +*/ + +/*! + \var HbAbstractItemView::EnsureVisible + + Item will be fully visible somewhere on the view. +*/ + + +/*! + \var HbAbstractItemView::PositionAtTop + + Item will be fully visible as topmost item. +*/ + + +/*! + \var HbAbstractItemView::PositionAtBottom + + Item will be fully visible as bottommost item. +*/ + +/*! + \var HbAbstractItemView::PositionAtCenter + + Item will be centered. +*/ + +/*! \enum HbAbstractItemView::ItemAnimation animations in HbAbstractItemView that can be disabled. By default all animations are enabled. */ /*! + \var HbAbstractItemView::None + + Any animation is not applied. +*/ + +/*! \var HbAbstractItemView::Appear Animation related to item appearance. Disable this animation in cases you expect many model items to appear, - for example in case like insertion of a new data source, and you do not wish to see animations. - - Note that the item appearance animations are not used directly after a setModel call to force non-animated model change. + for example in case like insertion of a new data source, and you do not wish to see animations. + + Note that the item appearance animations are not used directly after a setModel call to force non-animated model change. */ /*! @@ -177,6 +218,12 @@ */ /*! + \var HbAbstractItemView::All + + Every animation is applied. +*/ + +/*! Here are the main properties of the class: \li HbAbstractItemView::itemRecycling: ItemRecycling. @@ -192,6 +239,8 @@ Scrolls the view if necessary to ensure that the item at \a index is visible in a position according to \a hint. Default value just guarantees, that item will be fully visible. + + Scrolling is not animated but movement is immediate. */ @@ -217,8 +266,23 @@ } /*! + Constructs a new HbAbstractItemView with \a parent. +*/ +HbAbstractItemView::HbAbstractItemView(HbAbstractItemContainer *container, + HbModelIterator *modelIterator, + QGraphicsItem *parent) + : HbScrollArea(*new HbAbstractItemViewPrivate, parent) +{ + Q_D(HbAbstractItemView); + Q_ASSERT_X(container, "HbAbstractItemView constructor", "Container is null"); + + d->q_ptr = this; + d->init(container, modelIterator); +} + +/*! Destructs the abstract item view. - */ +*/ HbAbstractItemView::~HbAbstractItemView() { @@ -239,7 +303,7 @@ If no prototype has been passed, default prototype is used. Note! Itemview may create view items asynchronously. - */ +*/ void HbAbstractItemView::setModel(QAbstractItemModel *model, HbAbstractViewItem *prototype) { Q_D(HbAbstractItemView); @@ -318,7 +382,7 @@ Sets the current selection model to \a selectionModel. Note: If setModel() is called after this function, the given selectionModel will be replaced by default selection model of the view. - */ +*/ void HbAbstractItemView::setSelectionModel(QItemSelectionModel *selectionModel) { Q_D(HbAbstractItemView); @@ -331,7 +395,7 @@ /*! If \a newMode is not same as current selection mode of view, updates selection mode, all viewitems and clears all existing selections. - */ +*/ void HbAbstractItemView::setSelectionMode(SelectionMode newMode) { Q_D(HbAbstractItemView); @@ -346,22 +410,24 @@ /*! Selects all items in the view. - */ +*/ void HbAbstractItemView::selectAll() { Q_D(HbAbstractItemView); - if (d->mModelIterator->model() - && d->mSelectionModel - && d->mSelectionMode == MultiSelection) { - QModelIndex firstIndex = d->mModelIterator->nextIndex(QModelIndex()); - QModelIndex lastIndex = d->mModelIterator->previousIndex(QModelIndex()); + QAbstractItemModel *model = d->mModelIterator->model(); + if ( model + && d->mSelectionModel + && d->mSelectionMode == MultiSelection) { + QModelIndex rootIndex = d->mModelIterator->rootIndex(); + QModelIndex firstIndex = model->index(0, 0, rootIndex); + QModelIndex lastIndex = model->index(model->rowCount(rootIndex)-1, 0, rootIndex); d->mSelectionModel->select(QItemSelection(firstIndex, lastIndex), QItemSelectionModel::Select); } } /*! Deselects all selected items. The current index will not be changed. - */ +*/ void HbAbstractItemView::clearSelection() { Q_D(HbAbstractItemView); @@ -374,7 +440,7 @@ /*! Returns current selection mode used by view. - */ +*/ HbAbstractItemView::SelectionMode HbAbstractItemView::selectionMode() const { Q_D(const HbAbstractItemView); @@ -383,7 +449,7 @@ /*! Returns index of current item. - */ +*/ QModelIndex HbAbstractItemView::currentIndex() const { Q_D(const HbAbstractItemView); @@ -394,7 +460,7 @@ Sets current index to \a index. The item is selected depending on the \a selectionFlag. By default item is not selected. If current selection mode is NoSelection, item is not selected irrespective of the selection flag. - */ +*/ void HbAbstractItemView::setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags selectionFlag) { @@ -416,7 +482,7 @@ Returns model index of the model's root item. The root item is parent item to view's top level items. The root can be invalid. - */ +*/ QModelIndex HbAbstractItemView::rootIndex() const { Q_D(const HbAbstractItemView); @@ -428,7 +494,7 @@ All view items are deleted and recreated Note! View items may be created asynchronously. - */ +*/ void HbAbstractItemView::setRootIndex(const QModelIndex &index) { Q_D(HbAbstractItemView); @@ -442,7 +508,7 @@ /*! Resets Item view. - */ +*/ void HbAbstractItemView::reset() { Q_D(HbAbstractItemView); @@ -455,7 +521,7 @@ /*! \reimp - It should be allways called by child class if overriden. + It should be always called by child class if overridden. */ bool HbAbstractItemView::event(QEvent *e) { @@ -533,7 +599,7 @@ /*! Sets item recycling to \a enabled. By default recycling is off. - */ +*/ void HbAbstractItemView::setItemRecycling(bool enabled) { Q_D(HbAbstractItemView); @@ -542,7 +608,7 @@ /*! Returns whether item recycling feature is in use. - */ +*/ bool HbAbstractItemView::itemRecycling() const { Q_D(const HbAbstractItemView); @@ -572,7 +638,7 @@ /*! Returns true if item with model index is fully or partially visible in view. - */ +*/ bool HbAbstractItemView::isVisible(const QModelIndex & index) const { Q_D( const HbAbstractItemView ); @@ -583,7 +649,7 @@ Base class implemmentation. Take care about scrollTo when it was called before view was visible (first scrollTo can be done after first layoutRequest). - It should be always called by child class if overriden. + It should be always called by child class if overridden. Note! If item recycling is enabled, view item may not have reached its final position, when this function returns. Then its position is fine tuned asynchronously. @@ -611,16 +677,17 @@ /*! Returns list of currently visible view items. - */ +*/ QList HbAbstractItemView::visibleItems() const { Q_D(const HbAbstractItemView); QList visibleItems; - const int count(d->mContainer->items().count()); + QList containerItems = d->mContainer->items(); + const int count(containerItems.count()); for (int i = 0; i < count; ++i) { - if(d->visible(d->mContainer->items().at(i), false)) - visibleItems.append(d->mContainer->items().at(i)); + if(d->visible(containerItems.at(i), false)) + visibleItems.append(containerItems.at(i)); } return visibleItems; } @@ -738,12 +805,8 @@ HbAbstractViewItem *item = d->mContainer->itemByIndex(selectedIndexes.at(i)); if (item) { item->setCheckState(Qt::Checked); - if (!d->mClearingSelection) { - Hb::InteractionModifiers modifiers = 0; - if (d->mIsScrolling) { - modifiers |= Hb::ModifierScrolling; - } - HbWidgetFeedback::triggered(item, Hb::InstantSelectionChanged, modifiers); + if (!d->mClearingSelection && !d->mDoingContiguousSelection) { + HbWidgetFeedback::triggered(item, Hb::InstantSelectionChanged); } } d->mContainer->setItemTransientStateValue(selectedIndexes.at(i), @@ -757,7 +820,7 @@ HbAbstractViewItem *item = d->mContainer->itemByIndex(deselectedIndexes.at(i)); if (item) { item->setCheckState(Qt::Unchecked); - if (!d->mClearingSelection) { + if (!d->mClearingSelection && !d->mDoingContiguousSelection) { HbWidgetFeedback::triggered(item, Hb::InstantSelectionChanged); } } @@ -968,10 +1031,10 @@ } /*! - Returns the current name of layout definition of view items of this view + Returns the current name of layout definition of view items of this view. \sa setLayoutName() - */ +*/ QString HbAbstractItemView::layoutName() const { Q_D(const HbAbstractItemView); @@ -990,7 +1053,7 @@ is "default". \sa layoutOption() - */ +*/ void HbAbstractItemView::setLayoutName(const QString &layoutName) { Q_D(HbAbstractItemView); @@ -1011,6 +1074,8 @@ the same size. This enables the view to do some optimizations for performance purposes. By default, this property is false. + + \sa uniformItemSizes */ void HbAbstractItemView::setUniformItemSizes(bool enable) { @@ -1019,8 +1084,10 @@ } /*! - Returns the current value of the uniformItemsSizes property - */ + Returns the current value of the uniformItemsSizes property. + + By default, this property is false. +*/ bool HbAbstractItemView::uniformItemSizes() const { Q_D(const HbAbstractItemView); @@ -1037,17 +1104,17 @@ } /*! - Sets the bitmask controlling the item animations. - */ - void HbAbstractItemView::setEnabledAnimations(HbAbstractItemView::ItemAnimations flags) + Sets the bitmask controlling the item animations. +*/ +void HbAbstractItemView::setEnabledAnimations(HbAbstractItemView::ItemAnimations flags) { Q_D(HbAbstractItemView); d->mEnabledAnimations = flags; } /*! - Returns the mask controlling the item animations. - */ + Returns the mask controlling the item animations. +*/ HbAbstractItemView::ItemAnimations HbAbstractItemView::enabledAnimations() const { Q_D(const HbAbstractItemView); @@ -1101,7 +1168,7 @@ } /*! - This slot is called when touch release event occurs for view item. + This slot is called when release event occurs for view item. Default implementation calls emitReleased(). \sa HbAbstractViewItem::released(const QPointF &position) @@ -1162,7 +1229,7 @@ /*! This slot is called when concrete view item has been created. Default implementation connects - touch event releated signals of HbAbstractViewItem to respective slots in this class. + touch event related signals of HbAbstractViewItem to respective slots in this class. \sa HbAbstractViewItem::pressed(const QPointF &position) \sa HbAbstractViewItem::released(const QPointF &position) @@ -1197,13 +1264,13 @@ } /*! - * Sets the value of the longPressEnabled property. This value is set - * to true if the widget is to respond to long press gestures, false otherwise. - * - * The default value is true. - * - * \sa HbAbstractItemView::longPressEnabled() - */ + Sets the value of the longPressEnabled property. This value is set + to true if the widget is to respond to long press gestures, false otherwise. + + The default value is true. + + \sa HbAbstractItemView::longPressEnabled() +*/ void HbAbstractItemView::setLongPressEnabled(bool enabled) { Q_D(HbAbstractItemView); @@ -1211,10 +1278,10 @@ } /*! - Returns true if the item view handles long press gestures, false otherwise - + Returns true if the item view handles long press gestures, false otherwise. + \sa HbAbstractItemView::setLongPressEnabled() - */ +*/ bool HbAbstractItemView::longPressEnabled() const { Q_D(const HbAbstractItemView); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractitemview.h --- a/src/hbwidgets/itemviews/hbabstractitemview.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractitemview.h Thu Jul 22 16:36:53 2010 +0100 @@ -44,7 +44,7 @@ Q_ENUMS(SelectionMode ScrollHint) Q_FLAGS(ItemAnimations) - + Q_PROPERTY(bool itemRecycling READ itemRecycling WRITE setItemRecycling) Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode) Q_PROPERTY(QString layoutName READ layoutName WRITE setLayoutName) @@ -124,7 +124,7 @@ bool uniformItemSizes() const; HbModelIterator *modelIterator() const; - + void setEnabledAnimations(ItemAnimations flags); ItemAnimations enabledAnimations() const; @@ -151,6 +151,11 @@ HbAbstractItemContainer *container, HbModelIterator *modelIterator, QGraphicsItem *parent = 0); + + HbAbstractItemView(HbAbstractItemContainer *container, + HbModelIterator *modelIterator, + QGraphicsItem *parent = 0); + virtual QItemSelectionModel::SelectionFlags selectionCommand( const HbAbstractViewItem *item, const QEvent *event); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractitemview_p.cpp --- a/src/hbwidgets/itemviews/hbabstractitemview_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractitemview_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -60,10 +60,10 @@ mPostponedScrollHint(HbAbstractItemView::PositionAtTop), mPreviousSelectedCommand(QItemSelectionModel::NoUpdate), mAnimationTimer(0), - mModelIterator(0), + mModelIterator(0), mEnabledAnimations(HbAbstractItemView::All), mLongPressEnabled(true), - mDoingContiguousSelection(false) + mDoingContiguousSelection(false) { } @@ -349,7 +349,7 @@ bool HbAbstractItemViewPrivate::panTriggered(QGestureEvent *event) { Q_Q(HbAbstractItemView); - + int retVal = false; HbPanGesture *gesture = static_cast(event->gesture(Qt::PanGesture)); switch (gesture->state()) { @@ -359,7 +359,6 @@ case Qt::GestureUpdated: { QPointF scenePos = event->mapToGraphicsScene(gesture->hotSpot()); if (mDoingContiguousSelection) { - int retVal = false; // loop through the items in the scene qreal scenePosY = scenePos.y(); @@ -380,7 +379,7 @@ mouseMoveEvent.setPos(position); QItemSelectionModel::SelectionFlags command = q->selectionCommand(item, &mouseMoveEvent); - // in contiguousselectionarea there shall be no panning from HbScrollArea, thus return true + // in contiguousselectionarea there shall be no panning from HbScrollArea, thus return true if (command != QItemSelectionModel::NoUpdate) { retVal = true; } @@ -390,6 +389,7 @@ mPreviousSelectedIndex = itemIndex; mPreviousSelectedCommand = command; mSelectionModel->select(itemIndex, command); + HbWidgetFeedback::triggered(q, Hb::InstantSelectionChanged, Hb::ModifierScrolling); } // check if we need to start or keep on scrolling @@ -426,9 +426,8 @@ break; } } - return retVal; } - else if (!mDoingContiguousSelection){ + else { HbWidgetFeedback::continuousTriggered(q, Hb::ContinuousScrolled); } break; @@ -439,7 +438,7 @@ if (mDoingContiguousSelection) { stopAnimating(); mDoingContiguousSelection = false; - return true; + retVal = true; } else { HbWidgetFeedback::continuousStopped(q, Hb::ContinuousScrolled); @@ -449,8 +448,7 @@ default: break; } - - return false; + return retVal; } /*! @@ -480,7 +478,7 @@ mFrictionEnabled = mOrigFriction; - QObject::disconnect(q, SIGNAL(scrollPositionChanged(QPointF)), q, SLOT(_q_scrollingI(QPointF))); + QObject::disconnect(q, SIGNAL(scrollPositionChanged(QPointF)), q, SLOT(_q_scrolling(QPointF))); QObject::disconnect(q, SIGNAL(scrollingEnded()), q, SLOT(_q_scrollingEnded())); QObject::disconnect(q, SIGNAL(scrollingStarted()), q, SLOT(_q_scrollingStarted())); } @@ -508,13 +506,7 @@ QModelIndex lastVisibleModelIndex; mContainer->firstAndLastVisibleModelIndex(firstVisibleModelIndex, lastVisibleModelIndex); - if (mModelIterator->model()) { - if (lastVisibleModelIndex == mModelIterator->index(mModelIterator->indexCount() - 1)) { - mVisibleIndex = lastVisibleModelIndex; - } else { - mVisibleIndex = firstVisibleModelIndex; - } - } + mVisibleIndex = firstVisibleModelIndex; } /*! @@ -663,8 +655,8 @@ case QEvent::GraphicsSceneMouseDoubleClick: { // check if the mouse click is in the multiselectionarea - if (item->selectionAreaContains(static_cast(event)->pos(), HbAbstractViewItem::MultiSelection)) { - mSelectionSettings |= Selection; + if (item->selectionAreaContains(static_cast(event)->pos(), HbAbstractViewItem::MultiSelection)) { + mSelectionSettings |= Selection; if (mSelectionModel && mSelectionModel->isSelected(item->modelIndex())) { mContSelectionAction = QItemSelectionModel::Deselect; } else { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractviewitem.cpp --- a/src/hbwidgets/itemviews/hbabstractviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,12 +35,15 @@ #include #include #include +#include #include #include #include #include #include +#include +#include #include #include @@ -48,6 +51,7 @@ const QString KDefaultLayoutOption = "default"; const int HbAbstractViewItemShared::ViewItemDeferredDeleteEvent = QEvent::registerEventType(); +const int HbViewItemPressDelay = 50; /*! @alpha @@ -72,9 +76,55 @@ If derived abstract view item has transient state information that is not meaningful to store within model index (child item cursor position selection areas etc.) this information can be supplied to transient state model. Transient state model is maintained internally by abstract item view. + + + \primitives + \primitive{background} HbIconItem representing the item background. This primitive exists in cases the model's Qt::BackgroundRole returns HbIcon or QBrush for this item. + \primitive{frame} HbFrameItem representing the background frame of the item. This primitive exists if background primitive does not exist and the model's Qt::BackgroundRole returns HbFrameBackground or there is a default frame set with the setDefaultFrame(). An item can have either the frame or the background primitive, but not the both at the same time. + \primitive{selection-icon} HbIconItem representing the checkbox in the multi selection mode. + \primitive{multiselection-toucharea} HbTouchArea used in extending the touch area of the selection-icon. */ /*! + \enum HbAbstractViewItem::SelectionAreaType + + Enumeration specifies selection area types. + + Multiselection selection mode may operate in contiguous selection mode, in which items are selected + or deselected by panning over items. Normal multiselection functionality is available also in this mode. + Location of touch down gesture determines whether contiguous selection mode is activated. + + \sa HbAbstractViewItem::selectionAreaContains(const QPointF &position, SelectionAreaType selectionAreaType) const +*/ + +/*! + \var HbAbstractViewItem::SingleSelection + + Selection area for single selection mode. + + \sa HbAbstractViewItem::selectionAreaContains(const QPointF &position, SelectionAreaType selectionAreaType) const +*/ + + +/*! + \var HbAbstractViewItem::MultiSelection + + Selection area for multiple selection mode. + + \sa HbAbstractViewItem::selectionAreaContains(const QPointF &position, SelectionAreaType selectionAreaType) const +*/ + + +/*! + \var HbAbstractViewItem::ContiguousSelection + + Selection area for contiguous selection mode. + + \sa HbAbstractViewItem::selectionAreaContains(const QPointF &position, SelectionAreaType selectionAreaType) const +*/ + + +/*! \fn void HbAbstractViewItem::pressed(const QPointF &position) This signal is emitted when a touch down event is received for this view item. @@ -127,6 +177,12 @@ \snippet{ultimatecodesnippet/customlistviewitem.cpp,1} */ +void HbAbstractViewItemShared::pressStateChangeTimerTriggered() +{ + HbWidgetFeedback::triggered(mPressedItem, Hb::InstantPressed, 0); + mPressedItem->pressStateChanged(true, mAnimatePress); +} + void HbAbstractViewItemPrivate::init() { Q_Q(HbAbstractViewItem); @@ -147,6 +203,11 @@ } } +/*! + Returns Hb::ModelItemType of this view item. + + \sa Hb::ModelItemType +*/ int HbAbstractViewItemPrivate::modelItemType() const { return mIndex.data(Hb::ItemTypeRole).toInt(); @@ -204,7 +265,11 @@ switch (gesture->state()) { case Qt::GestureStarted: { - HbWidgetFeedback::triggered(q, Hb::InstantPressed, 0); + q->scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + if (!gesture->property(HbPrivate::ThresholdRect.latin1()).toRect().isValid()) { + gesture->setProperty(HbPrivate::ThresholdRect.latin1(), q->mapRectToScene(q->boundingRect()).toRect()); + } + setPressed(true, true); emit q->pressed(position); break; @@ -223,13 +288,14 @@ break; } case Qt::GestureFinished: { - HbWidgetFeedback::triggered(q, Hb::InstantReleased, 0); + q->scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); if (gesture->tapStyleHint() == HbTapGesture::Tap || (mSharedData->mItemView && !mSharedData->mItemView->longPressEnabled())) { setPressed(false, true); + HbWidgetFeedback::triggered(q, Hb::InstantReleased, 0); HbWidgetFeedback::triggered(q, Hb::InstantClicked); QPointer item = q; emit item->activated(position); @@ -242,13 +308,14 @@ } } } else { + HbWidgetFeedback::triggered(q, Hb::InstantReleased,0); emit q->released(position); } break; } case Qt::GestureCanceled: { - + q->scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); // hides focus immediately setPressed(false, false); @@ -277,10 +344,31 @@ if (pressed != mPressed) { mPressed = pressed; - q->pressStateChanged(mPressed, animate); + + if (mSharedData->mPressStateChangeTimer) { + if(!pressed && animate && mSharedData->mPressStateChangeTimer->isActive()) { + // Release happened while press still delayed + mSharedData->mPressStateChangeTimer->stop(); + mSharedData->pressStateChangeTimerTriggered(); + } else { + mSharedData->mPressStateChangeTimer->stop(); + } + } + if (mPressed) { + if (!mSharedData->mPressStateChangeTimer) { + mSharedData->mPressStateChangeTimer = new QTimer(mSharedData.data()); + mSharedData->mPressStateChangeTimer->setSingleShot(true); + QObject::connect(mSharedData->mPressStateChangeTimer, SIGNAL(timeout()), mSharedData.data(), SLOT(pressStateChangeTimerTriggered())); + } + mSharedData->mPressedItem = q; + mSharedData->mAnimatePress = animate; + mSharedData->mPressStateChangeTimer->start(HbViewItemPressDelay); + q->setProperty("state", "pressed"); } else { + q->pressStateChanged(mPressed, animate); + q->setProperty("state", "normal"); } } @@ -490,11 +578,11 @@ Default selection areas are for \li HbAbstractViewItem::SingleSelection mode: whole item \li HbAbstractViewItem::MultiSelection mode: whole item. - \li HbAbstractItemView::NoSelection mode: none + \li HbAbstractViewItem::ContiguousSelection mode: area of HbStyle::P_ItemViewItem_touchmultiselection icon. The \a selectionAreaType tells what kind of selection area is requested. The parameter value ContiguousSelection returns - the area where mouse movement will extend the selection to new items. By default this contiguous selection area is - the HbStyle::P_ItemViewItem_touchmultiselection. + the area where mouse movement will extend the selection to new items. By default this contiguous selection area is + the HbStyle::P_ItemViewItem_touchmultiselection. */ bool HbAbstractViewItem::selectionAreaContains(const QPointF &position, SelectionAreaType selectionAreaType) const @@ -586,6 +674,10 @@ } break; } + case ItemEnabledHasChanged: { + updateChildItems(); + break; + } default: break; } @@ -596,7 +688,7 @@ /*! \reimp - To optimise loading css/xml definitions to take place only once, this function should be + To optimize loading css/xml definitions to take place only once, this function should be called only after other primitives (child items) has been created. */ @@ -749,7 +841,7 @@ GraphicsItemFlags itemFlags = flags(); Qt::ItemFlags indexFlags = d->mIndex.flags(); - if (indexFlags & Qt::ItemIsEnabled) { + if ((indexFlags & Qt::ItemIsEnabled) && sd->mItemView && sd->mItemView->isEnabled()) { if (!(itemFlags & QGraphicsItem::ItemIsFocusable)) { itemFlags |= QGraphicsItem::ItemIsFocusable; setFocusPolicy(sd->mPrototype->focusPolicy()); @@ -812,13 +904,18 @@ } // items visibility or items content has really changed - d->mSizeHintPolish = false; updatePrimitives(); if (!d->mContentChangedSupported || d->mItemsChanged) { updateGeometry(); // ensures that sizehint is calculated again in case items have been created or deleted d->mRepolishRequested = true; + // handle QEvent::Polish & QEvent::LayoutRequest event itself in ::sizeHint() as our performance is slightly better + // (saving a layoutrequest and going event loop through twice) + if (sd->mItemView && sd->mItemView->isScrolling()) { + d->mHandlingRepolishSynchronously = true; + } repolish(); + d->mHandlingRepolishSynchronously = false; } d->mItemsChanged = false; } @@ -872,7 +969,7 @@ if (!d->mFocusItem) { d->mFocusItem = style()->createPrimitive(HbStyle::P_ItemViewItem_focus, this); } - + HbStyleOptionAbstractViewItem styleOption; initStyleOption(&styleOption); @@ -896,10 +993,10 @@ HbEffect::start(d->mFocusItem, sd->mItemType + QString("-focus"), "released", this, "_q_animationFinished"); } else { HbEffect::cancel(this, "pressed"); - HbEffect::start(this, sd->mItemType, "released"); + HbEffect::cancel(this, "released"); if (d->mFocusItem) { HbEffect::cancel(d->mFocusItem, "pressed"); - HbEffect::start(d->mFocusItem, sd->mItemType + QString("-focus"), "released", this, "_q_animationFinished"); + HbEffect::cancel(d->mFocusItem, "released"); QCoreApplication::postEvent(this, new QEvent((QEvent::Type)HbAbstractViewItemShared::ViewItemDeferredDeleteEvent)); } } @@ -922,13 +1019,8 @@ { HB_SDD(HbAbstractViewItem); - if (!d->polished && layout()) { - return; - } - - if (d->mSizeHintPolish) { - d->mSizeHintPolish = false; - return; + if (!d->polished && layout()) { + return; } if (sd->mItemView) { @@ -958,16 +1050,17 @@ { Q_D(const HbAbstractViewItem); if (d->mRepolishRequested) { - // force the polish event in order to get the real size - const_cast(d)->mRepolishRequested = false; - QEvent polishEvent(QEvent::Polish); - QCoreApplication::sendEvent(const_cast(this), &polishEvent); - // HbAbstractItemView::scrollByAmount() [recycleItems()] - // causes updateChildItems() to be called, which posts Polish to be posted via repolish(). - // Next statement in the scrollByAmount() [refreshContainerGeometry()] - // causes synchronous call of this method. This is a quick way to disable another - // ::polish() to be called. - d->mSizeHintPolish = true; + if (d->repolishOutstanding) { + // force the polish event in order to get the real size + // updateGeometry() in ::updateChildItems() causes this function to be called + // before QEvent::Polish of repolish() is handled from the event loop + QCoreApplication::sendPostedEvents(const_cast(this), QEvent::Polish); + } else { + // needed for pure widget or at startup phase, if first polish has not yet been done + QEvent polishEvent(QEvent::Polish); + QCoreApplication::sendEvent(const_cast(this), &polishEvent); + } + QCoreApplication::sendPostedEvents(const_cast(this), QEvent::LayoutRequest); } return HbWidget::sizeHint(which, constraint); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractviewitem.h --- a/src/hbwidgets/itemviews/hbabstractviewitem.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractviewitem.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,6 +37,7 @@ QT_END_NAMESPACE class HbAbstractViewItemPrivate; +class HbAbstractViewItemShared; class HbAbstractItemView; class HbStyleOptionAbstractViewItem; class HbStyleParameters; @@ -116,6 +117,8 @@ private: Q_DECLARE_PRIVATE_D( d_ptr, HbAbstractViewItem ) Q_PRIVATE_SLOT(d_func(), void _q_animationFinished(const HbEffect::EffectStatus &status)) + + friend class HbAbstractViewItemShared; }; #endif /*HBABSTRACTVIEWITEM_H*/ diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbabstractviewitem_p.h --- a/src/hbwidgets/itemviews/hbabstractviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbabstractviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -32,6 +32,7 @@ #include #include +#include #include #include #include @@ -39,24 +40,34 @@ class HbAbstractItemView; class QGraphicsItem; - +class QTimer; class QGestureEvent; #define HB_SD(Class) Class##Shared * sd = (Class##Shared *)(d->mSharedData.data()) #define HB_SDD(Class) Q_D(Class); Class##Shared * sd = (Class##Shared *)(d->mSharedData.data()) -class HbAbstractViewItemShared : public QSharedData +class HbAbstractViewItemShared : public QObject, public QSharedData { + Q_OBJECT + public: HbAbstractViewItemShared() : mPrototype(0), mItemView(0), mDefaultFrame(), - mItemType("viewitem") + mItemType("viewitem"), + mPressStateChangeTimer(0), + mPressedItem(0) { } + public slots: + + void pressStateChangeTimerTriggered(); + + public: + HbAbstractViewItem *mPrototype; HbAbstractItemView *mItemView; @@ -65,6 +76,10 @@ QString mItemType; static const int ViewItemDeferredDeleteEvent; + + QTimer *mPressStateChangeTimer; + HbAbstractViewItem *mPressedItem; + bool mAnimatePress; }; class HbAbstractViewItemPrivate : public HbWidgetPrivate @@ -73,7 +88,7 @@ public: - HbAbstractViewItemPrivate(HbAbstractViewItem *prototype, HbAbstractViewItemShared *shared = 0) : + explicit HbAbstractViewItemPrivate(HbAbstractViewItem *prototype, HbAbstractViewItemShared *shared = 0) : HbWidgetPrivate(), mFocused(false), mBackgroundItem(0), @@ -84,7 +99,6 @@ mRepolishRequested(false), mContentChangedSupported(false), mItemsChanged(false), - mSizeHintPolish(false), mPressed(false), mFocusItem(0), mMultiSelectionTouchArea(0), @@ -108,7 +122,6 @@ mRepolishRequested(false), mContentChangedSupported(source.mContentChangedSupported), mItemsChanged(false), - mSizeHintPolish(false), mPressed(false), mFocusItem(0), mMultiSelectionTouchArea(0), @@ -129,7 +142,6 @@ mRepolishRequested = false; mContentChangedSupported = source.mContentChangedSupported; mItemsChanged = false; - mSizeHintPolish = false; mPressed = false; mFocusItem = 0; mSharedData = source.mSharedData; @@ -181,7 +193,6 @@ bool mContentChangedSupported; // Status of child item existence changed. bool mItemsChanged; - mutable bool mSizeHintPolish; bool mPressed; QGraphicsItem *mFocusItem; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbgriditemcontainer_p.cpp --- a/src/hbwidgets/itemviews/hbgriditemcontainer_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbgriditemcontainer_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -154,7 +154,7 @@ Set model indexes starting from \a startIndex. If \a startIndex is not a index of first item in a row, then it is calculated automatically (prevent) from different content looking (grid items arrangement should be - always the same). If there is not enought items function fetch data that + always the same). If there is not enough items function fetch data that are before \a startIndex. After calling this function item, with specified index is in container but it position depends on model size. If \a startIndex is invlaid then container is filled starting from first @@ -528,12 +528,12 @@ /*! \reimp - In grid case items are allways same size + In grid case items are always same size */ void HbGridItemContainer::setUniformItemSizes(bool enable) { Q_UNUSED(enable); - // d->mUniformItemSizes - allways true + // d->mUniformItemSizes - always true } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbgriditemcontainer_p_p.cpp --- a/src/hbwidgets/itemviews/hbgriditemcontainer_p_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbgriditemcontainer_p_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -63,7 +63,7 @@ qreal HbGridItemContainerPrivate::getDiffWithoutScrollareaCompensation(const QPointF &delta) const { - // substract invisible space from delta - part of scrolling that can + // subtract invisible space from delta - part of scrolling that can // be done by scroll area Q_Q(const HbGridItemContainer); const QSizeF containerSize(q->size()); @@ -547,7 +547,7 @@ QModelIndex index; if (mItems.size() == 0) { // in case when buffer was empty and to be sure - // it allways has at least one item - to make rest + // it always has at least one item - to make rest // code simpler index = mItemView->model()->index(startingIndex, 0); if (index.isValid()) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbgridview.cpp --- a/src/hbwidgets/itemviews/hbgridview.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbgridview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -49,20 +49,20 @@ Items are arranged according to the scroll direction i.e Qt::Horizontal lays out items horizontally and Qt::Vertical lays out items vertically. - By default the HbScrollArea::ClampingStyle used is BounceBackClamping, the HbScrollArea::ScrollingStyle is PanOrFlick, + By default the HbScrollArea::ClampingStyle used is BounceBackClamping, the HbScrollArea::ScrollingStyle is PanWithFollowOn, scrollbars are invisible and recycling and inertia are disabled. The following code snippet demonstrates the use of HbGridView \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,21} - */ +*/ /*! GridView recycling is in proto state. - */ +*/ /*! See also HbAbstractItemView,HbAbstractViewitem,HbGridViewItem,HbScrollArea - */ +*/ /*! \fn void HbGridView::setUniformItemSizes(bool enabled) is public from HbAbstractItemView but for HbGridView @@ -72,7 +72,7 @@ /*! Constructs a new HbGridView with \a parent. - */ +*/ HbGridView::HbGridView(QGraphicsItem *parent) : HbAbstractItemView(*new HbGridViewPrivate(), new HbGridItemContainer(), new HbModelIterator(), parent) { @@ -84,7 +84,7 @@ /*! Constructs a grid view with a private class object \a dd, \a container and \a parent. - */ +*/ HbGridView::HbGridView(HbGridViewPrivate &dd, HbAbstractItemContainer *container, QGraphicsItem *parent) : HbAbstractItemView(dd, container, new HbModelIterator(), parent) { @@ -104,7 +104,7 @@ Returns the total number of rows in the view. \sa setRowCount() - */ +*/ int HbGridView::rowCount() const { Q_D(const HbGridView); @@ -115,7 +115,7 @@ Sets the total number of rows to \a rowCount. \sa HbGridView::rowCount() - */ +*/ void HbGridView::setRowCount(int rowCount) { Q_D(HbGridView); @@ -131,7 +131,7 @@ Returns the total number of columns in the view. \sa setColumnCount() - */ +*/ int HbGridView::columnCount() const { Q_D(const HbGridView); @@ -142,7 +142,7 @@ Sets the total number of columns to \a columnCount. \sa columnCount() - */ +*/ void HbGridView::setColumnCount(int columnCount) { Q_D(HbGridView); @@ -159,7 +159,7 @@ Returns true if icons are currently displayed in GridView. \sa setIconVisible() - */ +*/ bool HbGridView::iconVisible() const { Q_D(const HbGridView); @@ -172,7 +172,7 @@ By default icons are visible. \sa iconVisible() - */ +*/ void HbGridView::setIconVisible(bool visible) { Q_D(HbGridView); @@ -183,7 +183,7 @@ Returns visibility of text in grid view. \sa setTextVisible() - */ +*/ bool HbGridView::textVisible() const { Q_D(const HbGridView); @@ -196,16 +196,43 @@ By default text is visible. \sa HbGridView::textVisible() - */ +*/ void HbGridView::setTextVisible(bool visible) { Q_D(HbGridView); d->setTextVisible(visible); } + +/*! + Returns true if the HbGridView will automatically swap the row and column counts in orientation change. + + \sa HbGridView::setSwapDimensionsOnOrientationChange() + */ +bool HbGridView::swapDimensionsOnOrientationChange() const +{ + Q_D(const HbGridView); + return d->mSwapDimensionsOnOrientationChange; +} + +/*! + Sets automatic row and column count swapping in orientatation change to \a swap. + + By default the row and column counts are swapped in orientation change. + + \sa HbGridView::swapDimensionsOnOrientationChange() + */ + +void HbGridView::setSwapDimensionsOnOrientationChange(bool swap) +{ + Q_D(HbGridView); + d->mSwapDimensionsOnOrientationChange = swap; +} + + /*! Returns item at \a row and \a column. - */ +*/ HbAbstractViewItem *HbGridView::itemAt(int row, int column) const { Q_D(const HbGridView); @@ -221,12 +248,12 @@ /*! \reimp - */ +*/ void HbGridView::scrollTo(const QModelIndex &index, ScrollHint hint) { Q_D(HbGridView); // always use container, event if recycling is off and all items are - // in container, but still aditional action is needed - + // in container, but still additional action is needed - // container::scrollTo is responsible for procesing all // posponed events (DelayedLayoutRequest) if ( d->mModelIterator->model() @@ -248,7 +275,7 @@ /*! \reimp - */ +*/ void HbGridView::orientationAboutToBeChanged() { Q_D(HbGridView); @@ -257,14 +284,16 @@ /*! \reimp - */ +*/ void HbGridView::orientationChanged(Qt::Orientation newOrientation) { Q_D(HbGridView); d->mContainer->setPos(0,0); - d->itemContainer()->orientationChanged(newOrientation); + if (d->mSwapDimensionsOnOrientationChange) { + d->itemContainer()->orientationChanged(newOrientation); + } - // abstract part is enought - container update buffer + // abstract part is enough - container update buffer HbAbstractItemView::scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtCenter); d->mVisibleIndex = QModelIndex(); @@ -361,7 +390,7 @@ /*! This slot is connected to scrollDirectionsChanged signal emitted from HbScrollArea. - */ +*/ void HbGridView::scrollDirectionChanged(Qt::Orientations scrollDirection) { Q_D(HbGridView); @@ -371,7 +400,7 @@ d->mContainer->setPos(0,0); d->itemContainer()->scrollDirectionChanged(scrollDirection); - // abstract part is enought - container update buffer + // abstract part is enough - container update buffer HbAbstractItemView::scrollTo(d->mVisibleIndex, HbAbstractItemView::PositionAtCenter); d->mVisibleIndex = QModelIndex(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbgridview.h --- a/src/hbwidgets/itemviews/hbgridview.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbgridview.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,6 +37,7 @@ Q_PROPERTY(int rowCount READ rowCount WRITE setRowCount) Q_PROPERTY(bool iconVisible READ iconVisible WRITE setIconVisible) Q_PROPERTY(bool textVisible READ textVisible WRITE setTextVisible) + Q_PROPERTY(bool swapDimensionsOnOrientationChange READ swapDimensionsOnOrientationChange WRITE setSwapDimensionsOnOrientationChange) public: explicit HbGridView(QGraphicsItem *parent = 0); @@ -55,6 +56,9 @@ bool textVisible() const; void setTextVisible(bool visible); + bool swapDimensionsOnOrientationChange() const; + void setSwapDimensionsOnOrientationChange(bool swap); + protected: void mouseMoveEvent(QGraphicsSceneMouseEvent *event); void orientationAboutToBeChanged(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbgridview_p.cpp --- a/src/hbwidgets/itemviews/hbgridview_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbgridview_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -38,7 +38,8 @@ HbGridViewPrivate::HbGridViewPrivate() : mIconVisible(true), - mTextVisible(true) + mTextVisible(true), + mSwapDimensionsOnOrientationChange(true) { } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbgridview_p.h --- a/src/hbwidgets/itemviews/hbgridview_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbgridview_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -65,6 +65,7 @@ public: bool mIconVisible; bool mTextVisible; + bool mSwapDimensionsOnOrientationChange; void relayout(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbgridviewitem.cpp --- a/src/hbwidgets/itemviews/hbgridviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbgridviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -52,6 +52,11 @@ implement the state() and setState() functions in the derived class. See also HbGridView, HbAbstractItemView, HbAbstractViewItem, HbStyleOptionAbstractViewItem + + \primitives + \primitive{icon} HbIconItem representing the icon in the HbGridViewItem. + \primitive{text} HbTextItem representing the text in the HbGridViewItem. + */ /*! @@ -108,7 +113,7 @@ /*! Assigns the \a source grid view item to this grid view item and returns a reference to this item. - */ +*/ HbGridViewItem &HbGridViewItem::operator=(const HbGridViewItem &source) { Q_D(HbGridViewItem); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbindexfeedback.cpp --- a/src/hbwidgets/itemviews/hbindexfeedback.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbindexfeedback.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -58,6 +58,10 @@ The sizing and number of characters to display are controlled by the IndexFeedbackPolicy. \sa HbAbstractItemView, HbIndexFeedback::IndexFeedbackPolicy. + + \primitives + \primitive{index-text} HbTextItem representing the text in the HbIndexFeedback. + \primitive{index-background} HbFrameItem representing the background of the HbIndexFeedback. */ /*! @@ -82,7 +86,7 @@ Index feedback will be the first letter of the contents of Hb::IndexFeedbackRole cast as a string. It will be displayed using a larger font centered over the list. - Recomended use is for alphabetically sorted lists. + Recommended use is for alphabetically sorted lists. */ /*! @@ -92,7 +96,7 @@ Hb::IndexFeedbackRole cast as a string. It will be displayed using a larger font centered over the list. - Recomended us is for month abreviations. + Recommended us is for month abreviations. */ /*! @@ -236,7 +240,9 @@ return d->mItemView; } -/* +/*! + \reimp + A scene event filter. It's purpose is to call calculatePopupRects on a resize event for the item view. */ @@ -251,7 +257,9 @@ return QGraphicsItem::sceneEventFilter(watched, ev); } -/* +/*! + \reimp + Rather than adding signals to HbScrollBar specifically to implement index feedback, an event filter is used. diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbindexfeedback_p.cpp --- a/src/hbwidgets/itemviews/hbindexfeedback_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbindexfeedback_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ +#include "hbindexfeedback_p.h" #include "hbindexfeedback.h" -#include "hbindexfeedback_p.h" #include #include @@ -133,6 +133,10 @@ q, SLOT(_q_hideIndexFeedback())); createPrimitives(); + + // ensure that the index feedback is shown on top of the itemView in + // all cases. + q->setZValue(1); } /* @@ -189,7 +193,7 @@ */ QString HbIndexFeedbackPrivate::displayText(const QVariant &data) const { - QString retVal = QString(); + QString retVal; switch (mIndexFeedbackPolicy) { case HbIndexFeedback::IndexFeedbackSingleCharacter: @@ -418,7 +422,7 @@ return; } - QRectF contentRect = mItemView->rect(); + QRectF contentRect = mItemView->mapToItem(q, mItemView->rect()).boundingRect(); HbScrollBar *verticalScrollBar = mItemView->verticalScrollBar(); HbScrollBar *horizontalScrollBar = mItemView->horizontalScrollBar(); @@ -502,7 +506,7 @@ { Q_Q( const HbIndexFeedback ); - qreal retVal; + qreal retVal = 0.0; switch (mIndexFeedbackPolicy) { case HbIndexFeedback::IndexFeedbackNone: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistitemcontainer_p.cpp --- a/src/hbwidgets/itemviews/hblistitemcontainer_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistitemcontainer_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,6 +30,7 @@ #include "hbabstractitemcontainer_p.h" #include "hbabstractitemview.h" #include "hblistviewitem.h" +#include "hblistview.h" #include "hbmodeliterator.h" #include @@ -129,7 +130,7 @@ bool HbListItemContainerPrivate::intoContainerBuffer(const QModelIndex &index) const { if (!mItems.isEmpty() - && mItems.first()->modelIndex().row() <= index.row() + && mItems.first()->modelIndex().row() <= index.row() && mItems.last()->modelIndex().row() >= index.row()){ return true; } else { @@ -168,7 +169,7 @@ if (minHeight == 0.0) { QModelIndex index; while (mItems.isEmpty()) { - // in practise following conditions must apply: itemview is empty and scrollTo() has been called. + // in practize following conditions must apply: itemview is empty and scrollTo() has been called. // Starts populating items from given mFirstItemIndex if ( mFirstItemIndex.isValid()) { index = mFirstItemIndex; @@ -237,17 +238,13 @@ if (animate) { Q_D(HbListItemContainer); - int itemCount = d->mItems.count(); - HbAbstractViewItem *item = 0; - for (int i = 0; i < itemCount; ++i) { - item = d->mItems.at(i); - if (item->modelIndex() == index) { - QPair pair(item, i); + HbAbstractViewItem *viewItem = d->item(index); + if (viewItem) { + if (HbEffect::effectRunning(viewItem)) { + QPair pair(viewItem, d->mapToLayoutIndex(d->mItems.indexOf(viewItem))); d->mAnimatedItems.append(pair); } - } - - if (!item) { + } else { return; } } @@ -256,6 +253,19 @@ } /*! + Sets the modelIndexes of \a count container items starting from item at \a containerStartRow row of the container + to model's indexes starting from \a modelStartRow +*/ +void HbListItemContainer::setItemModelIndexes(int containerStartRow, int modelStartRow, int count) +{ + Q_D(HbListItemContainer); + + for (int i = 0; i <= count; ++i) { + setItemModelIndex(d->mItems.at(containerStartRow + i), d->mItemView->modelIterator()->index(modelStartRow + i)); + } +} + +/*! \reimp */ void HbListItemContainer::itemRemoved( HbAbstractViewItem *item, bool animate ) @@ -385,7 +395,7 @@ // because only then container can go out of bounds qreal viewSize = itemView()->boundingRect().size().height(); if (layoutPreferredHeight + pos().y() < viewSize) { - // position is allways negative + // position is always negative // view out of bounds if (diff > 0.0) { QPointF posDiff(pos().x(), 0.0); @@ -506,6 +516,8 @@ newPos.setY(newPos.y() - item->preferredHeight()); setPos(newPos); } + + d->adjustContent(); } else { item->deleteLater(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistitemcontainer_p.h --- a/src/hbwidgets/itemviews/hblistitemcontainer_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistitemcontainer_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,6 +39,7 @@ virtual ~HbListItemContainer(); void removeItem(const QModelIndex &index, bool animate); + void setItemModelIndexes(int containerStartRow, int modelStartRow, int count); protected: @@ -47,6 +48,7 @@ virtual void itemAdded(int index, HbAbstractViewItem *item, bool animate = false); virtual void itemRemoved(HbAbstractViewItem *item, bool animate = false); + virtual void viewResized(const QSizeF &viewSize); QPointF recycleItems(const QPointF &delta); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistlayout_p_p.h --- a/src/hbwidgets/itemviews/hblistlayout_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistlayout_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -22,8 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ -#ifndef HBLISTITEMLAYOUT_P_P_H -#define HBLISTITEMLAYOUT_P_P_H +#ifndef HBLISTLAYOUT_P_P_H +#define HBLISTLAYOUT_P_P_H #include "hblistlayout_p.h" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistview.cpp --- a/src/hbwidgets/itemviews/hblistview.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,6 @@ #include "hblistlayout_p.h" #include "hblistviewitem.h" #include "hblistitemcontainer_p.h" -#include "hblistitemcontainer_p.h" #include "hbscrollbar.h" #include #include "hbmodeliterator.h" @@ -202,7 +201,7 @@ /*! Returns true if view is in arrange mode. False otherwise. - */ +*/ bool HbListView::arrangeMode() const { Q_D(const HbListView); @@ -210,8 +209,8 @@ } /*! - * Returns the view item being dragged. This is NULL if no item is being dragged. - */ + Returns the view item being dragged. This is NULL if no item is being dragged. +*/ HbAbstractViewItem *HbListView::draggedItem() const { Q_D( const HbListView ); @@ -233,25 +232,12 @@ { Q_D(HbListView); if (arrangeMode != d->mArrangeMode) { - if (arrangeMode == true) { - if (d->mSelectionMode != HbAbstractItemView::NoSelection - || !d->mModelIterator->model() - || !(d->mModelIterator->model()->supportedDropActions().testFlag(Qt::MoveAction))) { - return false; + if (d->mSelectionMode != HbAbstractItemView::NoSelection + || !d->mModelIterator->model() + || !(d->mModelIterator->model()->supportedDropActions().testFlag(Qt::MoveAction))) { + return false; } - verticalScrollBar()->setInteractive(true); - } else { - verticalScrollBar()->setInteractive(false); - } - d->mArrangeMode = arrangeMode; - d->mAnimateItems = !d->mArrangeMode; - - if (d->mArrangeMode == true) { - d->mOriginalFriction = d->mFrictionEnabled; - setFrictionEnabled(false); - } else { - setFrictionEnabled(d->mOriginalFriction); - } + d->arrangeModeSetup(arrangeMode); } return true; } @@ -317,14 +303,20 @@ /*! \reimp + + Derived implementations must respect the d->mMoveOngoing flag and not perform + any view actions when the flag is set. */ void HbListView::rowsInserted(const QModelIndex &parent, int start, int end) { Q_D(HbListView); + if (d->mMoveOngoing) + return; + if (parent == d->mModelIterator->rootIndex()) { HbAbstractItemView::rowsInserted(parent, start, end); - if (!d->mArrangeMode && d->animationEnabled(true)) { + if (d->animationEnabled(true)) { d->startAppearEffect("viewitem", "appear", parent, start, end); } } @@ -332,11 +324,17 @@ /*! \reimp + + Derived implementations must respect the d->mMoveOngoing flag and not perform + any view actions when the flag is set. */ void HbListView::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) { Q_D(HbListView); + if (d->mMoveOngoing) + return; + if (parent == d->mModelIterator->rootIndex()) { for (int i = start; i <= end; i++) { HbAbstractViewItem* item = viewItem(i); @@ -345,7 +343,7 @@ d->mDraggedItem = 0; } - if (!d->mArrangeMode && d->animationEnabled(false)) { + if (d->animationEnabled(false)) { d->mItemsAboutToBeDeleted.append(item); } } @@ -355,10 +353,17 @@ /*! \reimp + + Derived implementations must respect the d->mMoveOngoing flag and not perform + any view actions when the flag is set. */ void HbListView::rowsRemoved(const QModelIndex &parent, int start, int end) { Q_D(HbListView); + + if (d->mMoveOngoing) + return; + if (parent == d->mModelIterator->rootIndex()) { if (d->animationEnabled(false)) { for (int i = 0; i < d->mItemsAboutToBeDeleted.count(); i++) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistview_p.cpp --- a/src/hbwidgets/itemviews/hblistview_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistview_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,9 +25,11 @@ #include "hblistview_p.h" #include "hblistview.h" +#include "hbscrollbar.h" #include "hblistviewitem.h" #include "hbabstractitemcontainer_p.h" +#include "hblistitemcontainer_p.h" #include #include "hbmodeliterator.h" #include @@ -52,7 +54,8 @@ mMousePressPos(), mScrollStartMousePos(), mLastScrollPos(), - mOriginalTransform() + mOriginalTransform(), + mMoveOngoing(false) { } @@ -121,8 +124,16 @@ //mDraggedItem->setPressed(false, false); int targetRow = targetIndex.row(); + int startRow = qMin(targetRow, mDraggedItemIndex.row()); + int endRow = qMax(targetRow, mDraggedItemIndex.row()); + int containerStartIndex = mContainer->items().at(0)->modelIndex().row(); + mMoveOngoing = true; q->move(mDraggedItemIndex, targetIndex); - + static_cast (mContainer)->setItemModelIndexes(startRow - containerStartIndex, + startRow, + endRow - startRow); + mMoveOngoing = false; + // in the swap the dragged item may have been deleted and recreated. So take it again here mDraggedItemIndex = mModelIterator->index(targetRow); if (mDraggedItemIndex.isValid()) { @@ -165,10 +176,13 @@ mDraggedItemIndex = mDraggedItem->modelIndex(); if (mDraggedItemIndex.isValid()) { + HbEffect::cancel(mDraggedItem, QString(), true); mMousePressTimer.restart(); mMousePressPos = scenePos; mOriginalTransform = mDraggedItem->transform(); mDraggedItem->setZValue(mDraggedItem->zValue() + 1); + mDraggedItem->translate(0, event->mapToGraphicsScene(gesture->offset()).y() - + event->mapToGraphicsScene(gesture->lastOffset()).y()); QObject::connect(q, SIGNAL(scrollPositionChanged(QPointF)), q, SLOT(scrolling(QPointF))); } else { @@ -185,8 +199,6 @@ if (!q->isScrolling()) { // move the item with the cursor to indicate the move - //qDebug() << "ScenePos: " << scenePos; - //qDebug() << "Offset: " << event->mapToGraphicsScene(gesture->offset()).y() << " lastOffset: " << event->mapToGraphicsScene(gesture->lastOffset()).y(); mDraggedItem->translate(0, event->mapToGraphicsScene(gesture->offset()).y() - event->mapToGraphicsScene(gesture->lastOffset()).y()); @@ -207,8 +219,10 @@ QModelIndex firstItemIndex = mContainer->items().first()->modelIndex(); QModelIndex lastItemIndex = mContainer->items().last()->modelIndex(); // If the item is dragged up in the list (and there are more items to show), scroll up - if (!q->isScrolling() - && !q->isVisible(firstItemIndex) + + if (!mIsAnimating + && !(visible(mContainer->itemByIndex(firstItemIndex), true) + && (firstItemIndex.row() == 0)) && scenePos.y() < mMousePressPos.y() && pos.y() < q->itemByIndex(firstVisible)->size().height()) { mScrollStartMousePos = scenePos; @@ -216,8 +230,9 @@ animateScroll(QPointF(0.0f , DRAGGED_ITEM_SCROLL_SPEED)); } // If the item is dragged down in the list (and there are more items to show), scroll down - else if (!q->isScrolling() - && !q->isVisible(lastItemIndex) + else if (!mIsAnimating + && !(visible(mContainer->itemByIndex(lastItemIndex), true) + && (lastItemIndex.row() == mModelIterator->indexCount() - 1)) && scenePos.y() > mMousePressPos.y() && pos.y() > (q->size().height() - q->itemByIndex(lastVisible)->size().height())) { mScrollStartMousePos = scenePos; @@ -274,12 +289,23 @@ return HbAbstractItemViewPrivate::panTriggered(event); } -bool HbListViewPrivate::animationEnabled(bool insertOperation) +void HbListViewPrivate::arrangeModeSetup(bool newMode) { - if (mArrangeMode) { - return false; + Q_Q(HbListView); + + if (newMode) { + mOriginalInteractiveScrollBar = q->verticalScrollBar()->isInteractive(); + q->verticalScrollBar()->setInteractive(true); + mOriginalLongPressEnabled = q->longPressEnabled(); + q->setLongPressEnabled(false); + mOriginalFriction = mFrictionEnabled; + q->setFrictionEnabled(false); } else { - return HbAbstractItemViewPrivate::animationEnabled(insertOperation); + q->verticalScrollBar()->setInteractive(mOriginalInteractiveScrollBar); + q->setLongPressEnabled(mOriginalLongPressEnabled); + q->setFrictionEnabled(mOriginalFriction); } + + mArrangeMode = newMode; + } - diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistview_p.h --- a/src/hbwidgets/itemviews/hblistview_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistview_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -68,7 +68,9 @@ virtual bool panTriggered(QGestureEvent *event); - virtual bool animationEnabled(bool insertOperation); + void arrangeModeSetup(bool newMode); + + public: bool mArrangeMode; QPersistentModelIndex mDraggedItemIndex; @@ -79,7 +81,10 @@ QPointF mLastScrollPos; QTransform mOriginalTransform; + bool mMoveOngoing; bool mOriginalFriction; + bool mOriginalLongPressEnabled; + bool mOriginalInteractiveScrollBar; }; #endif // HBLISTVIEW_PRIVATE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistviewitem.cpp --- a/src/hbwidgets/itemviews/hblistviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -100,6 +100,14 @@ Below is an example how the layout properties can be configured. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,45} + + \primitives + \primitive{icon-1} HbIconItem representing the icon-1 as described in the table above. + \primitive{icon-2} HbIconItem representing the icon-2 as described in the table above. + \primitive{text-1} HbTextItem or HbRichTextItem representing the text-1 as described in the table above. The type of the return value depends on the textFormat() of the item. + \primitive{text-2} HbTextItem or HbRichTextItem representing the text-2 as described in the table above. + \primitive{text-3} HbTextItem or HbRichTextItem representing the text-3 as described in the table above. + */ /*! @@ -419,7 +427,7 @@ styleOption.multilineSecondaryTextSupported = d->isMultilineSupported(); if (i == 1) { - // criteria of secondary text in middle column is fullfilled + // criteria of secondary text in middle column is fulfilled styleOption.minimumLines = sd->mMinimumSecondaryTextRowCount; styleOption.maximumLines = sd->mMaximumSecondaryTextRowCount; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistwidget.cpp --- a/src/hbwidgets/itemviews/hblistwidget.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistwidget.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -43,67 +43,66 @@ @beta @hbwidgets \class HbListWidget - \brief HbListWidget represents a list + \brief The HbListWidget class is for simple lists consisting of single row items of an icon and some text, and together with HbListWidgetItem consisting of icon and at most two-row text items. - This class has been provided with the class HbListWidgetItem as a convenience - API. It provides an item-based interface for adding and removing items. + + HbListWidget provides a convenience API for adding, modifying, and removing single row items in simple lists. Single row items consist of some text and an icon in one line. If you want list items with two texts or two icons, that is, with multirow items, then you can create HbListWidgetItem objects and add them to an HbListWidget. See HbListWidgetItem for the detailed description of the multirow item. - SetModel() function of the base class HbListView cannot be used. If the user wants to start - using a list view with e.g. a directory model (QDirModel) this convenience API cannot be used. + HbListWidget model supports arranging items with drag and drop. + + \link HbAbstractItemView::setModel(QAbstractItemModel *model, HbAbstractViewItem *prototype=0) SetModel()\endlink method of the base class HbAbstractItemView cannot be used. HbListWidget cannot be used for list views with a directory model (QDirModel), for example. - HbListWidget can be used without HbListWidgetItem to populate - simple list with single row items consisting of a text and an icon. - - If multirow items are needed the HbListWidgetItem must be used. - + \section _usecases_hblistwidget Using the HbListWidget class + + \subsection _uc_hblistwidget_001 Creating a list and adding one single row item into it. + + The following code snippet first creates a list and then adds one item which contains some text and an icon to the list. + \snippet{unittest_hblistwidget.cpp,1} - See HbListWidgetItem for more usage examples. - - \sa HbListWidgetItem, HbListView + \sa HbListWidgetItem, HbListView for more use cases. */ /*! \fn void HbListWidget::pressed(HbListWidgetItem *item) - This signal is emitted when a list item is pressed. - The pressed item is specified by \a item. + This signal is emitted when the user presses an item in the list. \a item indicates the pressed item. - See also released(), longPressed() and activated(). + \sa released(), longPressed(), activated() */ /*! \fn void HbListWidget::released(HbListWidgetItem *item) - This signal is emitted when a list item is no more pressed. - The released item is specified by \a item. + This signal is emitted when when release event occurs for \a item. - See also pressed(), longPressed() and activated(). + \sa pressed(), longPressed(), activated() + \sa HbAbstractViewItem::released(const QPointF &position) */ /*! \fn void HbListWidget::activated(HbListWidgetItem *item) - - This signal is emitted when the item specified by \a item is activated by the user. - How to activate items depends on the input method; e.g., with mouse by clicking the item, - or with touch input by tapping the item, or with hardware keys by pressing the Return - or Enter key when the item is current, or with soft keys by pressing choosing "Select" - when the item is current. - - See also pressed(), released() and longPressed(). + + This signal is emitted when the user activates an item in the list. \a item indicates the activated item. The activation of the item depends on the input method. An item can be activated in the following ways: + - by clicking the item with a mouse + - by tapping the item on a touch screen + - by pressing Return or Enter hardware keys when the item has focus + - by pressing Select soft key when the item has focus + + \sa pressed(), released(), longPressed() */ /*! \fn void HbListWidget::longPressed(HbListWidgetItem *item, const QPointF &coords) - This signal is emitted when a list item is long pressed. - The pressed item is specified by \a item and \a coords. - See also pressed(), released() and activated(). + This signal is emitted when the user presses an item in the list for a long time. \a item indicates the activated item and \a coords the screen position where the long press happened. + + \sa pressed(), released(), activated() */ /*! Constructs a list widget with \a parent. - */ +*/ HbListWidget::HbListWidget(QGraphicsItem *parent) : HbListView( *new HbListWidgetPrivate, new HbListItemContainer, parent ) { @@ -119,14 +118,14 @@ } /*! - Destructs the list view. - */ + Destructor. +*/ HbListWidget::~HbListWidget() { } /*! - Returns the total number of rows. + Returns the total number of rows in the list. */ int HbListWidget::count() const { @@ -134,17 +133,18 @@ } /*! - Returns the current row number - */ + Returns the current row number in the list. A current row is a row having focus. +*/ int HbListWidget::currentRow() const { return modelIterator()->indexPosition(currentIndex()); } /*! - Sets current \a row. This function sets current index into selection model. - Selection is never changed. - */ + Sets the current row to \a row. A current row is a row having focus. + + \sa currentRow() +*/ void HbListWidget::setCurrentRow(int row) { Q_D(HbListWidget); @@ -152,10 +152,11 @@ } /*! - Returns a pointer to the current HbListWidgetItem. - Ownership not transferred to the caller. - Should not be deleted by the caller. - */ + Returns a pointer to the current list item. A current list item is a list item having focus. + Ownership is not transferred so the item should not be deleted by the caller. + + \sa currentRow() +*/ HbListWidgetItem *HbListWidget::currentItem() const { Q_D( const HbListWidget ); @@ -163,18 +164,17 @@ } /*! - Sets the current item to item. - */ + Sets the current item to \a item. A current item is an item having focus. +*/ void HbListWidget::setCurrentItem (HbListWidgetItem *item) { setCurrentRow(row(item)); } /*! - Returns a pointer to an item specified by \a row. - Ownership not transferred to the caller. - Should not be deleted by the caller. - */ + Returns a pointer to the list item specified by \a row. + Ownership is not transferred to the caller so the item should not be deleted by the caller. +*/ HbListWidgetItem *HbListWidget::item (int row) const { Q_D( const HbListWidget ); @@ -182,8 +182,8 @@ } /*! - Creates new one row item based on a string and an icon and append it to the end of the list. - */ + Creates a single row item specified by \a icon and \a text and appends it to the end of the list. +*/ void HbListWidget::addItem (const HbIcon &icon, const QString &text) { Q_D( HbListWidget ); @@ -195,8 +195,8 @@ } /*! - Creates new one row item based on a string and append it to the end of the list. - */ + Creates a new single row item spcified by \a text and appends it to the end of the list. +*/ void HbListWidget::addItem (const QString &text) { Q_D( HbListWidget ); @@ -207,8 +207,8 @@ } /*! - Appends an item created by the user to the end of the list. - */ + Appends \a item to the end of the list. +*/ void HbListWidget::addItem (HbListWidgetItem *item) { Q_D( HbListWidget ); @@ -219,8 +219,10 @@ } /*! - Creates a new item based on the string and an icon into a specified location in the list - */ + Creates a list widget item with \a icon and \a text and inserts it into the list at the \a row location. Regarding \a row the following rules apply: + - if \a row is negative the item is inserted into the first row + - if \a row is greater than the number of list's items the item is added at the last item +*/ void HbListWidget::insertItem (int row, const HbIcon &icon, const QString &text) { Q_D( HbListWidget ); @@ -233,8 +235,10 @@ } /*! - Creates a new item based on the string into a specified location in the list. - */ + Creates a list widget item with \a text and inserts it into the list at the \a row location. Regarding \a row the following rules apply: + - if \a row is negative the item is inserted into the first row + - if \a row is greater than the number of list's items the item is added at the last item +*/ void HbListWidget::insertItem (int row, const QString &text) { Q_D( HbListWidget ); @@ -246,8 +250,10 @@ } /*! - Inserts an item created by the user to the specified place on the list. - */ + Creates a list widget item with \a item and inserts it into the list at the \a row location. Regarding \a row the following rules apply: + - if \a row is negative the item is inserted into the first row + - if \a row is greater than the number of list's items the item is added at the last item +*/ void HbListWidget::insertItem (int row, HbListWidgetItem *item) { Q_D( HbListWidget ); @@ -258,8 +264,8 @@ } /*! - Deletes every item in the list - */ + Deletes all the items in the list. +*/ void HbListWidget::clear() { Q_D( HbListWidget ); @@ -270,8 +276,8 @@ } /*! - Returns the row containing the given item. - */ + Returns the row number of given \a item. +*/ int HbListWidget::row(const HbListWidgetItem *item) const { Q_D( const HbListWidget ); @@ -280,9 +286,7 @@ } /*! - \reimp - - Setting own model to HbListWidget is not allowed. + This method cannot be used. If you call it in debug builds you will get an ASSERT failure i.e. Q_ASSERT_X(). In release builds nothing will happen. */ void HbListWidget::setModel(QAbstractItemModel *model, HbAbstractViewItem *prototype) { @@ -293,9 +297,11 @@ /*! - Set the text for a simple one row item or the first text row for a - multi row item. Only the text is replaced, no icon removed. - Use HbListWidgetItem to modify multirow items. + Replaces the text on the given \a row with the given \a text. Only the text is replaced, the icon stays unchanged. In case of a multi-row only the first text row is replaced. Use HbListWidgetItem to modify multirow items. + + \param text - Text to be shown in the list widget item. + \param row - Row of the list widget item. + */ void HbListWidget::setText(int row, const QString &text) { @@ -306,9 +312,10 @@ } /*! - Set the icon for a simple one row item or the first icon for a - multi row item. Only the icon is replaced, no text removed. - Use HbListWidgetItem to modify multirow items. + Replaces the icon on the given \a row with the given \a icon. Only the icon is replaced, the text stays unchanged. The item can be a single row or a multirow item. Use HbListWidgetItem to modify multirow items. + + \param icon - Icon to be shown in the list widget item. + \param row - Row of the list widget item. */ void HbListWidget::setIcon(int row, const HbIcon& icon) { @@ -319,9 +326,13 @@ } /*! - Removes and returns the item from the given row in the list widget; otherwise returns 0. - Items removed from a list widget will not be managed, and will need to be deleted manually. - Use this function to remove items form the list. + Returns the list widget item of given row and then removes the item from the list. Items removed from a list must be deleted manually. + + \param row - Row to be removed. + + \return + - The list widget item of \a row if it exists in the list. + - 0, if \a row doesn't exist in the list. */ HbListWidgetItem *HbListWidget::takeItem(int row) { @@ -333,37 +344,34 @@ } /*! - HbListWidget model supports arranging items with drag and drop, so - this method returns true unless the widget is in some selection mode. + HbListWidget supports arranging items with drag and drop. If \a arrangeMode is \c true and the list is not in the selection mode, the list is put into the arrange list mode which allows the user to rearrange the list by dragging and dropping items. If \a arrangeMode is \c false, then the arrange list mode is cancelled. + + The list can be in either arrange or selection mode but not in both modes at any given time. + + \return + - \c True if the arrange list mode is successfully set according to \a arrangeMode. This includes the case where the requested \a arrangeMode is the same as what was already set for the list. + - \c False if the requested \a arrangeMode cannot be set. */ bool HbListWidget::setArrangeMode(const bool arrangeMode) { Q_D( HbListWidget ); if (arrangeMode != d->mArrangeMode) { - if (arrangeMode == true) { - if (d->mSelectionMode != HbAbstractItemView::NoSelection) { - return false; - } - verticalScrollBar()->setInteractive(true); - } else { - verticalScrollBar()->setInteractive(false); + if (d->mSelectionMode != HbAbstractItemView::NoSelection) { + return false; } - - d->mArrangeMode = arrangeMode; - d->mAnimateItems = !d->mArrangeMode; - - if (d->mArrangeMode == true) { - d->mOriginalFriction = d->mFrictionEnabled; - setFrictionEnabled(false); - } else { - setFrictionEnabled(d->mOriginalFriction); - } + d->arrangeModeSetup(arrangeMode); } return true; } /*! + Moves an item from given source row to given target row. The operation is cancelled in the following cases: + - Source and target rows are the same. + - Either or both given rows do not exist in the list. + + \param from - Source row that is the row from where the item is moved. + \param to - Target row that is the row to where the item is moved. */ void HbListWidget::move(const QModelIndex &from, const QModelIndex &to) { @@ -384,7 +392,7 @@ /*! Constructs a list widget with private view widget \a dd and \a parent. - */ +*/ HbListWidget::HbListWidget( HbListWidgetPrivate& dd, HbAbstractItemContainer *container, QGraphicsItem* parent ): HbListView( dd, container, parent ) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hblistwidgetitem.cpp --- a/src/hbwidgets/itemviews/hblistwidgetitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hblistwidgetitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,7 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ -#include + +#include "hblistwidgetitem.h" #include "hblistwidgetitem_p.h" #include "hblistmodel_p.h" @@ -35,31 +36,28 @@ @beta @hbwidgets \class HbListWidgetItem - \brief HbListWidgetItem represents a list item. It is part of convenience list API together with HbListWidget. - - As this is a convenience API it is supposed to be easy to use. For that reason complicated list items are not possible - to be created. HbListWidgetItem supports at maximum two text items and two icon items. - Either primary text or primary icon must always be provided. Icons are shown only in default size. + \brief The HbListWidgetItem class provides an item for use with the HbListWidget class. - A view item created from this item consists of three columns at maximum. - - First column contains primary icon - - Middle column has one or two rows to show text(s) - - Last column contains secondary icon - - Any column can be empty + As HbListWidget by itself supports the use of very basic items in simple lists, HbListWidgetItem provides together with HbListWidget a convenience API for adding, modifying, and removing more versatile items in simple lists. So, if you want to have list items consisting of more than an icon and a text, create HbListWidgetItem objects and add them to an HbListWidget object. The list item of HbListWidgetItem class consists of three columns and its features are as follows: + - The left and right columns have one row and they can contain an icon. + - The middle column can have two rows and both rows can contain text. + - At least the primary text is required. + + \section _usecases_hblistwidgetitem Using the HbListWidgetItem class + + \subsection _uc_hblistwidgetitem_001 Creating a list item and adding two icons and two rows of text into it. - The following code snippet presents how to create an list item with icons in the left - and right columns and two rows of text in the middle column. + The following code snippet creates a list item with icons in the left and right columns and two rows of text in the middle column. \snippet{unittest_hblistwidgetitem.cpp,1} \sa HbListWidget - */ /*! \fn QBrush HbListWidgetItem::background() const - Returns item's background. + Returns the background of the item. \sa setBackground */ @@ -67,17 +65,18 @@ /*! \fn void HbListWidgetItem::setBackground(const QVariant &background) - Sets the item's background to the specified \a background. Supported - background types are HbIcon and QBrush types plus any type that can be - converted to those types. + Sets the background of the item to the given \a background. Supported types are as follows: + - HbIcon + - QBrush + - any type that can be converted to HbIcon or QBrush \sa background */ /*! - Constructs an empty list widget item with the given \a type. + Constructs an empty list widget item of the given \a type. If no type is specified then Hb::StandardItem is used. - Default type for item is Hb::StandardItem. + */ HbListWidgetItem::HbListWidgetItem(int type) : d(new HbListWidgetItemPrivate(this)) @@ -103,8 +102,9 @@ /*! - Returns the item's application-specific data for the given role, - or an invalid QVariant if there is no data for the role. + Returns + - the item's application-specific data of the given \a role if the data exists. + - an invalid QVariant if there is no data of the given \a role for the item. */ QVariant HbListWidgetItem::data(int role) const { @@ -112,16 +112,11 @@ } /*! - Sets the item's data for the given role to the specified value. - Can be used to store application-specific data in an item. - - Specialised functions in section 'see also' are recommended setting user data. + Sets the item's data for the given \a role to the given \a value. It can be used to store application-specific data into an item. - \sa setText() - \sa setSecondaryText() - \sa setIcon() - \sa setSecondaryIcon() -*/ + Specialized functions in section 'see also' are recommended setting user data. + \param role - Role for the data of the item. + */ void HbListWidgetItem::setData(const QVariant &value, int role) { d->setData(value,role); @@ -141,7 +136,7 @@ /*! - Sets the item's primary text to the specified \a text. + Sets the item's primary text to the given \a text. \sa text */ @@ -153,7 +148,7 @@ } /*! - Returns item's secondary text. + Returns the secondary text of the item. \sa setSecondaryText */ @@ -163,7 +158,7 @@ } /*! - Sets the item's secondary text to the specified \a text. + Sets the item's secondary text to the given \a text. \sa secondaryText */ @@ -175,7 +170,7 @@ } /*! - Returns item's icon. + Returns the item's icon. \sa setIcon */ @@ -185,7 +180,7 @@ } /*! - Sets the item's icon to the specified \a icon. + Sets the item's icon to the given \a icon. \sa icon */ @@ -197,7 +192,7 @@ } /*! - Returns item's secondary icon. + Returns the item's secondary icon. \sa setSecondaryIcon */ @@ -207,7 +202,7 @@ } /*! - Sets the item's secondary icon to the specified \a icon. + Sets the item's secondary icon to the given \a icon. \sa secondaryIcon */ @@ -219,10 +214,9 @@ } /*! - Sets whether the item is enabled. + Enables the user interaction with item. - If enabled is true, the item is \a enabled, meaning that the user can interact with the item; if \a enabled is false, - the user cannot interact with the item. + \param enabled - If the value is \c true, the user can interact with the item. If the value is \c false, the user cannot interact with the item. */ void HbListWidgetItem::setEnabled(bool enabled) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbmodeliterator.h --- a/src/hbwidgets/itemviews/hbmodeliterator.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbmodeliterator.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,7 +36,7 @@ class HB_WIDGETS_EXPORT HbModelIterator { public: - HbModelIterator(QAbstractItemModel *model = 0, QModelIndex rootIndex = QModelIndex()); + explicit HbModelIterator(QAbstractItemModel *model = 0, QModelIndex rootIndex = QModelIndex()); virtual ~HbModelIterator(); virtual int indexCount(const QModelIndex &parent = QModelIndex()) const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbradiobuttonlist.cpp --- a/src/hbwidgets/itemviews/hbradiobuttonlist.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbradiobuttonlist.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -37,8 +37,6 @@ const int HB_RADIOBUTTONLIST_ITEM_ACTIVATION_TIMER = 150; const int HB_RADIOBUTTONLIST_PREVIEW_TIMER = 500; -const int HB_RADIOBUTTONLIST_MINIMUM_ITEM_COUNT_IN_SIZE_HINT = 4; - /*! \class HbRadioButtonList \brief HbRadioButtonList provides a widget for a string list with radio buttons @@ -67,6 +65,8 @@ An example of how to create a radiobuttonlist inside a popup. \snippet{decoratorlistdemo/contentwidget.cpp,3} + By default the radio button list has uniformItemSizes property set to true. + */ /*! @@ -128,15 +128,13 @@ HbRadioButtonList::PreviewMode mPreviewMode; bool mPreviewGoingOn; bool mStartUp; - qreal mHeight; }; HbRadioButtonListPrivate::HbRadioButtonListPrivate() : HbListViewPrivate(), mPreviewMode(HbRadioButtonList::NoPreview), mPreviewGoingOn(false), - mStartUp(true), - mHeight(0) + mStartUp(true) { } @@ -170,26 +168,7 @@ q->setSelected(selected); q->setPreviewMode(previewMode); q->setLongPressEnabled(false); - calculateItemHeight(); -} - -void HbRadioButtonListPrivate::calculateItemHeight() -{ - Q_Q(HbRadioButtonList); - if (!q->items().isEmpty()) { - //Let's create a temporary item and take the height for the size hint - HbAbstractViewItem *tempItem = q->itemPrototypes().first()->createItem(); - tempItem->setModelIndex(mModelIterator->nextIndex(QModelIndex())); - - qreal oldHeight = mHeight; - mHeight = tempItem->effectiveSizeHint(Qt::PreferredSize).height(); - - delete tempItem; - - if (mHeight != oldHeight) { - q->updateGeometry(); - } - } + q->setUniformItemSizes(true); } void HbRadioButtonListPrivate::emitStartPreview(int row) @@ -249,10 +228,6 @@ QStringListModel *stringListModel = qobject_cast(d->mModelIterator->model()); if (stringListModel) { stringListModel->setStringList(list); - //Calculate the item height only if needed - if(d->mHeight==0){ - d->calculateItemHeight(); - } updateGeometry(); } else { //TODO: set the item here using the base model class @@ -407,21 +382,7 @@ */ QSizeF HbRadioButtonList::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const { - Q_D(const HbRadioButtonList); - if (which == Qt::PreferredSize) { - QSizeF defaultSize = HbListView::sizeHint(which,constraint); - qreal minHeight = (d->mHeight) * HB_RADIOBUTTONLIST_MINIMUM_ITEM_COUNT_IN_SIZE_HINT; - defaultSize.setHeight(qMax(defaultSize.height(), minHeight)); - - qreal height = (d->mHeight) * (d->mModelIterator->indexCount()); - if( height <= defaultSize.height()) { - return QSizeF(defaultSize.width(), height); - } else { - return defaultSize; - } - } else { - return HbListView::sizeHint(which, constraint); - } + return HbListView::sizeHint(which, constraint); } /*! @@ -429,13 +390,7 @@ */ void HbRadioButtonList::rowsInserted(const QModelIndex &parent, int start, int end) { - Q_D(HbRadioButtonList); HbListView::rowsInserted(parent,start,end); - //Calculate the item height only if needed - if(d->mHeight==0){ - d->calculateItemHeight(); - } - updateGeometry(); } /*! @@ -444,7 +399,6 @@ void HbRadioButtonList::rowsRemoved(const QModelIndex &parent, int start, int end) { HbListView::rowsRemoved(parent,start,end); - updateGeometry(); } /*! @@ -453,7 +407,6 @@ void HbRadioButtonList::reset() { HbListView::reset(); - updateGeometry(); } #include "moc_hbradiobuttonlist.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbradiobuttonlistviewitem_p.h --- a/src/hbwidgets/itemviews/hbradiobuttonlistviewitem_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbradiobuttonlistviewitem_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBRADIOBUTTONLISTVIEVITEM_H -#define HBRADIOBUTTONLISTVIEVITEM_H +#ifndef HBRADIOBUTTONLISTVIEWITEM_P_H +#define HBRADIOBUTTONLISTVIEWITEM_P_H #include diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreeitemcontainer_p.cpp --- a/src/hbwidgets/itemviews/hbtreeitemcontainer_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreeitemcontainer_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -187,7 +187,7 @@ if (minHeight == 0.0) { QModelIndex index; while (mItems.isEmpty()) { - // in practise following conditions must apply: itemview is empty and scrollTo() has been called. + // in practize following conditions must apply: itemview is empty and scrollTo() has been called. // Starts populating items from given mFirstItemIndex if ( mFirstItemIndex.isValid()) { index = mFirstItemIndex; @@ -426,7 +426,7 @@ // because only then container can go out of bounds qreal viewSize = itemView()->boundingRect().size().height(); if (layoutPreferredHeight + pos().y() < viewSize) { - // position is allways negative + // position is always negative // view out of bounds if (diff > 0.0) { QPointF posDiff(pos().x(), 0.0); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreeitemselectionmodel_p.cpp --- a/src/hbwidgets/itemviews/hbtreeitemselectionmodel_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreeitemselectionmodel_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -83,7 +83,7 @@ QModelIndexList indexes = selection.indexes(); int count = indexes.count(); for (int i = 0; i < count; ++i) { - QModelIndex index = indexes.at(0); + QModelIndex index = indexes.at(i); if (!index.isValid()) { return; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreelayout_p_p.cpp --- a/src/hbwidgets/itemviews/hbtreelayout_p_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreelayout_p_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ +#include "hbtreelayout_p_p.h" #include "hbtreelayout_p.h" -#include "hbtreelayout_p_p.h" #include "hbabstractitemcontainer_p.h" #include diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreelayout_p_p.h --- a/src/hbwidgets/itemviews/hbtreelayout_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreelayout_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -23,8 +23,8 @@ ** ****************************************************************************/ -#ifndef HBTREELAYOUTPRIVATE_P_P_H -#define HBTREELAYOUTPRIVATE_P_P_H +#ifndef HBTREELAYOUT_P_P_H +#define HBTREELAYOUT_P_P_H #include @@ -65,4 +65,4 @@ static const qreal INVALID_ITEM_HEIGHT; }; -#endif // HBTREELAYOUTPRIVATE_P_P_H +#endif // HBTREELAYOUT_P_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreemodeliterator_p.cpp --- a/src/hbwidgets/itemviews/hbtreemodeliterator_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreemodeliterator_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -41,7 +41,7 @@ /*! \reimp - + Returns count of visible indexes under \a parent. Children of collapsed parents are not taken into account. */ int HbTreeModelIterator::indexCount(const QModelIndex &parent) const @@ -73,7 +73,8 @@ /*! \reimp - Position depends on item state - expanded/colapsed + Returns ordinal of index starting from root. Ordinal for first index under root is 0. + Indexes in collapsed parents are taken into account. */ int HbTreeModelIterator::indexPosition(const QModelIndex &index) const { @@ -94,8 +95,9 @@ /*! \reimp - Index is calculated from position and it depends on item state - expanded/colapsed - Very slow - need to interate throught whole model in worst case! + Returnes index of item, which is visible at pos ordinal under parent. + Indexes in collapsed parents are not taken into account. + Very slow - need to interate through whole model in worst case! */ QModelIndex HbTreeModelIterator::index(int pos, const QModelIndex &parent) const { @@ -175,12 +177,13 @@ /*! \reimp - Next index for valid index is determined in following way: - - If index is in collapsed branch QModelIndex is returned + Next visible index for valid index is determined in following way: + - If index is in collapsed branch QModelIndex is returned. - If index has children and it is expanded then first child is returned - Otherwise if index has next sibling then that is returned - Otherwise next valid sibling for parent is returned - Otherwise QModelIndex is returned + If index was invalid then first valid index is returned. \a index must belong to mRootIndex branch, otherwise result is not determined. @@ -231,7 +234,7 @@ /*! \reimp - Previous index for valid index is determined in following way: + Previous visible index for valid index is determined in following way: - If index is in collapsed branch QModelIndex is returned - If index has previous sibling last child from it is returned - Otherwise previous sibling is returned @@ -292,6 +295,8 @@ this, SLOT(columnsInserted(QModelIndex,int,int))); connect(d->mModel, SIGNAL(columnsRemoved(QModelIndex,int,int)), this, SLOT(columnsRemoved(QModelIndex,int,int))); + connect(d->mModel, SIGNAL(layoutChanged()), + this, SLOT(modelLayoutChanged())); } } else { setRootIndex(rootIndex); @@ -390,5 +395,11 @@ d->resetCache(); } +void HbTreeModelIterator::modelLayoutChanged() +{ + Q_D(HbTreeModelIterator); + d->resetCache(); +} + #include "moc_hbtreemodeliterator_p.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreemodeliterator_p.h --- a/src/hbwidgets/itemviews/hbtreemodeliterator_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreemodeliterator_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,7 @@ Q_OBJECT public: - HbTreeModelIterator(QAbstractItemModel *model = 0, QModelIndex rootIndex = QModelIndex(), bool useCache = true); + explicit HbTreeModelIterator(QAbstractItemModel *model = 0, QModelIndex rootIndex = QModelIndex(), bool useCache = true); ~HbTreeModelIterator(); int indexCount(const QModelIndex &parent = QModelIndex()) const; @@ -63,6 +63,7 @@ void rowsRemoved(const QModelIndex &parent, int start, int end); void columnsInserted(const QModelIndex &parent, int start, int end); void columnsRemoved(const QModelIndex &parent, int start, int end); + void modelLayoutChanged(); private: Q_DECLARE_PRIVATE_D(d, HbTreeModelIterator) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreemodeliterator_p_p.cpp --- a/src/hbwidgets/itemviews/hbtreemodeliterator_p_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreemodeliterator_p_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,8 +39,8 @@ } /* - Return first index belonging to specified parent - If parent is colapsed QModelIndex is returned + Return first visible index belonging to specified parent. + If parent is collapsed QModelIndex is returned. */ QModelIndex HbTreeModelIteratorPrivate::first(const QModelIndex &parent) const { @@ -54,7 +54,8 @@ } /* - Return last index belonging to specified parent - last child in whole parent branch + Return last visible index belonging to specified parent - last child in whole parent branch. + If parent is collapsed QModelIndex is returned. */ QModelIndex HbTreeModelIteratorPrivate::last(const QModelIndex &parent) const { @@ -112,8 +113,11 @@ return -1; } } - mCachedPosition.count = result; - mCachedPosition.index = index; + + if (mUseCache) { + mCachedPosition.count = result; + mCachedPosition.index = index; + } return result; } @@ -130,8 +134,11 @@ return -1; } } - mCachedPosition.count = result; - mCachedPosition.index = index; + + if (mUseCache) { + mCachedPosition.count = result; + mCachedPosition.index = index; + } return result; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreeview.cpp --- a/src/hbwidgets/itemviews/hbtreeview.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreeview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -178,19 +178,16 @@ if (d->isParentValid(parent)) { if (isExpanded(parent) || parent == d->mModelIterator->rootIndex()) { - int lastStartPoint = 0; for (int i = start; i <= end; ++i) { - QModelIndex newParent = d->treeModelIterator()->index(i, parent); + HbAbstractItemView::rowsInserted(parent, i, i); + // if there is expanded parent under expanding parent, handle it recursively + QModelIndex newParent = d->treeModelIterator()->model()->index(i, 0, parent); int childCount = d->treeModelIterator()->childCount(newParent); if (childCount > 0 && isExpanded(newParent)) { - HbAbstractItemView::rowsInserted(parent, lastStartPoint, i); - lastStartPoint = i; rowsInserted(newParent, 0, childCount - 1); - } + } } - HbAbstractItemView::rowsInserted(parent, lastStartPoint, end); - if (d->animationEnabled(true)) { if (d->mInSetExpanded) { d->startAppearEffect("treeviewitem", "expand", parent, start, end); @@ -537,7 +534,7 @@ /*! Returns indentation of tree view items. - The returned value is either default value or set by setIndentation(). + The returned value is either default value or value set by setIndentation(). Default value is -1. In this case indentation from style sheet is used. diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtreeviewitem.cpp --- a/src/hbwidgets/itemviews/hbtreeviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtreeviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,9 +22,10 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ + +#include "hbtreeviewitem.h" #include "hbtreeviewitem_p.h" -#include "hbtreeviewitem.h" #include "hbtreeview.h" #include "hbabstractitemview.h" #include "hbabstractitemcontainer_p.h" @@ -56,6 +57,8 @@ See HbListViewItem for commmon view item subclassing reference. + \primitives + \primitive{subitem-indicator} HbIconItem representing the expand/collapse icon in an HbTreeViewItem that has child items. */ @@ -299,7 +302,7 @@ /*! Returns true if the item is expanded; otherwise returns false. - \sa setExpanded + \sa setExpanded() */ bool HbTreeViewItem::isExpanded() const { @@ -352,7 +355,7 @@ This method will change the user expandable value for all view items. - \sa isUserExpandable + \sa isUserExpandable() */ void HbTreeViewItem::setUserExpandable(bool expandable) { @@ -366,7 +369,7 @@ /*! Returns true if the items are expandable by the user; otherwise returns false. - \sa setUserExpandable + \sa setUserExpandable() */ bool HbTreeViewItem::isUserExpandable() const { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtumbleview.cpp --- a/src/hbwidgets/itemviews/hbtumbleview.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtumbleview.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,12 +35,13 @@ #include #include +#include +#include #define HB_TUMBLE_ITEM_ANIMATION_TIME 500 #define HB_TUMBLE_PREFERRED_ITEMS 3 -#define DELAYED_SELECT_INTERVAL 100 -#define HBTUMBLE_DEBUG +//#define HBTUMBLE_DEBUG #ifdef HBTUMBLE_DEBUG #include #endif @@ -51,11 +52,14 @@ { Q_DECLARE_PRIVATE(HbTumbleViewItemContainer) public: - HbTumbleViewItemContainer(QGraphicsItem* parent = 0); + HbTumbleViewItemContainer(QGraphicsItem* parent = 0); QPointF recycleItems(const QPointF &delta); void setLoopingEnabled(bool looping) ; bool isLoopingEnabled() const ; + bool isLoopingNeeded() const; + void removeItem(const QModelIndex &index, bool animate ); + void setModelIndexes(const QModelIndex &startIndex); }; class HbTumbleViewItemContainerPrivate:public HbListItemContainerPrivate @@ -66,6 +70,7 @@ QPointF recycleItems(const QPointF &delta); HbAbstractViewItem *shiftDownItem(QPointF& delta); HbAbstractViewItem *shiftUpItem(QPointF& delta); + HbAbstractViewItem* item(const QModelIndex &index) const; bool mIsLooped; }; @@ -84,16 +89,14 @@ void init(QAbstractItemModel *model); void calculateItemHeight(); + void selectCurrentIndex(const QModelIndex& index); void selectMiddleItem(); + HbAbstractViewItem* getCenterItem(); void createPrimitives(); - - void delayedSelectCurrent(const QModelIndex& index); - void _q_scrollingStarted();//private slot void _q_scrollingEnded();//private slot - void _q_delayedSelectCurrent();//private slot void setPressedState(HbAbstractViewItem *item); @@ -127,73 +130,178 @@ QPointF HbTumbleViewItemContainer::recycleItems(const QPointF &delta) { - Q_D(HbTumbleViewItemContainer); - - if (d->mPrototypes.count() != 1) { - return delta; - } - - QRectF viewRect(d->itemBoundingRect(d->mItemView)); - viewRect.moveTopLeft(viewRect.topLeft() + delta); - - int firstVisibleBufferIndex = -1; - int lastVisibleBufferIndex = -1; - d->firstAndLastVisibleBufferIndex(firstVisibleBufferIndex, lastVisibleBufferIndex, viewRect, false); - - int hiddenAbove = firstVisibleBufferIndex; - int hiddenBelow = d->mItems.count() - lastVisibleBufferIndex - 1; + if(size().height() > itemView()->size().height()){ + Q_D(HbTumbleViewItemContainer); + const qreal diff = d->getDiffWithoutScrollareaCompensation(delta); + + if(diff !=0.0){ + QPointF newDelta(0.0, 0.0); + qreal result = 0.0; + HbAbstractViewItem *item = 0; + if (diff < 0.0) { + while (-newDelta.y() > diff) { + item = d->shiftUpItem(newDelta); + if (!item) { + break; + } + } + } - if (d->mItems.count() - && (firstVisibleBufferIndex == -1 || lastVisibleBufferIndex == -1)) { - // All items out of sight. - if (d->itemBoundingRect(d->mItems.first()).top() < 0) { - // All items above view. - hiddenAbove = d->mItems.count(); - hiddenBelow = 0; - } else { - // All items below view. - hiddenAbove = 0; - hiddenBelow = d->mItems.count(); - } - } - - QPointF newDelta(delta); + else { + while (-newDelta.y() < diff) { + item = d->shiftDownItem(newDelta); + if (!item) { + break; + } + } + } - while (hiddenAbove > hiddenBelow + 1) { - HbAbstractViewItem *item = d->shiftDownItem(newDelta); - if (!item){ - break; - } - - if (!d->visible(item, viewRect)) { - hiddenBelow++; - } - hiddenAbove--; - } + result = newDelta.y(); + return QPointF(delta.x(),delta.y()+result); + } + } - while (hiddenBelow > hiddenAbove + 1) { - HbAbstractViewItem *item = d->shiftUpItem(newDelta); - if (!item) { - break; - } - - if (!d->visible( item, viewRect)) { - hiddenAbove++; - } - hiddenBelow--; - } - - return newDelta; + return delta; } void HbTumbleViewItemContainer::setLoopingEnabled(bool looped) { Q_D(HbTumbleViewItemContainer); - d->mIsLooped = looped; + d->mIsLooped = looped; + + d->mItemView->scrollTo(d->mItemView->currentIndex(),HbAbstractItemView::PositionAtCenter); + recycleItems(QPointF()); } bool HbTumbleViewItemContainer::isLoopingEnabled() const { Q_D(const HbTumbleViewItemContainer); return d->mIsLooped; } +bool HbTumbleViewItemContainer::isLoopingNeeded() const +{ + Q_D(const HbTumbleViewItemContainer); + return (isLoopingEnabled() && (d->mItems.count() < maxItemCount())); +} + +void HbTumbleViewItemContainer::removeItem(const QModelIndex &index, bool animate ) +{ + Q_D(HbTumbleViewItemContainer); + HbListItemContainer::removeItem(index,animate); + if (d->mItems.count() < maxItemCount()) { + d->updateItemBuffer(); + } +} + +void HbTumbleViewItemContainer::setModelIndexes(const QModelIndex &startIndex) +{ + Q_D(HbAbstractItemContainer); + + if (!d->mItemView || !d->mItemView->model()) { + return; + } + + QModelIndex index = startIndex; + if (!index.isValid()) { + if (!d->mItems.isEmpty()) { + index = d->mItems.first()->modelIndex(); + } + + if (!index.isValid()) { + index = d->mItemView->modelIterator()->nextIndex(index); + } + } + + QModelIndexList indexList; + + int itemCount(d->mItems.count()); + + if (itemCount != 0 && index.isValid()) { + indexList.append(index); + } + + for (int i = indexList.count(); i < itemCount; ++i) { + index = d->mItemView->modelIterator()->nextIndex(indexList.last()); + + if (index.isValid()) { + indexList.append(index); + } else { + break; + } + } + if(isLoopingEnabled() && indexList.count()mItemView->modelIterator()->index(0,QModelIndex()); + indexList.append(firstModelIndex); + for (int i = indexList.count(); i < itemCount; ++i) { + index = d->mItemView->modelIterator()->nextIndex(indexList.last()); + + if (index.isValid()) { + indexList.append(index); + } else { + break; + } + } + } + + for (int i = indexList.count(); i < itemCount; ++i) { + index = d->mItemView->modelIterator()->previousIndex(indexList.first()); + + if (index.isValid()) { + indexList.prepend(index); + } else { + break; + } + } + + // if items have been added/removed in the middle of the buffer, there might be items + // that can be reused at the end of the buffer. The following block will scan for + // those items and move them in correct position + int lastUsedItem = -1; + for (int indexCounter = 0; indexCounter < indexList.count(); ++indexCounter) { + HbAbstractViewItem *item = d->mItems.at(indexCounter); + if (item && item->modelIndex() == indexList.at(indexCounter)) { + lastUsedItem = indexCounter; + } else { + for (int itemCounter = lastUsedItem + 1; itemCounter < d->mItems.count(); itemCounter++) { + HbAbstractViewItem *item2 = d->mItems.at(itemCounter); + + if (item2->modelIndex() == indexList.at(indexCounter)) { + d->mItems.swap(indexCounter, itemCounter); + itemRemoved(d->mItems.at(indexCounter), false); + itemRemoved(d->mItems.at(itemCounter), false); + itemAdded(qMin(indexCounter, itemCounter), d->mItems.at(qMin(indexCounter, itemCounter)), false); + itemAdded(qMax(indexCounter, itemCounter), d->mItems.at(qMax(indexCounter, itemCounter)), false); + lastUsedItem = itemCounter; + break; + } + } + + } + } + + int indexCount(indexList.count()); + for (int i = 0; i < itemCount; ++i) { + HbAbstractViewItem *item = d->mItems.at(i); + HbAbstractViewItem *prototype = 0; + // setItemModelIndex() is considered recycling. It is called only, if recycling is permitted + if (i < indexCount) { + prototype = d->itemPrototype(indexList.at(i)); + } + if (prototype) { + if ( prototype == item->prototype() + && d->mItemRecycling) { + setItemModelIndex(item, indexList.at(i)); + } else if ( d->mItemRecycling + || ( !d->mItemRecycling + && item->modelIndex() != indexList.at(i))) { + d->deleteItem(item); + insertItem(i, indexList.at(i)); + } // else: !d->mItemRecycling && item->modelIndex().isValid() == indexList.at(i)) + } else { + d->deleteItem(item); + itemCount--; + i--; + } + } +} + HbTumbleViewItemContainerPrivate::HbTumbleViewItemContainerPrivate() : mIsLooped(false) { @@ -264,6 +372,17 @@ return item; } +HbAbstractViewItem *HbTumbleViewItemContainerPrivate::item(const QModelIndex &index) const +{ + int itemCount = mItems.count(); + for(int i=0;imodelIndex() == index) { + return mItems.at(i); + } + } + return 0; +} + HbTumbleViewPrivate::HbTumbleViewPrivate() :HbListViewPrivate() ,mHeight(10.0) @@ -314,13 +433,15 @@ q->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); q->setHorizontalScrollBarPolicy(HbScrollArea::ScrollBarAlwaysOff); q->setFrictionEnabled(true); + + //don't want this to occupy entire screen. preferred is few items. + q->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred); + mDelayedSelectTimer.setSingleShot(true); bool b = q->connect(q,SIGNAL(scrollingStarted()),q,SLOT(_q_scrollingStarted())); Q_ASSERT(b); b = q->connect(q,SIGNAL(scrollingEnded()),q,SLOT(_q_scrollingEnded())); Q_ASSERT(b); - b = q->connect(&mDelayedSelectTimer,SIGNAL(timeout()),q,SLOT(_q_delayedSelectCurrent())); - Q_UNUSED(b); createPrimitives(); } @@ -331,17 +452,27 @@ if(!q->scene()) { return; } - QPointF centerPt = q->mapToScene(q->boundingRect().center()); - HbAbstractViewItem *item = itemAt(centerPt); + HbAbstractViewItem *item = getCenterItem(); if(item) { #ifdef HBTUMBLE_DEBUG - qDebug() << "HbTumbleViewPrivate::selectMiddleItem - " << item->modelIndex().row() ; + qDebug() << "HbTumbleViewPrivate::selectMiddleItem - " << item->modelIndex().row() ; #endif - delayedSelectCurrent(item->modelIndex()); - mSelected = item->modelIndex().row(); - } + selectCurrentIndex(item->modelIndex()); + mSelected = item->modelIndex().row(); } +} + +HbAbstractViewItem* HbTumbleViewPrivate::getCenterItem() +{ + Q_Q(HbTumbleView); + + if(!q->scene()) { + return 0; + } + QPointF centerPt = q->mapToScene(q->boundingRect().center()); + return itemAt(centerPt); +} void HbTumbleViewPrivate::scrollTo(const QModelIndex &index, HbAbstractItemView::ScrollHint hint) { @@ -366,12 +497,74 @@ #endif } -void HbTumbleView::scrollTo(const QModelIndex &index, ScrollHint) +void HbTumbleViewPrivate::selectCurrentIndex(const QModelIndex& index) { -#ifdef HBTUMBLE_DEBUG - qDebug() << "HbTumbleView::scrollTo(" << index.row() << ", )"; + Q_Q(HbTumbleView); + if(!mIsAnimating && !mIsScrolling) { + if(index == q->currentIndex()){ + HbAbstractViewItem *item =q->itemByIndex(index); + QPointF delta = pixelsToScroll(item,HbAbstractItemView::PositionAtCenter ); + QPointF newPos = -mContainer->pos() + delta; + checkBoundaries(newPos); + scrollByAmount(newPos - (-mContents->pos())); + mIsScrolling = false; + } + else{ + q->setCurrentIndex(index,QItemSelectionModel::SelectCurrent); + } + } +} + +void HbTumbleView::scrollTo(const QModelIndex &index, ScrollHint hint) +{ + Q_D(HbTumbleView); + + if (!d->mModelIterator->model() + || index.model() != d->mModelIterator->model()) { + return; + } + + //If item is in the buffer, just reveal it. + //This is always the case if recycling is off + //and sometimes the case when recycling is on + if (itemRecycling()) { + if ( !d->mContainer->itemByIndex(index) + || hint != EnsureVisible) { + //Now the item is not in the buffer. + //We must first set the item to be in the buffer + //If the item is above let's put it first and if it is below put it last + + int newIndex = -1; + + switch (hint) { + case PositionAtCenter: + { + int containerCount = d->mContainer->items().count(); + newIndex = index.row() - containerCount / 2 ; + if(newIndex < 0){ + if(((HbTumbleViewItemContainer*)(d->mContainer))->isLoopingNeeded()){ + newIndex = d->mModelIterator->indexCount()+newIndex; + } + else{ + newIndex = 0; + } + } + break; + } + + case EnsureVisible: + case PositionAtTop: + case PositionAtBottom: + default: { +#ifdef HBTUMBLE_DEBUG + qWarning()<<"Scroll Hint is not supported "; #endif - HbListView::scrollTo(index, PositionAtCenter); + } + } + d->mContainer->setModelIndexes(d->mModelIterator->index(newIndex)); + } + } + HbAbstractItemView::scrollTo(index, hint); } void HbTumbleViewPrivate::createPrimitives() @@ -419,21 +612,25 @@ /*! @proto \class HbTumbleView - \this is a tumbler widget which lets the user select alphanumeric values from a predefined list of - values via vertical flicking and dragging. Typically widgets such as date picker and time picker use the + \brief HbTumbleView is a tumbler widget which lets the user select alphanumeric values from a predefined list of values via vertical flicking and dragging.
    + + Typically widgets such as date picker and time picker use the Tumbler. The Tumbler could also be used to change other values such as number code sequence, - landmark coordinates, country selection, and currency. + landmark coordinates, country selection, and currency.
    Only strings can be accepted as HbTumbleView's items. - \this can be used like this: + HbTumbleView can be used, as shown in the below code snippet: \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,52} + + \image html hbdatetimepicker_date.png "Two TumbleViews(tumblers) in a datetime picker widget in d/MMMM format. One tumbler for day and the other for month." + Note:Graphics in the above image varies depending on theme. */ /*! \fn void itemSelected(int index) - This signal is emitted when an item is selected in date time picker. + This signal is emitted when an item is selected in the tumbler. \param index selected item. */ @@ -457,7 +654,7 @@ /*! HbTumbleView's constructor. - \param list to be set as data to QStringListModel. + \param list String list to be set as data to HbTumbleView's model. \parent item to set as parent. */ HbTumbleView::HbTumbleView(const QStringList &list,QGraphicsItem *parent) @@ -497,7 +694,7 @@ /*! Sets the HbTumbleView's items to the given string \a list. - \param list Items to be set as tumble view's model. + \param list Items to be set as data to HbTumbleView's model. */ void HbTumbleView::setItems(const QStringList &list) @@ -514,7 +711,7 @@ /*! Returns items in QStringList format. - \return list of items in tumbleview's model in QStringList format. + \return List of items set as data to HbTumbleView's model in QStringList format. */ QStringList HbTumbleView::items() const { @@ -528,7 +725,7 @@ /*! Sets the selection to the item at \a index. - \param index to be selected in the tumble view. + \param index of the item to be selected in the tumbler. */ void HbTumbleView::setSelected(int index) @@ -541,7 +738,7 @@ QModelIndex modelIndex = d->mModelIterator->index(index, rootIndex()); if(modelIndex.isValid()) { - d->delayedSelectCurrent(modelIndex); + d->selectCurrentIndex(modelIndex); emitActivated(modelIndex); } } @@ -549,7 +746,7 @@ /*! Returns the index of the current selected item in integer format. - \return current index selected in tumble view. + \return current index of the item selected in the tumbler. */ int HbTumbleView::selected() const { @@ -557,7 +754,6 @@ } /*! - \deprecated HbTumbleView::primitive(HbStyle::Primitive) is deprecated. @@ -653,25 +849,17 @@ */ void HbTumbleView::rowsInserted(const QModelIndex &parent,int start,int end) { + Q_D(HbTumbleView); HbListView::rowsInserted(parent,start,end); - scrollTo(currentIndex(),PositionAtCenter); -} -void HbTumbleViewPrivate::_q_delayedSelectCurrent() -{ - Q_Q(HbTumbleView); - if(!mIsAnimating && !mIsScrolling) { - if(mDelayedSelectIndex == q->currentIndex()){ - HbAbstractViewItem *item =q->itemByIndex(mDelayedSelectIndex); - QPointF delta = pixelsToScroll(item,HbAbstractItemView::PositionAtCenter ); - QPointF newPos = -mContainer->pos() + delta; - checkBoundaries(newPos); - scrollByAmount(newPos - (-mContents->pos())); - } - else{ - q->setCurrentIndex(mDelayedSelectIndex); - } + //Trigger recycle, in the scenario where item's are deleted and reinserted again. + QPointF alignedPosition = d->mContents->pos(); + Q_UNUSED(alignedPosition); + if(alignedPosition.y() > 0.0){ + alignedPosition.setY(0.0); + d->HbScrollAreaPrivate::setContentPosition(alignedPosition); } + scrollTo(currentIndex(),PositionAtCenter); } /*! @@ -727,9 +915,9 @@ } /*! - Sets the looping enabled flag to eith true or false, which makes the tumbleview to scroll in a circular way. + Sets the looping enabled flag to either true or false, which makes the tumbler to scroll in a circular way. - \param looped flag to enable curcular view. + \param looped flag to enable curcular view for the tumbler. \sa isLoopingEnabled */ @@ -745,7 +933,7 @@ /*! Returns looping enabled flag. - \return looping enabled flag. + \return looping enabled flag as boolean value. \sa setLoopingEnabled @@ -792,7 +980,7 @@ QSizeF sh=HbListView::sizeHint(which,constraint); switch(which) { case Qt::MinimumSize: - sh = QSizeF(sh.width(),HB_TUMBLE_PREFERRED_ITEMS*d->mHeight); + sh = QSizeF(sh.width(),HB_TUMBLE_PREFERRED_ITEMS*d->mHeight); break; case Qt::PreferredSize: sh = QSizeF(sh.width(),HB_TUMBLE_PREFERRED_ITEMS*d->mHeight); @@ -833,13 +1021,12 @@ return; } - QPointF pt = q->mapToScene(q->boundingRect().center()); - HbAbstractViewItem *centerItem=itemAt(pt); + HbAbstractViewItem *centerItem=getCenterItem(); if(centerItem) { setPressedState(centerItem); if(centerItem->modelIndex().isValid()) { - delayedSelectCurrent(centerItem->modelIndex()); + selectCurrentIndex(centerItem->modelIndex()); q->emitActivated(centerItem->modelIndex()); } } @@ -878,10 +1065,60 @@ HbListView::rowsRemoved(parent,start,end); scrollTo(currentIndex(),PositionAtCenter); } -void HbTumbleViewPrivate::delayedSelectCurrent(const QModelIndex& index) + +/*! + \reimp +*/ +void HbTumbleView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) +{ + Q_D(const HbListView); + + QList items = d->mContainer->items(); + if (!items.isEmpty()) { + QModelIndex rootIndex = d->mModelIterator->rootIndex(); + QModelIndex firstIndex = items.first()->modelIndex(); + QModelIndex lastIndex = items.last()->modelIndex(); + + if ( topLeft.parent() == rootIndex + /*&& firstIndex.row() <= bottomRight.row() + && topLeft.row() <= lastIndex.row()*/) { + HbAbstractItemView::dataChanged(topLeft, bottomRight); + } + } +} + +void HbTumbleView::gestureEvent(QGestureEvent *event) { - mDelayedSelectIndex = index; - mDelayedSelectTimer.start(DELAYED_SELECT_INTERVAL); + Q_D(HbTumbleView); + if(QTapGesture *gesture = static_cast(event->gesture(Qt::TapGesture))){ + switch(gesture->state()){ + case Qt::GestureStarted: + if(d->mIsAnimating || d->mIsScrolling){ + d->mInternalScroll = true; + HbAbstractViewItem* centerItem = d->getCenterItem(); + if(centerItem){ + d->mDelayedSelectIndex = centerItem->modelIndex(); + } + } + else{ + d->mDelayedSelectIndex = QModelIndex(); + } + break; + case Qt::GestureCanceled: + d->mInternalScroll = false; + break; + case Qt::GestureFinished: + d->mInternalScroll = false; + if(d->mDelayedSelectIndex.isValid()){ + d->selectCurrentIndex(d->mDelayedSelectIndex); + } + break; + default: + break; + + } + } + HbListView::gestureEvent(event); } #include "moc_hbtumbleview.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtumbleview.h --- a/src/hbwidgets/itemviews/hbtumbleview.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtumbleview.h Thu Jul 22 16:36:53 2010 +0100 @@ -81,6 +81,8 @@ void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; QVariant itemChange(GraphicsItemChange change,const QVariant &value); + void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); + void gestureEvent(QGestureEvent *event); bool event(QEvent *e); @@ -89,7 +91,6 @@ Q_DISABLE_COPY(HbTumbleView) Q_PRIVATE_SLOT(d_func(), void _q_scrollingStarted()) Q_PRIVATE_SLOT(d_func(), void _q_scrollingEnded()) - Q_PRIVATE_SLOT(d_func(), void _q_delayedSelectCurrent()) }; #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtumbleviewitem.cpp --- a/src/hbwidgets/itemviews/hbtumbleviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtumbleviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,10 +23,15 @@ ** ****************************************************************************/ #include "hbtumbleviewitem.h" +#include "hbtapgesture_p.h" #include "hblistviewitem_p.h" +#include "hbnamespace_p.h" #include +#include +#include + HbTumbleViewItem::HbTumbleViewItem(QGraphicsItem *parent) : HbListViewItem(parent) { @@ -51,25 +56,85 @@ /*! \reimp */ -HbAbstractViewItem *HbTumbleViewItem::createItem() +HbAbstractViewItem *HbTumbleViewItem::createItem() { HbTumbleViewItem* item = new HbTumbleViewItem(*this); item->setFocusPolicy(Qt::NoFocus); - + connect(item,SIGNAL(released(QPointF)),item->itemView(),SLOT(_q_itemSelected(QPointF))); return item; } - /*! \reimp */ void HbTumbleViewItem::updateChildItems() { Q_D(HbListViewItem); + if (d->mIndex.data(Qt::DisplayRole).isNull()) + return; HbListViewItem::updateChildItems(); if(d->mSelectionItem){ d->mSelectionItem->hide(); } } +void HbTumbleViewItem::gestureEvent(QGestureEvent *event) +{ + HbTapGesture *gesture = static_cast(event->gesture(Qt::TapGesture)); + if (gesture) { + Q_D(HbAbstractViewItem); + if(itemView()->isScrolling()){ + event->ignore(); + event->ignore(Qt::TapGesture); + return; + } + if(gesture->state() == Qt::GestureCanceled){ + d->setPressed(false, false); + event->accept(); + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + return; + } + d->tapTriggered(event); + } else { + HbWidget::gestureEvent(event); + + } +} + + +QSizeF HbTumbleViewItem::sizeHint(Qt::SizeHint which, const QSizeF &constraint) const +{ + HB_SDD(const HbAbstractViewItem); + static qreal height=0; + + QSizeF sh=HbListViewItem::sizeHint(which,constraint); + if(which == Qt::PreferredSize && sh.height()<=0) { + //TODO:remove this check once refresh issue in DTP is solved on removeRows/insertRows + if(height<=0) { + //Let's create a temporary item and take the height for the size hint + HbAbstractViewItem *tempitem = sd->mPrototype->createItem(); + if(sd->mItemView) { + QAbstractItemModel *model = sd->mItemView->model(); + if(model) { + int rowCount=model->rowCount(); + QModelIndex ind=model->index(rowCount,0); + if(ind.isValid()) { + tempitem->setModelIndex(ind); + } + } + } + + + //call polish + QEvent polishEvent(QEvent::Polish); + QCoreApplication::sendEvent(const_cast(tempitem), &polishEvent); + height=tempitem->effectiveSizeHint(which,constraint).height(); + delete tempitem; + } + return QSizeF(sh.width(),height); + } + return sh; +} + + #include "moc_hbtumbleviewitem.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/itemviews/hbtumbleviewitem.h --- a/src/hbwidgets/itemviews/hbtumbleviewitem.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/itemviews/hbtumbleviewitem.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,6 +30,10 @@ class HbListViewItemPrivate; +QT_BEGIN_NAMESPACE +class QGestureEvent; +QT_END_NAMESPACE + class HB_WIDGETS_EXPORT HbTumbleViewItem: public HbListViewItem { Q_OBJECT @@ -46,6 +50,10 @@ void updateChildItems(); +protected: + void gestureEvent(QGestureEvent *event); + QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint) const; + private: Q_DECLARE_PRIVATE_D(d_ptr, HbListViewItem) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbcolordialog.cpp --- a/src/hbwidgets/popups/hbcolordialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbcolordialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -56,6 +56,7 @@ HbGridView* createColorGrid(QObject *receiver, const char *method) { mGridView = new HbGridView(this); + mGridView->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded); HbStyle::setItemName(mGridView, "color_grid_view"); mGridView->setColumnCount(4); @@ -216,7 +217,6 @@ */ - /*! @beta Constructs a new HbColorDialog with \a parent @@ -343,7 +343,7 @@ } } -/* +/*! @beta Returns visibility of NoneBlock. Default value is false. @@ -458,7 +458,7 @@ if ( d->mDefaultColors ) { d->addDatatoModel( d->mNoneBlockVisible ? - d->mDefaultColorList.mid(0, d->mDefaultColorList.count() -1 ) : + d->mDefaultColorList.mid(0, (unsigned int)d->mDefaultColorList.count() -1 ) : d->mDefaultColorList ); } } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbcolorgridviewitem.cpp --- a/src/hbwidgets/popups/hbcolorgridviewitem.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbcolorgridviewitem.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,6 +29,14 @@ #include #include +/*! + \primitives + \primitive{cg-color-icon} HbIconItem representing the icon colored with this color item's color. + \primitive{cg-border-icon} HbIconItem representing borders of the color item. + \primitive{cg-selection-icon} HbIconItem representing the check mark of a selected color item. + \primitive{background} HbFrameBackground representing the background frame. + */ + class HbColorGridViewItemPrivate: public HbGridViewItemPrivate { Q_DECLARE_PUBLIC( HbColorGridViewItem ) @@ -73,6 +81,7 @@ HbColorGridViewItemPrivate::~HbColorGridViewItemPrivate() { + delete mFrameBackGround; } bool HbColorGridViewItemPrivate::isChecked() const diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbinputdialog.cpp --- a/src/hbwidgets/popups/hbinputdialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbinputdialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,9 +22,8 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ - +#include "hbinputdialog_p.h" #include -#include "hbinputdialog_p.h" #include "hbglobal_p.h" #include #include @@ -42,36 +41,53 @@ /*! @beta @hbwidgets - \class HbInputDialog - \brief HbInputDialog creates a modal dialog for the user to get some information in the form of text or numbers. - + \brief HbInputDialog is a convenient class for getting user inputs. Based on the \InputMode user can enter text, int, double or an IP address. InputDialog can have one or two line edit input fields. - HbInputDialog by default will have a label to display a descriptive text for the line edit input field and, - OK and Cancel buttons. + \image html inputdialog.png "An Input dialog with prompt text and a user input field." + + HbInputDialog by default will have a label to display a descriptive text which gives information on the user input field, + an edit field for entering text and,two action buttons. example code example: \code - HbInputDialog *object = new HbInputDialog(parent); - object->show(); + HbInputDialog *object = new HbInputDialog(); \endcode + + The HbDialog::open( QObject* receiver, const char* member ) method from the HbDialog is used to show the HbInputDialog. + + The open method can be attached with a SLOT of the format finished(HbAction*) or finished(int). When the open is used with a slot then the slot + will be invoked once the user does any action such as accept or reject (The Ok or Cancel press). + - Four static convenience API's are provided: getText(), getInteger(), getDouble(), and getIp() + below is the declaration of the slot. + \code + public slots : + void dialogClosed(int); + \endcode + + below code shows how the open method can be called using this slot. + \snipped{ultimatecodesnipped/ultimatecodesnippet.cpp,56} + + A sample slot definition is shown below + \snipped{ultimatecodesnipped/ultimatecodesnippet.cpp,55} + + In HbInputDialog four static convenience API's are provided: queryText(), queryInteger(), queryDouble(), and queryIp() static API's can be used to quickly get an input from user. - \enum HbInputDialog::InputMode + \enum HbInputDialog::InputMode - \value \b TextInput When this value is set as Input mode, input dialog accepts text input in its + \value \b TextInput When this value is set as Input mode, Input Dialog accepts text input in its correspoinding line edit field. - \value \b IntInput When this value is set as Input mode, input dialog accepts Integer input in its + \value \b IntInput When this value is set as Input mode, Input Dialog accepts Integer input in its correspoinding line edit field. - \value \b RealInput When this value is set as Input mode, input dialog accepts double or float input in its + \value \b RealInput When this value is set as Input mode, Input Dialog accepts double or float input in its correspoinding line edit field. - \value \b IpInput When this value is set as Input mode, input dialog accepts Ip address as input in its + \value \b IpInput When this value is set as Input mode, Input Dialog accepts Ip address as input in its correspoinding line edit field. */ @@ -107,15 +123,15 @@ } /*! - Sets the input mode of the primary(Top/default)line edit in the query widget. - - The default InputMode is TextInput + Sets the input mode of the user field. The default InputMode is TextInput. + The other available modes are IntInput,RealInput and IpInput. \param mode. InputMode can be TextMode, IntMode, RealMode and Ip address mode. each mode will affect how the line edit filters its input. - \param row. value 0 or 1 - + \param row. This parameter indicates which row of the field.0 (by default) means the + the first user field and 1 means second user field. + \sa inputMode() */ void HbInputDialog::setInputMode(InputMode mode ,int row) @@ -125,11 +141,10 @@ } /*! - Returns input mode for top/default line edit. + Returns input mode of the user field.The default InputMode is TextInput. - The default InputMode is TextInput - - \param row. value 0 or 1 + \param row This parameter indicates which row of the field.0 means the + the first user field and 1 means second user field. \sa setInputMode() */ @@ -148,10 +163,11 @@ } /*! - Sets the prompt \a text for top/default line edit. + Sets the prompt text for the user field. This prompt text text can be very descriptive like username,password etc. - \param text. Text for the label which describes the purpose of the corresponding input line edit field. - \param row. value 0 or 1 + \param text The promt text string. Maximum number of lines shown is 2. + \param row This parameter indicates which row of the user field.0 (by default) means the + the first user field and 1 means second user field. \sa promtText() */ @@ -162,9 +178,10 @@ } /*! - Returns prompt text for top/default line edit. - the default is null string. - \param row. value 0 or 1 + Returns descriptive prompt text. + + \param row This parameter indicates which row of the field. 0 means the + the user field in the first row and 1 means user field in the second row. \sa setPromptText() */ @@ -175,10 +192,12 @@ } /*! - Sets the top/default line edit value in \a text format. - - \param value. user defined value for the default line edit. - \param row. value 0 or 1 + Sets the value for the user input field.The value should in sync HbInputDialog::InputMode of the field. + + \param value The value that should be presented to the user. + + \param row This parameter indicates which row of the user field.0 (by default) means the + the first user field and 1 means second user field. \sa value() */ @@ -189,9 +208,11 @@ } /*! - Returns top/default line edit value as QVariant object. - - \param row. value 0 or 1 + This returns the value of the user field row. The return type is QVariant which can be converted to + corresponding type based on HbInputDialog::InputMode of the field. + + \param row This parameter indicates which row of the user field.0 (by default) means the + the first user field and 1 means second user field \sa setValue() */ @@ -202,9 +223,10 @@ } /*! - Sets the visibility of bottom line edit and prompt text. + HbInputDialog is capable of showing one or two user input fields. This can be set using this function. + By default this is false and only first row is visible. - \param visible true or false. + \param visible true or false. If true then two user fields will be visible otherwise one. \sa isAdditionalRowVisible() */ @@ -215,8 +237,8 @@ } /*! - Returns the visibility of secondary row(bottom line edit and prompt text). - the default is false + Returns the visibility of second row user input field.The default is false. + \sa setAdditionalRowVisible() */ bool HbInputDialog::isAdditionalRowVisible() @@ -226,12 +248,16 @@ } /*! - Validator is used to validate the content and cursor movements. + + This API allows the user to set any validator to the user input field. - \param validator. Validator uses undo stack to back out invalid changes. Therefore undo + \param validator Validator uses undo stack to back out invalid changes. Therefore undo is enabled when validator is set. - \sa HbAbstractEdit::setValidator + \param row This parameter indicates which row of the user field.0 means the + the first user field and 1 means second user field + + \sa HbAbstractEdit::validator */ void HbInputDialog::setValidator(HbValidator *validator,int row) { @@ -244,9 +270,10 @@ } /*! - Returns the validator of the inputDialog's line edit. + This API returns the validator of the corresponding user input row. - \param row. A value 0 or 1 + \param row This parameter indicates which row of the user field.0 (by default) means the + the first user field and 1 means second user field \sa setValidator() */ @@ -262,9 +289,9 @@ } /*! - returns the lineEdit pointer. will return NULL if row is greater than 2. - - \param row. A value 0 or 1 + This returns the editor instance used in HbInputDialog. + \param row This parameter indicates which row of the user field.0 (by default) means the + the first user field and 1 means second user field */ HbLineEdit* HbInputDialog::lineEdit(int row) const { @@ -278,12 +305,15 @@ } /*! - sets the echo mode for the given row. + sets the echo mode for the user input fiels. The echo mode is defined in HbLineEdit. + Normal, NoEcho, Password, PasswordEchoOnEdit are the different echo modes supportted in HbLineEdit. - \param echoMode - \param row. A value 0 or 1 + \param echoMode which can be HbLineEdit::Normal, HbLineEdit::NoEcho, HbLineEdit::Password or HbLineEdit::PasswordEchoOnEdit. + + \param row This parameter indicates which row of the user field.0 (by default) means the + the first user input field and 1 means second user input field - \sa HbLineEdit::setEchoMode + \sa echoMode() , HbLineEdit::setEchoMode() */ void HbInputDialog::setEchoMode(HbLineEdit::EchoMode echoMode,int row) { @@ -322,7 +352,6 @@ /*! \reimp - Initializes \a option with the values from this HbInputDialog. */ void HbInputDialog::initStyleOption(HbStyleOptionInputDialog *option) const { @@ -334,7 +363,6 @@ /*! \reimp - updatePrimitives. */ void HbInputDialog::updatePrimitives() { @@ -351,10 +379,40 @@ } } +void HbInputDialog::done(int code) +{ + Q_D(HbInputDialog); + if(code==Accepted) { + QString text; + if(d->mContentWidget && d->mContentWidget->mEdit1) { + text = d->mContentWidget->mEdit1->text(); + } + switch(d->mPrimaryMode) { + case HbInputDialog::TextInput: + case HbInputDialog::IpInput: { + emit textValueSelected(text); + break; + } + case HbInputDialog::IntInput: { + emit intValueSelected(text.toInt(0,10)); + break; + } + case HbInputDialog::RealInput: { + emit doubleValueSelected(text.toDouble()); + break; + } + default: + break; + } + } + HbDialog::done(code); +} + /*! - Returns the echoMode of line edit. returns -1 if row is more than 2. + Returns the echoMode of the user input field.It returns HbLineEdit::EchoMode. - \param row. A value 0 or 1 + \param row This parameter indicates which row of the user field.0 means the + the first user input field and 1 means second user input field \sa setEchoMode() */ @@ -370,16 +428,23 @@ } /*! - Static convenience function for creating an input dialog to get a string from the user. - \a label is the text which is shown to the user (it should - say what should be entered). \a text is the default text which is - placed in the line edit. If \a ok is non-null \e *\a ok will be - set to true if the user pressed \gui OK and to false if the user pressed - \gui Cancel. The dialog's parent is \a parent. The dialog will be - modal. - - This function return data has to be queried in the finished(HbAction*) slot. - + \deprecated HbInputDialog::getText(const QString&,QObject*,const char*,const QString&,QGraphicsScene*,QGraphicsItem*) + is deprecated. + + This is a static convenience function for creating an Input Dialog and to get a string data from the the user. The Application can use this + function in order to get any text data from user like username,search data etc. This API allows a slot to be passed as a param. This slot will + be invoked when the user does the action like OK press or CANCEL press. + + HbInputDialog::getText(iTitle,this,SLOT(dialogClosed(HbAction*)),iText); iTitle is the prompt text.dialogClosed will be invoked when the user does the action. + Please refer the class documentation to know how to handle the slot. + + \param label The prompt text which gives information on user input field. + \param receiver The instance where the slot is declared. + \param member The slot which has dialogClosed(HbAction*) signature. + \param text The default text that should be presented to the user. + \param scene The scene parameter. + \param parent The parent item for the dialog. + \sa getInteger(), getDouble(), getIp() */ void HbInputDialog::getText(const QString &label, @@ -402,17 +467,10 @@ /*! - Static convenience function to get an integer input from the - user.\a label is the text which is shown to the user - (it should say what should be entered). \a value is the default - integer which the spinbox will be set to. - If \a ok is non-null *\a ok will be set to true if the user - pressed \gui OK and to false if the user pressed \gui Cancel. The - dialog's parent is \a parent. The dialog will be modal. + \deprecated HbInputDialog::getInteger(const QString&,QObject*,const char*,int,QGraphicsScene*,QGraphicsItem*) + is deprecated. - This function return data has to be queried in the finished(HbAction*) slot. - - \sa getText(), getDouble(), getIp() + \sa queryInteger(), queryDouble(), queryIp() */ void HbInputDialog::getInteger(const QString &label, QObject *receiver, @@ -432,18 +490,10 @@ dlg->open(receiver,member); } /*! - Static convenience function to get a floating point number from - the user.\a label is the text which is shown to the user - (it should say what should be entered). \a value is the default - floating point number that the line edit will be set to. - - If \a ok is non-null, *\a ok will be set to true if the user - pressed \gui OK and to false if the user pressed \gui Cancel. The - dialog's parent is \a parent. The dialog will be modal. - - This function return data has to be queried in the finished(HbAction*) slot. - - \sa getText(), getInteger(), getIp() + \deprecated HbInputDialog::getDouble(const QString&,QObject*,const char*,double,QGraphicsScene*,QGraphicsItem*) + is deprecated. + + \sa queryInteger(), queryDouble(), queryIp() */ void HbInputDialog::getDouble(const QString &label, QObject *receiver, @@ -462,21 +512,13 @@ dlg->open(receiver,member); } - /*! - Static convenience function to get an ip address from - the user.\a label is the text which is shown to the user - (it should say what should be entered). \a address is the default - QHostAddress that the line edit will be set to. + \deprecated HbInputDialog::getIp(const QString &,QObject*,const char*,const QString&,QGraphicsScene*,QGraphicsItem*) + is deprecated. - If \a ok is non-null, *\a ok will be set to true if the user - pressed \gui OK and to false if the user pressed \gui Cancel. The - dialog's parent is \a parent. The dialog will be modal. + \sa queryInteger(), queryDouble(), queryIp() +*/ - This function return data has to be queried in the finished(HbAction*) slot. - - \sa getText(), getInteger(), getDouble() -*/ void HbInputDialog::getIp(const QString &label, QObject *receiver, const char *member, @@ -489,9 +531,148 @@ scene->addItem(dlg); } dlg->setPromptText(label); - dlg->setValue(ipaddress); + dlg->setValue(ipaddress); dlg->setInputMode(IpInput); dlg->open(receiver,member); } +/*! + This is a static convenience function for creating an Input Dialog and to get a string data from the the user. The Application can use this + function in order to get any text data from user like username,search data etc. This API allows a slot to be passed as a param. This slot will + be invoked when the user does the action like OK press or CANCEL press. + + HbInputDialog::queryText(iTitle,this,SLOT(dialogClosed(int)),iText); iTitle is the prompt text.dialogClosed will be invoked when the user does the action. + Please refer the class documentation to know how to handle the slot. + + \param promptText The prompt text which gives information on user input field. + \param receiver The instance where the slot is declared. + \param member The slot which has dialogClosed(HbAction*) or dialogClosed(int) signature. + \param defaultText The default text that should be presented to the user. + \param scene The scene parameter. + \param parent The parent item for the dialog. + + \sa queryInteger(), queryDouble(), queryIp() +*/ +void HbInputDialog::queryText(const QString &promptText, + QObject *receiver, + const char* member, + const QString &defaultText, + QGraphicsScene *scene, + QGraphicsItem *parent) +{ + HbInputDialog *dlg = new HbInputDialog(parent); + if (scene && !parent) { + scene->addItem(dlg); + } + dlg->setPromptText(promptText); + dlg->setInputMode(TextInput); + dlg->setValue(defaultText); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->open(receiver,member); +} + + +/*! + This is a static convenience function for creating an Input Dialog and to get an integer data from the the user. The Application can use this + function in order to get any integer data from user like year , any number etc. This API allows a slot to be passed as a param. This slot will + be invoked when the user does the action like OK press or CANCEL press. + + HbInputDialog::queryInt(iTitle,this,SLOT(dialogClosed(int)),iText); iTitle is the prompt text.dialogClosed will be invoked when the user does the action. + Please refer the class documentation to know how to handle the slot. + + \param promptText The prompt text which gives information on user input field. + \param receiver The instance where the slot is declared. + \param member The slot which has dialogClosed(HbAction*) or dialogClosed(int) signature. + \param defaultInt The default value that should be presented to the user. + \param scene The scene parameter. + \param parent The parent widget for the dialog. + + \sa queryText(), queryDouble(), queryIp() +*/ +void HbInputDialog::queryInt(const QString &promptText, + QObject *receiver, + const char *member, + int defaultInt, + QGraphicsScene *scene, + QGraphicsItem *parent) +{ + HbInputDialog *dlg = new HbInputDialog(parent); + if(scene && !parent) { + scene->addItem(dlg); + } + dlg->setPromptText(promptText); + dlg->setInputMode(IntInput); + dlg->setValue(QString::number(defaultInt)); + dlg->setAttribute(Qt::WA_DeleteOnClose); + dlg->open(receiver,member); +} +/*! + This is a static convenience function for creating an Input Dialog and to get a double data from the the user. The Application can use this + function in order to get any double data from user. This API allows a slot to be passed as a param. This slot will + be invoked when the user does the action like OK press or CANCEL press. + + HbInputDialog::queryDouble(iTitle,this,SLOT(dialogClosed(int)),iText); iTitle is the prompt text.dialogClosed will be invoked when the user does the action. + Please refer the class documentation to know how to handle the slot. + + \param promptText The prompt text which gives information on user input field. + \param receiver the instance where the slot is declared. + \param member the slot which has dialogClosed(HbAction*) or dialogClosed(int) signature. + \param defaultDouble the default value that should be presented to the user. + \param scene the scene parameter. + \param parent the parent widget for the dialog. + + \sa queryText(), queryInteger(), queryIp() +*/ +void HbInputDialog::queryDouble(const QString &promptText, + QObject *receiver, + const char *member, + double defaultDouble, + QGraphicsScene *scene, + QGraphicsItem *parent) +{ + HbInputDialog *dlg = new HbInputDialog(parent); + if(scene && !parent) { + scene->addItem(dlg); + } + dlg->setPromptText(promptText); + dlg->setInputMode(RealInput); + dlg->setValue(QString::number(defaultDouble)); + dlg->open(receiver,member); +} + + +/*! + This is a static convenience function for creating an Input Dialog and to get an IP information from the the user. This API allows a slot to be passed as a param. This slot will + be invoked when the user does the action like OK press or CANCEL press. + + HbInputDialog::queryIp(iTitle,this,SLOT(dialogClosed(int)),iText); iTitle is the prompt text.dialogClosed will be invoked when the user does the action. + Please refer the class documentation to know how to handle the slot. + + \param promptText The prompt text which gives information on user input field. + \param receiver the instance where the slot is declared. + \param member the slot which has dialogClosed(HbAction*) or dialogClosed(int) signature. + \param defaultIp the default value that should be presented to the user. + \param scene the scene parameter. + \param parent the parent widget for the dialog. + + \sa queryText(), queryInteger(), queryDouble() +*/ + +void HbInputDialog::queryIp(const QString &promptText, + QObject *receiver, + const char *member, + const QString &defaultIp, + QGraphicsScene *scene, + QGraphicsItem *parent) +{ + HbInputDialog *dlg = new HbInputDialog(parent); + if(scene && !parent) { + scene->addItem(dlg); + } + dlg->setPromptText(promptText); + dlg->setValue(defaultIp); + dlg->setInputMode(IpInput); + dlg->open(receiver,member); +} #include "moc_hbinputdialog.cpp" + diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbinputdialog.h --- a/src/hbwidgets/popups/hbinputdialog.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbinputdialog.h Thu Jul 22 16:36:53 2010 +0100 @@ -97,6 +97,31 @@ , QGraphicsScene *scene = 0 , QGraphicsItem *parent = 0); + static void queryText(const QString &promptText + ,QObject *receiver + ,const char *member + ,const QString &defaultText = QString() + ,QGraphicsScene *scene = 0 + ,QGraphicsItem *parent = 0); + static void queryInt(const QString &promptText + ,QObject *receiver + ,const char *member + ,int defaultInt = 0 + ,QGraphicsScene *scene = 0 + ,QGraphicsItem *parent = 0); + static void queryDouble(const QString &promptText + ,QObject *receiver + ,const char *member + ,double defaultDouble = 0 + , QGraphicsScene *scene = 0 + , QGraphicsItem *parent = 0); + static void queryIp(const QString &promptText + ,QObject *receiver + ,const char *member + , const QString &defaultIp = QString() + , QGraphicsScene *scene = 0 + , QGraphicsItem *parent = 0); + QGraphicsItem* primitive(HbStyle::Primitive primitive) const; enum { Type = Hb::ItemType_InputDialog }; @@ -104,6 +129,12 @@ public slots: void updatePrimitives(); + void done(int code); + +signals: + void intValueSelected(int value); + void doubleValueSelected(double value); + void textValueSelected(QString value); protected: HbInputDialog(HbDialogPrivate &dd, QGraphicsItem *parent); @@ -113,6 +144,7 @@ Q_DISABLE_COPY(HbInputDialog) Q_DECLARE_PRIVATE_D(d_ptr, HbInputDialog) Q_PRIVATE_SLOT(d_func(), void _q_notesOrientationChanged(Qt::Orientation)) + Q_PRIVATE_SLOT(d_func(), void textChange(const QString)) }; #endif //HBINPUT_DIALOG_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbinputdialog_p.cpp --- a/src/hbwidgets/popups/hbinputdialog_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbinputdialog_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -52,10 +52,14 @@ mEdit1 = new HbLineEdit(this); HbStyle::setItemName(mEdit1, "text-1"); + connect(mEdit1,SIGNAL(textChanged(const QString)),this,SLOT(emitTextChange(const QString))); this->setProperty("additionalRowVisible",QVariant(false)); } - +void HbInputDialogContentWidget::emitTextChange(const QString & data) +{ + emit textChanged(data); +} void HbInputDialogContentWidget::setAdditionalRowVisible(bool visible) { mAdditionalRowVisible = visible; @@ -103,7 +107,6 @@ { } - void HbInputDialogPrivate::init() { #ifdef HBINPUTDIALOG_DEBUG @@ -116,10 +119,17 @@ //Populate the widget mContentWidget = new HbInputDialogContentWidget(this); + q->connect(mContentWidget,SIGNAL(textChanged(const QString)),q,SLOT(textChange(const QString))); q->setContentWidget(mContentWidget); - q->addAction(new HbAction(q->tr("Ok"), q)); - q->addAction(new HbAction(q->tr("Cancel"), q)); + action1=new HbAction(hbTrId("txt_common_button_ok"),q); + action1->setEnabled(false); + q->addAction(action1); + q->connect(action1,SIGNAL(triggered()),q,SLOT(accept())); + + HbAction *action2=new HbAction(hbTrId("txt_common_button_cancel"),q); + q->addAction(action2); + q->connect(action2,SIGNAL(triggered()),q,SLOT(reject())); q->setTimeout(HbPopup::NoTimeout); q->setModal(true); // Dialog is modal @@ -131,6 +141,22 @@ SLOT( _q_notesOrientationChanged(Qt::Orientation) ) ); } +void HbInputDialogPrivate::textChange(const QString data) +{ + Q_UNUSED(data); + Q_Q(HbInputDialog); + + if(q->actions().count() == 0) { + return; + } + + if(mContentWidget->mEdit1->hasAcceptableInput()) { + q->actions().at(0)->setEnabled(true); + } else { + q->actions().at(0)->setEnabled(false); + } + +} void HbInputDialogPrivate::setInputMode(HbLineEdit *pEdit, HbInputDialog::InputMode mode) { @@ -144,12 +170,10 @@ { //set the validator if(mValid) { - // NOTE:This validation is for readability. mValid is being deleted - // when setValidator is called on editor. - mValid = 0; + delete mValid; } - mValid = new HbValidator(); - QValidator *intValidator = new QIntValidator(q); + mValid = new HbValidator(q); + QValidator *intValidator = new QIntValidator; mValid->addField(intValidator, "0"); pEdit->setValidator(mValid); @@ -161,11 +185,11 @@ { //set the validator if(mValid) { - mValid = 0; + delete mValid; } - mValid = new HbValidator(); - QValidator *doubleValidator = new QDoubleValidator(q); + mValid = new HbValidator(q); + QValidator *doubleValidator = new QDoubleValidator(mValid); mValid->addField(doubleValidator, "0"); pEdit->setValidator(mValid); @@ -176,9 +200,12 @@ case HbInputDialog::IpInput: { QString text = pEdit->text(); - mValid = new HbValidator; + if(mValid){ + delete mValid; + } + mValid = new HbValidator(q); mValid->setDefaultSeparator("."); - QStringList list = text.split("."); + QStringList list = text.split('.'); if (list.count() != 4 ) { mValid->setDefaultSeparator("."); mValid->addField(new QIntValidator(0, 255, 0), "127"); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbinputdialog_p.h --- a/src/hbwidgets/popups/hbinputdialog_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbinputdialog_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -64,7 +64,7 @@ HbInputCustomButtonBank *mCustomButtonBank; HbInputCustomButton *mDotButton; HbInputCustomButton *mDashButton; - HbValidator *mValid; + QPointer mValid; HbInputDialog::InputMode mPrimaryMode; HbInputDialog::InputMode mSecondaryMode; @@ -72,6 +72,9 @@ QString mPromptText; QString mPromptAdditionalText; QString mText; + HbAction *action1; +public slots: + void textChange(const QString); }; #endif //HBINPUTDIALOGPRIVATE_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbinputdialogcontent_p.h --- a/src/hbwidgets/popups/hbinputdialogcontent_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbinputdialogcontent_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,12 +37,17 @@ { Q_OBJECT public: - HbInputDialogContentWidget(HbInputDialogPrivate* priv,QGraphicsItem* parent =0); + explicit HbInputDialogContentWidget(HbInputDialogPrivate* priv,QGraphicsItem* parent =0); enum { Type = HbPrivate::ItemType_HbInputDialogContentWidget }; int type() const { return Type; } void setAdditionalRowVisible(bool visible); +public slots: + void emitTextChange(const QString &text); + +signals: + void textChanged(const QString &text); public: HbInputDialogPrivate* d; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbmessagebox.cpp --- a/src/hbwidgets/popups/hbmessagebox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbmessagebox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,9 +23,9 @@ ** ****************************************************************************/ +#include "hbmessagebox_p.h" #include "hbnamespace_p.h" #include -#include "hbmessagebox_p.h" #include #include #include @@ -37,11 +37,15 @@ #include #include #include +#ifdef Q_OS_SYMBIAN +#include +#endif class HbStyle; class HbMessageBoxEditor : public HbLineEdit { + Q_OBJECT public: HbMessageBoxEditor(QGraphicsItem* parent =0) : HbLineEdit(parent),mText() { @@ -51,14 +55,7 @@ scroll->setVerticalScrollBarPolicy(HbScrollArea::ScrollBarAsNeeded); clearContextMenuFlag(Hb::ShowTextContextMenuOnLongPress); clearContextMenuFlag(Hb::ShowTextContextMenuOnSelectionClicked); - primitive(HbStyle::P_LineEdit_frame_normal)->setVisible(false); - primitive(HbStyle::P_LineEdit_frame_highlight)->setVisible(false); - } - - HbScrollBar * getScrollBar() const - { - HbScrollArea *scroll = scrollArea(); - return scroll->verticalScrollBar(); + setBackgroundItem(0,0); } void focusInEvent(QFocusEvent * event) @@ -73,8 +70,14 @@ void setHtmlText(const QString &text) { mText = text; - setHtml(text); - } + if(Qt::mightBeRichText(mText)){ + setHtml(text); + } + else { + QString htmlString = Qt::convertFromPlainText(mText); + setHtml(htmlString); + } + } QString htmlText() const { @@ -116,15 +119,17 @@ HbDialogPrivate(), mIcon(), mMessageBoxContentWidget(0), - mMessageBoxType(HbMessageBox::MessageTypeInformation), + mMessageBoxType(HbMessageBox::MessageTypeNone), mIconVisible(true) { } -void HbMessageBoxPrivate::_q_closeOnGesture() +void HbMessageBoxPrivate::_q_buttonClicked() { + Q_Q(HbMessageBox); + HbAction *action = static_cast(q->sender()); + q->done(mActionList.value(action)); } - /* destructor */ @@ -138,117 +143,147 @@ void HbMessageBoxPrivate::init() { Q_Q(HbMessageBox); - + + mMessageBoxContentWidget = new HbMessageBoxContentWidget( this ); + q->setContentWidget( mMessageBoxContentWidget ); + q->setDismissPolicy(HbPopup::NoDismiss); + q->setTimeout(HbPopup::NoTimeout); + q->setStandardButtons(HbMessageBox::Ok); + switch(mMessageBoxType) { + case HbMessageBox::MessageTypeNone: + mMessageBoxContentWidget->mIconItem->hide(); + mMessageBoxContentWidget->setProperty("hasIcon",false); + break; case HbMessageBox::MessageTypeInformation: case HbMessageBox::MessageTypeWarning: - mMessageBoxContentWidget = new HbMessageBoxContentWidget( this ); - q->setContentWidget( mMessageBoxContentWidget ); - q->setDismissPolicy(HbPopup::NoDismiss); - q->setTimeout(HbPopup::NoTimeout); - q->addAction(new HbAction(q->tr("OK"),q)); + case HbMessageBox::MessageTypeQuestion: break; - - case HbMessageBox::MessageTypeQuestion: - mMessageBoxContentWidget = new HbMessageBoxContentWidget( this ); - q->setContentWidget( mMessageBoxContentWidget ); - q->setDismissPolicy(HbPopup::NoDismiss); - q->setTimeout(HbPopup::NoTimeout); - q->addAction(new HbAction(q->tr("Yes"),q)); - q->addAction(new HbAction(q->tr("No"),q)); - break; + } } +void HbMessageBoxPrivate::_q_appearEffectEnded(HbEffect::EffectStatus status) +{ +#ifdef Q_OS_SYMBIAN + + if ( (status.reason == Hb::EffectFinished) || ( (status.reason == Hb::EffectCancelled) && (!mStartEffect) )) { + CSystemToneService *pSystemTone = systemToneService(); + if(!pSystemTone) { + return ; + } + switch(mMessageBoxType) { + case HbMessageBox::MessageTypeInformation: + pSystemTone->PlayTone(CSystemToneService::EInformationBeep); + break; + case HbMessageBox::MessageTypeWarning: + pSystemTone->PlayTone(CSystemToneService::EWarningBeep); + break; + case HbMessageBox::MessageTypeQuestion: + pSystemTone->PlayTone(CSystemToneService::EConfirmationBeep); + break; + default: + break; + } + + } +#else + Q_UNUSED(status); +#endif // Q_OS_SYMBIAN +} /*! @beta \class HbMessageBox - \brief HbMessageBox is a convenience modal dialog class, using which a simple information, a question, or a simple warning can be shown to the user. + \brief HbMessageBox is a convenience modal dialog class. HbMessageBox can be used to launch a information,question,warning or any other + general messages. + + \image html information.PNG "An information MessageBox" + \image html question.PNG "A question MessageBox" + \image html warning.PNG "A warning MessageBox" Using HbMessageBox, the following dialogs can be created: - Information: a statement to the user to which they may respond by acknowledging the information ('OK').
    + Information: a statement to the user to which they may respond by acknowledging the information ('Ok').
    Question: a query to the user requiring a response. User needs to select between two alternatives, the positive or negative (For example: 'Delete Mailbox?' 'Yes'/'No').
    Warning: a statement to the user to which they may respond by acknowledging the warning ('OK').
    + None: Any general messages to which user responds. - By default, Message box launches an information dialog which contains a description text and user actions visualized as command buttons. + By default, Message box launches a None dialog which can contain a text, an icon and action buttons Default properties for the MessageBox (warning, information and question dialogs) are: Description text: Text shown to the user as information. The amount of text rows is not limited, but after five rows the text starts scrolling. Icon: Default icons are available for each dialog type using the MessageBox template. Changing the default icons is not recommended. - Action buttons (one or two): one button for information and warning MessageBox, two buttons for question MessageBox. + Action button : One action button ("Ok") for all the types. - All the three dialogs(information, warning, question) supported by MessageBox are by default modal in nature, with + All the four dialogs(information, warning, question and none) supported by MessageBox are by default modal in nature, with a dismiss policy of NoDismiss, timeout policy of NoTimeout, and with a BackgroundFade property on. Example code for launching MessageBox using static convenience functions: \code //Information MessageBox - HbMessageBox::information(informationText, this, SLOT(onDialogClose(HbAction*)), headWidget, scene, parent); + HbMessageBox::information("The file is deleted",0,0,HbMessageBox::Ok); //Warning MessageBox - HbMessageBox::warning(warningText, this, SLOT(onDialogClose(HbAction*)), headWidget, scene, parent); + HbMessageBox::warning("This will change the name",0,0,HbMessageBox::Ok); //Question MessageBox - HbMessageBox::question(questionText, this, SLOT(onDialogClose(HbAction*)), primaryButtonText, secondaryButtonText, headWidget, scene, parent); + HbMessageBox::question("Do you want to delete the file ?", this, SLOT(onDialogClose(int)),HbMessageBox::Yes |HbMessageBox::No ); \endcode Example code to show an information messagebox: - \code - HbMessageBox *box = new HbMessageBox("This is an information dialog."); + HbMessageBox *box = new HbMessageBox("This is a general note."); box->setAttribute(Qt::WA_DeleteOnClose); box->open(); \endcode - Example code to show an information messagebox with two action buttons: - \code - HbMessageBox *box = new HbMessageBox("XX will be deleted. Do you want to Continue ? "); - - //Add new action. - box->addAction(new HbAction(HbWidget::tr("Cancel"), q)); - - box->setAttribute(Qt::WA_DeleteOnClose); - - box->open(); - \endcode - Example code to show a question messagebox with a return value based action \code - HbMessageBox *box = new HbMessageBox(" Delete file IC0002 ? ",HbMessageBox::MessageTypeQuestion); + HbMessageBox *box = new HbMessageBox(HbMessageBox::MessageTypeQuestion); + box->setText("Delete file IC0002 ? "); box->setAttribute(Qt::WA_DeleteOnClose); - box->open(this,SLOT(dialogClosed(HbAction*))); - + box->setStandardButtons(HbMessageBox::Yes | HbMessageBox::No); + box->open(this,SLOT(onDialogClosed(int))); + //Slot implementation - void dialogClosed(HbAction *action) + void MessageBoxView::onDialogClosed(int action) { - HbMessageBox *dlg = static_cast(sender()); - if(action == dlg->actions().at(0)) - { - // Delete file - } - else - { - // Cancellation is done.Dont delete the file - } - } + if (action == HbMessageBox::Yes) { + //User Clicked Yes// + //Delete the file// + } + else if (action == HbMessageBox::No) { + //User Clicked No// + //do not delete the file// + } + + } + \endcode + + Example code to show a question messagebox using static API + \code + HbMessageBox::question("Delete file IC0002 ? ",this,SLOT(onDialogClosed(int)),HbMessageBox::Yes | HbMessageBox::No); + // Here the SLOT implementation is same as above \endcode + \enum HbMessageBox::MessageBoxType - \value \b MessageTypeInformation creates a modal information dialog, which by default will have one OK button + \value \b MessageTypeNone creates a modal dialog, which by default will have one OK button for the user to dismiss the dialog. \value \b MessageTypeWarning creates a simple modal dialog with a warning icon and a description text. - Dialog by default will have one OK button, for the user to dismiss the dialog. + This Dialog by default will have one Ok button, for the user to dismiss the dialog. - \value \b MessageTypeQuestion Shows a modal dialog with question icon and a description text. The user can either confirm or - reject the dialog. By default dialog supports two buttons, using which user can dismiss the dialog. + \value \b MessageTypeWarning creates a simple modal dialog with a information icon and a description text. + This Dialog by default will have one Ok button, for the user to dismiss the dialog. + \value \b MessageTypeQuestion creates a simple modal dialog with a question icon and a description text. + This Dialog by default will have one Ok button, for the user to dismiss the dialog. */ /*! @@ -348,7 +383,7 @@ } /*! - Sets the descriptive text for the messagebox. + Sets the descriptive text for the messagebox. It can be in plain text format or html format. \param text Descriptive text for the MessageBox \sa text() */ @@ -385,6 +420,10 @@ initStyleOption(&option); style()->updatePrimitive(d->mMessageBoxContentWidget->mIconItem, HbStyle::P_MessageBox_icon, &option); } + if(iconVisible() ) { + d->mMessageBoxContentWidget->mIconItem->show(); + d->mMessageBoxContentWidget->setProperty("hasIcon",true); + } } } @@ -435,11 +474,123 @@ return d->mIconVisible; } +/*! + sets the buttons for the dialog. If the Application wants "Yes" and "No" buttons + can set it like setStandardButtons(HbMessageBox::Yes | HbMessageBox::No). + If only yes Button then setStandardButtons(HbMessageBox::Yes). + + \param buttons the button set + \sa standardButtons() +*/ +void HbMessageBox::setStandardButtons(HbMessageBox::StandardButtons buttons) +{ + Q_D(HbMessageBox); + if(d->mStandardButtons == buttons ) { + return; + } + clearActions(); + d->mStandardButtons = buttons; + uint i = HbMessageBox::Ok; + int count =0; + while (i <= HbMessageBox::Reset) { + HbAction *action=0; + if (i & buttons) { + StandardButton button = HbMessageBox::StandardButton(i); + switch(button){ + case Ok: + action = new HbAction(hbTrId("txt_common_button_ok"),this); + d->mActionList.insert(action,Ok); + break; + case Save: + action = new HbAction(hbTrId("txt_common_button_save"),this); + d->mActionList.insert(action,Save); + break; + case Open: + action = new HbAction(hbTrId("txt_common_button_open"),this); + d->mActionList.insert(action,Open); + break; + case Yes: + action = new HbAction(hbTrId("txt_common_button_yes"),this); + d->mActionList.insert(action,Yes); + break; + case No: + action = new HbAction(hbTrId("txt_common_button_no"),this); + d->mActionList.insert(action,No); + break; + case Retry: + action = new HbAction(hbTrId("txt_common_button_retry"),this); + d->mActionList.insert(action,Retry); + break; + case Continue: + action = new HbAction(hbTrId("txt_common_button_continue"),this); + d->mActionList.insert(action,Continue); + break; + case Close: + action = new HbAction(hbTrId("txt_common_button_close"),this); + d->mActionList.insert(action,Close); + break; + case Cancel: + action = new HbAction(hbTrId("txt_common_button_cancel"),this); + d->mActionList.insert(action,Cancel); + break; + case Help: + action = new HbAction(hbTrId("txt_common_button_help"),this); + d->mActionList.insert(action,Help); + break; + case Reset: + action = new HbAction(hbTrId("txt_common_button_reset"),this); + d->mActionList.insert(action,Reset); + break; + case Delete: + action = new HbAction(hbTrId("txt_common_button_delete"),this); + d->mActionList.insert(action,Delete); + break; + default : + break; + + }; + + } + i = i << 1; + + if(action) { + connect(action,SIGNAL(triggered()),this,SLOT(_q_buttonClicked())); + addAction(action); + count++; + } + + } +} +/*! + Returns the standared button list + + \sa setStandardButtons() + +*/ +HbMessageBox::StandardButtons HbMessageBox::standardButtons() const +{ + Q_D(const HbMessageBox); + return d->mStandardButtons; + +} /*! - This is a convenience function for showing a question dialog with \a questionText and buttons with specified \a primaryButtonText and - \a secondaryButtonText. + + \deprecated HbMessageBox::question(const QString&,QObject*,const char*,const QString&,const QString&,QGraphicsWidget*,QGraphicsScene*,QGraphicsItem*) + is deprecated. + + Please use + + question(const QString &questionText, + QObject *receiver, + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headWidget, + QGraphicsScene *scene, + QGraphicsItem *parent) + + This is a convenience function for showing a question dialog with \a questionText with provided buttons. \param questionText descriptive text for the messagebox \param receiver Object which has the slot, which acts as a handler once the dialog closes. \param member the slot, where the control will come, once the dialog is closed. @@ -480,6 +631,18 @@ } /*! + \deprecated HbMessageBox::information(const QString&,QObject*,const char*,QGraphicsWidget*,QGraphicsScene*,QGraphicsItem*) + is deprecated. + + Please use + + information(const QString &questionText, + QObject *receiver, + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headWidget, + QGraphicsScene *scene, + QGraphicsItem *parent) This is a convenience function for showing an information dialog with a descriptive text and a default OK button. \param informationText Descriptive text for the information dialog. \param receiver Which has the slot, which acts as a handler once the dialog closes. @@ -508,6 +671,19 @@ } /*! + \deprecated HbMessageBox::warning(const QString&,QObject*,const char*,QGraphicsWidget*,QGraphicsScene*,QGraphicsItem*) + is deprecated. + + Please use + + warning(const QString &questionText, + QObject *receiver, + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headWidget, + QGraphicsScene *scene, + QGraphicsItem *parent) + This is a convenience function for showing a warning dialog with a descriptive text and an OK button. \param warningText Descriptive text for the warning dialog. \param receiver Which has the slot, which acts as a handler once the dialog closes. @@ -534,6 +710,105 @@ messageBox->setAttribute(Qt::WA_DeleteOnClose); messageBox->open(receiver,member); } + +/*! + This is a convenience function for showing a question dialog with \a questionText and a default OK button. + \param questionText descriptive text for the messagebox + \param receiver Object which has the slot, which acts as a handler once the dialog closes. + \param member the slot, where the control will come, once the dialog is closed.The signature of member is void dialogClosed(int val); + \param buttons The action buttons of the dialog. + \param headWidget the heading widget, where the user can set a title, Null by default. + \param scene the scene for the MessageBox. Null by default. + \param parent the parent widget. Null by default. +*/ +void HbMessageBox::question(const QString &questionText, + QObject *receiver, + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headingWidget, + QGraphicsScene *scene, + QGraphicsItem *parent) +{ + HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeQuestion, parent); + if (scene && !parent) { + scene->addItem(messageBox); + } + messageBox->setText(questionText); + + messageBox->setStandardButtons(buttons); + + if(headingWidget) { + messageBox->setHeadingWidget(headingWidget); + } + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->open(receiver,member); +} + +/*! + This is a convenience function for showing an information dialog with a descriptive text and a default OK button. + \param informationText Descriptive text for the information dialog. + \param receiver Which has the slot, which acts as a handler once the dialog closes. + \param member the slot, where the control will come, once the dialog is closed.The signature of member is void dialogClosed(int val); + \param buttons The action buttons of the dialog. + \param headWidget This can used by the user to set a title widget. Null by default. + \param scene the scene for the MessageBox, Null by default. + \param parent the parent widget. Null by default +*/ +void HbMessageBox::information(const QString &informationText, + QObject *receiver, + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headingWidget, + QGraphicsScene *scene, + QGraphicsItem *parent) +{ + HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeInformation, parent); + if (scene && !parent) { + scene->addItem(messageBox); + } + messageBox->setText(informationText); + + messageBox->setStandardButtons(buttons); + + if(headingWidget) { + messageBox->setHeadingWidget(headingWidget); + } + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->open(receiver,member); +} + +/*! + This is a convenience function for showing a warning dialog with a descriptive text and an OK button. + \param warningText Descriptive text for the warning dialog. + \param receiver Which has the slot, which acts as a handler once the dialog closes. + \param member the slot, where the control will come, once the dialog is closed.The signature of member is void dialogClosed(int val); + \param buttons The action buttons of the dialog. + \param headWidget This can used by the user to set a title widget, Null by default. + \param scene the scene for the messagebox, Null by default. + \param parent the parent widget, Null by default. +*/ +void HbMessageBox::warning(const QString &warningText, + QObject *receiver, + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headingWidget, + QGraphicsScene *scene, + QGraphicsItem *parent) +{ + HbMessageBox *messageBox = new HbMessageBox(HbMessageBox::MessageTypeWarning, parent); + if (scene && !parent) { + scene->addItem(messageBox); + } + messageBox->setText(warningText); + + messageBox->setStandardButtons(buttons); + + if(headingWidget) { + messageBox->setHeadingWidget(headingWidget); + } + messageBox->setAttribute(Qt::WA_DeleteOnClose); + messageBox->open(receiver,member); +} #include "moc_hbmessagebox.cpp" #include "hbmessagebox.moc" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbmessagebox.h --- a/src/hbwidgets/popups/hbmessagebox.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbmessagebox.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,20 +33,45 @@ class HbMessageBoxPrivate; class HbStyleOptionMessageBox; + class HB_WIDGETS_EXPORT HbMessageBox : public HbDialog { Q_OBJECT + Q_FLAGS(StandardButton StandardButtons) + Q_ENUMS(MessageBoxType StandardButton ) Q_PROPERTY( QString text READ text WRITE setText ) Q_PROPERTY( HbIcon icon READ icon WRITE setIcon ) Q_PROPERTY( bool iconVisible READ iconVisible WRITE setIconVisible ) + Q_PROPERTY(StandardButtons standardButtons READ standardButtons WRITE setStandardButtons) public: enum MessageBoxType { + MessageTypeNone, MessageTypeInformation, MessageTypeQuestion, MessageTypeWarning }; - explicit HbMessageBox(MessageBoxType type=MessageTypeInformation,QGraphicsItem *parent = 0); - explicit HbMessageBox(const QString &text,MessageBoxType type =MessageTypeInformation, QGraphicsItem *parent = 0); + + enum StandardButton { + NoButton = 0x00000000, + Ok = 0x00000400, + Save = 0x00000800, + Open = 0x00001000, + Yes = 0x00002000, + Continue = 0x00004000, + Delete = 0x00008000, + No = 0x00010000, + Retry = 0x00020000, + Close = 0x00040000, + Cancel = 0x00080000, + Help = 0x00100000, + Apply = 0x00200000, + Reset = 0x00400000 + }; + + Q_DECLARE_FLAGS(StandardButtons, StandardButton) + + explicit HbMessageBox(MessageBoxType type=MessageTypeNone,QGraphicsItem *parent = 0); + explicit HbMessageBox(const QString &text,MessageBoxType type =MessageTypeNone, QGraphicsItem *parent = 0); virtual ~HbMessageBox(); void setText(const QString &text); @@ -58,6 +83,9 @@ void setIconVisible(bool visible); bool iconVisible() const; + void setStandardButtons(StandardButtons buttons); + StandardButtons standardButtons() const; + QGraphicsItem *primitive(HbStyle::Primitive primitive) const; enum { Type = Hb::ItemType_MessageBox }; int type() const { return Type; } @@ -86,6 +114,30 @@ QGraphicsScene *scene = 0, QGraphicsItem *parent = 0 ); + static void question(const QString &questionText, + QObject *receiver , + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headingWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0); + + static void information(const QString &informationText, + QObject *receiver, + const char *member, + HbMessageBox::StandardButtons buttons , + QGraphicsWidget *headingWidget=0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + + static void warning(const QString &warningText, + QObject *receiver , + const char *member, + HbMessageBox::StandardButtons buttons, + QGraphicsWidget *headingWidget = 0, + QGraphicsScene *scene = 0, + QGraphicsItem *parent = 0 ); + public slots: void updatePrimitives(); @@ -94,11 +146,12 @@ void initStyleOption(HbStyleOptionMessageBox *option) const; private: - Q_PRIVATE_SLOT(d_func(), void _q_closeOnGesture()) + Q_PRIVATE_SLOT(d_func(), void _q_buttonClicked()) Q_DECLARE_PRIVATE_D(d_ptr, HbMessageBox) Q_DISABLE_COPY(HbMessageBox) }; +Q_DECLARE_OPERATORS_FOR_FLAGS(HbMessageBox::StandardButtons) #endif // HB_MESSAGEBOX_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbmessagebox_p.h --- a/src/hbwidgets/popups/hbmessagebox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbmessagebox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -28,7 +28,8 @@ #include #include "hbdialog_p.h" - +#include +#include class HbMessageBoxContentWidget; class HbMessageBoxPrivate : public HbDialogPrivate @@ -40,12 +41,15 @@ ~HbMessageBoxPrivate(); void init(); + void _q_appearEffectEnded(HbEffect::EffectStatus status); HbIcon mIcon; HbMessageBoxContentWidget *mMessageBoxContentWidget; HbMessageBox::MessageBoxType mMessageBoxType; bool mIconVisible; + QMap mActionList; + HbMessageBox::StandardButtons mStandardButtons; public slots: - void _q_closeOnGesture(); + void _q_buttonClicked(); }; #endif // HB_MESSAGEBOX_P_H diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbnotificationdialog.cpp --- a/src/hbwidgets/popups/hbnotificationdialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbnotificationdialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef HB_EFFECTS #include "hbeffectinternal_p.h" @@ -301,7 +302,12 @@ { Q_D(HbNotificationDialog); d->checkAndCreateContentWidget(); - d->content->setText( text ); + d->content->setText(text); + if (text.isEmpty()) { + d->titleTextWrapping = Hb::TextWordWrap; + } else { + d->titleTextWrapping = Hb::TextNoWrap; + } d->setNotificationDialogContent(); } @@ -346,7 +352,7 @@ Hb::TextWrapping HbNotificationDialog::titleTextWrapping() const { Q_D(const HbNotificationDialog); - return d->titleWrapping; + return d->titleTextWrapping; } /*! @@ -358,10 +364,10 @@ void HbNotificationDialog::setTitleTextWrapping(Hb::TextWrapping wrapping) { Q_D(HbNotificationDialog); - if (d->titleWrapping != wrapping) { - d->titleWrapping = wrapping; + if (d->titleTextWrapping != wrapping) { + d->titleTextWrapping = wrapping; if (d->content) { - d->content->setTitleTextWrapping(d->titleWrapping); + d->content->setTitleTextWrapping(d->titleTextWrapping); } d->doLayout(); } @@ -433,9 +439,11 @@ Q_D(HbNotificationDialog); if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { if(tap->state() == Qt::GestureStarted) { + HbWidgetFeedback::triggered(this, Hb::InstantPressed); d->stopTimeout(); } else if(tap->state() == Qt::GestureFinished) { if (d->isTouchActivating) { + HbWidgetFeedback::triggered(this, Hb::InstantReleased); emit activated(); } close(); @@ -507,9 +515,8 @@ } HbNotificationDialogPrivate::HbNotificationDialogPrivate() : - HbDialogPrivate(), isTouchActivating(false), - titleWrapping(Hb::TextWordWrap), - content(0), sequentialShow(true) + HbDialogPrivate(), isTouchActivating(false), titleTextWrapping(Hb::TextWordWrap), + content(0), sequentialShow(true) { } @@ -527,15 +534,14 @@ } void HbNotificationDialogPrivate::setBackgroundStyle() { - Q_Q(HbNotificationDialog); - q->setBackgroundItem(HbStyle::P_NotificationDialog_frame); + setBackgroundItem(HbStyle::P_NotificationDialog_frame); } void HbNotificationDialogPrivate::setNotificationDialogContent() { Q_Q(HbNotificationDialog); content->enableTouchActivation(isTouchActivating); - content->setTitleTextWrapping(titleWrapping); + content->setTitleTextWrapping(titleTextWrapping); if (q->contentWidget() == content) { doLayout(); } else { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbnotificationdialog_p.h --- a/src/hbwidgets/popups/hbnotificationdialog_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbnotificationdialog_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -42,7 +42,7 @@ void setBackgroundStyle(); bool isTouchActivating; - Hb::TextWrapping titleWrapping; + Hb::TextWrapping titleTextWrapping; bool integrationWithIndicatorArea; QPointF pointerDownPoint; HbNotificationDialogContent* content; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbnotificationdialogcontent.cpp --- a/src/hbwidgets/popups/hbnotificationdialogcontent.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbnotificationdialogcontent.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,14 +29,17 @@ #include "hbnotificationdialogcontent_p.h" HbNotificationDialogContent::HbNotificationDialogContent(QGraphicsWidget *parent) : - HbWidget(parent), mTitleWrapping(Hb::TextNoWrap), + HbWidget(parent), mTitleTextWrapping(Hb::TextNoWrap), mIsTouchActivating(false), mTextItem(0), mTitleItem(0), mIconItem(0) { } void HbNotificationDialogContent::setIcon(const HbIcon &icon) { - if(!mIconItem) { + delete mIconItem; + mIconItem = 0; + + if (!icon.isNull()) { mIconItem = style()->createPrimitive( HbStyle::P_NotificationDialog_icon, this); Q_CHECK_PTR(mIconItem); @@ -50,7 +53,7 @@ void HbNotificationDialogContent::setText(const QString &text) { - if(!mTextItem) { + if (!mTextItem) { mTextItem = style()->createPrimitive( HbStyle::P_NotificationDialog_text, this); Q_CHECK_PTR(mTextItem); @@ -64,7 +67,7 @@ void HbNotificationDialogContent::setTitle(const QString &title) { - if(!mTitleItem) { + if (!mTitleItem) { mTitleItem = style()->createPrimitive( HbStyle::P_NotificationDialog_title, this); Q_CHECK_PTR(mTitleItem); @@ -79,8 +82,8 @@ void HbNotificationDialogContent::setTitleTextWrapping(Hb::TextWrapping wrapping) { - if (mTitleWrapping != wrapping) { - mTitleWrapping = wrapping; + if (mTitleTextWrapping != wrapping) { + mTitleTextWrapping = wrapping; updatePrimitives(); if (isVisible()) { polishEvent(); @@ -90,7 +93,7 @@ Hb::TextWrapping HbNotificationDialogContent::titleTextWrapping() const { - return mTitleWrapping; + return mTitleTextWrapping; } void HbNotificationDialogContent::enableTouchActivation(bool enabled) @@ -133,7 +136,7 @@ setProperty("icon", iconSet); setProperty("textFields", textFields); setProperty("link", option.isLink); - setProperty("titleWrapping", option.titleWrapping); + setProperty("titleWrapping", (option.titleTextWrapping != Hb::TextNoWrap)); HbWidget::polish(params); } @@ -143,17 +146,14 @@ option->title = mTitle; option->text = mText; option->icon = mIcon; - option->textWrapping = Hb::TextNoWrap; - option->titleWrapping = mTitleWrapping; - option->wrappingText = Hb::TextNoWrap; - option->wrappingTitle = mTitleWrapping; + option->textTextWrapping = Hb::TextNoWrap; + option->titleTextWrapping = mTitleTextWrapping; option->isLink = mIsTouchActivating; } -QSizeF HbNotificationDialogContent::sizeHint( - Qt::SizeHint which, const QSizeF & constraint) const +QSizeF HbNotificationDialogContent::sizeHint(Qt::SizeHint which, const QSizeF & constraint) const { - switch(which) { + switch (which) { case Qt::PreferredSize: { QSizeF preferred = HbWidget::sizeHint(which, constraint); HbDeviceProfile dp(HbDeviceProfile::profile(this)); @@ -176,11 +176,11 @@ HbStyleOptionNotificationDialog option; initStyleOption(&option); - if(mTextItem) { + if (mTextItem) { style()->updatePrimitive(mTextItem, HbStyle::P_NotificationDialog_text, &option); } - if(mTitleItem) { + if (mTitleItem) { style()->updatePrimitive(mTitleItem, HbStyle::P_NotificationDialog_title, &option); } @@ -200,11 +200,9 @@ } else { if (itemName == "text") { return mTextItem; - } - else if (itemName == "title") { + } else if (itemName == "title") { return mTitleItem; - } - else if (itemName == "icon") { + } else if (itemName == "icon") { return mIconItem; } else { return 0; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbnotificationdialogcontent_p.h --- a/src/hbwidgets/popups/hbnotificationdialogcontent_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbnotificationdialogcontent_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -62,7 +62,7 @@ void initStyleOption(HbStyleOptionNotificationDialog *option) const; QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const; private: - Hb::TextWrapping mTitleWrapping; + Hb::TextWrapping mTitleTextWrapping; QString mText; QString mTitle; HbIcon mIcon; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbprogressdialog.cpp --- a/src/hbwidgets/popups/hbprogressdialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbprogressdialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -111,7 +111,7 @@ mContentWidget->mProgressBar->setRange(0,100); } - HbAction *action = new HbAction(q->tr("Cancel"), q); + HbAction *action = new HbAction(hbTrId("txt_common_button_cancel"), q); QObject::connect(action, SIGNAL(triggered()), q, SLOT(_q_userCancel())); q->addAction(action); @@ -231,20 +231,21 @@ \class HbProgressDialog \brief HbProgressDialog provides feedback on the progress of a slow operation. - \image html hbprogressdialog.png A progress dialog. + \image html progressdialog1.png "A normal Progress Dialog with icon and text" + \image html progressdialog2.png "A wait Progress Dialog with icon and text" - ProgressDialog widget displays that a process is active and also the completion level of the process to the user. + ProgressDialog widget displays that an application is active and also the completion level of the process to the user. A progress dialog is used to give the user an indication of how long an operation is going to take, and to demonstrate that the application has not frozen. It can also give the user an opportunity to abort the operation. - Progress dialog provides several types of notifications. The supported types are: + Progress dialog provides 2 types of notifications. They are: \code enum ProgressDialogType { ProgressDialog, WaitDialog }; \endcode - Progress dialog has the following mandatory elements: + Progress dialog has the following default elements: \li Progress bar (Determinate type) \li Description \li Cancel button (for canceling the process) @@ -252,7 +253,6 @@ Optionally, progress dialog may also includes: \li Icon \li Heading - \li Close button (same as ‘Cancel’ button during active process, closes the dialog after successful process) Progress dialog is modal and requires user intervention to dismiss it. \sa HbDialog @@ -270,7 +270,7 @@ \endcode The progress note is closed explicitly when the user clicks Cancel button or the application - calls cancel(). + calls cancel() API. Another use case is an application downloading a file. \code @@ -285,6 +285,13 @@ } \endcode + + Below sample code shows how the \a cancel() signal can be connected so that application can terminate the task. + + \code + HbProgressDialog *pDialog = new HbProgressDialog(HbProgressDialog::ProgressDialog); + connect(pDialog,SIGNAL(cancelled()),this,SLOT(dialogCancelled())); + \endcode */ /*! @@ -309,7 +316,7 @@ /*! \var HbProgressDialog::WaitDialog - TThis enum describes the type value as WaitDialog. + This enum describes the type value as WaitDialog. */ diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbprogressdialog.h --- a/src/hbwidgets/popups/hbprogressdialog.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbprogressdialog.h Thu Jul 22 16:36:53 2010 +0100 @@ -48,7 +48,7 @@ enum ProgressDialogType { ProgressDialog, WaitDialog }; explicit HbProgressDialog(QGraphicsItem *parent = 0); - HbProgressDialog(ProgressDialogType type, QGraphicsItem *parent = 0); + explicit HbProgressDialog(ProgressDialogType type, QGraphicsItem *parent = 0); ~HbProgressDialog(); int maximum() const; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbselectiondialog.cpp --- a/src/hbwidgets/popups/hbselectiondialog.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbselectiondialog.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,9 +22,10 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ +#include "hbselectiondialog_p.h" #include "hbselectiondialog.h" #include "hbwidget_p.h" -#include "hbselectiondialog_p.h" + #include "hblabel.h" #include "hbaction.h" #include "hbabstractviewitem.h" @@ -41,26 +42,36 @@ @beta @hbwidgets \class HbSelectionDialog - \brief HbSelectionDialog class allows user create a list of options out of which one or more can be selected. + \brief HbSelectionDialog class allows user to create a list of options out of which one or more can be selected. - HbSelectionDialog is a modal dialog which means once it is displayed, user can not perform any action - untill dialog is closed. + SelectionDialog is a modal dialog, for which user has to use default or custom action buttons to dismiss the dialog. + + There are 2 modes of selection for SelectionDialog. SingleSelection or MultiSelection.
    - There can be 2 modes of selection. SingleSelection or MultiSelection. If it is SingleSelection, dialog is closed - as soon as user clicks one of the options.In case of MultiSelection, user has to explicitly press "OK" button to - close it after selecting the item(s). User can anytime press "Cancel" button to close the dialog without selecting - anything. + SingleSelection: User can select one item from the list at a time and the SelectionDialog will be dismissed + as soon as the user selects the item.
    + + MultiSelection: User can select multiple items from the list. To dismiss the dialog user has to explicitly press "OK/Cancel" button. + User can anytime press "Cancel" button to close the dialog without any selection. User can provide the data for options in different forms. It can be simple list of strings, list of custom items or a model itself. + + Below is a snippet of code which shows SelectionDialog in a single selection mode. + + \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,55} + + slot implementation: + + \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,56} + */ /*! - @beta Constructor of HbSelectionDialog - \param parent. Parent widget + \param parent Parent item to SelectionDialog. */ HbSelectionDialog::HbSelectionDialog(QGraphicsItem* parent): HbDialog(*new HbSelectionDialogPrivate, parent) @@ -71,7 +82,6 @@ } /*! - @beta Destructor */ HbSelectionDialog::~HbSelectionDialog() @@ -79,8 +89,6 @@ } /*! - @beta - \reimp */ void HbSelectionDialog::showEvent(QShowEvent *event) @@ -89,10 +97,9 @@ } /*! - @beta Sets the \a SelectionMode of the list. - \param mode. It can be SingleSelection or MultiSelection .Default value is \a NoSelection. + \param mode It can be SingleSelection or MultiSelection. \sa selectionMode() */ @@ -104,7 +111,6 @@ } /*! - @beta Returns current SelectionMode of the list.Default value is \a NoSelection. \sa setSelectionMode() @@ -116,11 +122,10 @@ } /*! - @beta Sets the string list items to be displayed. - \param items. A items is the list of strings - \param currentIndex. A currentIndex is the index of default selection + \param items list of string items as input to SelectionDialog in QStringList format. + \param currentIndex index of item to be selected in the SelectionDialog by default. \sa stringItems() */ @@ -131,7 +136,6 @@ } /*! - @beta Returns list of string list items earlier set by setStringItems(). \sa setStringItems() @@ -143,7 +147,6 @@ } /*! - @beta Returns list of selected indexes. List contains only one item if \a SelectionMode is \a NoSelection or \a SingleSelection. It may contain more items if \a SelectionMode is \a MultiSelection. @@ -158,12 +161,11 @@ } /*! - @beta set the item selected. It can select one item if \a Selection mode is \a SingleSelection it can select more item if \a SelectionMode is \a MultiSelection. - \param items. + \param items indices of the items to be selected in SelectionDialog. \sa selectedItems */ @@ -174,7 +176,6 @@ } /*! - @beta Returns list of selected model indexes. List contains only one item if \a SelectionMode is \a NoSelection or \a SingleSelection. It may contain more items if \a SelectionMode is \a MultiSelection. @@ -189,16 +190,15 @@ } /*! - @beta Sets the list of custom list items to be displayed.\a items is the list of custom items.\a bTransferOwnership is a flag defining the owner of the items. If \a true, items will be deleted when dialog is deleted else user is responsible for deleting the items.Default value is \a false. \a current is the index of default selection. - \param items. items is the list of custom items - \param transferOwnership. true or false - \param currentIndex + \param items list of custom items to be set as input to SelectionDialog. + \param transferOwnership Transfer the ownership of items to SelectionDialog by passing true else false. + \param currentIndex index of the item to be selected in SelectionDialog. \sa widgetItems(); */ @@ -209,7 +209,6 @@ } /*! - @beta Returns list of custom list items earlier set by setWidgetItems(). \sa setWidgetItems(). @@ -221,10 +220,9 @@ } /*! - @beta Sets the Model containing data for the list items. - \param model. + \param model which has data for items to be set as input to SelectionDialog. \sa model() */ @@ -235,7 +233,6 @@ } /*! - @beta Returns model eariler set by setModel(). \sa setModel() @@ -246,5 +243,4 @@ return d->model(); } - #include "moc_hbselectiondialog.cpp" diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbselectiondialog_p.cpp --- a/src/hbwidgets/popups/hbselectiondialog_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbselectiondialog_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -33,29 +33,89 @@ #include #include #include +#include + +HbSelectionDialogMarkWidget::HbSelectionDialogMarkWidget(QGraphicsItem *parent):HbWidget(parent),mBackgroundItem(0){ + chkMark = new HbCheckBox(this); + chkMark->setText("Mark All"); + lbCounter = new HbTextItem(this); + HbStyle::setItemName(chkMark,"checkbox"); + HbStyle::setItemName(lbCounter,"counter"); + createPrimitives(); +} + +void HbSelectionDialogMarkWidget::createPrimitives() +{ + if ( !mBackgroundItem ) { + mBackgroundItem = style( )->createPrimitive( HbStyle::P_TumbleView_background , this ); + style()->setItemName( mBackgroundItem , "background" ); + } +} + +void HbSelectionDialogMarkWidget::updatePrimitives() +{ + HbStyleOption option; + initStyleOption( &option ); + + if ( mBackgroundItem ) { + style( )->updatePrimitive( mBackgroundItem , HbStyle::P_TumbleView_background , &option ); + } +} + +/*! + \reimp + */ +QVariant HbSelectionDialogMarkWidget::itemChange( GraphicsItemChange change, const QVariant &value ) +{ + switch ( change ) { + case ItemVisibleHasChanged: { + updatePrimitives( ); + } + break; + + case ItemSceneHasChanged: { + updatePrimitives(); + } + break; + default: + break; + } + return HbWidget::itemChange( change, value ); +} +/*! + Returns the pointer for \a primitive passed. + Will return NULL if \a primitive passed is invalid +*/ +QGraphicsItem* HbSelectionDialogMarkWidget::primitive(HbStyle::Primitive primitive) const +{ + switch (primitive) { + case HbStyle::P_TumbleView_background: + return mBackgroundItem; + default: + return 0; + } +} + +HbSelectionDialogMarkWidget::~HbSelectionDialogMarkWidget() +{ +} HbSelectionDialogContentWidget::HbSelectionDialogContentWidget(HbSelectionDialogPrivate *priv):HbWidget(), - mListWidget(0),d(priv),chkMark(0),lbCounter(0) + mListView(0),d(priv),markWidget(0) { - mListWidget = new HbListWidget(this); - HbStyle::setItemName(mListWidget, "list"); - QObject::connect(mListWidget,SIGNAL(activated(const QModelIndex&)),this,SLOT(_q_listItemSelected(QModelIndex))); - QObject::connect(mListWidget,SIGNAL(activated(HbListWidgetItem *)),this,SLOT(_q_listWidgetItemSelected(HbListWidgetItem *))); + } void HbSelectionDialogContentWidget::_q_listWidgetItemSelected(HbListWidgetItem *item) { - if(item){ - updateCounter(); - } + Q_UNUSED(item) } void HbSelectionDialogContentWidget::_q_listItemSelected(QModelIndex index) { Q_UNUSED(index) - if(mListWidget->selectionMode()== HbAbstractItemView::SingleSelection || - mListWidget->selectionMode()== HbAbstractItemView::NoSelection){ - d->close(); + if(mListView->selectionMode()== HbAbstractItemView::SingleSelection){ + d->close(); } updateCounter(); } @@ -63,36 +123,43 @@ int HbSelectionDialogContentWidget::selectedItemCount() const { int selectedItems = 0; - QItemSelectionModel* selectionModel = mListWidget->selectionModel(); - if(selectionModel){ - selectedItems = selectionModel->selectedRows().count(); - } + if(mListView){ + QItemSelectionModel* selectionModel = mListView->selectionModel(); + if(selectionModel){ + selectedItems = selectionModel->selectedRows().count(); + } + } return selectedItems; } int HbSelectionDialogContentWidget::totalItemCount() const { - return mListWidget->count(); + int nCount = 0; + if(mListView && mListView->model()){ + nCount = mListView->model()->rowCount(); + } + return nCount; } void HbSelectionDialogContentWidget::updateCounter() { - if(mListWidget->selectionMode()!= HbAbstractItemView::MultiSelection) return; - if(chkMark && lbCounter){ + if(!mListView) return; + if(mListView->selectionMode()!= HbAbstractItemView::MultiSelection) return; + if(markWidget){ int totalItems = totalItemCount(); int selectedItems = selectedItemCount(); - - lbCounter->setText(QString(QString::number(selectedItems) + "/" + QString::number(totalItems))); + markWidget->updatePrimitives(); + markWidget->lbCounter->setText(QString(QString::number(selectedItems) + "/" + QString::number(totalItems))); //update checked state of "MarkAll" checkbox - if (selectedItems == totalItems){ - chkMark->blockSignals(true); //should not call _q_checkboxclicked() - chkMark->setChecked(true); - chkMark->blockSignals(false); + if (totalItems > 0 && (selectedItems == totalItems)){ + markWidget->chkMark->blockSignals(true); //should not call _q_checkboxclicked() + markWidget->chkMark->setChecked(true); + markWidget->chkMark->blockSignals(false); } else{ - chkMark->blockSignals(true); //should not call _q_checkboxclicked() - chkMark->setChecked(false); - chkMark->blockSignals(false); + markWidget->chkMark->blockSignals(true); //should not call _q_checkboxclicked() + markWidget->chkMark->setChecked(false); + markWidget->chkMark->blockSignals(false); } } } @@ -101,7 +168,7 @@ { int totalItems = 0; int selectedItems = 0; - QAbstractItemModel* itemModel = mListWidget->model(); + QAbstractItemModel* itemModel = mListView->model(); QModelIndex indexStart,indexEnd; if(itemModel){ indexStart = itemModel->index(0,0); @@ -109,7 +176,7 @@ totalItems = itemModel->rowCount(); } - QItemSelectionModel* selectionModel = mListWidget->selectionModel(); + QItemSelectionModel* selectionModel = mListView->selectionModel(); if(selectionModel){ selectedItems = selectionModel->selectedRows().count(); if(value){ //Select All @@ -124,50 +191,73 @@ void HbSelectionDialogContentWidget::showMarkWidget(bool bShow) { - if(bShow){ - chkMark = new HbCheckBox(this); - chkMark->setText("Mark All"); - lbCounter = new HbTextItem(this); - HbStyle::setItemName(chkMark,"checkbox"); - HbStyle::setItemName(lbCounter,"counter"); - setProperty("multiSelection",true); - connect(chkMark,SIGNAL(stateChanged ( int )),this,SLOT(_q_checkboxclicked(int))); + if(bShow){ + if(!markWidget){ + markWidget = new HbSelectionDialogMarkWidget(this); + HbStyle::setItemName(markWidget,"markwidget"); + setProperty("multiSelection",true); + connect(markWidget->chkMark,SIGNAL(stateChanged ( int )),this,SLOT(_q_checkboxclicked(int))); updateCounter(); + } } else{ - delete chkMark;chkMark=0; - delete lbCounter;lbCounter=0; - HbStyle::setItemName(chkMark,""); - HbStyle::setItemName(lbCounter,""); - setProperty("multiSelection",false); + delete markWidget; markWidget = 0; + HbStyle::setItemName(markWidget,""); + setProperty("multiSelection",false); } } +void HbSelectionDialogContentWidget::connectSlots() +{ + QObject::connect(mListView,SIGNAL(activated(const QModelIndex&)),this,SLOT(_q_listItemSelected(QModelIndex))); +} + +void HbSelectionDialogContentWidget::createListWidget() +{ + if(mListView){ + HbListWidget* mView = qobject_cast(mListView); + if(!mView){ + delete mListView; + mListView = new HbListWidget(this); + HbStyle::setItemName(mListView, "list"); + connectSlots(); + } + } + else{ + mListView = new HbListWidget(this); + HbStyle::setItemName(mListView, "list"); + connectSlots(); + } +} + +void HbSelectionDialogContentWidget::createListView() +{ + if(mListView){ + HbListView* mView = qobject_cast(mListView); + if(!mView){ + delete mListView; + mListView = new HbListView(this); + HbStyle::setItemName(mListView, "list"); + connectSlots(); + } + } + else{ + mListView = new HbListView(this); + HbStyle::setItemName(mListView, "list"); + connectSlots(); + } +} + HbSelectionDialogPrivate::HbSelectionDialogPrivate() :HbDialogPrivate() { bOwnItems = false; + action1 = action2 = 0; } HbSelectionDialogPrivate::~HbSelectionDialogPrivate() { - if(!bOwnItems){ - Q_Q(HbSelectionDialog); - HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); - if(cWidget){ - if(cWidget->mListWidget){ - int nRows = 0; - QAbstractItemModel* itemModel = cWidget->mListWidget->model(); - if(itemModel){ - nRows = itemModel->rowCount(); - while(nRows){ - cWidget->mListWidget->takeItem(0); - nRows = itemModel->rowCount(); - } - } - } - } - } + clearItems(bOwnItems); } void HbSelectionDialogPrivate::init() @@ -176,15 +266,34 @@ Q_Q(HbSelectionDialog); bOwnItems = false; - + mSelectionMode = HbAbstractItemView::SingleSelection; HbSelectionDialogContentWidget* contentWidget = new HbSelectionDialogContentWidget(this); q->setContentWidget(contentWidget); - q->addAction(new HbAction(q->tr("Ok"), q)); + q->setDismissPolicy(HbPopup::NoDismiss); + q->setTimeout(HbPopup::NoTimeout); + q->setModal(true); + showActions(mSelectionMode); +} - q->addAction(new HbAction(q->tr("Cancel"), q)); - q->setTimeout(0); - q->setModal(true); +void HbSelectionDialogPrivate::showActions(HbAbstractItemView::SelectionMode selectionMode) +{ + Q_Q(HbSelectionDialog); + if(selectionMode == HbAbstractItemView::SingleSelection){ + delete action1;action1=0;delete action2;action2=0; + action1=new HbAction(hbTrId("txt_common_button_cancel"),q); + q->addAction(action1); + q->connect(action1,SIGNAL(triggered()),q,SLOT(reject())); + } + else{ + delete action1;action1=0;delete action2;action2=0; + action1=new HbAction(hbTrId("txt_common_button_ok"),q); + q->addAction(action1); + q->connect(action1,SIGNAL(triggered()),q,SLOT(accept())); + action2=new HbAction(hbTrId("txt_common_button_cancel"),q); + q->addAction(action2); + q->connect(action2,SIGNAL(triggered()),q,SLOT(reject())); + } } void HbSelectionDialogPrivate::setSelectionMode(HbAbstractItemView::SelectionMode mode) @@ -192,23 +301,57 @@ Q_Q(HbSelectionDialog); mSelectionMode = mode; - switch(mode) + switch(mSelectionMode) { case HbAbstractItemView::SingleSelection: case HbAbstractItemView::MultiSelection: - case HbAbstractItemView::NoSelection: { HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); - if(cWidget){ - cWidget->mListWidget->setSelectionMode(mode); - } - if(mode == HbAbstractItemView::MultiSelection) - cWidget->showMarkWidget(true); - else - cWidget->showMarkWidget(false); + if(cWidget && cWidget->mListView){ + cWidget->mListView->setSelectionMode(mSelectionMode); + if(mode == HbAbstractItemView::MultiSelection) + cWidget->showMarkWidget(true); + else + cWidget->showMarkWidget(false); + } + showActions(mSelectionMode); } break; - } + case HbAbstractItemView::NoSelection: + break; + } +} + + +void HbSelectionDialogPrivate::clearItems(bool keepItems) +{ + Q_Q(HbSelectionDialog); + HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); + if(cWidget){ + HbListWidget* mWidget = qobject_cast(cWidget->mListView); + if(mWidget){ + if(keepItems){ + int nRows = 0; + QAbstractItemModel* itemModel = mWidget->model(); + if(itemModel){ + nRows = itemModel->rowCount(); + while(nRows){ + mWidget->takeItem(0); + nRows = itemModel->rowCount(); + } + } + } + else{ + mWidget->clear(); + } + bOwnItems = false; + return; + } + HbListView* mView = qobject_cast(cWidget->mListView); + if(mView){ + cWidget->mListView->setModel(0); + } + } } QList HbSelectionDialogPrivate::widgetItems() const @@ -218,7 +361,7 @@ QList rows; HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); if(cWidget){ - HbListWidget* widget = qobject_cast(cWidget->mListWidget); + HbListWidget* widget = qobject_cast(cWidget->mListView); if(widget){ int count = 0; QAbstractItemModel* itemModel = widget->model(); @@ -240,16 +383,19 @@ if(!cWidget) return; int nRows = 0; - - if(cWidget->mListWidget){ + cWidget->createListWidget(); + setSelectionMode(mSelectionMode); + if(cWidget->mListView){ int count = items.size(); + if(count > 0) clearItems(bOwnItems); //Clear the existing items first for (int i = 0; i < count; ++i) { HbListWidgetItem* modelItem = new HbListWidgetItem(); QString str = items.at(i); modelItem->setText(str); - cWidget->mListWidget->addItem(modelItem); + HbListWidget* widget = (HbListWidget*)cWidget->mListView; + widget->addItem(modelItem); - QAbstractItemModel* itemModel = cWidget->mListWidget->model(); + QAbstractItemModel* itemModel = cWidget->mListView->model(); if(itemModel) nRows = itemModel->rowCount(); } @@ -282,7 +428,9 @@ HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); if(cWidget){ - cWidget->mListWidget->HbListView::setModel(model); //HbListView's implementation of setModel() + cWidget->createListView(); + setSelectionMode(mSelectionMode); + cWidget->mListView->setModel(model); } } @@ -292,12 +440,16 @@ HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); if(cWidget){ - if(cWidget->mListWidget){ + cWidget->createListWidget(); + setSelectionMode(mSelectionMode); + if(cWidget->mListView){ + HbListWidget* widget = (HbListWidget*)cWidget->mListView; int count = items.count(); + if(count > 0) clearItems(bOwnItems); //Clear the existing items first for(int i = 0; i < count; i++){ - cWidget->mListWidget->addItem(items[i]); + widget->addItem(items[i]); } - cWidget->mListWidget->setCurrentRow(currentIndex); + widget->setCurrentRow(currentIndex); } bOwnItems = transferOwnership; @@ -309,8 +461,8 @@ Q_Q(const HbSelectionDialog); HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); - if(cWidget){ - return cWidget->mListWidget->HbListView::model(); //HbListView's implementation of model() + if(cWidget && cWidget->mListView){ + return cWidget->mListView->model(); } return 0; } @@ -320,8 +472,8 @@ Q_Q(const HbSelectionDialog); HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); - if(cWidget){ - return cWidget->mListWidget->selectionModel(); + if(cWidget && cWidget->mListView){ + return cWidget->mListView->selectionModel(); } return 0; } @@ -332,15 +484,16 @@ QItemSelectionModel *model = 0; model = selectionModel(); if(model){ + model->clearSelection(); Q_FOREACH(QVariant i,items) { model->select(model->model()->index(i.toInt(),0), QItemSelectionModel::Select); } - } - HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); - if(cWidget){ - cWidget->updateCounter(); - } + HbSelectionDialogContentWidget* cWidget = qobject_cast(q->contentWidget()); + if(cWidget){ + cWidget->updateCounter(); + } + } } QList HbSelectionDialogPrivate::selectedItems() const @@ -375,5 +528,6 @@ void HbSelectionDialogPrivate::close() { Q_Q(HbSelectionDialog); - q->close(); + q->accept(); //emit the signal } + diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbselectiondialog_p.h --- a/src/hbwidgets/popups/hbselectiondialog_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbselectiondialog_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -37,7 +37,7 @@ class HbLabel; class HbListWidgetItem; -class HbListWidget; +class HbListView; class HbCheckBox; class HbSelectionDialogPrivate : public HbDialogPrivate @@ -64,10 +64,30 @@ QAbstractItemModel* model() const; QItemSelectionModel* selectionModel() const; QModelIndexList selectedModelIndexes() const; + void clearItems(bool keepItems); + void showActions(HbAbstractItemView::SelectionMode selectionMode); public: bool bOwnItems; HbAbstractItemView::SelectionMode mSelectionMode; void close(); +private: + HbAction *action1; + HbAction *action2; +}; + +class HbSelectionDialogMarkWidget : public HbWidget +{ + Q_OBJECT +public: + QGraphicsItem *mBackgroundItem; + HbCheckBox* chkMark; + HbTextItem* lbCounter; + HbSelectionDialogMarkWidget(QGraphicsItem *parent = 0); + ~HbSelectionDialogMarkWidget(); + void createPrimitives(); + void updatePrimitives(); + QVariant itemChange( GraphicsItemChange change, const QVariant &value ); + QGraphicsItem* primitive(HbStyle::Primitive primitive) const; }; class HB_AUTOTEST_EXPORT HbSelectionDialogContentWidget :public HbWidget @@ -78,7 +98,10 @@ int selectedItemCount() const; int totalItemCount() const; public: - HbListWidget* mListWidget; + void createListWidget(); + void createListView(); + void connectSlots(); + HbListView* mListView; HbSelectionDialogPrivate* d; HbSelectionDialogContentWidget(HbSelectionDialogPrivate *priv); enum { Type = Hb::ItemType_SelectionDialogContentWidget }; @@ -89,8 +112,7 @@ bool bMultiSelection; void updateCounter(); private: - HbCheckBox* chkMark; - HbTextItem* lbCounter; + HbSelectionDialogMarkWidget* markWidget; private slots: void _q_listWidgetItemSelected(HbListWidgetItem *item); void _q_listItemSelected(QModelIndex index); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbsliderpopup.cpp --- a/src/hbwidgets/popups/hbsliderpopup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbsliderpopup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -98,7 +98,7 @@ Q_Q( HbSliderPopup); mSliderPopupContentWidget = new HbSliderPopupContentWidget( this ); q->setContentWidget( mSliderPopupContentWidget ); - q->setBackgroundItem(HbStyle::P_SliderPopup_background); + setBackgroundItem(HbStyle::P_SliderPopup_background); HbStyle::setItemName(q->backgroundItem(),QLatin1String("sliderpopup_background")); q->connect(mSliderPopupContentWidget->slider,SIGNAL(valueChanged(int)),q,SLOT(_q_valueChanged(int))); @@ -115,7 +115,6 @@ q->setDismissPolicy(HbDialog::TapOutside); q->setBackgroundFaded(false); q->setModal(false); - mainLayout->setContentsMargins(0,0,0,0); mSliderPopupContentWidget->slider->setFlags(QGraphicsItem::ItemIsFocusable); } @@ -290,6 +289,7 @@ } /*! +@beta Constructs a sliderPopup with a \a orientation and \a parent. The slider contains only track element by default. @@ -325,6 +325,7 @@ } /*! + @beta Returns the slider text. returns empty text if text element does not exist @@ -338,6 +339,7 @@ } /*! + @beta Sets the slider \a text for text element Slider will not take care of localization. @@ -353,6 +355,7 @@ } /*! + @beta Sets whether the tooltip is visible . \sa isToolTipVisible() @@ -364,6 +367,7 @@ } /*! + @beta Returns \c true if tooltip is visible. The default value is \c false. @@ -377,6 +381,7 @@ } /*! + @beta sets the toolTip Alignment with respect to the thumb. \sa toolTipAlignment() @@ -388,6 +393,7 @@ } /*! + @beta returns the tooltip Alignment with respect to the thumb \sa setToolTipAlignment() @@ -400,6 +406,7 @@ /*! + @beta Returns the major ticklabels of the slider popup. \sa setMajorTickLabels() @@ -411,6 +418,7 @@ } /*! + @beta Sets the major ticklabels of the slider popup. Detailed description: @@ -441,6 +449,7 @@ } /*! + @beta Returns the minor ticklabels of the slider popup. \sa setMajorTickLabels() @@ -452,6 +461,7 @@ } /*! + @beta Sets the minor ticklabels of the slider popup. see setMajorTickLabels for detailed description @@ -499,7 +509,7 @@ /*! - @proto + @beta Returns the map , which consist of element name as key and icon name as value returns NULL map if none of the element has icon @@ -514,7 +524,7 @@ /*! - @proto + @beta Sets the icons for elements key of \a elements is element name QString) and value is icon @@ -544,6 +554,7 @@ /*! + @beta Returns \c true whether the slider track is inverted. The default value is \c false. @@ -561,6 +572,7 @@ } /*! + @beta Sets whether the slider track is \a inverted. \sa invertedAppearance() @@ -572,6 +584,7 @@ } /*! + @beta Returns the list of slider elements as QVariant ( can be type-casted to HbSlider::SliderElement ). The slider contains only track element by default. @@ -585,6 +598,7 @@ } /*! + @beta Sets the elements of the slider. \note Duplicate elements will be ignored. @@ -614,6 +628,7 @@ /*! + @beta Returns the maximum value of the slider. The default value is \c 100. @@ -627,6 +642,7 @@ } /*! + @beta Sets the maximum value of the slider. \note When setting this property, the minimum is adjusted if @@ -644,6 +660,7 @@ } /*! + @beta Returns the minimum value of the slider. The default value is \c 0. @@ -657,6 +674,7 @@ } /*! + @beta Sets the minimum value of the slider. \note When setting this property, the maximum is adjusted if @@ -672,6 +690,7 @@ } /*! + @beta This function is provided for convenience. Sets the slider's minimum to \a min and its maximum to \a max. @@ -687,6 +706,7 @@ } /*! + @beta Returns the page step of the slider. The default value is \c 10. @@ -703,6 +723,7 @@ } /*! + @beta Sets the page \a step of the slider. \sa pageStep() @@ -714,6 +735,7 @@ } /*! + @beta Returns the single step of the slider. The default value is \c 1. @@ -731,6 +753,7 @@ } /*! + @beta Sets the single \a step of the slider. \sa singleStep() @@ -742,6 +765,7 @@ } /*! + @beta Returns the current slider position. If tracking is enabled (the default), this is identical to the value. @@ -755,6 +779,7 @@ } /*! + @beta Sets the current slider position. \sa sliderPosition() @@ -766,6 +791,7 @@ } /*! + @beta Returns \c true whether slider tracking is enabled. The default value is \c true. @@ -784,6 +810,7 @@ } /*! + @beta Sets whether the slider tracking is enabled. \sa hasTracking() @@ -795,6 +822,7 @@ } /*! + @beta Returns the current value of the slider. The default value is \c 0. @@ -806,6 +834,7 @@ } /*! + @beta Sets the current value of the slider. The slider forces the value to be within the legal range: \b @@ -822,6 +851,7 @@ } /*! + @beta Returns the tickmark position of the slider. The default value is \c HbSlider::NoTicks. @@ -835,6 +865,7 @@ } /*! + @beta Sets the tickmark position of the slider. \sa tickPosition() @@ -846,6 +877,7 @@ } /*! + @beta Returns the SnappingMode of the slider. The default value is \c HbSlider::MinorTickSnapping. @@ -860,6 +892,7 @@ } /*! + @beta Sets the snappingMode of the slider. \sa snappingMode() @@ -871,6 +904,7 @@ } /*! + @beta Sets the \a orientation of the sliderpopup. \sa orientation() @@ -882,6 +916,7 @@ } /*! + @beta Returns the orientation of the sliderpopup. The default value is \c Qt::Vertical. @@ -895,6 +930,7 @@ } /*! + @beta Returns the interval between major tickmarks. The default value is \c 0. @@ -908,6 +944,7 @@ } /*! + @beta Sets the interval between major tickmarks. Special values: @@ -923,6 +960,7 @@ } /*! + @beta Returns the interval between minor tickmarks. The default value is \c 0. @@ -936,6 +974,7 @@ } /*! + @beta Sets the interval between minor tickmarks. Special values: @@ -961,7 +1000,7 @@ } /*! - @proto + @beta Sets whether to display progress track or not \default value is true @@ -977,7 +1016,7 @@ } /*! - @proto + @beta returns whether progress track is visible or not \sa setTrackFilled( ) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbvolumesliderpopup.cpp --- a/src/hbwidgets/popups/hbvolumesliderpopup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbvolumesliderpopup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -52,7 +52,7 @@ \note order of element can not be changed - Orientation of HbVolumeSliderPopup can not be changed. If orientation change is need, + Orientation of HbVolumeSliderPopup can not be changed. If orientation change is needed, then first create HbSliderPopup and set needed elements. It is positioned at Right side of the screen in non mirrored layout. @@ -65,7 +65,7 @@ \endcode Note:: position and size of these elements cant be change. - use HbVolumeSlider instead if you want to change position or size + use HbSlider and set the elements instead if you want to change position or size Note:: if setElement is called on this slider , application is reponsible for inconsitent UI. @@ -199,7 +199,8 @@ */ void HbVolumeSliderPopup::keyReleaseEvent(QKeyEvent *keyevent) { - switch (keyevent->key()) { + Q_D( HbVolumeSliderPopup); + switch (keyevent->key()) { //hide popup for following key press event case Qt::Key_Enter: case Qt::Key_Return: @@ -212,6 +213,11 @@ hide(); break; case Qt::Key_Left: + if (d->keyNavigation()) { + hide(); + keyevent->accept(); + break; + } case Qt::Key_Backspace: case Qt::Key_Back: hide(); @@ -225,13 +231,21 @@ } /*! + \reimp Reimplemented from QGraphicsItem::keyPressEvent(). */ void HbVolumeSliderPopup::keyPressEvent(QKeyEvent *keyevent) { - switch (keyevent->key()) { + Q_D( HbVolumeSliderPopup); + switch (keyevent->key()) { case Qt::Key_Left: case Qt::Key_Right: + if( d->keyNavigation() ) { + hide(); + keyevent->accept(); + break; + } + case Qt::Key_Back: case Qt::Key_Backspace: hide(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/popups/hbzoomsliderpopup.cpp --- a/src/hbwidgets/popups/hbzoomsliderpopup.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/popups/hbzoomsliderpopup.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -51,9 +51,11 @@ The elements can be changed by calling HbSlider::setElements() later at any time. - Orientation of HbZoomSliderPopup can not be changed. If orientation change is need, + Orientation of HbZoomSliderPopup can not be changed. If orientation change is needed, then first create HbSlider and set needed elements. + It is positioned at Right side of the screen in non mirrored layout. + Example usage: \code HbZoomSliderPopup *slider = new HbZoomSliderPopup(); @@ -62,7 +64,7 @@ Note:: position and size of these elements cant be change. - use HbZoomSlider instead if you want to change position or size + use HbSlider and set the appropriate elements instead if you want to change position or size Note:: if setElement is called on this slider , application is reponsible for inconsitent UI. @@ -193,11 +195,13 @@ /*! + \reimp Reimplemented from QGraphicsItem::keyReleaseEvent(). */ void HbZoomSliderPopup::keyReleaseEvent(QKeyEvent *keyevent) { - switch (keyevent->key()) { + Q_D( HbZoomSliderPopup); + switch (keyevent->key()) { case Qt::Key_Enter: case Qt::Key_Return: case Qt::Key_Select: @@ -209,6 +213,11 @@ hide(); break; case Qt::Key_Left: + if ( d->keyNavigation() ) { + hide(); + keyevent->accept(); + break; + } case Qt::Key_Backspace: case Qt::Key_Back: hide(); @@ -221,13 +230,21 @@ } /*! + \reimp Reimplemented from QGraphicsItem::keyPressEvent(). */ void HbZoomSliderPopup::keyPressEvent(QKeyEvent *keyevent) { - switch (keyevent->key()) { + Q_D( HbZoomSliderPopup ); + switch (keyevent->key()) { case Qt::Key_Left: case Qt::Key_Right: + if ( d->keyNavigation() ) + { + hide(); + keyevent->accept(); + break; + } case Qt::Key_Back: case Qt::Key_Backspace: hide(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbabstractslidercontrol.cpp --- a/src/hbwidgets/sliders/hbabstractslidercontrol.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbabstractslidercontrol.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -100,7 +100,7 @@ /*! \var HbAbstractSliderControl::SliderSingleStepSub - Substract a single step. + Subtract a single step. */ /*! @@ -112,7 +112,7 @@ /*! \var HbAbstractSliderControl::SliderPageStepSub - Substract a page step. + Subtract a page step. */ /*! @@ -858,7 +858,7 @@ // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird. case Qt::Key_Left: - if(orientation()==Qt::Horizontal){ + if( d->keyNavigation() && orientation()==Qt::Horizontal){ if (layoutDirection() == Qt::RightToLeft) action = d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd; else @@ -871,7 +871,7 @@ } break; case Qt::Key_Right: - if(orientation()==Qt::Horizontal){ + if( d->keyNavigation() && orientation()==Qt::Horizontal){ if (layoutDirection() == Qt::RightToLeft) action = d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub; else @@ -883,7 +883,7 @@ } break; case Qt::Key_Up: - if(orientation()==Qt::Vertical){ + if( d->keyNavigation() && orientation()==Qt::Vertical){ action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd; event->accept(); } @@ -892,7 +892,7 @@ } break; case Qt::Key_Down: - if(orientation()==Qt::Vertical){ + if( d->keyNavigation() && orientation()==Qt::Vertical){ action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub; event->accept(); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbprogressbar.cpp --- a/src/hbwidgets/sliders/hbprogressbar.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbprogressbar.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,10 +22,9 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ - +#include "hbprogressbar_p.h" #include #include -#include "hbprogressbar_p.h" #include "hbglobal_p.h" #ifdef HB_EFFECTS @@ -40,53 +39,65 @@ \class HbProgressBar \brief HbProgressBar widget provides a vertical and horizontal progress bar. - An infinite progressbar is also available. - - A progress bar is used to give the user an indication of the progress of an operation and to - reassure them that the application is still running. + + \image html progressbar.png "A Progress Bar with Min-Max text at bottom" + \image html infiniteprogressbar.png "An infinite progres bar" - The progress bar uses the concept of steps. User can set it up by specifying the minimum and - maximum possible step values, and it will display the percentage of steps that have been completed - when you later give it the current step value. - - The percentage is calculated by dividing the progress (progressValue() - minimum()) divided by maximum() - minimum(). + The HbProgressBar widget provides a horizontal or vertical progress bar. - User can specify the minimum and maximum number of steps with setMinimum() and setMaximum() APIs. - The current number of steps is set with setProgressValue(). + A progress bar is used to give the user an indication of the progress of an operation and to reassure them that + the application is still running. The progress bar uses the concept of steps. You set it up by specifying the + minimum and maximum possible step values, and it will display the percentage of steps that have been completed + when you later give it the current step value. The percentage is calculated by dividing the + progress (value() - minimum()) divided by maximum() - minimum(). + + By default the min value is 0 and max value is 100.If minimum and maximum both are set to 0, the bar shows a busy indicator + instead of a percentage of steps.The ProgressBar is always non interactive. - If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. - This is useful, for example, when using ftp or http to download items when they are unable to - determine the size of the item being downloaded. - - ProgressBar also supports adding text . min max text pair is also supported which is commonly - used for progress indication for music. + ProgressBar also supports adding text . Min-Max text pair is also supported which is commonly + used for progress indication for music. - \image html hbprogressbartext.png Left Aligned Text, Min Max Text. - Progress bar provides below signal. \li valueChanged(int value) Emitted when the value of the progressbar is changed. -*/ - -/*! - @beta - \fn void HbProgressBar::valueChanged(int value) - - Emitted when the value of the progressbar is changed. -*/ -/*! - @beta - \reimp - \fn int HbProgressBar::type() const - */ + Example code for creating normal ProgressBar: + \code + HbProgressBar *pb = new HbProgressBar(); + pb->setMinimum(0); + pb->setMaximum(500); + pb->setProgressValue(175); + \endcode + + Example code for creating infinite ProgressBar: + \code + HbProgressBar *pb = new HbProgressBar(); + pb->setMinimum(0); + pb->setMaximum(0); + \endcode -/*! - @beta - \enum HbProgressBar::ProgressBarType + Example code for creating normal ProgressBar with Min-Max text at Top: + \code + HbProgressBar *pb = new HbProgressBar(); + pb->setMinimum(0); + pb->setMaximum(500); + pb->setProgressValue(175); + pb->setMinMaxTextVisible(true); + pb->setMinMaxTextAlignment(Qt::AlignTop);// The possible options are Qt::AlignTop ,Qt::AlignBottom ,Qt::AlignCenter + pb->setminText("0"); + pb->setmaxText("500"); - This enum defines available progress bar types. + \endcode + + Example code for creating vertical normal ProgressBar: + \code + HbProgressBar *pb = new HbProgressBar(); + pb->setOrientation(Qt::Vertical); + pb->setMinimum(0); + pb->setMaximum(500); + pb->setProgressValue(175); + \endcode */ @@ -223,14 +234,23 @@ mProgressValue = mMaximum; } + // update primitve optimization, update only track primitive + // incase of normal as well as in infinite progressbar + HbStyleOptionProgressBar progressBarOption; + q->initStyleOption(&progressBarOption); + if( (mMinimum == 0) && (mMaximum == 0) ) { mWaitTrack->setVisible(true); mTrack->setVisible(false); + + q->style()->updatePrimitive(mWaitTrack, HbStyle::P_ProgressBar_waittrack, &progressBarOption); } else { mWaitTrack->setVisible(false); mTrack->setVisible(true); + + q->style()->updatePrimitive(mTrack, HbStyle::P_ProgressBar_track, &progressBarOption); } - q->updatePrimitives(); + //q->updatePrimitives(); } /*! @@ -275,8 +295,9 @@ /*! @beta - Constructor of Progressbar. - \param parent. Parent widget + Constructs a progress bar with the given parent. + By default, the minimum step value is set to 0, and the maximum to 100. + \param parent The parent of ProgressBar */ HbProgressBar::HbProgressBar(QGraphicsItem *parent) : @@ -304,8 +325,7 @@ /*! @beta - Return the inverted appearence property. - + Return the inverted appearance property. \sa setInvertedAppearance() */ bool HbProgressBar::invertedAppearance() const @@ -316,7 +336,7 @@ /*! @beta - Sets the inverted appearence. If this is true progress grows from right to + Sets the inverted Appearance. If this is true progress grows from right to left otherwise left to right. \param inverted true or false. @@ -346,7 +366,7 @@ @beta Sets the maximum value of the progressbar. By default it is 100. - \param maximum the max value + \param maximum the maximum value \sa maximum() */ @@ -372,7 +392,7 @@ @beta Sets the minimum value of the progressbar. By default it is 0. - \param maximum the max value + \param minimum the minimum value \sa minimum() */ @@ -410,14 +430,13 @@ /*! @beta This function is provided for convenience. - Sets the progress bar's minimum and its maximum. If maximum is smaller than minimum, minimum becomes the only valid legal value. - \param minimum the minimum value - \param maximum the maximum value + \param minimum the minimum value + \param maximum the maximum value */ void HbProgressBar::setRange(int minimum, int maximum) { @@ -427,7 +446,8 @@ /*! @beta - Sets the min text string. + A text can be shown at top,bottom or left-right of the progressbar near minimum and maximum. + This will set the text near the minimum point. \param text mintext string @@ -457,7 +477,8 @@ /*! @beta - Sets the max text string. + A text can be shown at top,bottom or left-right of the progressbar near minimum and maximum. + This will set the text near the minimum point. \param text max text string @@ -488,7 +509,7 @@ /*! @beta Set the MinMaxtext visibility. true for showing text,false for hiding the text. - The default is false. Min Max text doesnt have a background and would have a transparent background. + The default is false. Min Max text does not have a background and would have a transparent background. \param visible true or false. \sa isMinMaxTextVisible(). */ @@ -502,6 +523,15 @@ if(!d->mMinTextItem && !d->mMaxTextItem){ d->createTextPrimitives(); } + + // update primitve optimization, update only text primitives + // incase of with and without min-max text + HbStyleOptionProgressBar progressBarOption; + initStyleOption(&progressBarOption); + + style()->updatePrimitive(d->mMinTextItem,HbStyle::P_ProgressBar_mintext,&progressBarOption); + style()->updatePrimitive(d->mMaxTextItem,HbStyle::P_ProgressBar_maxtext,&progressBarOption); + d->mMinTextItem->show(); d->mMaxTextItem->show(); } else { @@ -511,7 +541,7 @@ } } repolish(); - updatePrimitives(); + //updatePrimitives(); } } @@ -539,7 +569,7 @@ AlignTop is equivalent to Left AlignBottom is equivalent to Right - \param alignment alignement for the min max text + \param alignment alignment for the min max text \sa isMinMaxTextVisible(). */ @@ -554,7 +584,8 @@ if (d->mMinMaxTextVisible) { repolish(); } - updatePrimitives(); + // no need for primitve updation, only layout change is required + //updatePrimitives(); } } @@ -596,8 +627,8 @@ } /*! - Returns the pointer for \a primitive passed. - Will return NULL if \a primitive passed is invalid + \deprecated HbProgressBar::primitive(HbStyle::Primitive) + is deprecated. */ QGraphicsItem* HbProgressBar::primitive(HbStyle::Primitive primitive) const { @@ -653,10 +684,8 @@ } /*! - Initializes \a option with the values from this HbProgressBar. This method - is useful for subclasses when they need a HbStyleOptionProgressBar, but don't - want to fill in all the information themselves. - */ + \reimp +*/ void HbProgressBar::initStyleOption(HbStyleOptionProgressBar *option) const { @@ -673,9 +702,7 @@ option->inverted = d->mInvertedAppearance; option->stopWaitAnimation = false; option->minMaxTextAlignment = d->mMinMaxTextAlignment; - QRect rect((int)d->mFrame->boundingRect().x(),(int)d->mFrame->boundingRect().y(),(int)d->mFrame->boundingRect().width(), - (int)d->mFrame->boundingRect().height()); - option->rect = rect; + } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbprogressslider.cpp --- a/src/hbwidgets/sliders/hbprogressslider.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbprogressslider.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,9 +23,8 @@ ** ****************************************************************************/ +#include "hbprogressslider_p.h" #include -#include "hbprogressslider_p.h" - #include #include #include @@ -45,7 +44,7 @@ mDownState=false; handle = 0; mSliderValue = 0; - mHandlePath = QString(); + mHandlePath.clear(); } HbProgressSliderPrivate::~HbProgressSliderPrivate() @@ -86,17 +85,10 @@ void HbProgressSliderPrivate::setEnableFlag(bool flag) { Q_Q(HbProgressSlider); - - HbStyleOptionProgressSlider option; + Q_UNUSED(flag); + HbStyleOptionProgressSlider option; q->initStyleOption(&option); - - if(!flag) { - q->setProgressValue(q->minimum()); - q->setSliderValue(q->minimum()); - } - if (mFrame) { - q->style()->updatePrimitive(mFrame, HbStyle::P_ProgressSlider_frame, &option); - } + q->updatePrimitives(); } void HbProgressSliderPrivate::init() @@ -203,23 +195,54 @@ void HbProgressSliderPrivate::setRange(int minimum, int maximum) { - Q_Q( HbProgressSlider ); - HbProgressBarPrivate::setRange(minimum, maximum); - q->setSliderValue(mSliderValue); + Q_Q(HbProgressSlider); + if( minimum > maximum ){ + maximum = minimum ; + } + mMinimum = minimum; + mMaximum = maximum; + + if ( mProgressValue < mMinimum){ + mProgressValue = mMinimum; + } + + if(mProgressValue > mMaximum){ + mProgressValue = mMaximum; + } + + HbStyleOptionProgressSlider progressSliderOption; + q->initStyleOption(&progressSliderOption); + + if (mSliderGraphicItem) { + q->style()->updatePrimitive(mSliderGraphicItem, HbStyle::P_ProgressSlider_slidertrack, &progressSliderOption); + } + + if (mTrack) { + q->style()->updatePrimitive(mTrack, HbStyle::P_ProgressSlider_track, &progressSliderOption); + } + + q->setSliderValue(mSliderValue); } /*! @beta @hbwidgets \class HbProgressSlider - \brief Constructs a basic progress slider. - ProgressSlider is a basic slider but the track is like a progressbar indicating how much progress - has been done. its a slider with progressbar as its track with some additional behaviour. + \brief ProgressSlider is used to indicate the current position of a playing music or video. It can show the progress + of a progressing music or video along with the status of the buffered data. + + \image html progressslider.png "A Progress Slider with Min-Max text at bottom " + \image html progressslider2.png "A Progress Slider with Min-Max text at bottom and with pregress value" + + + ProgressSlider has a track like Progress Bar indicating how much progress + has been done. It is a Progress Bar with some additional behaviour. There is also a progressValue which indicates the amount of buffered data.General use for this widget would be for playing music online which indicates sliderValue as currentTime and progressValue as the buffered amount. HbProgressSlider is derived from HbProgressBar so it supports all the features supported by HbProgressBar. + But It supports only horizontal orientation. HbProgressSlider emits below signals @@ -227,24 +250,42 @@ void sliderReleased(); void sliderMoved(int value); - sliderPressed is emits when the track is pressed. - sliderReleased is emits when the track is released. - sliderMoved is emits when the handle is moved in any direction. + sliderPressed is emitted when the track is pressed. + sliderReleased is emitted when the track is released. + sliderMoved is emitted when the handle is moved in any direction. + + The Application can customize the Slider behaviour by listening to the signals sliderPressed and sliderReleased.By default there + is no behaviour defined by HbProgressSlider for these actions. + + By default the min value is 0 and max value is 100. The application can set the progressValue (buffer data) and + sliderValue (Progress Slider position) according to the situation. + + Example code for creating and using Progress Slider: + \code + HbProgressSlider *mySlider = new HbProgressSlider(parent); + connect(mySlider,SIGNAL(sliderMoved(int)), mySlider ,SLOT(setSliderValue(int))); + //This sets the buffered data progress + mySlider->setProgressValue(45); + \endcode - sample code showing how this can be connected. If the Application has different use case based on - Slider press and slider release they can customize the behaviour. - + Example code for creating and using Progress Slider along with Min-Max text: \code - HbProgressSlider *object = new HbProgressSlider(parent); + HbProgressSlider *mySlider = new HbProgressSlider(parent); connect(mySlider,SIGNAL(sliderMoved(int)), mySlider ,SLOT(setSliderValue(int))); + //This sets the buffered data progress + mySlider->setProgressValue(45); + mySlider->setMinText("0"); + mySlider->setMaxText("100"); + //This sets the slider position + mySlider->setSliderValue(20); \endcode */ /*! @beta - Constructs a progressslider with a parent. + Constructs a Progress Slider with a parent. */ HbProgressSlider::HbProgressSlider(QGraphicsItem *parent) : @@ -275,7 +316,8 @@ /*! @beta - Constructs a progressslider with a parent. + Constructs a Progress Bar with the given parent. + \param parent The parent of ProgressBar */ HbProgressSlider::HbProgressSlider(HbProgressSliderPrivate &dd,QGraphicsItem *parent) : HbProgressBar( dd,parent) @@ -298,7 +340,7 @@ /*! @beta - Destructor for the progressslider. + Destructor for the Progress Slider. */ HbProgressSlider::~HbProgressSlider() { @@ -369,7 +411,7 @@ /*! @beta - Sets the inverted appearence of the slider. + Sets the inverted appearance of the slider. If inverted the slider increases from right to left. \param inverted true or false @@ -386,10 +428,20 @@ } } - +/*! + \reimp + */ void HbProgressSlider::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_D(HbProgressSlider); + + QRectF rect = d->mTouchAreaItem->sceneBoundingRect( ); + // return if point is outside track touch area + if ( !rect.contains( event->scenePos( ) ) ) { + event->ignore( ); + return; + } + if(flags().testFlag(ItemIsFocusable)) { d->mDownState = true; HbStyleOptionProgressSlider option; @@ -397,14 +449,6 @@ if (d->mFrame) { style()->updatePrimitive(d->mFrame, HbStyle::P_ProgressSlider_frame, &option); } - qreal temp = event->scenePos().x(); - if((d->mMinMaxTextVisible) && (d->mMinMaxTextAlignment== Qt::AlignCenter)) { - temp -= d->mMinTextItem->boundingRect().width(); - } - if( (temp > d->handle->pos().x()) && (temp < (d->handle->boundingRect().width()+d->handle->pos().x())) ) { - event->ignore(); - return; - } HbWidgetFeedback::triggered(this, Hb::InstantPressed); d->handle->handleTrackPress(event); @@ -417,9 +461,13 @@ } } +/*! + \reimp + */ void HbProgressSlider::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { Q_D(HbProgressSlider); + if(flags().testFlag(ItemIsFocusable)) { d->mDownState = false; @@ -439,19 +487,19 @@ event->ignore(); } } - +/*! + \reimp + */ void HbProgressSlider::setGeometry(const QRectF & rect) { Q_D(HbProgressSlider); HbProgressBar::setGeometry(rect); d->handle->setHandlePosForValue(sliderValue()); - updatePrimitives(); + //updatePrimitives(); } /*! - Initializes \a option with the values from this HbProgressSlider. - This method is useful for subclasses when they need a HbStyleOptionProgressSlider, - but don't want to fill in all the information themselves. + \reimp */ void HbProgressSlider::initStyleOption( HbStyleOptionProgressSlider *option ) const { @@ -468,7 +516,9 @@ option->disableState = true; } } - +/*! + \reimp + */ void HbProgressSlider::updatePrimitives() { Q_D(HbProgressSlider); @@ -503,7 +553,9 @@ } } } - +/*! + \reimp + */ void HbProgressSlider::showEvent( QShowEvent * event ) { Q_D(const HbProgressSlider); @@ -514,6 +566,9 @@ HbProgressBar::showEvent(event); } +/*! + \reimp + */ QVariant HbProgressSlider::itemChange(GraphicsItemChange change,const QVariant & value) { Q_D(HbProgressSlider); @@ -531,7 +586,9 @@ } return HbProgressBar::itemChange(change, value); } - +/*! + \reimp + */ bool HbProgressSlider::sceneEventFilter(QGraphicsItem *obj,QEvent *event) { Q_D(HbProgressSlider); @@ -554,9 +611,8 @@ /*! @beta - Sets the tooltip for the handle. By default it shows the slider value. - If the Application wants to configure this they use setSliderToolTip for - setting the new tooltip text. + Sets the tooltip for the Slider handle. By default it shows the slider value. + The application can customize the tooltip text using this API. \param text tooltip text diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbprogresssliderhandle_p.cpp --- a/src/hbwidgets/sliders/hbprogresssliderhandle_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbprogresssliderhandle_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -131,18 +131,21 @@ mMousePressPos = event->scenePos(); mItemPosAtPress = pos(); - if(q->textVisible()) { + + HbWidgetFeedback::triggered(q->parentGraphicsWidget(), Hb::InstantPressed, Hb::ModifierSliderHandle); + + event->accept(); + q->emitSliderPressed(); + + if(q->textVisible()) { HbToolTip::showText(q->toolTipText(),this, QRectF(mItemPosAtPress,QSize(0,0)),q->textAlignment()); } else { HbExtendedLocale locale; - HbToolTip::showText(locale.toString(q->progressValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment()); + HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget(); + HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment()); } - HbWidgetFeedback::triggered(q->parentGraphicsWidget(), Hb::InstantPressed, Hb::ModifierSliderHandle); - - event->accept(); - q->emitSliderPressed(); } void HbProgressSliderHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) @@ -217,16 +220,18 @@ #endif } + event->accept(); + + q->emitSliderMoved(pointToValue(mItemCurPos)); + if(q->textVisible()) { HbToolTip::showText(q->toolTipText(),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment()); } else { HbExtendedLocale locale; - HbToolTip::showText(locale.toString(q->progressValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment()); + HbProgressSlider *slider = (HbProgressSlider*)q->parentGraphicsWidget(); + HbToolTip::showText(locale.toString(slider->sliderValue()),this, QRectF(mItemCurPos,QSize(0,0)),q->textAlignment()); } - event->accept(); - - q->emitSliderMoved(pointToValue(mItemCurPos)); } int HbProgressSliderHandle::pointToValue(QPointF point) const diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbratingslider.cpp --- a/src/hbwidgets/sliders/hbratingslider.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbratingslider.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -22,15 +22,14 @@ ** Nokia at developer.feedback@nokia.com. ** ****************************************************************************/ - - +#include "hbratingslider_p.h" #include -#include "hbratingslider_p.h" #include #include #include #include #include +#include #ifdef HB_GESTURE_FW #include @@ -140,50 +139,65 @@ /*! \class HbRatingSlider - \brief A control for user to do rating. - - This is a general rating widget where user will be able to do different - ratings for things like Music ,Video etc. + \brief This is a widget that enables a user to rate contents like videos , music etc. + \image html ratingslider.png "A Rating Slider with rating done" - By default there are 5 ratings ( 5 stars ). This can be configured also. - The interval , number of icons etc can be configured. + The default version of Rating Slider contains 5 repeated icons drawn side by side, using a single themed graphics. + The application can replace the themed graphic with a custom graphic. + The custom graphics should contain only one icon (eg one star) which will be multipled by the API \a setNumberOfIcons(). + By default it is 5 and maximum number of icons are 10. - Apart from rating the this can used for showing cumulative rating also. + Along with the rating Rating Slider can be used to show the cumulative rating also. - example code example: + To use HbRatingSlider with default settings it just needs to be created. + example code: \code HbRatingSlider *object = new HbRatingSlider(parent); \endcode - The below code can be used to show some rating e.g. 2.5/5 - by default the stepcount =5 + HbRatingSlider emits below signals + + void ratingDone(int ratingValue); + void ratingChanged(int ratingValue); + ratingDone is emitted when the user does the rating and releases the finger. + ratingChanged is emitted when the user presses and drags the finger on Rating Slider. + + To use HbRatingSlider with default settings it just needs to be created. + example code: + \code + HbMainWindow window; + HbRatingSlider *rs = new HbRatingSlider(); + window.addView(rs); + \endcode + + HbRatingSlider supports integer ratings.But using the API \a setStepCount() fraction ratings can also be + shown on Rating Slider + + The below code can be used to show some rating e.g. 2.5/5 \code + //2.5/5 can be set as 25/50 HbRatingSlider *slider = new HbRatingSlider(); - slider->setStepCount(100); //5 *20// - slider->setCurrentRating(50); //2.5*20 it shows 50 / 100 which is same as 2.5/5 + slider->setStepCount(50); //5 *10// + slider->setCurrentRating(25); //2.5*10 it shows 25/50 which is same as 2.5/5 \endcode - This will show as 2.5/5. Now if one the same ratingslider - if the Application wants to configure a rating slider with range 1-5 - on emitting the signal rating changed it can set to - slider->setStepCount(5); - slider->setCurrentRating(0) - - When the rating is done it emits a signal called ratingDone and when rating is - changed by the user by draging the pointer ratingChanged signal is emitted. - + This will show as 2.5/5. Now if on the same ratingslider + the Application wants to configure a Rating Slider with range 1-5 + on emitting the signal rating changed it can set to 5. */ - /*! @beta - Constructor of RatingSlider. - \param parent. Parent widget + Constructs a Rating Slider bar with the given parent. + \param parent Parent Item. */ + + + HbRatingSlider::HbRatingSlider(QGraphicsItem *parent) : HbWidget(*new HbRatingSliderPrivate,parent) { @@ -195,8 +209,7 @@ /*! @beta - Constructor of RatingSlider. - \param parent. Parent widget + Protected constructor */ HbRatingSlider::HbRatingSlider(HbRatingSliderPrivate &dd,QGraphicsItem *parent) : HbWidget( dd,parent) @@ -232,9 +245,8 @@ /*! @beta - Sets the number of icons. In a Rating scenario you may have number of repeated icons. This API can be used to set - the number of icons required. For Example the default image is "*" and you have 5 stars. You can set the number of - stars using this. By default this value is 5. + Sets the number of icons. There can be n number of repeated icons. This method can be used to set + the number of icons required.The default image is "*" and has 5 stars. \param number. A value between 1 and 10 @@ -268,9 +280,8 @@ /*! @beta - Sets the step count for the rating slider. If the number of icons is 5 and step count is 10 then it is possible to have 10 ratings. - one rating will be half star (by default). If the number of icons is 5 and step count is 5 then 5 ratings are possible. In this - case one rating will be one complete star. By default this value is 5. + Sets the step count for the Rating Slider.This indicates the interval of the rating. Eg. If step count is 10 + then 10 rating is possible. \param count. A value between 1 and 100. This can be considerd as the maximum rating possible. @@ -354,8 +365,8 @@ /*! @beta - It sets the unrated graphics name.This is the graphics shown when rating slider is displayed. - the grpahics can be a single star kind of or multi star image. If it is single star then use setNumberOfIcons for + It sets the unrated graphics name.This is the graphics shown when Rating Slider is displayed. + the graphicscan be a single star kind of or multi star image. If it is single star then use setNumberOfIcons for setting number of stars. \param name. The graphics name along with the path. @@ -389,7 +400,7 @@ @beta It sets the rated graphics name.This is the graphics shown when rating is on going. - the grpahics can be a single star kind of or multi star image. If it is single star then use setNumberOfIcons for + the graphicscan be a single star kind of or multi star image. If it is single star then use setNumberOfIcons for setting number of stars. \param name. The graphics name along with the path. @@ -432,6 +443,7 @@ } d->mMousePressed = true; event->accept(); + updatePrimitives(); } @@ -465,7 +477,7 @@ int rating=0; if(rect.contains(xVal,0 )) { rating = d->calculateProgressValue(xVal); - if(toolTip() != QString()) { + if(!toolTip().isNull()) { HbToolTip::showText(toolTip(),this); } setCurrentRating(rating); @@ -507,7 +519,7 @@ int rating=0; if(rect.contains(xVal,0 )) { rating = d->calculateProgressValue(xVal); - if(toolTip() != QString()) { + if(!toolTip().isNull()) { HbToolTip::showText(toolTip(),this); } setCurrentRating(rating); @@ -517,10 +529,14 @@ event->accept(); d->mMousePressed = false; } + updatePrimitives(); } } #else +/*! + \reimp + */ void HbRatingSlider::mousePressEvent(QGraphicsSceneMouseEvent *event) { Q_UNUSED(event) @@ -528,6 +544,9 @@ #endif #ifdef HB_GESTURE_FW +/*! + \reimp + */ void HbRatingSlider::gestureEvent(QGestureEvent *event) { Q_D (HbRatingSlider); @@ -545,9 +564,19 @@ event->ignore(); return; } - - d->mMousePressed = true; - event->accept(); + QRectF rect = d->mTouchArea->boundingRect(); + if(rect.contains(xVal,0 )) { + HbWidgetFeedback::triggered(this, Hb::InstantPressed); + d->mMousePressed = true; + updatePrimitives(); + rating = d->calculateProgressValue(xVal); + setCurrentRating(rating); + event->accept(); + } + else { + event->ignore(); + } + } break; @@ -574,16 +603,35 @@ rating = d->calculateProgressValue(xVal); - if(toolTip() != QString()) { + if(!toolTip().isNull()) { HbToolTip::showText(toolTip(),this); } setCurrentRating(rating); + HbWidgetFeedback::triggered(this, Hb::InstantReleased); if(d->mCurrentValue) { emit ratingDone (d->mCurrentValue); } + event->accept(); d->mMousePressed = false; + updatePrimitives(); + } + else { + + d->mMousePressed = false; + updatePrimitives(); + + if(xVal mCurrentValue); } + + } + + + + } break; default: break; @@ -612,10 +660,11 @@ rating = d->calculateProgressValue(xVal); - if(toolTip() != QString()) { + if(!toolTip().isNull()) { HbToolTip::showText(toolTip(),this); } setCurrentRating(rating); + HbWidgetFeedback::continuousTriggered(this, Hb::ContinuousDragged); emit ratingChanged (d->mCurrentValue); event->accept(); } @@ -628,34 +677,35 @@ { qreal xVal = mapFromScene(event->mapToGraphicsScene( pan->startPos()+pan->offset())).x(); QRectF rect = d->mTouchArea->boundingRect(); + d->mMousePressed = false; + updatePrimitives(); int rating=0; if(rect.contains(xVal,0 )) { if(d->mReadOnly) { event->ignore(); return; } - } + } - if(!d->mMousePressed) { - return; - } + if(xVal <0) { + setCurrentRating(0); + emit ratingDone (d->mCurrentValue); + return; + } - if(xVal <0) { - setCurrentRating(0); - emit ratingDone (d->mCurrentValue); - return; - } - - rating = d->calculateProgressValue(xVal); - setCurrentRating(rating); - if(d->mCurrentValue) { - emit ratingDone (d->mCurrentValue); - } - d->mMousePressed = false; - event->accept(); - } - default: - break; + rating = d->calculateProgressValue(xVal); + setCurrentRating(rating); + HbWidgetFeedback::triggered(this, Hb::InstantReleased); + if(d->mCurrentValue) { + emit ratingDone (d->mCurrentValue); + } + event->accept(); + + } + + + default: + break; } } } @@ -671,7 +721,9 @@ updatePrimitives(); d->createLookupTable(); } - +/*! + \reimp + */ void HbRatingSlider::initStyleOption(HbStyleOption *hboption) const { Q_D( const HbRatingSlider ); @@ -683,6 +735,8 @@ option->unRatedGraphicsName = d->mUnratedIconName; option->ratedGraphicsName = d->mRatedIconName; option->progressValue = d->mCurrentValue; + option->disableState = !isEnabled(); + option->pressedState = d->mMousePressed; } } @@ -710,7 +764,9 @@ return 0; } } - +/*! + \reimp + */ void HbRatingSlider::changeEvent(QEvent *event) { HbWidget::changeEvent(event); @@ -718,10 +774,16 @@ case QEvent::LayoutDirectionChange: updatePrimitives(); break; + case QEvent::EnabledChange: + updatePrimitives(); + break; default: break; } } +/*! + \reimp + */ void HbRatingSlider::updatePrimitives() { Q_D(HbRatingSlider); @@ -740,7 +802,9 @@ } } - +/*! + \reimp + */ QVariant HbRatingSlider::itemChange(GraphicsItemChange change, const QVariant &value) { if(change == ItemVisibleHasChanged && value.toBool()){ diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbratingslider_p.h --- a/src/hbwidgets/sliders/hbratingslider_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbratingslider_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -27,7 +27,7 @@ #define HBRATINGSLIDER_P_H #include "hbwidget_p.h" - +#include class HbRatingSliderPrivate :public HbWidgetPrivate { Q_DECLARE_PUBLIC( HbRatingSlider ) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslider.cpp --- a/src/hbwidgets/sliders/hbslider.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslider.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -31,6 +31,7 @@ #include "hbsliderhandle_p.h" #include "hbstyleoptionslider_p.h" +#include "hbslidertickmarks_p.h" #include "hbslidertickmarkslabel_p.h" #include "hbabstractbutton.h" #include @@ -38,7 +39,9 @@ #include #include #include - +#ifdef HB_GESTURE_FW +#include +#endif #ifdef HB_EFFECTS #include "hbeffect.h" #include "hbeffectinternal_p.h" @@ -88,7 +91,7 @@ \image html verticalslider.png A Custom vertical slider with all elements. - order in which HbSlider::SliderElement are inserted into QList doesnt matter. + order in which HbSlider::SliderElement are inserted into QList does not matter. HbSlider provides methods for controlling tickmarks. You can use setTickPosition( ) to indicate where you want the tickmarks to be, @@ -195,7 +198,7 @@ /*! \var HbSlider::TrackElement - The slider track that consists of a groove, ticks and handle. + The slider track that consists of a groove and handle. */ /*! @@ -207,7 +210,7 @@ /*! \var HbSlider::IconElement - An icon element associated to the slider. + An icon element associated to the slider.For example mute icon of volume slider */ /*! @@ -243,7 +246,12 @@ HbSliderPrivate::HbSliderPrivate( ) : sliderControl( 0 ), orientation( Qt::Vertical ), - pressOnIncrement( false ) + pressOnIncrement( false ), + tickmarksLeft( 0 ), // slider left/top tick mark item + tickmarksRight( 0 ),// slider right/bottom tick mark item + tickmarkslabelLeft( 0 ),// slider left/above tick mark label + tickmarkslabelRight ( 0 )// slider right/bottom tick mark label + { elementItemMap.clear(); @@ -270,13 +278,16 @@ HbStyle::setItemName( q,"this" ); q->setFlags( QGraphicsItem::ItemIsFocusable ); q->setProperty("TickLabelPresent",false); +#ifdef HB_GESTURE_FW + q->grabGesture(Qt::TapGesture); +#endif } void HbSliderPrivate::setElements( QList elementList) { Q_Q( HbSlider); bool oldElementRemoved = false; - foreach(HbSlider::SliderElement element,elements){ + foreach(const HbSlider::SliderElement &element,elements){ if(!elementList.contains(element)&& elementItemMap.contains(element)) { delete elementItemMap[element].item; delete elementItemMap[element].touchItem; @@ -293,7 +304,13 @@ // repolish call is required because new elements might be added } +QSizeF HbSliderPrivate::getHandleSize( ) +{ + return sliderControl ->getHandleSize(); +} + /*! + \internal This api creates widget for given element */ void HbSliderPrivate::elementWidget( HbSlider::SliderElement element ) @@ -391,6 +408,7 @@ /*! + \internal update element will first delete element which are not required and then create new element */ @@ -404,6 +422,7 @@ } /*! + \internal This Api will start incrementing slider value by step size till the time stopReapetAction( ) is not being called or slider value becomes maximum( ) @@ -421,6 +440,7 @@ } /*! + \internal This Api will start decrementing slider value by step size till the time stopReapetAction( ) is not being called or slider value becomes minimum( ) @@ -436,6 +456,7 @@ } /*! + \internal stops the reapeating action reapeat action can be increase slider value by step or decrease slider value by step */ @@ -445,28 +466,243 @@ } -void HbSliderPrivate::setTickLabelPresentProperty( ) +/*! + \internal + creates either left tickmarks or right tickmarks or both based on tickposition of slider + */ + +void HbSliderPrivate::createTickMarks( ) { - Q_Q ( HbSlider ); - if (q->majorTickInterval( ) > 0 && q->tickPosition( ) !=Hb::NoSliderTicks && - (q->majorTickLabels().length() > 0 || - (q->minorTickInterval() > 0 && q->minorTickLabels( ).length() > 0))) { - if(!q->property("TickLabelPresent").toBool()){ - q->setProperty("TickLabelPresent",true); - q->repolish( ); - } + Q_Q ( HbSlider); + bool modified = false; + if( q->majorTickInterval( ) <= 0) { + return; + } + if ( q->tickPosition( ) & Hb::SliderTicksLeft) { + if (!tickmarksLeft) { + tickmarksLeft = new HbSliderTickmarks(q); + tickmarksLeft->setZValue(sliderControl->zValue()-1); + tickmarksLeft->setTickPosition (Hb::SliderTicksLeft); + modified = true; + if ( orientation == Qt::Vertical ) { + HbStyle::setItemName( tickmarksLeft, "tick-marksleft" ); + } else { + HbStyle::setItemName( tickmarksLeft, "tick-marksabove" ); + } + } + + } else if ( tickmarksLeft ) { + delete tickmarksLeft; + tickmarksLeft = 0; + modified = true; + } + if ( q->tickPosition( ) & Hb::SliderTicksRight) { + if (!tickmarksRight) { + tickmarksRight = new HbSliderTickmarks(q); + tickmarksRight->setTickPosition (Hb::SliderTicksRight); + tickmarksRight->setZValue(sliderControl->zValue()-1); + modified = true; + + if ( orientation == Qt::Vertical ) { + HbStyle::setItemName( tickmarksRight, "tick-marksright" ); + } else { + HbStyle::setItemName( tickmarksRight, "tick-marksbelow" ); + } + } + } else if ( tickmarksRight ) { + delete tickmarksRight; + tickmarksRight = 0; + modified = true; + } + if ( orientation == Qt::Vertical ) { + if ( q->tickPosition( ) & Hb::SliderTicksAbsolute) { + q->setLayoutDirection (Qt::LeftToRight ); + } else { + q->unsetLayoutDirection( ); + } } else { - if( q->property("TickLabelPresent").toBool()){ - q->setProperty("TickLabelPresent",false); - q->repolish( ); + q->unsetLayoutDirection( ); + } + + if ( modified) { + q->repolish( ); + } +} + +/*! + \internal + creates either left tickmarks or right tickmarksLabel or both based on tickposition of slider + + */ +void HbSliderPrivate::createTickLabels( ) +{ + Q_Q(HbSlider); + bool modified = false; + if( q->majorTickInterval( ) <= 0 || q->majorTickLabels( ).isEmpty( ) ) { + return; + } + if ( q->tickPosition( ) & Hb::SliderTicksLeft) { + if (!tickmarkslabelLeft) { + modified = true; + tickmarkslabelLeft = new HbSliderTickmarksLabel(q); + tickmarkslabelLeft->setTickPosition (Hb::SliderTicksLeft); + if ( orientation == Qt::Vertical ) { + HbStyle::setItemName( tickmarkslabelLeft, "tick-textsleft" ); + } else { + HbStyle::setItemName( tickmarkslabelLeft, "tick-textsabove" ); + } + } + } else if ( tickmarkslabelLeft ) { + modified = true; + delete tickmarkslabelLeft; + tickmarkslabelLeft = 0; + } + if ( q->tickPosition( ) & Hb::SliderTicksRight) { + if (!tickmarkslabelRight) { + modified = true; + tickmarkslabelRight = new HbSliderTickmarksLabel(q); + tickmarkslabelRight->setTickPosition (Hb::SliderTicksRight); + if ( orientation == Qt::Vertical ) { + HbStyle::setItemName( tickmarkslabelRight, "tick-textsright" ); + } else { + HbStyle::setItemName( tickmarkslabelRight, "tick-textsbelow" ); } + } + } else if ( tickmarkslabelRight ) { + delete tickmarkslabelRight; + modified = true; + tickmarkslabelRight = 0; + } + if ( orientation == Qt::Vertical ) { + if ( q->tickPosition( ) & Hb::SliderTicksAbsolute) { + q->setLayoutDirection (Qt::LeftToRight ); + } + } + if ( modified ) { + q->repolish( ); + } +} + +/*! + \internal + changes the orientation of slider tick marks or label based on slider's orientation + */ +void HbSliderPrivate::setTickOrientation() +{ + Q_Q(HbSlider); + if ( orientation == Qt::Vertical ) { + if ( tickmarksLeft ) { + HbStyle::setItemName( tickmarksLeft, "tick-marksleft" ); + } + if ( tickmarksRight) { + HbStyle::setItemName( tickmarksRight, "tick-marksright" ); + } + if (tickmarkslabelLeft ) { + HbStyle::setItemName( tickmarkslabelLeft, "tick-textsleft" ); + } + if (tickmarkslabelRight ) { + HbStyle::setItemName( tickmarkslabelRight, "tick-textsright" ); + } + if ( q->tickPosition( )&Hb::SliderTicksAbsolute) { + q->setLayoutDirection (Qt::LeftToRight); + } + } else { + if ( tickmarksLeft ) { + HbStyle::setItemName( tickmarksLeft, "tick-marksabove" ); + } + if ( tickmarksRight) { + HbStyle::setItemName( tickmarksRight, "tick-marksbelow" ); + } + if (tickmarkslabelLeft ) { + HbStyle::setItemName( tickmarkslabelLeft, "tick-textsabove" ); + } + if (tickmarkslabelRight ) { + HbStyle::setItemName( tickmarkslabelRight, "tick-textsbelow" ); + } + q->unsetLayoutDirection( ); + + } } + + + + +/*! + \internal + Updates tick and Label. + */ +void HbSliderPrivate::updateTickMarks( ) +{ + if (tickmarksLeft) { + tickmarksLeft->createTicks(); + tickmarksLeft->updateTicks(); + } + if (tickmarksRight) { + tickmarksRight->createTicks(); + tickmarksRight->updateTicks(); + } +} + + +/*! + \internal + Updates tick and Label. + */ +void HbSliderPrivate::updateTickLabels( ) +{ + if( tickmarkslabelLeft ) { + tickmarkslabelLeft->updateTickLabels(); + } + if( tickmarkslabelRight ) { + tickmarkslabelRight->updateTickLabels( ); + } +} + + +/*! + \internal + deletes slidertickmarks. + */ +void HbSliderPrivate::deleteTickMarks( ) +{ + if (tickmarksLeft) { + HbStyle::setItemName(tickmarksLeft,QString()); + delete tickmarksLeft; + tickmarksLeft = 0; + } + if (tickmarksRight) { + HbStyle::setItemName(tickmarksRight,QString()); + delete tickmarksRight; + tickmarksRight = 0; + } +} + + +/*! + \internal + deletes ticklabels. + */ +void HbSliderPrivate::deleteTickLabels( ) +{ + if (tickmarkslabelLeft) { + HbStyle::setItemName(tickmarkslabelLeft,QString()); + delete tickmarkslabelLeft; + tickmarkslabelLeft = 0; + } + if (tickmarkslabelRight) { + HbStyle::setItemName(tickmarkslabelRight,QString()); + delete tickmarkslabelRight; + tickmarkslabelRight = 0; + } + } + #ifdef HB_EFFECTS /*! + \internal start effect for on icon press */ void HbSliderPrivate::_q_startIconPressedEffect( ) @@ -476,6 +712,7 @@ } /*! + \internal start effect on icon release */ void HbSliderPrivate::_q_startIconReleasedEffect( ) @@ -551,7 +788,7 @@ } /*! - @proto + @beta Returns the list of slider elements as QVariant \note it is safe to type-cast element to HbSlider::SliderElement. @@ -564,14 +801,14 @@ { Q_D( const HbSlider ); QList elementList; - foreach(HbSlider::SliderElement element,d->elements){ + foreach(const HbSlider::SliderElement &element,d->elements){ elementList.append ( QVariant ( element ) ); } return elementList; } /*! - @proto + @beta Sets the elements of the slider. \note Duplicate elements will be ignored. @@ -596,14 +833,14 @@ { Q_D( HbSlider ); QList elements; - foreach ( QVariant elementVar , elementlist ) { + foreach (const QVariant &elementVar , elementlist ) { elements.append( static_cast(elementVar.toInt())); } d->setElements( elements ); } /*! - @proto + @beta Sets the icons for elements key of \a elements is element name and value is icon @@ -616,8 +853,8 @@ Eg Usage: HbSlider slider; QMap map; - map.insert(QString("IncreaseElement") , QVariant(":/unittest_hbslider/star_on.png")); - map.insert(QString("DecreaseElement") , QVariant(":/unittest_hbslider/star_on.png")); + map.insert(QString("IncreaseElement") , QVariant("example1.png")); + map.insert(QString("DecreaseElement") , QVariant("example2.png")); slider.setElementIcons( map ); \warning Setting icon to a non-existing element has no effect. @@ -658,7 +895,7 @@ } /*! - @proto + @beta Returns the map , which consist of element name as key and icon name as value returns NULL map if none of the element has icon @@ -963,7 +1200,8 @@ if ( d->orientation != orientation ) { d->orientation = orientation; d->sliderControl->setOrientation( orientation ); - repolish(); + d->setTickOrientation( ); + repolish( ); } } @@ -1289,7 +1527,10 @@ { Q_D( HbSlider ); d->sliderControl->setTickPosition( position ); - d->setTickLabelPresentProperty( ); + d->createTickMarks( ); + d->createTickLabels( ); + d->updateTickMarks( ); + d->updateTickLabels( ); } /*! @@ -1346,7 +1587,16 @@ { Q_D( HbSlider ); d->sliderControl->setMajorTickInterval( interval ); - d->setTickLabelPresentProperty( ); + if (interval <=0 ) { + d->deleteTickMarks( ); + d->deleteTickLabels( ); + } + else { + d->createTickMarks( ); + d->createTickLabels( ); + d->updateTickMarks( ); + d->updateTickLabels( ); + } } /*! @@ -1377,7 +1627,8 @@ { Q_D( HbSlider ); d->sliderControl->setMinorTickInterval( interval ); - d->setTickLabelPresentProperty( ); + d->updateTickMarks( ); + d->updateTickLabels( ); } /*! @@ -1408,7 +1659,7 @@ /*! - @proto + @beta Sets whether to display progress track or not \default value is true @@ -1424,7 +1675,7 @@ } /*! - @proto + @beta returns whether progress track is visible or not \sa setTrackFilled( ) @@ -1472,13 +1723,23 @@ case 4: if both major & minor tickinterval are same,then only majortickLabel strings are taken into account for drawing the labelItem + case 5: If you want to remove the whole tickLabel then set the empty string as the argument. + + Note:: if the major tickinterval of the slider is very small, the tick labels may overlap, + application needs to take care of this. + \sa majorTickLabels( ) */ void HbSlider::setMajorTickLabels( const QStringList &majorTickLabels ) { Q_D( HbSlider ); d->sliderControl->setMajorTickLabels( majorTickLabels ); - d->setTickLabelPresentProperty( ); + if(majorTickLabels.isEmpty( )) { + d->deleteTickLabels( ); + } else { + d->createTickLabels( ); + d->updateTickLabels( ); + } } /*! @@ -1496,7 +1757,10 @@ /*! @beta Sets the minor ticklabels of the slider. - see setMajorTickLabels for detailed description + see setMajorTickLabels for detailed description. + Note:: if the minor tickinterval of the slider is very small, the tick labels may overlap, + application needs to take care of this. + \sa minorTickLabels( ),setMajorTickLabels( ) */ @@ -1504,7 +1768,7 @@ { Q_D( HbSlider ); d->sliderControl->setMinorTickLabels( minorTickLabels ); - d->setTickLabelPresentProperty( ); + d->updateTickLabels( ); } @@ -1544,6 +1808,8 @@ break; case HbStyle::P_Slider_groove: return HbSliderControlPrivate::d_ptr( d->sliderControl )->groove; + case HbStyle::P_SliderElement_touchgroove: + return HbSliderControlPrivate::d_ptr( d->sliderControl )->grooveTouchArea; case HbStyle::P_SliderElement_touchhandle: return HbSliderControlPrivate::d_ptr( d->sliderControl )->handle->primitive( @@ -1655,6 +1921,42 @@ } /*! + reimp + +*/ + +void HbSlider::gestureEvent(QGestureEvent *event) +{ + Q_D(HbSlider); + //consume the event if gesture is on increment or decrement,It is being handled in mouse press and mouse release + //If it is on mute/control igonore the gesture as they are handled separately by HbAbstractButton and HbSlidercontrol classes + if (HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { + QPointF pos = event->mapToGraphicsScene(tap->position()); + bool consumeEvent = false; + if ( d->elementItemMap.contains (HbSlider::IncreaseElement ) ) { + if (d->elementItemMap[HbSlider::IncreaseElement].touchItem ) { + if (d->elementItemMap[HbSlider::IncreaseElement].touchItem->sceneBoundingRect().contains(pos)) { + consumeEvent = true; + } + } + } + if ( d->elementItemMap.contains (HbSlider::DecreaseElement ) ) { + if (d->elementItemMap[HbSlider::DecreaseElement].touchItem ) { + if (d->elementItemMap[HbSlider::DecreaseElement].touchItem->sceneBoundingRect().contains(pos)) { + consumeEvent = true; + } + } + } + + if(!consumeEvent) { + event->ignore(); + HbWidget::gestureEvent(event); + } + } + +} + +/*! \reimp This api update the primitive when ever item enable has changed diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslider.h --- a/src/hbwidgets/sliders/hbslider.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslider.h Thu Jul 22 16:36:53 2010 +0100 @@ -162,6 +162,7 @@ bool isTrackFilled() const; virtual QGraphicsItem * primitive(HbStyle::Primitive primitive) const; + virtual void gestureEvent(QGestureEvent *event); public slots: void setOrientation(Qt::Orientation orientation); @@ -194,10 +195,14 @@ private: Q_DECLARE_PRIVATE_D(d_ptr, HbSlider) Q_DISABLE_COPY(HbSlider) + friend class HbSliderTickmarks; + friend class HbSliderTickmarksLabel; + #ifdef HB_EFFECTS Q_PRIVATE_SLOT(d_func(), void _q_startIconPressedEffect()) Q_PRIVATE_SLOT(d_func(), void _q_startIconReleasedEffect()) Q_PRIVATE_SLOT(d_func(), void _q_startTextClickEffect()) + #endif }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslider_p.h --- a/src/hbwidgets/sliders/hbslider_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslider_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -29,9 +29,12 @@ #include "hbwidget_p.h" #include +#include class HbSliderControl; class QGraphicsItem; +class HbSliderTickmarksLabel; +class HbSliderTickmarks; struct ItemPrimitive { @@ -50,11 +53,26 @@ void init(); void setElements( QList elementList); void elementWidget(HbSlider::SliderElement element); + QSizeF getHandleSize( ); void updateElements(); void startIncrementing(); void startDecrementing(); void stopRepeatAction(); - void setTickLabelPresentProperty(); + void updateTickMarks(); + void updateTickLabels(); + void deleteTickMarks(); + void deleteTickLabels(); + void createTickMarks( ); + void createTickLabels( ); + void setTickOrientation( ); + +public: + static HbSliderPrivate *d_ptr(HbSlider *slider) { + Q_ASSERT(slider); + return slider->d_func(); + } + + #ifdef HB_EFFECTS void _q_startIconPressedEffect(); @@ -72,6 +90,12 @@ QString thumbPath; bool pressOnIncrement; QMap elementItemMap; + HbSliderTickmarks *tickmarksLeft; + HbSliderTickmarks *tickmarksRight; + HbSliderTickmarksLabel *tickmarkslabelLeft; + HbSliderTickmarksLabel *tickmarkslabelRight; + friend class HbSliderTickmarks; + friend class HbSliderTickmarksLabel; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslidercontrol.cpp --- a/src/hbwidgets/sliders/hbslidercontrol.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslidercontrol.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -29,7 +29,6 @@ #include "hbsliderhandle_p.h" #include "hbstyleoptionslider_p.h" #include "hbslidertickmarkslabel_p.h" -#include "hbslidertickmarkslabel_p.h" #include #include #include @@ -62,10 +61,6 @@ minorTickInterval( 0 ),// minor tick interval groove( 0 ), //slider groove progressGroove( 0 ),//progress mask top of groove - tickmarksLeft( 0 ), // slider left/top tick mark item - tickmarksRight( 0 ),// slider right/bottom tick mark item - tickmarkslabelLeft( 0 ),// slider left/above tick mark label - tickmarkslabelRight ( 0 ),// slider right/bottom tick mark label displayCurrValueToolTip( true ), // holds whether to show current value tooltip or not toolTipAlignment( Qt::AlignTop|Qt::AlignRight ), // tooltip alignment groovePressed( false ), // hold whether groove is pressed or not @@ -100,22 +95,23 @@ Q_Q( HbSliderControl ); q->enableTrackEventHandling( true ); -#ifdef HB_GESTURE_FW - q->grabGesture(Qt::TapGesture); - q->grabGesture(Qt::PanGesture,Qt::ReceivePartialGestures); - q->setFiltersChildEvents(true) ; -#endif + // creating handle handle = createHandle(); if(handle) { HbStyle::setItemName( handle, "handle" ); } +#if defined( QT_KEYPAD_NAVIGATION ) && !defined( Q_OS_SYMBIAN ) q->setFocusPolicy( Qt::FocusPolicy( ( qApp->style( ) )->styleHint( QStyle::SH_Button_FocusPolicy ) ) ); - //creating groove +#endif groove = createGroove(); if(groove) { HbStyle::setItemName( groove, "groove" ); } +#ifdef HB_GESTURE_FW + q->setFiltersChildEvents(true) ; +#endif + //filled item top of groove if ( enableProgressTrack ) { progressGroove = createProgressGroove(); @@ -126,61 +122,16 @@ q->connect( hbInstance->theme( ), SIGNAL( changed( ) ), q, SLOT( updateTheme( ) ) ); q->connect( q , SIGNAL( actionTriggered( int ) ), q , SLOT( showToolTip( ) ) ); q->connect( q , SIGNAL( sliderReleased( ) ), q , SLOT( hideToolTip( ) ) ); +#if defined( QT_KEYPAD_NAVIGATION ) && !defined( Q_OS_SYMBIAN ) q->setFlags( QGraphicsItem::ItemIsFocusable ); +#endif } -/*! - \internal - Updates tick and Label. - */ -void HbSliderControlPrivate::updateTickAndLabel( ) -{ - if (tickmarksLeft) { - tickmarksLeft->updateTicks(); - } - if (tickmarksRight) { - tickmarksRight->updateTicks(); - } - if( tickmarkslabelLeft ) { - tickmarkslabelLeft->updateTickLabels(); - } - if( tickmarkslabelRight ) { - tickmarkslabelRight->updateTickLabels( ); - } -} /*! \internal - Updates tick and Label. - */ -void HbSliderControlPrivate::deleteTickAndLabel( ) -{ - if (tickmarksLeft) { - delete tickmarksLeft; - tickmarksLeft = 0; - - } - if (tickmarksRight) { - delete tickmarksRight; - tickmarksRight = 0; - } - - - if( tickmarkslabelLeft ) { - delete tickmarkslabelLeft; - tickmarkslabelLeft = 0; - } - if( tickmarkslabelRight ) { - delete tickmarkslabelRight; - tickmarkslabelRight = 0; - } - -} - -/*! - \internal - This is used to create the handle, is virtual and can be overridden to create different handle. + This is used to create the handle, it is virtual and can be overridden to create different handle. */ HbSliderHandle *HbSliderControlPrivate::createHandle() { @@ -191,7 +142,7 @@ /*! \internal - This is used to create the groove. can be overrideen by derived class + This is used to create the groove.It can be overrideen by derived class */ QGraphicsItem *HbSliderControlPrivate::createGroove() { @@ -202,7 +153,7 @@ } /*! \internal - This is used to create the masked progress groove. can be overrideen by derived class + This is used to create the masked progress groove.This can be overrideen by derived class */ QGraphicsItem *HbSliderControlPrivate::createProgressGroove() { @@ -255,7 +206,7 @@ } /*! - This api returns true if pos in on handle rect + This api returns true if pos in on handle boundingRect */ bool HbSliderControlPrivate::onHandle( QPointF pos ) { @@ -323,92 +274,6 @@ return ( q->sliderPosition( ) ); } -void HbSliderControlPrivate::createSliderTicks( ) -{ - - Q_Q ( HbSliderControl); - if (! tickmarksLeft) { - tickmarksLeft = new HbSliderTickmarks(q); - tickmarksLeft->setTickPosition (Hb::SliderTicksLeft); - } - if (!tickmarksRight) { - tickmarksRight = new HbSliderTickmarks(q); - tickmarksRight->setTickPosition ( Hb::SliderTicksRight); - } - if ( orientation == Qt::Vertical ) { - HbStyle::setItemName( tickmarksLeft, "tick-marksleft" ); - HbStyle::setItemName( tickmarksRight, "tick-marksright" ); - } else { - HbStyle::setItemName( tickmarksLeft, "tick-marksabove" ); - HbStyle::setItemName( tickmarksRight, "tick-marksbelow" ); - } -} - -void HbSliderControlPrivate::positionTickMarks( ) -{ - Q_Q (HbSliderControl); - if (!tickmarksLeft||!tickmarksRight) { - return; - } - // SliderTickLeft and SliderTicksAbove value is same - if ( tickPosition & Hb::SliderTicksLeft) { - tickmarksLeft->createIcons(true); - } else { - tickmarksLeft->createIcons(false); - } - if ( tickPosition & Hb::SliderTicksRight ) { - tickmarksRight->createIcons(true); - } else { - tickmarksRight->createIcons(false); - } - if ( orientation == Qt::Vertical ) { - if ( tickPosition & Hb::SliderTicksAbsolute) { - q->setLayoutDirection (Qt::LeftToRight ); - } - } -} - -void HbSliderControlPrivate::createSliderTickLabels( ) -{ - Q_Q(HbSliderControl); - if (! tickmarkslabelLeft) { - tickmarkslabelLeft = new HbSliderTickmarksLabel(q); - tickmarkslabelLeft->setTickPosition (Hb::SliderTicksLeft); - } - if (!tickmarkslabelRight) { - tickmarkslabelRight = new HbSliderTickmarksLabel(q); - tickmarkslabelRight->setTickPosition (Hb::SliderTicksRight ); - } - if ( orientation == Qt::Horizontal ) { - HbStyle::setItemName( tickmarkslabelLeft, "tick-textsabove" ); - HbStyle::setItemName( tickmarkslabelRight, "tick-textsbelow" ); - } else { - HbStyle::setItemName( tickmarkslabelLeft, "tick-textsleft" ); - HbStyle::setItemName( tickmarkslabelRight, "tick-textsright" ); - } - -} - - -void HbSliderControlPrivate::positionTickMarksLabel( ) -{ - if (!tickmarkslabelLeft||!tickmarkslabelRight) { - return; - } - // SliderTickLeft and SliderTicksAbove value is same - if ( tickPosition & Hb::SliderTicksLeft) { - tickmarkslabelLeft->createText(true); - } else { - tickmarkslabelLeft->createText(false); - } - if ( tickPosition & Hb::SliderTicksRight ) { - tickmarkslabelRight->createText(true); - } else { - tickmarkslabelRight->createText(false); - } -} - - /*! Constructs a slider control with \a parent. */ @@ -482,26 +347,7 @@ Q_D( HbSliderControl ); if ( d->tickPosition != position ) { d->tickPosition = position; - unsetLayoutDirection( ); - if ( position == Hb::NoSliderTicks) { - d->deleteTickAndLabel( ); - } else { - if ( (!d->tickmarksLeft || !d->tickmarksRight) && d->majorTickInterval > 0) { - d->createSliderTicks( ); - d->positionTickMarks( ); - repolish( ); - - } - if ( (!d->tickmarkslabelLeft || !d->tickmarkslabelRight) && d->majorTickInterval > 0 && - (!d->majorLabel.isEmpty( ) || (!d->minorLabel.isEmpty( ) && d->minorTickInterval > 0) ) ) { - d->createSliderTickLabels( ); - d->positionTickMarksLabel ( ); - repolish( ); - } - d->positionTickMarks( ); - d->positionTickMarksLabel( ); - } - } + } } /*! @@ -531,29 +377,7 @@ Q_D( HbSliderControl ); if ( d->majorTickInterval != interval ) { d->majorTickInterval = qAbs ( interval ); - if (interval <= 0 ) { - d->deleteTickAndLabel(); - repolish(); - } else if( d->tickPosition!=Hb::NoSliderTicks) { - if( !d->tickmarksLeft || !d->tickmarksRight) { - d->createSliderTicks( ); - d->positionTickMarks( ); - repolish( ); - } else { - d->tickmarksLeft->updateTicks( ); - d->tickmarksRight->updateTicks( ); - } - if ( (!d->tickmarkslabelRight || !d->tickmarkslabelLeft) && (!d->majorLabel.isEmpty( ) || - (d->minorTickInterval >0 &&! d->minorLabel.isEmpty( )))) { - d->createSliderTickLabels( ); - d->positionTickMarksLabel( ); - repolish( ); - } - if ( d->snappingMode == MajorTickSnapping ) { - updateSliderPosToTick( ); - } - } } } @@ -582,15 +406,6 @@ Q_D( HbSliderControl ); if ( d->minorTickInterval != interval ) { d->minorTickInterval = qAbs ( interval ); - if ( d->tickmarksLeft && d->tickmarksRight ) { - d->tickmarksLeft->updateTicks( ); - d->tickmarksRight->updateTicks( ); - } - if ( d->majorTickInterval > 0 && ( !d->minorLabel.isEmpty() && d->minorTickInterval > 0) && - (!d->tickmarkslabelLeft || !d->tickmarkslabelRight) && d->tickPosition!=Hb::NoSliderTicks) { - d->createSliderTickLabels( ); - repolish( ); - } if ( d->snappingMode == MinorTickSnapping && d->minorTickInterval > 0 && d->tickPosition!= Hb::NoSliderTicks ) { updateSliderPosToTick( ); } @@ -630,7 +445,10 @@ specify empty string ( "" ) for that item in the string list. case 4: if both major & minor tickinterval are same,then only majortickLabel - strings are taken into account for drawing the labelItem + strings are taken into account for drawing the labelItem. + + case 5: If you want to remove the majorticklabel from the slider, pass the empty + stringlist as the argument \sa majorTickLabels( ) */ @@ -638,28 +456,7 @@ { Q_D( HbSliderControl ); d->majorLabel = majorTickLabels; - if (d->majorLabel.isEmpty( ) && (d->minorLabel.isEmpty( )|| d->minorTickInterval <=0) ) { - if (d->tickmarkslabelLeft) { - delete d->tickmarkslabelLeft; - d->tickmarkslabelLeft =0; - } - if( d->tickmarkslabelRight) { - delete d->tickmarkslabelRight; - d->tickmarkslabelRight =0; - } - repolish( ); - } else { - if ((!d->tickmarkslabelLeft || !d->tickmarkslabelRight) && !d->majorLabel.isEmpty( ) && - d->majorTickInterval > 0 && d->tickPosition!=Hb::NoSliderTicks) { - d->createSliderTickLabels( ); - d->positionTickMarksLabel( ); - repolish( ); - } else if ( d->tickmarkslabelLeft && d->tickmarkslabelRight ) { - d->tickmarkslabelLeft->updateTickLabels( ); - d->tickmarkslabelRight->updateTickLabels( ); - } - } } /*! @@ -684,25 +481,6 @@ { Q_D( HbSliderControl ); d->minorLabel = minorTickLabels; - if (d->majorLabel.isEmpty( ) && (d->minorLabel.isEmpty( )|| d->minorTickInterval <=0) ) { - if (d->tickmarkslabelLeft) { - delete d->tickmarkslabelLeft; - } - if( d->tickmarkslabelRight) { - delete d->tickmarkslabelRight; - } - repolish( ); - - } else { - if ((!d->tickmarkslabelLeft || !d->tickmarkslabelRight) && - d->majorTickInterval > 0 && d->tickPosition!=Hb::NoSliderTicks) { - d->createSliderTickLabels( ); - repolish( ); - } else if ( d->tickmarkslabelLeft && d->tickmarkslabelRight) { - d->tickmarkslabelLeft->updateTickLabels( ); - d->tickmarkslabelRight->updateTickLabels( ); - } - } } @@ -736,7 +514,7 @@ } /*! - This will enable/disable current value diplay as tooltip + This will enable/disable current value display as tooltip on thumb drag */ void HbSliderControl::setToolTipVisible( bool value ) @@ -786,7 +564,6 @@ switch ( event->type( ) ) { case QEvent::LayoutDirectionChange: d->adjustHandle( ); - d->updateTickAndLabel( ); break; case QEvent::StyleChange: // HbSlider::boundingRect( ) result depends on current style @@ -820,7 +597,7 @@ { Q_D( HbSliderControl ); if ( isSliderDown( ) && d->displayCurrValueToolTip ) { - HbToolTip::showText( toolTip( ) , d->handle , d->toolTipAlignment ); + HbToolTip::showText( toolTip( ) , d->handle->primitive(HbStyle::P_SliderElement_touchhandle) , d->toolTipAlignment ); } } @@ -905,7 +682,7 @@ static_cast( handlePos ),static_cast( span ),opt.upsideDown ); //update the groove and touch item style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt ); - // if default is set then dont increment or decrement slider value + // if default is set then do not increment or decrement slider value // just set default value to slider if ( d->setDefault ) { setValue( d->previousValue ); @@ -995,7 +772,10 @@ #endif } +/*! + reimp +*/ #ifdef HB_GESTURE_FW void HbSliderControl::gestureEvent(QGestureEvent *event) { @@ -1071,12 +851,31 @@ static_cast( handlePos ),static_cast( span ),opt.upsideDown ); - // if default is set then dont increment or decrement slider value + // if default is set then don't increment or decrement slider value // just set default value to slider setSliderPosition( pressValue ); triggerAction( SliderMove ); setRepeatAction( SliderNoAction, pressValue ); + HbWidgetFeedback::triggered( this, Hb::InstantReleased ); + if ( d->groovePressed ) { +#ifdef HB_EFFECTS + if( orientation( ) == Qt::Horizontal ) { + HbEffectInternal::add( HB_SLIDERCONTROL_TYPE,"slider_h_trackrelease", "h_trackrelease" ); + HbEffect::start( d->groove, HB_SLIDERCONTROL_TYPE, "h_trackrelease" ); + } else { + HbEffectInternal::add( HB_SLIDERCONTROL_TYPE,"slider_v_trackrelease", "v_trackrelease" ); + HbEffect::start( d->groove, HB_SLIDERCONTROL_TYPE, "v_trackrelease" ); + } +#endif + HbStyleOptionSlider opt; + d->groovePressed = false; + initStyleOption( &opt ); + // update primitive from press to normal + style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt ); } + } + break; + case Qt::GestureCanceled: { if ( d->groovePressed ) { #ifdef HB_EFFECTS @@ -1095,6 +894,8 @@ style( )->updatePrimitive( d->groove, HbStyle::P_Slider_groove, &opt ); } } + break; + default: break; } @@ -1104,6 +905,7 @@ case Qt::GestureStarted: case Qt::GestureUpdated:{ QPointF startPoint = event->mapToGraphicsScene(panGesture->offset()+panGesture->startPos( ) ); + //if the position is on thumb , then start moving the thumb if( ( d->onHandle( startPoint) && d->grooveTouchArea->sceneBoundingRect( ).contains( startPoint))||isSliderDown( ) ) { qreal handlePos = 0; qreal span = 0; @@ -1145,8 +947,18 @@ HbWidgetFeedback::triggered( this, Hb::InstantPressed ); event->ignore(); break; - } + } else { + setSliderDown( false ); + d->groovePressed = false; + updatePrimitives( ); + d->handle->updatePrimitives(); + d->handleMoving = false; + event->ignore(); + HbAbstractSliderControl::gestureEvent(event); + } + } + break; case Qt::GestureFinished: case Qt::GestureCanceled: { setSliderDown( false ); @@ -1154,15 +966,17 @@ updatePrimitives( ); d->handle->updatePrimitives(); d->handleMoving = false; + int pressValue = sliderPosition(); + setRepeatAction( SliderNoAction,static_cast( pressValue ) ); event->ignore(); HbAbstractSliderControl::gestureEvent(event); } + break; default: break; } } - // HbAbstractSliderControl::gestureEvent(event); } #endif @@ -1170,7 +984,7 @@ bool HbSliderControl::sceneEventFilter(QGraphicsItem *obj,QEvent *event) { Q_D(HbSliderControl); - if( obj == d->grooveTouchArea) { + if( obj == d->grooveTouchArea ) { if (!isEnabled() ) { return false; } @@ -1181,6 +995,12 @@ } else if ( obj == d->handle) { event->ignore(); + if (event->type() == QEvent::Gesture){ + QGestureEvent *gestureEvent = static_cast (event); + foreach(QGesture *g, gestureEvent->gestures()) { + gestureEvent->ignore(g); + } + } } return false; } @@ -1208,7 +1028,6 @@ updatePrimitives( ); repolish(); d->adjustHandle( ); - d->updateTickAndLabel( ); } /*! reimp @@ -1216,16 +1035,12 @@ */ void HbSliderControl::polish( HbStyleParameters& params ) { - Q_D( HbSliderControl ); HbStyleOptionSlider option; initStyleOption( &option ); HbAbstractSliderControl::polish( params ); d->adjustHandle( ); - d->updateTickAndLabel(); updatePrimitives( ); - - } /*! @@ -1265,11 +1080,11 @@ QRectF handleBounds = d->handle->boundingRect( ); qreal span = 0; if ( orientation( ) == Qt::Horizontal ) { - bounds.adjust( 0, 0, -handleBounds.width( )/2, 0 ); + bounds.adjust( 0, 0, -handleBounds.width( ), 0 ); // calculating span span = bounds.width( ); } else { - bounds.adjust( 0, 0, 0, -handleBounds.height( )/2 ); + bounds.adjust( 0, 0, 0, -handleBounds.height( ) ); // calculating span span = bounds.height( ); } @@ -1331,7 +1146,7 @@ } } -bool HbSliderControl::handleVisible() const +bool HbSliderControl::handleVisible( ) const { Q_D( const HbSliderControl ); return d->handle->isVisible(); @@ -1347,52 +1162,17 @@ d->adjustHandle( ); if ( change == SliderOrientationChange ) { //Layout is not mirrored in vertical orientation with absolute ticks - if ( d->orientation == Qt::Horizontal ) { - } else if ( d->tickPosition&Hb::SliderTicksAbsolute) { - setLayoutDirection (Qt::LeftToRight); - } if(d->orientation ==Qt::Horizontal) { - unsetLayoutDirection( ); if (!d->userDefinedTooltipAlign) { d->toolTipAlignment = ( Qt::AlignTop|Qt::AlignHCenter ); } - setProperty("orientation",(Qt::Orientation)1); - if ( d->tickmarksLeft && d->tickmarksRight) { - HbStyle::setItemName( d->tickmarksLeft, "tick-marksabove" ); - HbStyle::setItemName( d->tickmarksRight, "tick-marksbelow" ); - } - if ( d->tickmarkslabelLeft && d->tickmarkslabelRight ) { - HbStyle::setItemName( d->tickmarkslabelLeft, "tick-textsabove" ); - HbStyle::setItemName( d->tickmarkslabelRight, "tick-textsbelow" ); - } - } else { - setProperty("orientation",(Qt::Orientation)2); - if ( d->tickPosition & Hb::SliderTicksAbsolute) { - setLayoutDirection (Qt::LeftToRight); + if (!d->userDefinedTooltipAlign) { + // Bug in tooltip, cannot align it with top right + d->toolTipAlignment = ( Qt::AlignTop|Qt::AlignHCenter ); } - if (!d->userDefinedTooltipAlign) { - d->toolTipAlignment = ( Qt::AlignTop|Qt::AlignRight ); - } - if ( d->tickmarksLeft && d->tickmarksRight) { - HbStyle::setItemName( d->tickmarksLeft, "tick-marksleft" ); - HbStyle::setItemName( d->tickmarksRight, "tick-marksright" ); - if ( d->tickPosition & Hb::SliderTicksAbsolute ) { - setLayoutDirection (Qt::LeftToRight ); - } - } - if ( d->tickmarkslabelLeft && d->tickmarkslabelRight ) { - HbStyle::setItemName( d->tickmarkslabelLeft, "tick-textsleft" ); - HbStyle::setItemName( d->tickmarkslabelRight, "tick-textsright" ); - } - } repolish( ); - if ( d->tickmarkslabelLeft && d->tickmarkslabelRight ) { - d->tickmarkslabelLeft->updateTickLabels( ); - d->tickmarkslabelRight->updateTickLabels( ); - } - } } @@ -1501,7 +1281,7 @@ } /*! - snapp slider values + snap to slider values */ void HbSliderControl::updateSliderPosToTick( ) { @@ -1553,7 +1333,7 @@ ungrabGesture(Qt::TapGesture); ungrabGesture(Qt::PanGesture); touchArea->grabGesture(Qt::TapGesture); - touchArea->grabGesture(Qt::PanGesture,Qt::ReceivePartialGestures); + touchArea->grabGesture(Qt::PanGesture); #endif } } @@ -1568,6 +1348,19 @@ Q_D( HbSliderControl ); return d->trackHandlingEnable ; } +/*! + Gets the size of the handle + */ + +QSizeF HbSliderControl::getHandleSize ( ) +{ + Q_D( HbSliderControl ); + return d->handle->size( ) ; +} + +/*! + fills the track upto the current value if \a trackVisible is true + */ void HbSliderControl::setTrackFilled(bool trackVisible ) { @@ -1592,7 +1385,9 @@ } - +/*! + Returns whether the track is filled upto the current value or not + */ bool HbSliderControl::isTrackFilled() const { Q_D( const HbSliderControl ); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslidercontrol_p.h --- a/src/hbwidgets/sliders/hbslidercontrol_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslidercontrol_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -98,6 +98,7 @@ void setTrackFilled(bool trackVisible ); bool isTrackFilled() const; + QSizeF getHandleSize() ; public slots: void updateTheme(); diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslidercontrol_p_p.h --- a/src/hbwidgets/sliders/hbslidercontrol_p_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslidercontrol_p_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -49,17 +49,11 @@ void adjustHandle(); bool onHandle(QPointF pos); int getNearbyTick(); - void updateTickAndLabel(); - void deleteTickAndLabel(); - virtual HbSliderHandle *createHandle(); virtual QGraphicsItem *createGroove(); virtual QGraphicsItem *createProgressGroove(); - void createSliderTicks( ); - void positionTickMarks( ); - void createSliderTickLabels( ); - void positionTickMarksLabel ( ); + HbSliderHandle *handle; Hb::SliderTickPositions tickPosition; HbSliderControl::SnappingMode snappingMode; @@ -67,10 +61,8 @@ int minorTickInterval; QGraphicsItem *groove; QGraphicsItem *progressGroove; - HbSliderTickmarks *tickmarksLeft; - HbSliderTickmarks *tickmarksRight; - HbSliderTickmarksLabel *tickmarkslabelLeft; - HbSliderTickmarksLabel *tickmarkslabelRight; + + bool displayCurrValueToolTip; QPointF oldPos; Qt::Alignment toolTipAlignment; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbsliderhandle.cpp --- a/src/hbwidgets/sliders/hbsliderhandle.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbsliderhandle.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -40,6 +40,7 @@ #ifdef HB_GESTURE_FW #include #include +#include #endif /*! This is internal class for HbSlider @@ -63,6 +64,7 @@ // create handle icon item gItem = slider->style()->createPrimitive(HbStyle::P_Slider_thumb, this); HbStyle::setItemName(gItem , "icon"); + setFiltersChildEvents(true) ; // create touch area for handle touchItem = slider->style()->createPrimitive(HbStyle::P_SliderElement_touchhandle, this); @@ -72,11 +74,12 @@ #ifdef HB_GESTURE_FW grabGesture(Qt::TapGesture); grabGesture(Qt::PanGesture); + grabGesture(Qt::TapAndHoldGesture); if(touchItem) { if(QGraphicsObject *touchArea = touchItem->toGraphicsObject()) { - Q_UNUSED(touchArea); - touchArea->grabGesture(Qt::PanGesture); - touchArea->grabGesture(Qt::TapGesture); + touchArea->grabGesture(Qt::PanGesture); + touchArea->grabGesture(Qt::TapGesture); + touchArea->grabGesture(Qt::TapAndHoldGesture); } } #endif @@ -96,6 +99,8 @@ #endif } + + /*! Destroys the slider handle. */ @@ -162,7 +167,6 @@ mHandleItem->removeSceneEventFilter(this); mHandleItem->installSceneEventFilter(this); } - mHandleItem->setFlag(QGraphicsItem::ItemIsMovable,true);//required as the press has to be accepted to filter move events. } @@ -188,20 +192,29 @@ } bool HbSliderHandle::sceneEventFilter(QGraphicsItem *obj,QEvent *event) { - //TODO: touch area doesnt work with the current filtering mechanism. find better solution + //TODO: touch area does not work with the current filtering mechanism. find better solution if( obj == mHandleItem) { - if(event->type() == QEvent::GraphicsSceneMouseMove){ - mouseMoveEvent ( (QGraphicsSceneMouseEvent *) event ) ; - return true; - } - else if (event->type() == QEvent::GraphicsSceneMousePress){ - mousePressEvent((QGraphicsSceneMouseEvent *) event); - } - else if (event->type() == QEvent::GraphicsSceneMouseRelease){ - mouseReleaseEvent((QGraphicsSceneMouseEvent *) event); - } + if(event->type() == QEvent::GraphicsSceneMouseMove){ + mouseMoveEvent ((QGraphicsSceneMouseEvent *) event) ; + return true; + } else if (event->type() == QEvent::GraphicsSceneMousePress){ + mousePressEvent((QGraphicsSceneMouseEvent *) event); + return true; + } else if (event->type() == QEvent::GraphicsSceneMouseRelease){ + mouseReleaseEvent((QGraphicsSceneMouseEvent *) event); + return true; + } } - return false; + if( obj == touchItem ) { + if (!isEnabled() ) { + return false; + } + if (event->type() == QEvent::Gesture){ + gestureEvent( (QGestureEvent *) (event)); + return true; + } + } + return false; } /*! @@ -210,6 +223,7 @@ */ void HbSliderHandle::mousePressEvent(QGraphicsSceneMouseEvent *event) { +#ifndef HB_GESTURE_FW qreal span = 0; HbWidget::mousePressEvent(event); QRectF sliderBounds=sliderControl->boundingRect(); @@ -239,6 +253,9 @@ updatePrimitives(); } event->accept(); +#else + Q_UNUSED(event) +#endif } /*! @@ -247,6 +264,7 @@ */ void HbSliderHandle::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { +#ifndef HB_GESTURE_FW HbWidget::mouseReleaseEvent(event); #ifdef HB_EFFECTS if( sliderControl->orientation() == Qt::Horizontal ) { @@ -270,6 +288,9 @@ sliderControl->updateSliderPosToTick(); } updatePrimitives(); +#else + Q_UNUSED(event) +#endif } /*! @@ -278,6 +299,7 @@ */ void HbSliderHandle::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { +#ifndef HB_GESTURE_FW qreal span = 0; HbWidget::mouseMoveEvent(event); QRectF sliderBounds=sliderControl->boundingRect(); @@ -312,6 +334,9 @@ sliderPos, static_cast(span),opt.upsideDown); sliderControl->setSliderPosition(pressValue); sliderControl->showToolTip(); +#else + Q_UNUSED(event) +#endif } /*! @@ -319,9 +344,123 @@ */ void HbSliderHandle::gestureEvent(QGestureEvent *event) -{ - Q_UNUSED(event); - // HbWidgetBase::gestureEvent() ignores, overriding to accept +{ + if(HbTapAndHoldGesture *tapandHold= qobject_cast(event->gesture(Qt::TapAndHoldGesture))) { + if(tapandHold->state() == Qt::GestureStarted) { + sliderControl->showToolTip(); + } + } + if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { + switch(tap->state()) { + case Qt::GestureStarted: { + if (!sliderControl->isSliderDown( ) ) { + sliderControl->setSliderDown(true); + updatePrimitives(); + } + HbWidgetFeedback::triggered(sliderControl, Hb::InstantPressed, Hb::ModifierSliderHandle); + if (scene()){ + HbStyleOptionSlider opt; + sliderControl->initStyleOption(&opt); + if (sliderControl->orientation() == Qt::Horizontal) { +#ifdef HB_EFFECTS + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "h_thumbpress"); +#endif + } else { +#ifdef HB_EFFECTS + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "v_thumbpress"); +#endif + } + event->accept(); + } + } + break; + case Qt::GestureFinished: + { +#ifdef HB_EFFECTS + if( sliderControl->orientation() == Qt::Horizontal ) { + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "h_thumbrelease"); + } else { + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "v_thumbrelease"); + } +#endif + HbWidgetFeedback::triggered(sliderControl, Hb::InstantReleased, Hb::ModifierSliderHandle); + sliderControl->setSliderDown(false); + updatePrimitives(); + break; + } + default: + break; + + } + } + if (HbPanGesture *panGesture = qobject_cast(event->gesture(Qt::PanGesture))) { + switch(panGesture->state( )) { + case Qt::GestureStarted: + case Qt::GestureUpdated:{ + QPointF eventScenePos =panGesture->sceneOffset( )+panGesture->sceneStartPos( ); + QPointF relativePos = mapToParent( mapFromScene(eventScenePos )); + qreal span = 0; + QRectF sliderBounds=sliderControl->boundingRect(); + QRectF handleBounds=boundingRect(); + HbStyleOptionSlider opt; + sliderControl->initStyleOption(&opt); + int sliderPos; + if ( sliderControl->orientation() == Qt::Horizontal ) { +#ifdef HB_EFFECTS + if( sliderBounds.topLeft().x() > relativePos.rx( ) || + sliderBounds.bottomRight().x() < relativePos.rx()) { + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "h_outofbound"); + } +#endif + sliderBounds.adjust(0, 0, -handleBounds.width(), 0); + span = sliderBounds.width(); + sliderPos = relativePos.rx(); + sliderPos-=handleBounds.width()/2; + } else { +#ifdef HB_EFFECTS + if( sliderBounds.topLeft().y() > relativePos.ry() || + sliderBounds.bottomRight().y() < relativePos.ry()) { + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "v_outofbound"); + } +#endif + sliderBounds.adjust(0, 0, 0, -handleBounds.height()); + span = sliderBounds.height(); + sliderPos = relativePos.ry(); + sliderPos -= handleBounds.height() / 2; + + } + int pressValue= QStyle::sliderValueFromPosition(opt.minimum, opt.maximum, + sliderPos, static_cast(span),opt.upsideDown); + sliderControl->setSliderPosition(pressValue); + sliderControl->showToolTip(); + break; + } + case Qt::GestureFinished: + case Qt::GestureCanceled: { +#ifdef HB_EFFECTS + if( sliderControl->orientation() == Qt::Horizontal ) { + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "h_thumbrelease"); + } else { + HbEffect::start(gItem, HB_SLIDERHANDLE_TYPE, "v_thumbrelease"); + } +#endif + HbWidgetFeedback::triggered(sliderControl, Hb::InstantReleased, Hb::ModifierSliderHandle); + sliderControl->setSliderDown(false); + QRectF controlRect = sliderControl->sceneBoundingRect(); + if(sliderControl->singleStep() != 0) { + HbWidgetFeedback::continuousStopped(sliderControl, Hb::ContinuousDragged); + } + if( sliderControl->snappingMode()!= HbSliderControl::NoSnapping ){ + sliderControl->updateSliderPosToTick(); + } + updatePrimitives(); + break; + } + default: + break; + } + } + } /*! diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbsliderhandle_p.h --- a/src/hbwidgets/sliders/hbsliderhandle_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbsliderhandle_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -71,7 +71,6 @@ virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event); virtual void gestureEvent(QGestureEvent *event); - //void updatePrimitive(); //virtual void polish( HbStyleParameters& params ); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslidertickmarks.cpp --- a/src/hbwidgets/sliders/hbslidertickmarks.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslidertickmarks.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,14 +25,24 @@ #include "hbslidertickmarks_p.h" #include "hbwidget_p.h" -#include "hbslidercontrol_p.h" #include "hbsliderhandle_p.h" +#include "hbslider_p.h" #include #include -#include #include #include +#include #include +#include +#include +#include + + +#ifdef HB_EFFECTS +#include "hbeffect.h" +#include "hbeffectinternal_p.h" +#define HB_SLIDER_TYPE "HB_SLIDER" +#endif @@ -45,55 +55,49 @@ public: HbSliderTickmarksPrivate(); - void createTicks( ); - void updateTickSize( ); HbStyleOptionSlider sliderOption; QList tickmarkmajorIcons; QList tickmarkminorIcons; - HbSliderControl *sliderControl; + HbSlider *slider; Hb::SliderTickPositions tickPosition; - bool createIcons; - int majorTickWidth; - int minorTickWidth; - int majorTickHeight; - int minorTickHeight; + qreal majorTickWidth; + qreal minorTickWidth; + qreal majorTickHeight; + qreal minorTickHeight; + Qt::Orientation sliderOrientation; }; HbSliderTickmarksPrivate::HbSliderTickmarksPrivate() :HbWidgetPrivate(){ tickmarkmajorIcons.clear(); tickmarkminorIcons.clear(); - sliderControl = 0; + slider = 0; tickPosition = Hb::NoSliderTicks; - createIcons = true; majorTickWidth = 0; minorTickWidth = 0; majorTickHeight = 0; minorTickHeight = 0; + sliderOrientation = Qt::Vertical; } - -void HbSliderTickmarksPrivate::createTicks( ) +void HbSliderTickmarks::createTicks( ) { - Q_Q ( HbSliderTickmarks ); - if(!createIcons){ - return; - } - int minimum = sliderControl->minimum(); - int maximum = sliderControl->maximum(); - int majorTickInterval = sliderControl->majorTickInterval ( ); - int minorTickInterval = sliderControl->minorTickInterval ( ); + Q_D ( HbSliderTickmarks ); + int minimum = d->slider->minimum(); + int maximum =d->slider->maximum(); + int majorTickInterval = d->slider->majorTickInterval ( ); + int minorTickInterval =d-> slider->minorTickInterval ( ); if (majorTickInterval) { int totalMajorTicks = ((maximum-minimum)/majorTickInterval)+1; - int majorIconListLength = tickmarkmajorIcons.length(); + int majorIconListLength = d->tickmarkmajorIcons.length(); for (int i=majorIconListLength;istyle()->createPrimitive(HbStyle::P_SliderTickMark_majoricon, q); + QGraphicsItem *iconItem =style()->createPrimitive(HbStyle::P_SliderTickMark_majoricon, this); Q_ASSERT(iconItem->isWidget()); - tickmarkmajorIcons.append(static_cast(iconItem));//add newly defind primitive + d->tickmarkmajorIcons.append(static_cast(iconItem));//add newly defind primitive } - while ( totalMajorTicks < tickmarkmajorIcons.length() ) { - QGraphicsWidget *iconItem = tickmarkmajorIcons.at(totalMajorTicks); - tickmarkmajorIcons.removeAll(iconItem); + while ( totalMajorTicks < d->tickmarkmajorIcons.length() ) { + QGraphicsWidget *iconItem = d->tickmarkmajorIcons.at(totalMajorTicks); + d->tickmarkmajorIcons.removeAll(iconItem); delete iconItem; } } @@ -107,40 +111,27 @@ } } } - int minorIconListLength = tickmarkminorIcons.length(); + int minorIconListLength = d->tickmarkminorIcons.length(); for (int i=minorIconListLength;istyle()->createPrimitive(HbStyle::P_SliderTickMark_minoricon, q); + QGraphicsItem *iconItem = style()->createPrimitive(HbStyle::P_SliderTickMark_minoricon, this); Q_ASSERT(iconItem->isWidget()); - tickmarkminorIcons.append(static_cast(iconItem));//add newly defind primitive + d->tickmarkminorIcons.append(static_cast(iconItem));//add newly defind primitive } - while (totalMinorTicks < tickmarkminorIcons.length() ){ - QGraphicsWidget *iconItem = tickmarkminorIcons.at(totalMinorTicks); - tickmarkminorIcons.removeAll(iconItem); + while (totalMinorTicks < d->tickmarkminorIcons.length() ){ + QGraphicsWidget *iconItem = d->tickmarkminorIcons.at(totalMinorTicks); + d->tickmarkminorIcons.removeAll(iconItem); delete iconItem; } } else { - while (tickmarkminorIcons.length() > 0 ){ - QGraphicsWidget *iconItem = tickmarkminorIcons.at(0); - tickmarkminorIcons.removeAll(iconItem); + while (d->tickmarkminorIcons.length() > 0 ){ + QGraphicsWidget *iconItem = d->tickmarkminorIcons.at(0); + d->tickmarkminorIcons.removeAll(iconItem); delete iconItem; } } - q->setProperty("state", "normal"); + setProperty("state", "normal"); } -void HbSliderTickmarksPrivate::updateTickSize() -{ - for(int i=0;isetMinimumSize(majorTickWidth,majorTickHeight); - tickmarkmajorIcons.at(i)->setMaximumSize(majorTickWidth,majorTickHeight); - } - for(int i=0;isetMinimumSize(minorTickWidth,minorTickHeight); - tickmarkminorIcons.at(i)->setMaximumSize(minorTickWidth,minorTickHeight); - } - - -} void HbSliderTickmarks::resizeEvent(QGraphicsSceneResizeEvent *event) { @@ -163,8 +154,9 @@ { Q_D( HbSliderTickmarks ); d->q_ptr = this; - d->sliderControl=dynamic_cast( parentItem() ); - d->createTicks(); + d->slider=dynamic_cast( parentItem() ); + createTicks(); + d->sliderOrientation = d->slider->orientation( ); } /*! @@ -174,26 +166,7 @@ { } -void HbSliderTickmarks::createIcons( bool create ) -{ - Q_D(HbSliderTickmarks); - d->createIcons = create; - if (!create) { - while ( d->tickmarkmajorIcons.length() > 0) { - QGraphicsWidget *iconItem = d->tickmarkmajorIcons.at(0); - d->tickmarkmajorIcons.removeAll(iconItem); - delete iconItem; - } - while ( d->tickmarkminorIcons.length() > 0) { - QGraphicsWidget *iconItem = d->tickmarkminorIcons.at(0); - d->tickmarkminorIcons.removeAll(iconItem); - delete iconItem; - } - } else { - d->createTicks(); - } - } /*! updates the ticks whenever there is change in position or number of ticks */ @@ -201,26 +174,27 @@ void HbSliderTickmarks::updateTicks( ) { Q_D ( HbSliderTickmarks ); - if(!d->createIcons) { + int minimum = d->slider->minimum(); + int maximum = d->slider->maximum(); + int majorTickInterval = d->slider->majorTickInterval ( ); + int minorTickInterval = d->slider->minorTickInterval ( ); + qreal span = 0; + bool rtlLayout = (((d->slider->orientation()!=Qt::Vertical)&& + (HbApplication::layoutDirection() == Qt::LeftToRight))?false:true); + HbSliderPrivate *sliderPrivate = dynamic_cast(HbSliderPrivate::d_ptr(d->slider)); + QSizeF handleSize(0.0,0.0); + if( sliderPrivate) { + handleSize = sliderPrivate->getHandleSize( ); + } else { return; } - d->createTicks(); - d->updateTickSize(); - int minimum = d->sliderControl->minimum(); - int maximum = d->sliderControl->maximum(); - int majorTickInterval = d->sliderControl->majorTickInterval ( ); - int minorTickInterval = d->sliderControl->minorTickInterval ( ); - qreal span = 0; - bool rtlLayout = (((d->sliderControl->orientation()!=Qt::Vertical)&& - (HbApplication::layoutDirection() == Qt::LeftToRight))?false:true); - HbSliderHandle *handle = dynamic_cast (d->sliderControl->primitive (HbStyle::P_Slider_thumb)); - if ( d->sliderControl->orientation() == Qt::Horizontal) { - span = d->sliderControl->size().width(); - span-=handle->size().width(); + if ( d->slider->orientation() == Qt::Horizontal) { + span = boundingRect().width(); + span-=handleSize.width(); } - if ( d->sliderControl->orientation() == Qt::Vertical) { - span = d->sliderControl->size().height(); - span-=handle->size().height(); + if ( d->slider->orientation() == Qt::Vertical) { + span = boundingRect().height(); + span-=handleSize.height(); } if (majorTickInterval) { int totalMajorTicks = ((maximum-minimum)/majorTickInterval)+1; @@ -228,22 +202,20 @@ QGraphicsWidget *iconItem = d->tickmarkmajorIcons.at ( i); HbStyleOptionSlider opt; initStyleOption(&opt); - opt.orientation = d->sliderControl->orientation(); + opt.orientation = d->slider->orientation(); style()->updatePrimitive(iconItem,HbStyle::P_SliderTickMark_majoricon,&opt); int pos = QStyle::sliderPositionFromValue( minimum, maximum, minimum+majorTickInterval*i,static_cast( span ), rtlLayout ); - if ( d->sliderControl->orientation() == Qt::Horizontal) { - qreal correctedPosX = handle->size().width()/2+pos; - qreal correctedPosY = 0; - iconItem->setPos ( correctedPosX,correctedPosY ); - iconItem->update(); + qreal correctedPosX = 0; + qreal correctedPosY = 0; + if ( d->slider->orientation() == Qt::Horizontal) { + correctedPosX = handleSize.width()/2+pos; } else { - qreal correctedPosY = handle->size().height()/2+pos; - qreal correctedPosX =0; - iconItem->setPos ( correctedPosX,correctedPosY ); - iconItem->update(); + correctedPosY = handleSize.height()/2+pos; } + iconItem->setGeometry (QRectF( correctedPosX,correctedPosY ,d->majorTickWidth,d->majorTickHeight)); + iconItem->update(); } } if (minorTickInterval) { @@ -259,26 +231,23 @@ minorIndex++; HbStyleOptionSlider opt; initStyleOption(&opt); - opt.orientation = d->sliderControl->orientation(); + opt.orientation = d->slider->orientation(); style()->updatePrimitive(iconItem,HbStyle::P_SliderTickMark_minoricon,&opt); int pos = QStyle::sliderPositionFromValue( minimum, maximum, minimum+minorTickInterval*i,static_cast( span ), rtlLayout ); - - if ( d->sliderControl->orientation() == Qt::Horizontal) { - qreal correctedPosX = handle->size().width()/2+pos; - qreal correctedPosY = 0; - iconItem->setPos ( correctedPosX,correctedPosY ); - iconItem->update(); + qreal correctedPosX = 0; + qreal correctedPosY = 0; + if ( d->slider->orientation() == Qt::Horizontal) { + correctedPosX = handleSize.width()/2+pos; } else { - qreal correctedPosY = handle->size().height()/2+pos; - qreal correctedPosX =0; - iconItem->setPos ( correctedPosX,correctedPosY ); - iconItem->update(); - + correctedPosY = handleSize.height()/2+pos; } + iconItem->setGeometry (QRectF( correctedPosX,correctedPosY ,d->majorTickWidth,d->majorTickHeight)); + iconItem->update(); } } + update(boundingRect()); } /* ! @@ -316,16 +285,21 @@ void HbSliderTickmarks::polish( HbStyleParameters& params ) { Q_D (HbSliderTickmarks); - params.addParameter("fixed-width-major"); - params.addParameter("fixed-height-major"); - params.addParameter("fixed-width-minor"); - params.addParameter("fixed-height-minor"); - HbWidget::polish(params); - d->majorTickWidth = params.value("fixed-width-major").toInt(); - d->majorTickHeight = params.value("fixed-height-major").toInt(); - d->minorTickWidth = params.value("fixed-width-minor").toInt(); - d->minorTickHeight = params.value("fixed-height-minor").toInt(); - updateTicks(); + if (d->majorTickHeight == 0 || d->sliderOrientation!= d->slider->orientation() ) { + d->sliderOrientation = d->slider->orientation(); + params.addParameter("fixed-width-major"); + params.addParameter("fixed-height-major"); + params.addParameter("fixed-width-minor"); + params.addParameter("fixed-height-minor"); + HbWidget::polish(params); + d->majorTickWidth = params.value("fixed-width-major").toReal(); + d->majorTickHeight = params.value("fixed-height-major").toReal(); + d->minorTickWidth = params.value("fixed-width-minor").toReal(); + d->minorTickHeight = params.value("fixed-height-minor").toReal(); + } else { + HbWidget::polish(params); + updateTicks(); + } } //end of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslidertickmarks_p.h --- a/src/hbwidgets/sliders/hbslidertickmarks_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslidertickmarks_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -40,17 +40,13 @@ explicit HbSliderTickmarks( QGraphicsItem *parent = 0 ); ~HbSliderTickmarks(); - /* virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget );*/ - virtual void resizeEvent(QGraphicsSceneResizeEvent *event); - enum {Type = HbPrivate::ItemType_SliderTickmarks }; int type() const {return Type;} - - void createIcons(bool create); + virtual void resizeEvent(QGraphicsSceneResizeEvent *event); void updateTicks( ); void setTickPosition(Hb::SliderTickPositions position); - virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); + virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); + void createTicks( ); protected: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslidertickmarkslabel.cpp --- a/src/hbwidgets/sliders/hbslidertickmarkslabel.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslidertickmarkslabel.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,15 +25,18 @@ #include "hbslidertickmarkslabel_p.h" #include "hbslidercontrol_p.h" -#include "hbsliderhandle_p.h" +#include "hbslider_p.h" #include "hbwidget_p.h" #include #include #include #include #include +#include #include #include +#include +#include class HbSliderTickmarksLabelPrivate : public HbWidgetPrivate @@ -46,7 +49,7 @@ HbStyleOptionSlider sliderOption; QList tickmarkmajorIconItemsLabel; QList tickmarkminorIconItemsLabel; - HbSliderControl *sliderControl; + HbSlider *slider; Hb::SliderTickPositions tickPosition; bool createText; @@ -56,7 +59,7 @@ HbSliderTickmarksLabelPrivate::HbSliderTickmarksLabelPrivate() :HbWidgetPrivate(){ tickmarkmajorIconItemsLabel.clear(); tickmarkminorIconItemsLabel.clear(); - sliderControl = 0; + slider = 0; tickPosition = Hb::NoSliderTicks; createText = true; @@ -70,13 +73,14 @@ if (!createText) { return; } + bool textItemCreated = false; - int minimum = sliderControl->minimum(); - int maximum = sliderControl->maximum(); - QStringList majorLabelList = sliderControl->majorTickLabels( ); - QStringList minorLabelList = sliderControl->minorTickLabels( ); - int majorTickInterval = sliderControl->majorTickInterval ( ); - int minorTickInterval = sliderControl->minorTickInterval ( ); + int minimum = slider->minimum(); + int maximum = slider->maximum(); + QStringList majorLabelList = slider->majorTickLabels( ); + QStringList minorLabelList = slider->minorTickLabels( ); + int majorTickInterval = slider->majorTickInterval ( ); + int minorTickInterval = slider->minorTickInterval ( ); if (majorTickInterval) { int totalMajorTicksLabel = ((maximum-minimum)/majorTickInterval)+1; if (majorLabelList.length( ) < totalMajorTicksLabel ) { @@ -85,6 +89,7 @@ int majorLabelListLength = tickmarkmajorIconItemsLabel.length(); for (int i=majorLabelListLength;istyle()->createPrimitive(HbStyle::P_SliderTickMark_majorlabel, q); + textItemCreated = true; Q_ASSERT(textItem->isWidget()); tickmarkmajorIconItemsLabel.append(static_cast(textItem));//add newly defind primitive } @@ -111,6 +116,7 @@ int minorIconLabelListLength = tickmarkminorIconItemsLabel.length(); for (int i=minorIconLabelListLength;istyle()->createPrimitive(HbStyle::P_SliderTickMark_minorlabel, q); + textItemCreated = true; Q_ASSERT(textItem->isWidget()); tickmarkminorIconItemsLabel.append(static_cast(textItem));//add newly defind primitive } @@ -127,6 +133,9 @@ } } q->setProperty("state","normal"); + if( textItemCreated ) { + q->repolish(); +} } void HbSliderTickmarksLabel::resizeEvent(QGraphicsSceneResizeEvent *event) @@ -144,23 +153,48 @@ return; } d->createTickLabels(); - setLabelSize( ); - int minimum = d->sliderControl->minimum(); - int maximum = d->sliderControl->maximum(); - int majorTickInterval = d->sliderControl->majorTickInterval ( ); - int minorTickInterval = d->sliderControl->minorTickInterval ( ); + int totalMajorTicksLabel = d->tickmarkmajorIconItemsLabel.length(); + for (int i=0;itickmarkmajorIconItemsLabel.at ( i); + HbStyleOptionSlider opt; + initStyleOption(&opt); + opt.orientation = d->slider->orientation(); + opt.text = (d->slider->majorTickLabels( )).at(i); + style()->updatePrimitive(textItem,HbStyle::P_SliderTickMark_majorlabel,&opt); + } + int minimum = d->slider->minimum(); + int maximum = d->slider->maximum(); + int majorTickInterval = d->slider->majorTickInterval ( ); + int minorTickInterval = d->slider->minorTickInterval ( ); qreal span = 0; - bool rtlLayout = (((d->sliderControl->orientation( ) != Qt::Vertical) + bool rtlLayout = (((d->slider->orientation( ) != Qt::Vertical) &&(HbApplication::layoutDirection() == Qt::LeftToRight))?false:true); - HbSliderHandle *handle = dynamic_cast (d->sliderControl->primitive (HbStyle::P_Slider_thumb)); - if ( d->sliderControl->orientation() == Qt::Horizontal) { - span = d->sliderControl->size().width(); - span-=handle->size().width(); + HbSliderPrivate *sliderPrivate = dynamic_cast(HbSliderPrivate::d_ptr(d->slider)); + QSizeF handleSize(0.0,0.0); + if( sliderPrivate) { + handleSize = sliderPrivate->getHandleSize( ); + } else { + return; + } + if ( d->slider->orientation() == Qt::Horizontal) { + span = boundingRect().width(); + span-=handleSize.width(); } - if ( d->sliderControl->orientation() == Qt::Vertical) { - span = d->sliderControl->size().height(); - span-=handle->size().height(); + if ( d->slider->orientation() == Qt::Vertical) { + span = boundingRect().height(); + span-=handleSize.height(); } + int minPos = QStyle::sliderPositionFromValue( minimum, maximum, + minimum,static_cast( span ), rtlLayout ); + int firstMajorIntervalPos = QStyle::sliderPositionFromValue( minimum, maximum, + minimum+majorTickInterval,static_cast( span ), rtlLayout ); + + int firstMinorIntervalPos = QStyle::sliderPositionFromValue( minimum, maximum, + minimum+minorTickInterval,static_cast( span ), rtlLayout ); + + qreal totalMajorTextWidth = abs(firstMajorIntervalPos-minPos); + qreal totalMinorTextWidth = abs(firstMinorIntervalPos-minPos); + if (majorTickInterval) { int totalMajorTicksLabel = d->tickmarkmajorIconItemsLabel.length(); for (int i=0;i( span ), rtlLayout ); - if ( d->sliderControl->orientation() == Qt::Horizontal) { - textItem->setPreferredHeight(boundingRect().height()); + if ( d->slider->orientation() == Qt::Horizontal) { textItem->update(); - qreal correctedPosX = handle->size().width()/2+pos; - qreal tickWidth = textItem->boundingRect().size().width(); + qreal correctedPosX = handleSize.width()/2+pos; + qreal tickWidth = totalMajorTextWidth; correctedPosX -= tickWidth/2; qreal correctedPosY = 0; - textItem->setPos( correctedPosX,correctedPosY ); + qreal tickHeight = textItem->boundingRect().size().height(); + textItem->setGeometry( QRectF(correctedPosX,correctedPosY,tickWidth,tickHeight)); } else { - qreal correctedPosY = handle->size().height()/2+pos; + qreal correctedPosY = handleSize.height()/2+pos; qreal tickHeight = textItem->boundingRect().size().height(); correctedPosY-=tickHeight/2; qreal correctedPosX =0; - textItem->setPos ( correctedPosX,correctedPosY ); + qreal tickWidth = boundingRect().width(); + textItem->setGeometry ( QRectF(correctedPosX,correctedPosY,tickWidth,tickHeight )); textItem->setLayoutDirection (layoutDirection()); } } @@ -201,25 +236,29 @@ QGraphicsWidget *textItem = d->tickmarkminorIconItemsLabel.at ( minorIndex); HbStyleOptionSlider opt; initStyleOption(&opt); - opt.orientation = d->sliderControl->orientation(); - opt.text = (d->sliderControl->minorTickLabels( )).at(minorIndex); + opt.orientation = d->slider->orientation(); + opt.text = (d->slider->minorTickLabels( )).at(minorIndex); style()->updatePrimitive(textItem,HbStyle::P_SliderTickMark_minorlabel,&opt); minorIndex++; int pos = QStyle::sliderPositionFromValue( minimum, maximum, minimum+minorTickInterval*i,static_cast( span ), rtlLayout ); - if ( d->sliderControl->orientation() == Qt::Horizontal) { - qreal correctedPosX = handle->size().width()/2+pos; - qreal tickWidth = textItem->boundingRect().size().width(); - correctedPosX -= tickWidth/2; + if ( d->slider->orientation() == Qt::Horizontal) { + qreal correctedPosX = handleSize.width()/2+pos; + correctedPosX -= totalMinorTextWidth/2; qreal correctedPosY = 0; - textItem->setPos ( correctedPosX,correctedPosY ); + qreal tickHeight = textItem->boundingRect().size().height(); + textItem->setGeometry( QRectF(correctedPosX,correctedPosY,totalMinorTextWidth,tickHeight)); + } else { - qreal correctedPosY = handle->size().height()/2+pos; + qreal correctedPosY = handleSize.height()/2+pos; qreal tickHeight = textItem->boundingRect().size().height(); correctedPosY-=tickHeight/2; textItem->setLayoutDirection (layoutDirection()); qreal correctedPosX =0; - textItem->setPos ( correctedPosX,correctedPosY ); + qreal tickWidth = boundingRect().width(); + textItem->setGeometry ( QRectF(correctedPosX,correctedPosY,tickWidth,tickHeight )); + + } } } @@ -256,8 +295,11 @@ { Q_D( HbSliderTickmarksLabel ); d->q_ptr = this; - d->sliderControl=dynamic_cast( parentItem() ); + d->slider=dynamic_cast( parentItem() ); d->createTickLabels(); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemSendsGeometryChanges,true); +#endif } /*! @@ -267,120 +309,9 @@ { } -void HbSliderTickmarksLabel::setLabelSize() -{ - Q_D (HbSliderTickmarksLabel); - - int minimum = d->sliderControl->minimum(); - int maximum = d->sliderControl->maximum(); - int majorTickInterval = d->sliderControl->majorTickInterval ( ); - int minorTickInterval = d->sliderControl->minorTickInterval ( ); - qreal span = 0; - bool rtlLayout = (((d->sliderControl->orientation( ) != Qt::Vertical) - &&(HbApplication::layoutDirection() == Qt::LeftToRight))?false:true); - HbSliderHandle *handle = dynamic_cast (d->sliderControl->primitive (HbStyle::P_Slider_thumb)); - if ( d->sliderControl->orientation() == Qt::Horizontal) { - span = d->sliderControl->size().width(); - span-=handle->size().width(); - } - if ( d->sliderControl->orientation() == Qt::Vertical) { - span = d->sliderControl->size().height(); - span-=handle->size().height(); - } - int minPos = QStyle::sliderPositionFromValue( minimum, maximum, - minimum,static_cast( span ), rtlLayout ); - int firstMajorIntervalPos = QStyle::sliderPositionFromValue( minimum, maximum, - minimum+majorTickInterval,static_cast( span ), rtlLayout ); - - int firstMinorIntervalPos = QStyle::sliderPositionFromValue( minimum, maximum, - minimum+minorTickInterval,static_cast( span ), rtlLayout ); - - qreal totalMajorTextWidth = abs(firstMajorIntervalPos-minPos); - qreal totalMinorTextWidth = abs(firstMinorIntervalPos-minPos); - - if (majorTickInterval) { - int totalMajorTicksLabel = d->tickmarkmajorIconItemsLabel.length(); - for (int i=0;itickmarkmajorIconItemsLabel.at ( i); - HbStyleOptionSlider opt; - initStyleOption(&opt); - opt.orientation = d->sliderControl->orientation(); - opt.text = (d->sliderControl->majorTickLabels( )).at(i); - style()->updatePrimitive(textItem,HbStyle::P_SliderTickMark_majorlabel,&opt); - if ( d->sliderControl->orientation() == Qt::Horizontal) { - textItem->setMaximumHeight (boundingRect().height()); - textItem->setMinimumHeight (boundingRect().height()); - textItem->setMinimumWidth(totalMajorTextWidth); - textItem->setMaximumWidth(totalMajorTextWidth); - textItem->update(); - } else { - textItem->setMinimumWidth(boundingRect().width()); - textItem->setMaximumWidth(boundingRect().width()); - textItem->update( ); - } - } - } - if (minorTickInterval) { - int totalminorTicks = ((maximum-minimum)/minorTickInterval)+1; - int minorIndex = 0; - for (int i=0;itickmarkminorIconItemsLabel.length() ) { - QGraphicsWidget *textItem = d->tickmarkminorIconItemsLabel.at ( minorIndex); - minorIndex++; - if ( d->sliderControl->orientation() == Qt::Horizontal) { - textItem->setMaximumHeight (boundingRect().height()); - textItem->setMinimumHeight (boundingRect().height()); - textItem->setMinimumWidth(totalMinorTextWidth); - textItem->setMaximumWidth(totalMinorTextWidth); - textItem->update(); - } else { - textItem->setMinimumWidth(boundingRect().width()); - textItem->setMaximumWidth(boundingRect().width()); - textItem->update( ); - } - } - } - } -} - -void HbSliderTickmarksLabel::createText(bool create) -{ - Q_D(HbSliderTickmarksLabel); - d->createText = create; - if (!create) { - while ( d->tickmarkmajorIconItemsLabel.length() > 0) { - QGraphicsWidget *textItem = d->tickmarkmajorIconItemsLabel.at(0); - d->tickmarkmajorIconItemsLabel.removeAll(textItem); - delete textItem; - } - while ( d->tickmarkminorIconItemsLabel.length() > 0) { - QGraphicsWidget *textItem = d->tickmarkminorIconItemsLabel.at(0); - d->tickmarkminorIconItemsLabel.removeAll(textItem); - delete textItem; - } - } else { - d->createTickLabels(); - } - - -} - - void HbSliderTickmarksLabel::polish( HbStyleParameters& params ) { - Q_D (HbSliderTickmarksLabel); - d->createTickLabels(); - if( d->sliderControl->orientation( ) == Qt::Horizontal ) { - setProperty("orientation",(Qt::Orientation)1); - } else { - setProperty("orientation",(Qt::Orientation)2); - } HbWidget::polish(params); updateTickLabels(); } @@ -409,6 +340,14 @@ return HbWidget::itemChange( change, value ); } +bool HbSliderTickmarksLabel::event(QEvent *e) +{ + if(e->type( ) == QEvent::LayoutDirectionChange) { + updateTickLabels( ); + } + return HbWidget::event(e); +} + void HbSliderTickmarksLabel::initStyleOption( HbStyleOptionSlider *option ) const { @@ -417,11 +356,11 @@ return; } HbWidget::initStyleOption( option ); - option->orientation = d->sliderControl->orientation( ); - option->tickPosition = d->sliderControl->tickPosition( ); - option->upsideDown = ( d->sliderControl->orientation( ) == Qt::Horizontal ) - ? ( d->sliderControl->invertedAppearance( ) != ( option->direction == Qt::RightToLeft ) ) - : ( !d->sliderControl->invertedAppearance( ) ); + option->orientation = d->slider->orientation( ); + option->tickPosition = d->slider->tickPosition( ); + option->upsideDown = ( d->slider->orientation( ) == Qt::Horizontal ) + ? ( d->slider->invertedAppearance( ) != ( option->direction == Qt::RightToLeft ) ) + : ( !d->slider->invertedAppearance( ) ); // we use the upsideDown option instead } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbslidertickmarkslabel_p.h --- a/src/hbwidgets/sliders/hbslidertickmarkslabel_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbslidertickmarkslabel_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -33,6 +33,8 @@ class QStyleOption; class HbSliderTickmarksLabelPrivate; +class QEvent; + class HB_AUTOTEST_EXPORT HbSliderTickmarksLabel : public HbWidget { @@ -42,8 +44,6 @@ explicit HbSliderTickmarksLabel( QGraphicsItem *parent = 0 ); ~HbSliderTickmarksLabel(); - /* virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, - QWidget *widget );*/ virtual void resizeEvent(QGraphicsSceneResizeEvent *event); enum {Type = HbPrivate::ItemType_SliderTickmarksLabel }; @@ -51,8 +51,8 @@ void updateTickLabels( ); void setTickPosition(Hb::SliderTickPositions position); - void setLabelSize(); - void createText(bool create); + virtual bool event ( QEvent * event ); + protected: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbvolumeslider_p.cpp --- a/src/hbwidgets/sliders/hbvolumeslider_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbvolumeslider_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -123,6 +123,7 @@ void HbVolumeSliderPrivate::init( ) { Q_Q( HbVolumeSlider ); + sliderControl->setToolTipVisible(false); q->connect( q, SIGNAL( valueChanged( int ) ), q, SLOT( _q_valueChanged( int ) ) ); q->connect( q, SIGNAL( iconToggled( bool ) ), q, SLOT( _q_muteToggled( bool ) ) ); QList elements; @@ -244,6 +245,9 @@ } option.sliderElementIcon = icons.value( HbSlider::IconElement ); q->style( )->updatePrimitive( elementItemMap[HbSlider::IconElement].item,HbStyle::P_SliderElement_icon,&option ); + q->setProperty("changeincrementState" ,false); + q->setProperty("changedecrementState" ,false); + q->setProperty("state", "normal"); } @@ -401,6 +405,8 @@ Q_D( HbVolumeSlider ); HbSlider::mouseReleaseEvent( event ); d->stopRepeatAction( ); + setProperty("changeincrementState" ,false); + setProperty("changedecrementState" ,false); setProperty("state", "normal"); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/sliders/hbzoomslider_p.cpp --- a/src/hbwidgets/sliders/hbzoomslider_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/sliders/hbzoomslider_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -116,7 +116,7 @@ { Q_Q( HbZoomSlider ); mDefaultSet = false; - + sliderControl->setToolTipVisible(false); QList elements; elements << HbSlider::IncreaseElement << HbSlider::TrackElement diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcheckbox.cpp --- a/src/hbwidgets/widgets/hbcheckbox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcheckbox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -55,8 +55,9 @@ HbCheckBoxSpacer::HbCheckBoxSpacer( QGraphicsItem *parent ) : HbWidgetBase( parent ) { - // seems to be 4.6 only? - // setFlag( QGraphicsItem::ItemHasNoContents, true ); +#if QT_VERSION >= 0x040600 + setFlag(QGraphicsItem::ItemHasNoContents, true); +#endif } QSizeF HbCheckBoxSpacer::sizeHint( Qt::SizeHint which, const QSizeF &constraint ) const diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcheckbox.h --- a/src/hbwidgets/widgets/hbcheckbox.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcheckbox.h Thu Jul 22 16:36:53 2010 +0100 @@ -36,17 +36,21 @@ { Q_OBJECT Q_PROPERTY( QString text READ text WRITE setText ) - Q_PROPERTY(bool tristate READ isTristate WRITE setTristate) - Q_PROPERTY(Qt::CheckState checkState READ checkState WRITE setCheckState) + Q_PROPERTY( bool tristate READ isTristate WRITE setTristate ) + Q_PROPERTY( Qt::CheckState checkState READ checkState WRITE setCheckState ) public: explicit HbCheckBox( QGraphicsItem *parent = 0 ); explicit HbCheckBox( const QString &text, QGraphicsItem *parent = 0 ); - virtual ~HbCheckBox(); + virtual ~HbCheckBox( ); - enum { Type = Hb::ItemType_CheckBox }; - int type() const { return Type; } + enum { + Type = Hb::ItemType_CheckBox + }; + int type() const { + return Type; + } void setText( const QString &text ); QString text( ) const; @@ -56,7 +60,7 @@ Qt::CheckState checkState( ) const; - virtual QGraphicsItem *primitive(HbStyle::Primitive primitive) const; + virtual QGraphicsItem *primitive( HbStyle::Primitive primitive ) const; public slots: @@ -64,28 +68,32 @@ virtual void updatePrimitives(); protected: + void initStyleOption( HbStyleOptionCheckBox *option ) const; - void resizeEvent(QGraphicsSceneResizeEvent *event); + void resizeEvent( QGraphicsSceneResizeEvent *event ); virtual bool hitButton( const QPointF &pos ) const; virtual void checkStateSet( ); virtual void nextCheckState( ); #ifndef HB_GESTURE_FW void mouseReleaseEvent( QGraphicsSceneMouseEvent *event ); - void mouseMoveEvent(QGraphicsSceneMouseEvent *event); + void mouseMoveEvent( QGraphicsSceneMouseEvent *event ); #endif + #ifdef HB_GESTURE_FW - virtual void gestureEvent(QGestureEvent *event); + virtual void gestureEvent( QGestureEvent *event ); #endif - void keyPressEvent(QKeyEvent *keyEvent); + void keyPressEvent( QKeyEvent *keyEvent ); QVariant itemChange( GraphicsItemChange change, const QVariant &value ); signals: + void stateChanged ( int state ); private: - Q_DECLARE_PRIVATE_D(d_ptr, HbCheckBox) - Q_DISABLE_COPY(HbCheckBox) + + Q_DECLARE_PRIVATE_D( d_ptr, HbCheckBox ) + Q_DISABLE_COPY( HbCheckBox ) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcombobox.cpp --- a/src/hbwidgets/widgets/hbcombobox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcombobox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include #include @@ -47,9 +49,9 @@ in a way that takes up the minimum amount of screen space. A combobox is a selection widget that displays the currently selected item, - and can provides a drop-down list that permits selecting an item. + and provides a drop-down list that permits selecting an item. - A HbComboBox with currently Selected item + A HbComboBox with currently selected item \image html noneditablecombobox.png. @@ -57,71 +59,68 @@ \image html comboboxdropdownlist.png. - HbComboBox are of two types. + HbComboBox are of two types: - Editable: + 1: Editable: - If the comboBox is set to editable, touching the ComboBox label field invokes the VKB in - touch environments or accepts input from an attached keyboard. - choosing an element from the ComboBox dropdown list replaces the label - area with the chosen item. - on touching button area of the comboBox launches the drop-down list to select - the list of options - ( button area in comboBox behaves same in both editable and Non Editable comboBox ). + If combobox is set to editable, tapping on combobox label field invokes the VKB in + touch environments or accepts input from an attached keyboard. Tapping on + button area of combobox launches dropdown list. Choosing an element from + the combobox dropdown list replaces the label with the chosen item. Touch events on + combobox button behaves same in both editable and non-editable combobox. - Non Editable: + 2: Non Editable: - If the comboBox is set to Non Editable widget that displays the currently selected item - in the label field of ComboBox. - Touching the comboBox label field or button area of the comboBox will opens - the drop-down list to select an item from list of options. + If the combobox is set to non-editable then even tapping on label field will launch + drop down unlike editable combobox. Tapping on combobox button area behaves in + same way as in editable combobox. - By Default comboBox is Non Editable. + By default combobox is non-editable. - Application is responsible for setting the model to the HbComboBox, - If no model is set, the drop down list cannot be displayed at all. + Application is responsible for setting the model in combobox. If no model is set or model + set is empty then drop down list will not be displayed at all. Combobox owns the model set + by application. - HbComboBox owns the model set by the Application. + The number of rows to be displayed in HbComboBox drop down can be configured by overriding + HbComboBox css. By default number of items in drop down is 8 in portrait mode and 5 in + landscape mode. - HbComboBox provides three signals: + HbComboBox provides four signals: \li currentIndexChanged( index ) is emitted when the current selection in the combobox is - changed by user interaction. If application is setting a index/text then this signal is - not emmitted. In case of an editable combobox on combobox loosing focus if the current - selection has changed then this signal is emitted with the new model index. + changed either by user interaction or programmatically. \li currentIndexChanged( const QString& ) is emitted when the curret selection in the combobox is changed by user interaction. If application is setting a differnet index/text - then this signal is not emmitted. - In case of an editable combobox on combobox loosing focus if the current selection - has changed then this signal is emitted with the new string. + then this signal is not emmitted. + + \li editTextChanged( const QString& ) is emitted when text is changed in editable combobox. - \li editTextChanged( QString& ) is emitted when combobox looses focus and user has typed a text - for which there is no matching item found in the model with the text typed by the user. + \li editingFinished( ) is emitted either because editable combobox lost focus or Return/Enter + is pressed. - The following is an example of how to create a model and adding item to the created model. - How to set the model on the HbcomboBox. - Here the model is ownership transfer to the widget. + The following is an example of how to create a model and adding item in the model. + HbComboBox takes ownership of model. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,37} - An example how to add strings into HbComboBox and setting currentIndex. - HbComboBox will creates the model internally if model is not created. + An example of how to add strings in HbComboBox and setting currentIndex. + HbComboBox will creates model internally if model is not created. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,38} - An example how to add stringsList into HbComboBox and setting currentIndex. + An example of how to add stringsList into HbComboBox and setting currentIndex. HbComboBox will creates the model internally if model is not created. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,39} - An example how to insert String at index into HbComboBox. + An example of how to insert string at some index in HbComboBox. HbComboBox will creates the model internally if model is not created. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,40} - An example how to insert StringList at index into HbComboBox. + An example of how to insert StringList at index into HbComboBox. HbComboBox will creates the model internally if model is not created. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,41} - An example how to set the items into HbComboBox. - HbComboBox will replces the existing model. + An example of how to set the items into HbComboBox. + HbComboBox will replace the existing model. \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,42} */ @@ -136,7 +135,7 @@ Q_D( HbComboBox ); d->init( ); updatePrimitives( ); - setProperty("state", "normal"); + setFlag(QGraphicsItem::ItemSendsScenePositionChanges); } /*! @@ -155,14 +154,14 @@ Q_D( HbComboBox ); d->init( ); updatePrimitives( ); - setProperty("state", "normal"); } /*! @beta + \property HbComboBox::items - \brief list of comboBox items - It replaces the existing list. + + It replaces the existing list with \a texts. */ void HbComboBox::setItems( const QStringList &texts ) { @@ -182,44 +181,46 @@ /*! @beta + This property holds the list added in the combobox. By default, for an empty combo box, this property has a empty StringList. */ QStringList HbComboBox::items( ) const { Q_D( const HbComboBox ); - if( d->mModel && d->mModel->rowCount( )) { + if( d->mModel && d->mModel->rowCount( ) ) { QStringList list; - int rowCount = d->mModel->rowCount(); - for(int i = 0; i < rowCount; i++) - { - list<<( d->mModel->data( d->mModel->index( i, 0 ) ) ).toString(); + int rowCount = d->mModel->rowCount( ); + for(int i = 0; i < rowCount; i++) { + list<<( d->mModel->data( d->mModel->index( i, 0 ) ) ).toString( ); } return list; } else { - return QStringList(); + return QStringList( ); } } /*! @alpha - Sets the \a icon for the item on the given \a index in the combobox. - this API will not work if applcation sets the model as QStringlistModel. + + Sets \a icon for the item at the given \a index in the combobox. + This API will not work if applcation sets the model as QStringListModel. */ void HbComboBox::setItemIcon( int index, const HbIcon &icon ) { - Q_D(const HbComboBox); - if(d->mModel) { + Q_D( const HbComboBox ); + if( d->mModel ) { QModelIndex item = d->mModel->index( index, 0 ); - if ( item.isValid( ) ) { - d->mModel->setData( item, icon.qicon(), Qt::DecorationRole ); + if ( item.isValid( ) ) { + d->mModel->setData( item, icon.qicon( ), Qt::DecorationRole ); } } } /*! @alpha - returns the HbIcon for the given \a index in the combobox. + + Returns HbIcon at \a index in the combobox. */ HbIcon HbComboBox::itemIcon( int index ) const { @@ -235,8 +236,9 @@ /*! @beta - Returns the data for the given \a role in the given \a index in the - combobox, or QVariant::Invalid if there is no data for this role. + + Either returns the \a role data at this \a index in HbComboBox, or QVariant::Invalid + if there is no data for this role. */ QVariant HbComboBox::itemData( int index, int role ) const { @@ -245,14 +247,15 @@ QModelIndex mi = d->mModel->index( index, 0 ); if( mi.isValid ( ) ) { return d->mModel->data( mi, role ); - } + } } return QVariant( ); } /*! @beta - Sets the data \a role for the item on the given \a index in the combobox + + Sets the \a role data for the item at the given \a index in HbComboBox to the specified \a value. */ void HbComboBox::setItemData( int index, const QVariant &value, int role ) @@ -267,14 +270,15 @@ } /*! - @proto - This case is valid only for Editable comboBox - Returns the validator that is used to constraint text input to the - combobox and returns NULL if it is invalid. + @beta + + This API is valid only for editable combobox. + Either returns the validator that is used to constraint text input in + combobox or returns NULL if it is invalid. \sa editable */ -const HbValidator *HbComboBox::validator() const +const HbValidator *HbComboBox::validator( ) const { Q_D( const HbComboBox ); if( d->mEditable) { @@ -284,25 +288,28 @@ } /*! - @proto - This case is only valid for the Editable comboBox. - Sets the \a validator to use instead of the current validator. + @beta + + This API is only valid for the editable combobox. + Sets the \a validator to be used in editable combobox. */ void HbComboBox::setValidator( HbValidator *validator ) { Q_D( HbComboBox ); if( d->mEditable ) { - disconnect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), + disconnect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), this, SLOT( _q_textChanged( QString ) ) ); d->mLineEdit->setValidator( validator ); - connect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), + connect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), this, SLOT( _q_textChanged( QString ) ) ); } } /*! - This property holds the number of items in the combobox. - By default, for an empty combo box, this property has a value of 0. + @beta + + This property holds the number of items in combobox. + For an empty combo box, this property is equal to 0. */ int HbComboBox::count( ) const { @@ -315,10 +322,12 @@ /*! @beta + Sets the model to \a model - comboBox Owns the model set by the Application. + Ownership of \a model is taken by HbComboBox. It replaces the old model if exists. - please do not pass 0(NULL) as \a model instead call clear() to clear the contens of the model. + Do not pass 0(NULL) as \a model to clear contents of model instead call clear( ). + \sa clear */ void HbComboBox::setModel( QAbstractItemModel * model ) { @@ -334,7 +343,8 @@ /*! @beta - Returns model that view is currently presenting. + + Returns current model. */ QAbstractItemModel* HbComboBox::model( ) const { @@ -344,6 +354,7 @@ /*! @beta + Sets current index to \a index. By default no item is selected. */ @@ -360,7 +371,8 @@ /*! @beta - Returns index of current item and returns -1 for invalid current index. + + Either returns index of current item if valid or else returns -1 for invalid current index. */ int HbComboBox::currentIndex( ) const { @@ -370,6 +382,7 @@ /*! @beta + \fn int HbComboBox::findText(const QString &text, Qt::MatchFlags flags = Qt::MatchExactly|Qt::MatchCaseSensitive) const @@ -380,20 +393,23 @@ */ /*! + @beta + Returns the index of the item containing the given \a data for the - given \a role; otherwise returns -1. + given \a role if valid, otherwise returns -1. The \a flags specify how the items in the combobox are searched. */ int HbComboBox::findData( const QVariant &data, int role, Qt::MatchFlags flags ) const { Q_D( const HbComboBox ); - if(d->mModel) { + if( d->mModel ) { QModelIndexList result; QModelIndex start = d->mModel->index( 0, 0 ); result = d->mModel->match( start, role, data, 1, flags ); - if ( result.isEmpty( ) ) + if ( result.isEmpty( ) ) { return -1; + } return result.first( ).row( ); } return -1; @@ -401,26 +417,29 @@ /*! @beta - This is specific to the Editable comboBox only. - Sets the text in the combobox's text edit + + This API is valid for editable combobox. + Sets the \a text in editable combobox's line edit. */ void HbComboBox::setEditText( const QString &text ) { Q_D( HbComboBox ); if( d->mEditable ) { - disconnect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), + disconnect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), this, SLOT( _q_textChanged( QString ) ) ); d->mLineEdit->setText( text ); - connect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), + connect( d->mLineEdit, SIGNAL( textChanged ( QString ) ), this, SLOT( _q_textChanged( QString ) ) ); } } /*! @beta + \property HbComboBox::currentText - \brief the text of the current item - combo box with model count \0 returns an empty string. + + In case of non-editable combobox it returns the text at current index. + In case of editable combobox it returns the text in line edit. */ QString HbComboBox::currentText( ) const { @@ -436,8 +455,9 @@ /*! @beta - Removes the item at the given index from the combobox. - This will update the current index if the index is removed. + + Removes the item at the given \a index from HbComboBox. + If \a index passed is current index then current index will be updated accordingly. */ void HbComboBox::removeItem( int index ) { @@ -446,11 +466,11 @@ int rowCount = d->mModel->rowCount( ); if( index >=0 && index < rowCount ) { bool currentText = false; - if ( d->mModel->index(index, 0) == d->mCurrentIndex ) { + if ( d->mModel->index( index, 0 ) == d->mCurrentIndex ) { currentText = true; d->mModel->removeRow( index ); - } else if( d->mCurrentIndex.row() > index ) { - int row = d->mCurrentIndex.row(); + } else if( d->mCurrentIndex.row( ) > index ) { + int row = d->mCurrentIndex.row( ); d->mModel->removeRow( index ); d->mCurrentIndex = d->mModel->index( --row, 0 ); d->currentIndexChanged( d->mCurrentIndex ); @@ -459,35 +479,38 @@ } if( d->mModel->rowCount( ) == 0 ) { if( d->mEditable ) { - clearEditText(); + clearEditText( ); } else { if( d->mLineEdit ) { - d->mLineEdit->setText( QString() ); + d->mLineEdit->setText( QString( ) ); } else { - d->mText.clear(); + d->mText.clear( ); HbStyleOptionComboBox comboBoxOption; - initStyleOption(&comboBoxOption); - style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption); + initStyleOption( &comboBoxOption ); + style( )->updatePrimitive( + d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption ); } } + d->mCurrentIndex = QModelIndex(); return; } if( currentText ) { d->mCurrentIndex = d->mModel->index( 0, 0 ); if( d->mEditable ) { disconnect(d->mLineEdit, SIGNAL( textChanged ( QString ) ), - this, SLOT( _q_textChanged( QString ) ) ); + this, SLOT( _q_textChanged( QString ) ) ); d->mLineEdit->setText( d->mModel->data( d->mCurrentIndex ).toString( ) ); connect(d->mLineEdit, SIGNAL( textChanged ( QString ) ), - this, SLOT( _q_textChanged( QString ) ) ); + this, SLOT( _q_textChanged( QString ) ) ); } else { if( d->mLineEdit ) { - d->mLineEdit->setText( QString() ); + d->mLineEdit->setText( QString( ) ); } else { d->mText = d->mModel->data( d->mCurrentIndex ).toString( ); HbStyleOptionComboBox comboBoxOption; - initStyleOption(&comboBoxOption); - style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption); + initStyleOption( &comboBoxOption ); + style( )->updatePrimitive( + d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption); } } d->currentIndexChanged( d->mCurrentIndex ); @@ -503,7 +526,7 @@ { Q_UNUSED( event ) Q_D( HbComboBox ); - if ( d->mDropDown && d->mDropDown->isVisible() ){ + if ( d->mDropDown && d->mDropDown->isVisible( ) ) { d->positionDropDown( ); } } @@ -555,7 +578,7 @@ { Q_D( const HbComboBox ); - switch( primitive ){ + switch( primitive ) { case HbStyle::P_ComboBox_text: return d->mTextItem; case HbStyle::P_ComboBox_background: @@ -569,11 +592,14 @@ } } +/*! + \reimp + */ void HbComboBox::initStyleOption( HbStyleOptionComboBox *option )const { - Q_D( const HbComboBox ); + Q_D( const HbComboBox ); option->text = d->mText; - HbWidget::initStyleOption( option ); + HbWidget::initStyleOption( option ); } /*! @@ -581,7 +607,7 @@ */ void HbComboBox::updatePrimitives( ) { - Q_D( HbComboBox ); + Q_D( HbComboBox ); HbStyleOption styleOption; HbWidget::initStyleOption( &styleOption ); if ( d->mIsDown ) { @@ -597,24 +623,25 @@ /*! @beta - Clears the combobox, removes all items from model. + + Removes all items from model. */ void HbComboBox::clear( ) { Q_D( HbComboBox ); if( d->mModel ) { - d->mModel->removeRows(0, d->mModel->rowCount()); + d->mModel->removeRows( 0, d->mModel->rowCount( ) ); d->mCurrentIndex = QModelIndex( ); if( d->mEditable ) { - clearEditText(); + clearEditText( ); } else { if( d->mLineEdit ) { - d->mLineEdit->setText( QString() ); + d->mLineEdit->setText( QString( ) ); } else { - d->mText.clear(); + d->mText.clear( ); HbStyleOptionComboBox comboBoxOption; - initStyleOption(&comboBoxOption); - style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption); + initStyleOption( &comboBoxOption ); + style( )->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption ); } } } @@ -622,7 +649,9 @@ /*! @beta - Clears the contents of the line edit used for editing in the combobox. + + This API is valid only for editable combobox. + Clears the contents of line edit in editable combobox. */ void HbComboBox::clearEditText( ) { @@ -638,24 +667,30 @@ /*! @beta + \property HbComboBox::editable - \brief Set editable the property of the combobox. - True, Editable, user can type in the combobox to search for items from - the list of items. Shows the prediction. If user types a text which does not match - to any items in the model then slection is not changed. - False, Non editable user canot enter text using keyboard. + + If \a editable is true then combobox will be editable else it will be + non-editable. + + \sa isEditable */ void HbComboBox::setEditable( bool editable ) { Q_D( HbComboBox ); d->setEditable( editable ); - setProperty("state", "normal"); + if (!editable ) { + setProperty( "state", "normal" ); + } } /*! @beta - Returns whether or not the combobox is editable - True if editable, else false + + Returns combobox is editable or not. If editable then returns true else returns + false. + + \sa setEditable */ bool HbComboBox::isEditable( ) const { @@ -665,20 +700,25 @@ /*! @beta - Adds an item to the combobox with the given text, - and containing the specified userData (stored in the Qt::UserRole). - The item is appended to the list of existing items. + + Adds an item in combobox with the given \a text, containing the specified \a userData + (stored in the Qt::UserRole). The item is appended to the list of existing items. + + \sa insertItem */ -void HbComboBox::addItem( const QString &text, const QVariant &userData) +void HbComboBox::addItem( const QString &text, const QVariant &userData ) { insertItem( count( ), text, userData ); } /*! @beta - Adds an item to the combobox with the given icon and text, - and containing the specified userData (stored in the Qt::UserRole). + + Adds an item in combobox with the given \a icon and \a text, + and containing the specified \a userData (stored in the Qt::UserRole). The item is appended to the list of existing items. + + \sa insertItem */ void HbComboBox::addItem( const HbIcon &icon, const QString &text, const QVariant &userData ) { @@ -687,33 +727,39 @@ /*! @beta - Adds each of the strings in the given texts to the combobox. + + Adds each of the strings in the given \a texts to combobox. Each item is appended to the list of existing items in turn. + + \sa insertItem */ void HbComboBox::addItems( const QStringList &texts ) { - insertItems( count(), texts ); + insertItems( count( ), texts ); } /*! @beta - Inserts the text into the combobox at the given index. + + Inserts the \a text in combobox at the given \a index. If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items. + + \sa addItems addItem */ void HbComboBox::insertItem( int index, const QString &text, const QVariant &userData ) { Q_D( HbComboBox ); - if( text.isNull( ) ){ + if( text.isNull( ) ) { return; } if( !d->mModel ) { - QStandardItemModel* model = new QStandardItemModel(this ); + QStandardItemModel* model = new QStandardItemModel( this ); setModel( model ); } - if ( !d->mModel->rowCount( ) ) { + if ( !d->mModel->rowCount( ) ) { d->mModel->insertRow( 0 ); d->mModel->insertColumn( 0 ); if( d->mModel->index( 0, 0 ).isValid( ) ) { @@ -733,97 +779,21 @@ } } else if(index <= 0) { d->mModel->insertRow( 0 ); - d->mModel->setData( d->mModel->index(0,0), text, Qt::DisplayRole ); + d->mModel->setData( d->mModel->index( 0, 0 ), text, Qt::DisplayRole ); if( userData.isValid( ) ) { d->mModel->setData( d->mModel->index( 0, 0 ), userData, Qt::UserRole ); } - if( d->mCurrentIndex.row() >= 0 ) { - d->mCurrentIndex = d->mModel->index(d->mCurrentIndex.row()+1, 0); - d->currentIndexChanged(d->mCurrentIndex); + if( d->mCurrentIndex.row( ) >= 0 ) { + d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + 1, 0); + d->currentIndexChanged( d->mCurrentIndex ); } } else { d->mModel->insertRow( index ); d->mModel->setData( d->mModel->index( index, 0 ), text, Qt::DisplayRole ); if( userData.isValid( ) ) { - d->mModel->setData( d->mModel->index( index, 0 ), userData, Qt::UserRole ); - } - if( d->mCurrentIndex.row() <= index ) { - d->mCurrentIndex = d->mModel->index(d->mCurrentIndex.row()+1, 0); - d->currentIndexChanged(d->mCurrentIndex); - } - } - } -} - -/*! - @beta - Inserts the text and icon into the combobox at the given index. - If the index is equal to or higher than the total number of items, - the new item is appended to the list of existing items. - If the index is zero or negative, the new item is prepended to the list of existing items. - */ -void HbComboBox::insertItem( int index, const HbIcon &icon, const QString &text, const QVariant &userData) -{ - Q_D( HbComboBox ); - if( text.isEmpty( ) ){ - return; - } - - if( !d->mModel ) { - QStandardItemModel* model = new QStandardItemModel( this ); - setModel( model ); - } - if ( !d->mModel->rowCount( ) ) { - d->mModel->insertRow( 0 ); - d->mModel->insertColumn( 0 ); - if( d->mModel->index( 0, 0 ).isValid( ) ) { - d->mModel->setData( d->mModel->index(0,0), text, Qt::DisplayRole ); - setCurrentIndex( 0 ); - } - if(!icon.isNull() && d->mModel->index( 0, 0 ).isValid( ) ) { - d->mModel->setData(d->mModel->index( 0, 0 ), icon.qicon( ), Qt::DecorationRole); - } - if( userData.isValid( ) && d->mModel->index( 0, 0 ).isValid( ) ) { - d->mModel->setData( d->mModel->index( 0, 0 ), userData, Qt::UserRole ); - } - } else { - int rowCount = d->mModel->rowCount( ); - if( index >= rowCount ) { - d->mModel->insertRow( rowCount ); - d->mModel->setData( d->mModel->index( rowCount, 0 ), text, Qt::DisplayRole ); - if(!icon.isNull()) { - d->mModel->setData( d->mModel->index( rowCount, 0 ), icon, Qt::DecorationRole ); - } - if( userData.isValid( ) ) { - d->mModel->setData( d->mModel->index( rowCount, 0 ), userData, Qt::UserRole ); - } - if( d->mCurrentIndex.row() == index ) { - d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + 1, 0 ); - d->currentIndexChanged( d->mCurrentIndex ); - } - } else if(index <= 0) { - d->mModel->insertRow( 0 ); - d->mModel->setData( d->mModel->index( 0, 0 ), text, Qt::DisplayRole ); - if(!icon.isNull()) { - d->mModel->setData(d->mModel->index( 0, 0 ), icon, Qt::DecorationRole); - } - if( userData.isValid( ) ) { - d->mModel->setData( d->mModel->index( 0, 0 ), userData, Qt::UserRole ); - } - if( d->mCurrentIndex.row() >= 0 ) { - d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + 1, 0); - d->currentIndexChanged( d->mCurrentIndex ); - } - } else { - d->mModel->insertRow( index ); - d->mModel->setData( d->mModel->index( index, 0 ), text, Qt::DisplayRole ); - if(!icon.isNull( ) ) { - d->mModel->setData( d->mModel->index( index, 0 ), icon, Qt::DecorationRole ); - } - if( userData.isValid( ) ) { d->mModel->setData( d->mModel->index( index, 0 ), userData, Qt::UserRole ); } - if( d->mCurrentIndex.row() <= index ) { + if( d->mCurrentIndex.row( ) >= index ) { d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + 1, 0); d->currentIndexChanged( d->mCurrentIndex ); } @@ -833,7 +803,88 @@ /*! @beta - Inserts the strings from the list into the combobox as separate items, starting at the index. + + Inserts the \a text and \a icon into the combobox at the given \a index. + If the index is equal to or higher than the total number of items, + the new item is appended to the list of existing items. + If the index is zero or negative, the new item is prepended to the list of existing items. + + \sa insertItem + */ +void HbComboBox::insertItem( int index, const HbIcon &icon, + const QString &text, const QVariant &userData ) +{ + Q_D( HbComboBox ); + if( text.isEmpty( ) ) { + return; + } + + if( !d->mModel ) { + QStandardItemModel* model = new QStandardItemModel( this ); + setModel( model ); + } + if ( !d->mModel->rowCount( ) ) { + d->mModel->insertRow( 0 ); + d->mModel->insertColumn( 0 ); + if( d->mModel->index( 0, 0 ).isValid( ) ) { + d->mModel->setData( d->mModel->index( 0, 0 ), text, Qt::DisplayRole ); + setCurrentIndex( 0 ); + } + if( !icon.isNull( ) && d->mModel->index( 0, 0 ).isValid( ) ) { + d->mModel->setData( d->mModel->index( 0, 0 ), icon.qicon( ), Qt::DecorationRole ); + } + if( userData.isValid( ) && d->mModel->index( 0, 0 ).isValid( ) ) { + d->mModel->setData( d->mModel->index( 0, 0 ), userData, Qt::UserRole ); + } + } else { + int rowCount = d->mModel->rowCount( ); + if( index >= rowCount ) { + d->mModel->insertRow( rowCount ); + d->mModel->setData( d->mModel->index( rowCount, 0 ), text, Qt::DisplayRole ); + if( !icon.isNull( ) ) { + d->mModel->setData( d->mModel->index( rowCount, 0 ), icon, Qt::DecorationRole ); + } + if( userData.isValid( ) ) { + d->mModel->setData( d->mModel->index( rowCount, 0 ), userData, Qt::UserRole ); + } + if( d->mCurrentIndex.row( ) == index ) { + d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + 1, 0 ); + d->currentIndexChanged( d->mCurrentIndex ); + } + } else if( index <= 0 ) { + d->mModel->insertRow( 0 ); + d->mModel->setData( d->mModel->index( 0, 0 ), text, Qt::DisplayRole ); + if( !icon.isNull( ) ) { + d->mModel->setData( d->mModel->index( 0, 0 ), icon, Qt::DecorationRole ); + } + if( userData.isValid( ) ) { + d->mModel->setData( d->mModel->index( 0, 0 ), userData, Qt::UserRole ); + } + if( d->mCurrentIndex.row( ) >= 0 ) { + d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + 1, 0 ); + d->currentIndexChanged( d->mCurrentIndex ); + } + } else { + d->mModel->insertRow( index ); + d->mModel->setData( d->mModel->index( index, 0 ), text, Qt::DisplayRole ); + if( !icon.isNull( ) ) { + d->mModel->setData( d->mModel->index( index, 0 ), icon, Qt::DecorationRole ); + } + if( userData.isValid( ) ) { + d->mModel->setData( d->mModel->index( index, 0 ), userData, Qt::UserRole ); + } + if( d->mCurrentIndex.row( ) <= index ) { + d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + 1, 0 ); + d->currentIndexChanged( d->mCurrentIndex ); + } + } + } +} + +/*! + @beta + + Inserts the strings in \a texts into combobox as separate items, starting at the given \a index. If the index is equal to or higher than the total number of items, the new item is appended to the list of existing items. If the index is zero or negative, the new item is prepended to the list of existing items. @@ -847,11 +898,11 @@ } if ( !d->mModel->rowCount( ) ) { int textCount = texts.count( ); - for( int i = 0; i < textCount; i++) - { + for( int i = 0; i < textCount; i++) { d->mModel->insertRow( i ); - if( i == 0) + if( i == 0) { d->mModel->insertColumn( 0 ); + } if( d->mModel->index( i, 0 ).isValid( ) ) { d->mModel->setData( d->mModel->index( i, 0 ), texts.at( i ), Qt::DisplayRole ); if( i == 0) { @@ -859,7 +910,7 @@ } } } - } else { + } else { int rowCount = -1; rowCount = d->mModel->rowCount( ); int textCount = texts.count( ); @@ -869,8 +920,8 @@ for ( int i = rowCount; i < ( rowCount + textCount ); i++ ) { d->mModel->setData ( d->mModel->index( i, 0 ), texts.at( temp++ ) ); } - if( d->mCurrentIndex.row() == index ) { - d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + textCount, 0); + if( d->mCurrentIndex.row( ) == index ) { + d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + textCount, 0 ); d->currentIndexChanged( d->mCurrentIndex ); } } else if( index <= 0 ) { @@ -878,8 +929,8 @@ for ( int i = 0; i < textCount; i++ ) { d->mModel->setData( d->mModel->index( i, 0 ), texts.at( i ) ); } - if( d->mCurrentIndex.row() >= 0 ) { - d->mCurrentIndex = d->mModel->index(d->mCurrentIndex.row() + textCount, 0); + if( d->mCurrentIndex.row( ) >= 0 ) { + d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + textCount, 0 ); d->currentIndexChanged( d->mCurrentIndex ); } } else { @@ -888,8 +939,8 @@ for ( int i = index; i < ( textCount + index ); i++ ) { d->mModel->setData( d->mModel->index( i, 0 ), texts.at( temp++ ) ); } - if( d->mCurrentIndex.row() <= index ) { - d->mCurrentIndex = d->mModel->index(d->mCurrentIndex.row() + textCount, 0); + if( d->mCurrentIndex.row( ) <= index ) { + d->mCurrentIndex = d->mModel->index( d->mCurrentIndex.row( ) + textCount, 0 ); d->currentIndexChanged( d->mCurrentIndex ); } } @@ -898,14 +949,17 @@ /*! @beta - Returns the text for the given index in the combobox. + + Returns text at given \a index in combobox. + + \sa setItemText */ QString HbComboBox::itemText( int index ) const { Q_D( const HbComboBox ); - if(d->mModel) { + if( d->mModel ) { QModelIndex mi = d->mModel->index( index, 0 ); - if( mi.isValid() ) { + if( mi.isValid( ) ) { return d->itemText( mi ); } } @@ -914,75 +968,99 @@ /*! @beta - Sets the text for the item on the given index in the combobox. + + Sets the \a text for item at given \a index in combobox. + + \sa itemText */ void HbComboBox::setItemText( int index, const QString &text ) { Q_D( HbComboBox ); - if (d->mModel) { + if ( d->mModel ) { QModelIndex item = d->mModel->index( index, 0 ); if ( item.isValid( ) ) { - if(d->mModel->setData( item, text, Qt::EditRole )) { - if(d->mCurrentIndex.row() == index) { + if( d->mModel->setData( item, text, Qt::EditRole ) ) { + if( d->mCurrentIndex.row( ) == index ) { if( d->mLineEdit ) { d->mLineEdit->setText( text ); - } else { + } else { d->mText = text ; HbStyleOptionComboBox comboBoxOption; - initStyleOption(&comboBoxOption); - style()->updatePrimitive( d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption); + initStyleOption( &comboBoxOption ); + style( )->updatePrimitive( + d->mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption ); } } } - } } } +bool HbComboBox::eventFilter( QObject *obj, QEvent *event ) +{ + return HbWidget::eventFilter(obj,event); +} + /*! reimplementation. */ -bool HbComboBox::eventFilter( QObject* obj, QEvent* event ) +void HbComboBox::gestureEvent(QGestureEvent *event) { Q_D( HbComboBox ); - bool accepted = false; - if ( !isEnabled() ) { - return false ; + + if (!isEnabled()) { + return; } - if(obj == static_cast(d->mButtonTouchAreaItem)) { - if(event->type() == QEvent::Gesture ) { - QGestureEvent *gestureEvent = static_cast( event ); - if(gestureEvent->gesture(Qt::TapGesture)) { - HbTapGesture *tap = static_cast(gestureEvent->gesture(Qt::TapGesture)); - switch(tap->state()) { - case Qt::GestureStarted: - { - d->touchAreaPressEvent( ); - accepted = true; - break; - } - case Qt::GestureCanceled: - { - d->mIsDown = false; - updatePrimitives(); - setProperty("state", "normal"); - accepted = true; - break; - } - case Qt::GestureFinished: - { - d->touchAreaReleaseEvent( ); - accepted = true; - break; - //TODO :: move else part here - } - default: - break; + if(event->gesture(Qt::TapGesture)) { + HbTapGesture *tap = + static_cast(event->gesture(Qt::TapGesture)); + switch(tap->state()) { + case Qt::GestureStarted: { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + if (!tap->property(HbPrivate::ThresholdRect.latin1()).toRect().isValid()) { + tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); } + + d->touchAreaPressEvent(); + break; } + case Qt::GestureCanceled: { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + + d->mIsDown = false; + updatePrimitives(); + setProperty( "state", "normal" ); + break; + } + case Qt::GestureFinished: { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + + d->touchAreaReleaseEvent(); + break; + //TODO :: move else part here + } + default: + break; } } - return accepted; +} + +/*! + \reimp + */ +QVariant HbComboBox::itemChange( GraphicsItemChange change, const QVariant & value ) +{ + Q_D( HbComboBox ); + switch( change ) { + case QGraphicsItem::ItemScenePositionHasChanged: + if( ( d->mDropDown ) && ( d->mDropDown->mList ) && ( d->mDropDown->isVisible( ) ) ) { + d->positionDropDown( ); + } + break; + default: + break; + } + return HbWidget::itemChange( change, value ); } /*! @@ -990,7 +1068,7 @@ */ void HbComboBox::changeEvent( QEvent *event ) { - switch ( event->type( ) ){ + switch ( event->type( ) ) { case QEvent::EnabledChange: updatePrimitives( ); break; @@ -1000,6 +1078,7 @@ HbWidget::changeEvent( event ); } + // End of file diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcombobox.h --- a/src/hbwidgets/widgets/hbcombobox.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcombobox.h Thu Jul 22 16:36:53 2010 +0100 @@ -57,21 +57,22 @@ explicit HbComboBox( QGraphicsItem *parent = 0 ); virtual ~HbComboBox( ); - enum { Type = Hb::ItemType_ComboBox }; - int type( ) const { return Type; } + enum { + Type = Hb::ItemType_ComboBox + }; + int type( ) const { + return Type; + } void addItem( const QString &text, const QVariant &userData = QVariant() ); - void addItem( const HbIcon &icon, - const QString &text, - const QVariant &userData = QVariant( ) ); + void addItem( const HbIcon &icon, const QString &text, + const QVariant &userData = QVariant( ) ); void addItems( const QStringList &texts ); void insertItem( int index, const QString &text, const QVariant &userData = QVariant() ); - void insertItem( int index, - const HbIcon &icon, - const QString &text, - const QVariant & userData = QVariant( ) ); + void insertItem( int index, const HbIcon &icon, const QString &text, + const QVariant & userData = QVariant( ) ); void insertItems( int index, const QStringList &texts ); int count( ) const; @@ -84,10 +85,10 @@ void setItemText( int index, const QString &text ); QString itemText( int index ) const; - + void setModel( QAbstractItemModel *model ); QAbstractItemModel *model( ) const; - + void setEditable( bool editable ); bool isEditable( ) const; @@ -96,17 +97,18 @@ void setValidator( HbValidator *validator ); const HbValidator *validator( ) const; - + QString currentText( ) const; - + int currentIndex( ) const; - + void removeItem( int index ); inline int findText( const QString &text, - Qt::MatchFlags flags = Qt::MatchExactly|Qt::MatchCaseSensitive ) const - { return findData( text, Qt::DisplayRole, flags ); } - + Qt::MatchFlags flags = Qt::MatchExactly|Qt::MatchCaseSensitive ) const { + return findData( text, Qt::DisplayRole, flags ); + } + int findData( const QVariant &data, int role = Qt::UserRole, Qt::MatchFlags flags = Qt::MatchExactly|Qt::MatchCaseSensitive ) const; @@ -118,11 +120,12 @@ void clearEditText( ); void setCurrentIndex( int index ); void setEditText( const QString &text ); - + signals: void currentIndexChanged( int index ); void currentIndexChanged( const QString &text ); void editTextChanged( const QString &text ); + void editingFinished( ); protected: HbComboBox( HbComboBoxPrivate &dd, QGraphicsItem *parent = 0 ); @@ -132,6 +135,8 @@ void keyReleaseEvent( QKeyEvent *event ); void changeEvent( QEvent *event ); bool eventFilter( QObject *obj, QEvent *event ); + QVariant itemChange ( GraphicsItemChange change, const QVariant & value ); + void gestureEvent( QGestureEvent *event ); private: Q_DECLARE_PRIVATE_D( d_ptr, HbComboBox ) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcombobox_p.cpp --- a/src/hbwidgets/widgets/hbcombobox_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcombobox_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -38,6 +38,8 @@ #include #include #include +#include + #ifdef HB_EFFECTS #include @@ -48,7 +50,7 @@ #include HbComboBoxPrivate::HbComboBoxPrivate( ): - HbWidgetPrivate ( ), + HbWidgetPrivate ( ), mLineEdit ( 0 ), mTextItem ( 0 ), mButton ( 0 ), @@ -61,10 +63,10 @@ mButtonTouchAreaItem ( 0 ), mIsDown ( false ), mEditable ( false ), - mIsDorpdownCreated(false), - mIsDropwnToSceneAdded(false), + mIsDorpdownCreated( false ), + mIsDropwnToSceneAdded( false ), mHasDownEffect ( false ), - mHasUpEffect (false ), + mHasUpEffect ( false ), mListItemHeight( -1 ), mDropDownRowsInPortrait( -1 ), mDropDownRowsInLandscape( -1 ) @@ -73,15 +75,18 @@ HbComboBoxPrivate::~HbComboBoxPrivate( ) { - Q_Q(HbComboBox); + Q_Q( HbComboBox ); if( mButtonTouchAreaItem ) { static_cast( mButtonTouchAreaItem )->removeEventFilter( q ); } - if ( !q->scene() || !q->scene( )->property( "destructed" ).isValid( ) ) { - if( mDropDown ) { - delete mDropDown; - mDropDown = 0; - } + + if ( !mDropDown ) { + return; + } + + if ( !mDropDown->scene() || !mDropDown->scene( )->property( "destructed" ).isValid( ) ) { + delete mDropDown; + mDropDown = 0; } } @@ -103,23 +108,20 @@ mButton = q->style( )->createPrimitive( HbStyle::P_ComboBox_button, q ); HbStyle::setItemName( mButton, "combobox_button" ); - mButtonTouchAreaItem = q->style( )->createPrimitive( - HbStyle::P_ComboBoxButton_toucharea, q ); - static_cast(mButtonTouchAreaItem)->installEventFilter( q ); - q->setHandlesChildEvents(true); + mButtonTouchAreaItem = q->style( )->createPrimitive( HbStyle::P_ComboBoxButton_toucharea, q ); - static_cast(mButtonTouchAreaItem)->grabGesture( Qt::TapGesture ); + static_cast( mButtonTouchAreaItem )->grabGesture( Qt::TapGesture ); } void HbComboBoxPrivate::touchAreaPressEvent( ) { Q_Q( HbComboBox ); - if (q->count() > 0) { + if ( q->count( ) > 0 ) { HbWidgetFeedback::triggered( q, Hb::InstantPressed ); } mIsDown = true; q->updatePrimitives( ); - q->setProperty( "state", "pressed" ); + q->setProperty( "state", "pressed" ); } void HbComboBoxPrivate::touchAreaReleaseEvent( ) @@ -128,11 +130,10 @@ mIsDown = false; touchAreaClicked( ); q->updatePrimitives( ); - if ( q->count() > 0 ) { + if ( q->count( ) > 0 ) { HbWidgetFeedback::triggered( q, Hb::InstantReleased ); } - q->setProperty( "state", "normal" ); } void HbComboBoxPrivate::touchAreaClicked( ) @@ -141,11 +142,16 @@ if ( mModel && mModel->rowCount( ) ) { addDropDownToScene( ); mDropDown->setVisible( true ); + q->setProperty( "state", "latched" ); if( !mDropDown->mList ) { mDropDown->createList( ); - mDropDown->mList->setModel( mModel ); + mDropDown->mList->setModel( mModel ); q->connect( mDropDown->mList, SIGNAL( activated( QModelIndex ) ), q, - SLOT( _q_textChanged( QModelIndex ) ) ); + SLOT( _q_textChanged( QModelIndex ) ) ); + //send layout request so that geometries of list view item are updated + //and proper height is fetched in calculateListItemHeight + QEvent layoutEvent(QEvent::LayoutRequest); + QApplication::sendEvent(mDropDown->mList->contentWidget(), &layoutEvent); } if ( mCurrentIndex.isValid( ) ) { if( mDropDown->mList->model( ) != mModel ) { @@ -158,12 +164,13 @@ mDropDown->mList->setModel( mModel ); } mDropDown->mList->scrollTo( mModel->index( 0, 0 ) ); - mDropDown->mList->setCurrentIndex( mModel->index( 0, 0 ), QItemSelectionModel::Select ); + mDropDown->mList->setCurrentIndex( + mModel->index( 0, 0 ), QItemSelectionModel::Select ); } #ifdef HB_EFFECTS - HbEffect::start( mDropDown, HB_DROPD0WN_ITEM_TYPE, "appear" ); + HbEffect::start( mDropDown, HB_DROPD0WN_ITEM_TYPE, "appear" ); #endif - positionDropDown( ); + positionDropDown( ); } } @@ -172,7 +179,7 @@ } -void HbComboBoxPrivate::vkbClosed() +void HbComboBoxPrivate::vkbClosed( ) { if( mDropDown->isVisible( ) ) { positionDropDown( ); @@ -180,17 +187,14 @@ } void HbComboBoxPrivate::showPopup( QAbstractItemModel *aModel, QModelIndex aIndex ) -{ - Q_UNUSED( aModel ); - Q_UNUSED( aIndex ); +{ Q_Q( HbComboBox ); if ( aModel && aModel->rowCount( ) ) { - addDropDownToScene(); + addDropDownToScene( ); if( !mDropDown->mList ) { - mDropDown->createList(); + mDropDown->createList( ); q->connect( mDropDown->mList, SIGNAL( activated( QModelIndex ) ), q, - SLOT( _q_textChanged( QModelIndex ) ) ); - + SLOT( _q_textChanged( QModelIndex ) ) ); } mDropDown->mList->setModel( aModel ); if ( aIndex.isValid( ) ) { @@ -204,22 +208,27 @@ } } -void HbComboBoxPrivate::createDropDown() -{ +void HbComboBoxPrivate::createDropDown( ) +{ + Q_Q ( HbComboBox ); if( !mIsDorpdownCreated ) { mDropDown = new HbComboDropDown( this ); mIsDorpdownCreated = true; - mDropDown->setVisible(false); + mDropDown->setVisible( false ); + q->setProperty( "state", "normal" ); } } -void HbComboBoxPrivate::calculateListItemHeight() +void HbComboBoxPrivate::calculateListItemHeight( ) { QAbstractItemModel *model = mDropDown->mList->model( ); if( mCurrentIndex.isValid( ) && mDropDown->mList->itemByIndex( mCurrentIndex ) ) { mListItemHeight = mDropDown->mList->itemByIndex( mCurrentIndex )->geometry( ).height( ); - } else if( model->index( 0, 0 ).isValid() && mDropDown->mList->itemByIndex( model->index( 0, 0 ) ) ) { - mListItemHeight = mDropDown->mList->itemByIndex( model->index( 0, 0 ) )->geometry( ).height( ); + } else if( model->index( 0, 0 ).isValid( ) && + mDropDown->mList->itemByIndex( model->index( 0, 0 ) ) ) { + + mListItemHeight = + mDropDown->mList->itemByIndex( model->index( 0, 0 ) )->geometry( ).height( ); } else { HbListViewItem *proto = mDropDown->mList->listItemPrototype( ); HbListViewItem *temp = static_cast( proto->createItem( ) ); @@ -238,10 +247,10 @@ QAbstractItemModel *model = mDropDown->mList->model( ); calculateListItemHeight( ); qreal totalHeightRequd = model->rowCount( ) * mListItemHeight; - qreal maxPopupHeight = 0.0; + //read the maximum rows in drop down for different orientation from css - if( q->mainWindow( )->orientation( ) == Qt::Horizontal ){ + if( q->mainWindow( )->orientation( ) == Qt::Horizontal ) { if( mDropDownRowsInLandscape == -1 ) { HbStyleParameters params; q->style( )->parameters( params ); @@ -250,17 +259,17 @@ mDropDownRowsInLandscape = params.value( "max-rows-in-dropdown" ).toInt( ); } maxPopupHeight = mDropDownRowsInLandscape * mListItemHeight; - } else if( q->mainWindow( )->orientation( ) == Qt::Vertical ){ + } else if( q->mainWindow( )->orientation( ) == Qt::Vertical ) { if( mDropDownRowsInPortrait == -1 ) { HbStyleParameters params; - q->style( )->parameters(params); + q->style( )->parameters( params ); params.addParameter( "max-rows-in-dropdown" ); q->polish( params ); - mDropDownRowsInPortrait = params.value("max-rows-in-dropdown").toInt(); + mDropDownRowsInPortrait = params.value( "max-rows-in-dropdown" ).toInt( ); } maxPopupHeight = mDropDownRowsInPortrait * mListItemHeight; } - + if ( totalHeightRequd < maxPopupHeight ) { maxPopupHeight = totalHeightRequd; } @@ -269,55 +278,55 @@ if( !mDropDown->vkbOpened ) { //position of drop down in both editable and non-editable combobox depends upon //the available space above and below combobox - if( (widgetPos.y( ) + q->rect( ).height( ) + maxPopupHeight) < sceneRect.height( ) ) { - popupPos = QPointF( widgetPos.x(), widgetPos.y( ) + q->rect( ).height( ) ); + if( ( widgetPos.y( ) + q->rect( ).height( ) + maxPopupHeight) < sceneRect.height( ) ) { + popupPos = QPointF( widgetPos.x( ), widgetPos.y( ) + q->rect( ).height( ) ); #ifdef HB_EFFECTS - if ( !mHasDownEffect ) { - mHasDownEffect = true; - mHasUpEffect = false; - // this is temporary until proper effect theming comes. - //this Effect will be shown when there is space in the view bottom. - HbEffectInternal::add( mDropDown, "combo_appear_down", "appear" ); - HbEffectInternal::add( mDropDown, "combo_disappear_downl", "disappear" ); - } + if ( !mHasDownEffect ) { + mHasDownEffect = true; + mHasUpEffect = false; + // this is temporary until proper effect theming comes. + //this Effect will be shown when there is space in the view bottom. + HbEffectInternal::add( mDropDown, "combo_appear_down", "appear" ); + HbEffectInternal::add( mDropDown, "combo_disappear_downl", "disappear" ); + } #endif } else if( widgetPos.y( ) - maxPopupHeight > 0.0 ) { popupPos = QPointF( widgetPos.x( ), widgetPos.y( ) - maxPopupHeight ); #ifdef HB_EFFECTS - if ( !mHasUpEffect ) { - // this is temporary until proper effect theming comes. - //this Effect will be shown when there is no space in the view bottom - mHasUpEffect = true; - mHasDownEffect = false; - HbEffectInternal::add( mDropDown, "combo_appear_up", "appear" ); - HbEffectInternal::add( mDropDown, "combo_disappear_up", "disappear" ); - } + if ( !mHasUpEffect ) { + // this is temporary until proper effect theming comes. + //this Effect will be shown when there is no space in the view bottom + mHasUpEffect = true; + mHasDownEffect = false; + HbEffectInternal::add( mDropDown, "combo_appear_up", "appear" ); + HbEffectInternal::add( mDropDown, "combo_disappear_up", "disappear" ); + } #endif } else { qreal topScreenHeight = sceneRect.height( ) - maxPopupHeight; if( topScreenHeight > sceneRect.height( ) - topScreenHeight ) { popupPos = QPointF( widgetPos.x( ), 0.0 ); #ifdef HB_EFFECTS - if ( !mHasDownEffect ) { - mHasDownEffect = true; - mHasUpEffect = false; - // this is temporary until proper effect theming comes. - //this Effect will be shown when there is more space in the view bottom. - HbEffectInternal::add( mDropDown, "combo_appear_down", "appear" ); - HbEffectInternal::add( mDropDown, "combo_disappear_down", "disappear" ); - } + if ( !mHasDownEffect ) { + mHasDownEffect = true; + mHasUpEffect = false; + // this is temporary until proper effect theming comes. + //this Effect will be shown when there is more space in the view bottom. + HbEffectInternal::add( mDropDown, "combo_appear_down", "appear" ); + HbEffectInternal::add( mDropDown, "combo_disappear_down", "disappear" ); + } #endif } else { popupPos = QPointF( widgetPos.x( ), sceneRect.height( ) - maxPopupHeight ); #ifdef HB_EFFECTS - if ( !mHasUpEffect ) { - mHasUpEffect = true; - mHasDownEffect = false; - // this is temporary until proper effect theming comes. - //this Effect will be shown when there is more space in the view bottom. - HbEffectInternal::add( mDropDown, "combo_appear_up", "appear" ); - HbEffectInternal::add( mDropDown, "combo_disappear_up", "disappear" ); - } + if ( !mHasUpEffect ) { + mHasUpEffect = true; + mHasDownEffect = false; + // this is temporary until proper effect theming comes. + //this Effect will be shown when there is more space in the view bottom. + HbEffectInternal::add( mDropDown, "combo_appear_up", "appear" ); + HbEffectInternal::add( mDropDown, "combo_disappear_up", "disappear" ); + } #endif } } @@ -325,13 +334,12 @@ // positioning drop down when vkb is positioned // drop down will come on top/below of combo based upon which side has more space // available - HbEditorInterface editorInterface( q ); HbVkbHost *host = editorInterface.vkbHost( ); if ( host ) { QSizeF keyBoardArea = host->keyboardArea( ); QSize screenSize = HbDeviceProfile::profile( q ).logicalSize( ); - + qreal heightDifference = screenSize.height( ) - keyBoardArea.height( ); qreal topSpace = widgetPos.y( ); qreal bottomSpace = heightDifference - topSpace - q->boundingRect( ).height( ); @@ -345,16 +353,15 @@ popupSize.setHeight( topSpace ); } #ifdef HB_EFFECTS - if ( !mHasUpEffect ) { - mHasUpEffect = true; - mHasDownEffect = false; - // this is temporary until proper effect theming comes. - //this Effect will be shown when there is more space in the view bottom. - HbEffectInternal::add( mDropDown, "combo_appear_up", "appear" ); - HbEffectInternal::add( mDropDown, "combo_disappear_up", "disappear" ); - } + if ( !mHasUpEffect ) { + mHasUpEffect = true; + mHasDownEffect = false; + // this is temporary until proper effect theming comes. + //this Effect will be shown when there is more space in the view bottom. + HbEffectInternal::add( mDropDown, "combo_appear_up", "appear" ); + HbEffectInternal::add( mDropDown, "combo_disappear_up", "disappear" ); + } #endif - } else { //display drop down at bottom popupPos = QPointF( widgetPos.x( ), widgetPos.y( ) + q->rect( ).height( ) ); @@ -362,14 +369,14 @@ popupSize.setHeight( bottomSpace ); } #ifdef HB_EFFECTS - if ( !mHasDownEffect ) { - mHasDownEffect = true; - mHasUpEffect = false; - // this is temporary until proper effect theming comes. - //this Effect will be shown when there is more space in the view bottom. - HbEffectInternal::add( mDropDown, "combo_appear_down", "appear" ); - HbEffectInternal::add( mDropDown, "combo_disappear_down", "disappear" ); - } + if ( !mHasDownEffect ) { + mHasDownEffect = true; + mHasUpEffect = false; + // this is temporary until proper effect theming comes. + //this Effect will be shown when there is more space in the view bottom. + HbEffectInternal::add( mDropDown, "combo_appear_down", "appear" ); + HbEffectInternal::add( mDropDown, "combo_disappear_down", "disappear" ); + } #endif } } @@ -377,7 +384,7 @@ mDropDown->setPreferredSize( popupSize ); mDropDown->setMinimumSize( popupSize ); mDropDown->setMaximumSize( popupSize ); - mDropDown->setPos(popupPos); + mDropDown->setPos( popupPos ); QGraphicsWidget *p = q; while ( p->parentWidget( ) ) { p = p->parentWidget( ); @@ -390,31 +397,32 @@ Q_Q( HbComboBox ); QVariant data = mDropDown->mList->model( )->data( aIndex ); mText = data.toString( ); - if( !mEditable ) { + if( !mEditable ) { if( mLineEdit ) { mLineEdit->setText( mText ); } else { HbStyleOptionComboBox comboBoxOption; q->initStyleOption( &comboBoxOption ); - q->style( )->updatePrimitive( mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption); + q->style( )->updatePrimitive( mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption ); } mCurrentIndex = aIndex; } else { q->disconnect( mLineEdit, SIGNAL( textChanged ( QString ) ), q, - SLOT( _q_textChanged( QString ) ) ); + SLOT( _q_textChanged( QString ) ) ); mLineEdit->setText( mText ); mCurrentIndex = findData( mText ); q->connect( mLineEdit, SIGNAL( textChanged ( QString ) ), q, - SLOT( _q_textChanged( QString ) ) ); + SLOT( _q_textChanged( QString ) ) ); } if ( mDropDown->isVisible( ) ) { mDropDown->setVisible( false ); + q->setProperty( "state", "normal" ); } currentIndexChanged( mCurrentIndex ); } void HbComboBoxPrivate::_q_textCompleted( const QModelIndex & aIndex ) -{ +{ if( aIndex.isValid( ) ) { showPopup( mCompleter->completionModel( ) ); } @@ -422,21 +430,21 @@ void HbComboBoxPrivate::_q_textChanged( const QString & aString ) { - Q_Q(HbComboBox); + Q_Q( HbComboBox ); if( !aString.isEmpty( ) ) { if ( mCompleter ) { mCompleter->setCompletionPrefix( aString ); mCompleter->complete( ); - if( mCompleter->currentRow() == -1 ) { - if (( mDropDown ) && ( mDropDown->isVisible() )) { - mDropDown->setVisible(false); + if( mCompleter->currentRow( ) == -1 ) { + if ( ( mDropDown ) && ( mDropDown->isVisible( ) ) ) { + mDropDown->setVisible( false ); } } } } else { if( mDropDown ) { - mDropDown->setVisible(false); + mDropDown->setVisible( false ); } //showPopup( mModel, mCurrentIndex); } @@ -449,6 +457,7 @@ createDropDown( ); if ( mDropDown->isVisible( ) ) { mDropDown->setVisible( false ); + q->setProperty( "state", "normal" ); } q->clear( ); delete mModel; @@ -495,19 +504,20 @@ void HbComboBoxPrivate::setEditable( bool editable ) { - Q_Q(HbComboBox); + Q_Q( HbComboBox ); if( mEditable == editable ) { return; } mEditable = editable; - if( editable ) { + if( editable ) { if( mTextItem ) { HbStyle::setItemName( mTextItem, "" ); delete mTextItem; mTextItem = 0; mLineEdit = new HbCustomLineEdit( q, this ); + q->connect( mLineEdit, SIGNAL( editingFinished( ) ), q, SIGNAL( editingFinished( ) ) ); HbStyle::setItemName( mLineEdit, "combobox_labelfield" ); - mLineEdit->backgroundItem()->setVisible(false); + mLineEdit->backgroundItem( )->setVisible( false ); } q->setHandlesChildEvents( false ); mLineEdit->setReadOnly( false ); @@ -545,7 +555,7 @@ QIcon HbComboBoxPrivate::itemIcon( const QModelIndex &index ) const { QVariant decoration = mModel->data( index, Qt::DecorationRole ); - if ( decoration.type() == QVariant::Icon ) { + if ( decoration.type( ) == QVariant::Icon ) { return QIcon( qvariant_cast( decoration ) ); } return qvariant_cast( decoration ); @@ -557,7 +567,7 @@ } void HbComboBoxPrivate::addDropDownToScene( ) -{ +{ Q_Q( HbComboBox ); if( !mIsDropwnToSceneAdded ) { if ( q->scene( ) ) { @@ -577,20 +587,21 @@ bool indexChanged = ( mi != mCurrentIndex ); if ( indexChanged ) { mCurrentIndex = QModelIndex( mi ); - mText = q->itemText( mCurrentIndex.row( ) ); + mText = q->itemText( mCurrentIndex.row( ) ); if( mEditable ) { q->disconnect( mLineEdit, SIGNAL( textChanged ( QString ) ), q, SLOT( _q_textChanged( QString ) ) ); - mLineEdit->setText( mText ); - q->connect( mLineEdit, SIGNAL( textChanged ( QString ) ), - q, SLOT( _q_textChanged( QString ) ) ); - } else { + mLineEdit->setText( mText ); + q->connect( mLineEdit, SIGNAL( textChanged ( QString ) ), + q, SLOT( _q_textChanged( QString ) ) ); + } else { if( mLineEdit ) { mLineEdit->setText( mText ); - } else { + } else { HbStyleOptionComboBox comboBoxOption; q->initStyleOption(&comboBoxOption); - q->style( )->updatePrimitive( mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption ); + q->style( )->updatePrimitive( + mTextItem, HbStyle::P_ComboBox_text, &comboBoxOption ); } } currentIndexChanged( mCurrentIndex ); @@ -598,9 +609,9 @@ } void HbComboBoxPrivate::currentIndexChanged( const QModelIndex &index ) -{ +{ Q_Q( HbComboBox ); - emit q->currentIndexChanged( index.row( ) ); + emit q->currentIndexChanged( index.row( ) ); emit q->currentIndexChanged( q->itemText ( mCurrentIndex.row( ) ) ); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcombobox_p.h --- a/src/hbwidgets/widgets/hbcombobox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcombobox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -66,7 +66,7 @@ HbComboBoxPrivate( ); ~HbComboBoxPrivate( ); void init( ); - void createPrimitives(); + void createPrimitives( ); void setModel( QAbstractItemModel * model ); void positionDropDown( ); void setCompletion( bool completion ); @@ -88,9 +88,9 @@ QModelIndex findData( const QVariant &data ) const; void showPopup( QAbstractItemModel* aModel, QModelIndex aIndex = QModelIndex( ) ); void createDropDown( ); - void calculateListItemHeight(); + void calculateListItemHeight( ); -public: +public: HbCustomLineEdit* mLineEdit; QGraphicsItem* mTextItem; QGraphicsItem *mButton; @@ -118,14 +118,12 @@ { Q_OBJECT public: - explicit HbComboListViewItem ( QGraphicsItem *parent = 0 ) : HbListViewItem( parent ) - { + explicit HbComboListViewItem ( QGraphicsItem *parent = 0 ) : HbListViewItem( parent ) { } - HbAbstractViewItem *createItem() - { - return new HbComboListViewItem(*this); - } + HbAbstractViewItem *createItem( ) { + return new HbComboListViewItem( *this ); + } }; class HbCustomLineEdit : public HbLineEdit @@ -133,34 +131,40 @@ Q_OBJECT public: - HbCustomLineEdit( QGraphicsWidget *parent, HbComboBoxPrivate *comboPriv ) - :HbLineEdit( *new HbLineEditPrivate, parent ), + HbCustomLineEdit( QGraphicsWidget *parent, HbComboBoxPrivate *comboPriv ) : + HbLineEdit( *new HbLineEditPrivate, parent ), comboBoxPrivate( comboPriv ), - VkbLaunched( false ) - { - + VkbLaunched( false ) { + } + + ~HbCustomLineEdit() { + HbEditorInterface editorInterface( this ); + HbVkbHost *host = editorInterface.vkbHost( ); + if( host ) { + host->disconnect(); + } } -void setLongPressEnabled( bool enable = true ) - { - if( enable ) { - scrollArea( )->setLongPressEnabled( true ); - } else { - scrollArea( )->setLongPressEnabled( false ); - } - } + + void setLongPressEnabled( bool enable = true ) { + if( enable ) { + scrollArea( )->setLongPressEnabled( true ); + } else { + scrollArea( )->setLongPressEnabled( false ); + } + } + protected: - void focusInEvent( QFocusEvent *event ) - { - HbEditorInterface editorInterface(this); - HbVkbHost *host = editorInterface.vkbHost(); - if ( host && !VkbLaunched ) { - VkbLaunched = true; - connect( host, SIGNAL( keypadClosed ( ) ), comboBoxPrivate->mDropDown, - SLOT( keypadClosed( ) ) ); - connect( host, SIGNAL( keypadOpened ( ) ), comboBoxPrivate->mDropDown, - SLOT( keypadOpened( ) ) ); - } - HbLineEdit::focusInEvent(event); + void focusInEvent( QFocusEvent *event ) { + HbEditorInterface editorInterface( this ); + HbVkbHost *host = editorInterface.vkbHost( ); + if ( host && !VkbLaunched ) { + VkbLaunched = true; + connect( host, SIGNAL( keypadClosed ( ) ), comboBoxPrivate->mDropDown, + SLOT( keypadClosed( ) ) ); + connect( host, SIGNAL( keypadOpened ( ) ), comboBoxPrivate->mDropDown, + SLOT( keypadOpened( ) ) ); + } + HbLineEdit::focusInEvent( event ); } private: HbComboBoxPrivate *comboBoxPrivate; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcombodropdown_p.cpp --- a/src/hbwidgets/widgets/hbcombodropdown_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcombodropdown_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -25,29 +25,31 @@ #include "hbcombodropdown_p.h" #include "hbcombobox_p.h" +#include "hbwidget_p.h" #include #include -#ifdef HB_GESTURE_FW #include #include -#endif +#include -HbComboDropDown::HbComboDropDown( HbComboBoxPrivate *comboBoxPrivate, QGraphicsItem *parent ) - :HbWidget( parent ), - mList( 0 ), - comboPrivate( comboBoxPrivate ), - vkbOpened( false ), - backgroundPressed( false ) +class HbComboDropDownPrivate : public HbWidgetPrivate { - setBackgroundItem( HbStyle::P_ComboBoxPopup_background ); +}; +HbComboDropDown::HbComboDropDown( HbComboBoxPrivate *comboBoxPrivate, QGraphicsItem *parent ) + :HbWidget( *new HbComboDropDownPrivate(), parent ), + mList( 0 ), + comboPrivate( comboBoxPrivate ), + vkbOpened( false ), + backgroundPressed( false ) +{ + Q_D(HbComboDropDown); + d->setBackgroundItem(HbStyle::P_ComboBoxPopup_background); #if QT_VERSION >= 0x040600 - //this is to keep the focus in the previous widget. - setFlag( QGraphicsItem::ItemIsPanel, true ); - setActive( false ); + //this is to keep the focus in the previous widget. + setFlag( QGraphicsItem::ItemIsPanel, true ); + setActive( false ); #endif - //setFlag(QGraphicsItem::ItemIsPanel); - //setPanelModality(PanelModal); } HbComboDropDown::~HbComboDropDown( ) @@ -58,8 +60,8 @@ void HbComboDropDown::createList( ) { mList = new HbListView( this ); - mList->setLongPressEnabled(false); - HbComboListViewItem *protoType = new HbComboListViewItem(this); + mList->setLongPressEnabled( false ); + HbComboListViewItem *protoType = new HbComboListViewItem( this ); mList->setItemPrototype( protoType ); HbStyle::setItemName( mList, "list" ); mList->setUniformItemSizes( true ); @@ -69,13 +71,13 @@ void HbComboDropDown::keypadOpened( ) { vkbOpened = true; - comboPrivate->vkbOpened(); + comboPrivate->vkbOpened( ); } void HbComboDropDown::keypadClosed( ) { vkbOpened = false; - comboPrivate->vkbClosed(); + comboPrivate->vkbClosed( ); } bool HbComboDropDown::eventFilter( QObject *obj, QEvent *event ) @@ -90,28 +92,25 @@ case QEvent::GraphicsSceneMouseDoubleClick: { if( !( this->isUnderMouse( ) ) ) { - backgroundPressed = true; - accepted = true; - } - } - break; - case QEvent::GraphicsSceneMouseRelease: - { - if( !( this->isUnderMouse( ) ) && backgroundPressed ) { HbWidgetFeedback::triggered( this, Hb::InstantPopupClosed ); setVisible( false ); - backgroundPressed = false; + comboPrivate->q_ptr->setProperty("state","normal"); + backgroundPressed = true; accepted = true; } } break; case QEvent::Gesture: { - if( !this->isUnderMouse() ) { + if( !this->isUnderMouse( ) ) { //if its a pan gesture then don't accept the event so that list can be scrolled - //even if mouse is outside drop down area - if(QGestureEvent *gestureEvent = static_cast( event ) ) { - if( !qobject_cast( gestureEvent->gesture( Qt::PanGesture ) ) ) { + //even if mouse is outside drop down area. Also tap might finish outside the + //dropdown area + if( QGestureEvent *gestureEvent = static_cast( event ) ) { + HbTapGesture *tapGesture = qobject_cast(gestureEvent->gesture(Qt::TapGesture)); + if( !qobject_cast( + gestureEvent->gesture( Qt::PanGesture ) ) && + !(tapGesture && tapGesture->state() != Qt::GestureStarted)) { accepted = true; } } @@ -122,7 +121,6 @@ break; } } - return accepted; } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbcombodropdown_p.h --- a/src/hbwidgets/widgets/hbcombodropdown_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbcombodropdown_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -30,13 +30,14 @@ class HbListView; class HbComboBoxPrivate; +class HbComboDropDownPrivate; class HbComboDropDown : public HbWidget { Q_OBJECT public: explicit HbComboDropDown( HbComboBoxPrivate *comboBoxPrivate, QGraphicsItem *parent = 0 ); - virtual ~HbComboDropDown(); - void createList(); + virtual ~HbComboDropDown( ); + void createList( ); HbListView *mList; HbComboBoxPrivate *comboPrivate; @@ -46,6 +47,7 @@ protected: bool eventFilter( QObject *obj, QEvent *event ); + Q_DECLARE_PRIVATE_D(d_ptr, HbComboDropDown) public: bool vkbOpened; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbdatetimepicker.cpp --- a/src/hbwidgets/widgets/hbdatetimepicker.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbdatetimepicker.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -23,36 +23,44 @@ ** ****************************************************************************/ +#include "hbdatetimepicker.h" #include "hbdatetimepicker_p.h" -#include "hbdatetimepicker.h" #include "hbstyleoption_p.h" /*! @beta \class HbDateTimePicker - \brief HbDateTimePicker class provides a widget for picking the date, time, date and time. + \brief HbDateTimePicker class provides a widget for picking the date, time, date and time.
    + By default date picker will be created, with date functionality only. For exclusive time or datetime picker creation, use QTime or QDateTime variable as parameter for the constructor. \li Date and Time \li Date \li Time + Below is a sample code snippet for datetime picker creation: \snippet{ultimatecodesnippet/ultimatecodesnippet.cpp,51} - By default, display format is from HbExtendedLocale. User can set the format using \sa setDisplayFormat. - Based on the display format the tumblers or sections will be rearranged. + By default, display format is from HbExtendedLocale. User can set the format using setDisplayFormat API. \sa setDisplayFormat.
    + Based on the display format the tumblers or sections will be rearranged.
    + For each tumbler(TumbleView) in datetime picker, loopingEnabled property is always true.
    - HbDateTimePicker provides various date and time range functionalities. - currently the date range is independent of the time range. + HbDateTimePicker provides various date and time range functionalities.
    + Currently the date range is independent of the time range. \sa setDateRange \sa setTimeRange \sa setDateTimeRange \sa setMinimumTime \sa setMaximumTime \sa setMinimumDate \sa setMaximumDate \sa setMinimumDateTime \sa setMaximumDateTime + + \image html hbdatetimepicker_date.png "Datetime picker with date functionalities, in d/MMMM format" + \image html hbdatetimepicker_time.png "Datetime picker with time functionalities, in h.m.AP format" + + Note:Graphics in the above images varies depending on theme. */ /*! \fn void dateChanged(const QDate &date) - This signal is emitted when item selection changes in any of the date pickers in the datetimepicker widget. + This signal is emitted when item selection changes in any of the date pickers(day, month, year) in the datetimepicker widget. \param date selected by the user. @@ -61,7 +69,7 @@ /*! \fn void timeChanged(const QTime &time) - This signal is emitted when item selection changes in any of the time pickers in the datetimepicker widget. + This signal is emitted when item selection changes in any of the time pickers(hour, minute, second, am/pm) in the datetimepicker widget. \param time selected by the user. */ @@ -69,7 +77,7 @@ /*! \fn void dateTimeChanged(const QDateTime &datetime) - This signal is emitted when item selection changes in any of the pickers in the datetimepicker widget. + This signal is emitted when item selection changes in any of the date and time pickers in the datetimepicker widget. \param datetime selected by the user. */ @@ -77,35 +85,34 @@ /*! Constructs date picker widget by default. - \param parent parent item. + \param parent parent item for datetime picker widget. */ HbDateTimePicker::HbDateTimePicker( QGraphicsItem *parent ): HbWidget(*new HbDateTimePickerPrivate, parent) { - Q_D(HbDateTimePicker); + Q_D(HbDateTimePicker); - //no mode passed so it should take date as mode by default - d->init(QVariant::Date); + //no mode passed so it should take date as mode by default + d->init(QVariant::Date); - setDateTime(QDateTime::currentDateTime()); + setDateTime(QDateTime::currentDateTime()); } /*! - Constructs datetime picker widget. - - \param datetime QDateTime value. + Constructs datetime picker widget with both date and time functionalities and with default locale's datetime format. + \param datetime Value to be set on datetime picker widget, which has both date and time related tumblers. */ HbDateTimePicker::HbDateTimePicker(const QDateTime &datetime, QGraphicsItem *parent ): HbWidget(*new HbDateTimePickerPrivate, parent) { Q_D(HbDateTimePicker); - d->init(QVariant::DateTime); - setDateTime(datetime); + d->init(QVariant::DateTime); + setDateTime(datetime); } /*! - Constructs date picker widget with default locale's date format. + Constructs datetime picker widget with only date functionalities and with default locale's date format. \param date QDate value. */ @@ -114,12 +121,12 @@ { Q_D(HbDateTimePicker); - d->init(QVariant::Date); + d->init(QVariant::Date); setDate(date); } /*! - Constructs time picker widget with default locale's time format. + Constructs datetime picker widget with only time functionalities and with with default locale's time format. \param time QTime value. */ @@ -128,12 +135,13 @@ { Q_D(HbDateTimePicker); - d->init(QVariant::Time); + d->init(QVariant::Time); setTime(time); } /*! - Internal. Protected constructor for derivations. + \internal + Protected constructor for derivations. the default mode is DateTimeMode, if other mode is required, set the mDateTimeMode variable. this does not set any default datetime, needs to be explicitly done in the derived constructor. @@ -144,7 +152,7 @@ { Q_D(HbDateTimePicker); - d->init(QVariant::DateTime); + d->init(QVariant::DateTime); } /*! @@ -169,7 +177,7 @@ /*! Returns current display format as QString value. - \return display format. + \return display format of datetime picker widget. \sa setDisplayFormat() */ @@ -207,29 +215,43 @@ a minus sign is prepended in addition. - NOTE:setDisplayFormat works only when the seperators are mentioned in the format like 'dd.mm.yy' or 'dd mm yy', this + NOTE:setDisplayFormat works only when the separators are mentioned in the format like 'dd.mm.yy' or 'dd mm yy', this will be fixed in the future versions. - \param format is the display format in QString format. + \param format is the display format, for datetime picker widget, in QString format. \sa displayFormat() */ void HbDateTimePicker::setDisplayFormat(const QString &format) { - Q_D(HbDateTimePicker); + Q_D(HbDateTimePicker); - if(d->isFormatValid(format)){ - d->mFormat = format; - d->parseDisplayFormat(format); - d->rearrangeTumbleViews(); + if(d->isFormatValid(format)){ + d->mFormat = format; + d->parseDisplayFormat(format); + d->rearrangeTumbleViews(); d->emitDateTimeChange(); - }//End If format is valid + }//End If format is valid } /*! Returns the current date in QDate format. - \return Date Picker's current date. + \return current selected date in datetime picker. + + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode \sa setDate */ @@ -243,7 +265,7 @@ /*! Sets the current \a date in the form of QDate. - \param date date in QDate format + \param date date to be set on the datetime picker in QDate format \sa date */ @@ -256,7 +278,21 @@ /*! Returns minimum date in QDate format. - \return Minimum date in QDate format. + \return Minimum date set on datetime picker in QDate format. + + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode \sa setMinimumDate */ @@ -269,7 +305,7 @@ /*! Sets minimum \a date in QDate format. - \param Minimum date in QDate format. + \param Minimum date to be set on datetime picker in QDate format. \sa minimumDate */ @@ -282,7 +318,21 @@ /*! Returns maximum date in QDate format. - \return Maximum Date in QDate format. + \return Maximum Date set on datetime picker in QDate format. + + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode \sa setMaximumDate */ @@ -295,7 +345,7 @@ /*! Sets maximum \a date in QDate format. - \param date Maximum date in QDate format. + \param date Maximum date to be set on datetime picker in QDate format. \sa maximumDate */ @@ -306,7 +356,7 @@ } /*! - Sets minimum \a minDate and maximum \a maxDate dates in QDate format. + Sets minimum \a minDate and maximum \a maxDate dates in QDate format. This will allow user to set date range on datetime picker. \param minDate Minimum date in QDate format. \param maxDate Maximum date in QDate format. @@ -321,10 +371,24 @@ } /*! - Returns the current datetime in QDateTime format. + Returns the current date and time value, selected in datetime picker, in QDateTime format. \return date and time value in QDateTime format. + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode + \sa setDateTime */ QDateTime HbDateTimePicker::dateTime()const @@ -334,7 +398,7 @@ } /*! - Sets the current \a datetime in the form of QDateTime. + Sets the current \a datetime value to be set on datetime picker in QDateTime format. \param datetime in QDateTime format. @@ -347,10 +411,24 @@ } /*! - Returns minimum date time in QDateTime format. + Returns minimum date time value set on datetime picker in QDateTime format. \return Minimum date and minimum time in QDateTime format. + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode + \sa setMinimumDateTime */ QDateTime HbDateTimePicker::minimumDateTime()const @@ -360,9 +438,10 @@ } /*! - Sets minimum \a datetime in QDateTime format. - Note: There's no link between Date and time in this API, using this API as of now - would be similar to using combination of \sa setMinimumDate and \sa setMinimumTime + Sets minimum \a datetime for datetime picker in QDateTime format. + + Note: There's no link between Date functionality and time functionality in this API. Using this API, for now, + would be similar to using a combination of setMinimumDate and setMinimumTime APIs. \param datetime minimum date and minimum time in QDateTime format. @@ -375,11 +454,25 @@ } /*! - Returns maximum date time in QDateTime format. + Returns maximum date time, set on datetime picker, in QDateTime format. \return Maximum date and maximum time in QDateTime format. - \sa setMaximumDate + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode + + \sa setMaximumDateTime */ QDateTime HbDateTimePicker::maximumDateTime()const { @@ -388,10 +481,10 @@ } /*! - Sets maximum \a datetime in QDateTime format. - - Note: There's no link between Date and time in this API, using this API as of now - would be similar to using combination of \sa setMaximumDate and \sa setMaximumTime + Sets maximum \a datetime, to be set on datetime picker, in QDateTime format. + + Note: There's no link between Date functionality and time functionality in this API, using this API for now + would be similar to using a combination of setMaximumDate and setMaximumTime APIs. \param date Maximum date and maximum time in QDateTime format. @@ -404,17 +497,18 @@ } /*! - Sets minimum \a minDatetime and maximum \a maxDatetime datetimes in QDateTime format. + Sets minimum \a minDatetime and maximum \a maxDatetime date and time values, to be set on datetime picker, in QDateTime format. + This will allow the user to set date and time range on datetime picker. - Note: There's no link between Date and time in this API, using this API as of now - would be similar to using combination of \sa setMinimumDate \sa setMaximumTime and - \sa setMinimumTime, \sa setMaximumTime. + Note: There's no link between Date and time in this API, using this API for now + would be similar to using a combination of setMinimumDate, setMaximumTime and + setMinimumTime, setMaximumTime APIs. \param minDateTime minimum date and time in QDateTime format. \param maxDateTime maximum date and time in QDateTime format. \sa setMinimumDateTime \sa setMaximumDateTime \sa setMinimumDate \sa setMaximumDate - \sa setMinimumTime \sa setMaximumTime + \sa setMinimumTime \sa setMaximumTime */ void HbDateTimePicker::setDateTimeRange(const QDateTime &minDateTime, const QDateTime &maxDateTime) { @@ -423,10 +517,24 @@ } /*! - Returns the current time in QTime format. + Returns the current time, selected in datetime picker widget, in QTime format. \return time in QTime format. + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode + \sa setTime */ QTime HbDateTimePicker::time() const @@ -436,7 +544,7 @@ } /*! - Sets the current \a time in the form of QTime. + Sets the current \a time, to be set on datetime picker widget, in QTime format. \param time in QTime format. @@ -449,10 +557,24 @@ } /*! - Returns minimum time in QTime format. + Returns minimum time, set on datetime picker, in QTime format. \return Minimum time in QTime format. + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode + \sa setMinimumTime */ QTime HbDateTimePicker::minimumTime()const @@ -462,7 +584,7 @@ } /*! - Sets minimum \a time in QTime format. + Sets minimum \a time, to be set on datetime picker, in QTime format. \param time minimum time in QTime format. @@ -475,10 +597,24 @@ } /*! - Returns maximum time in QTime format. + Returns maximum time, set on datetime picker, in QTime format. \return maximum time in QTime format. + Note: The DocML does not support directly the properties which uses QDate/QTime/QDateTime as parameters. For the properties to work user has to pass date, time or datetime + as a string, in a valid ISO date format. + + ISO 8601 extended format: either YYYY-MM-DD for dates or YYYY-MM-DDTHH:MM:SS for combined dates and times. + + \code + ... + + + + + ... + \endcode + \sa setMaximumTime */ QTime HbDateTimePicker::maximumTime()const @@ -488,7 +624,7 @@ } /*! - Sets maximum \a time in QTime format. + Sets maximum \a time, to be set on datetime picker, in QTime format. \param time maximum time in QTime format @@ -501,7 +637,7 @@ } /*! - Sets minimum \a minTime and maximum \a maxTime in QTime format. + Sets minimum \a minTime and maximum \a maxTime in QTime format. This will allow the user to set a time range on datetime picker. \param minTime minimum time in QTime format. \param maxTime maximum time in QTime format. @@ -516,9 +652,10 @@ } /*! - sets the \a interval for the corresponding \a section. + Sets the \a interval or periodic gap for the corresponding \a section. - Note: Only MinuteSection is supported at this time. + Note: Only MinuteSection is supported at this time.
    + Note: Minute interval must be a divisor of 60. Divisors of 60 are 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30 \param section can be a MinuteSection. \param interval to be set on each picker. @@ -534,14 +671,34 @@ return; } + if(60 % interval) + { + return; + } + d->mIntervals[section] = interval; - if((section == QDateTimeEdit::MinuteSection) && (d->mMinuteModel)){ + //trigger minute range change + int start=0,end=0; + if(d->mMinutePicker) { + start=d->mMinuteOffset; + end=start+d->mMinuteModel->rowCount()-1; + if(d->isMinimumHour() ) { + start = d->mMinimumDate.time().minute(); + } else { + if((d->mIntervals[QDateTimeEdit::MinuteSection]!=1) && (d->mIntervals[section]>0)) { + start = d->mMinimumDate.time().minute()%d->mIntervals[section]; + } else { + start = 0; + } + } + if(d->isMaximumHour()) { + end = d->mMaximumDate.time().minute(); + } else { + end = 59; + } - d->mMinuteModel->removeRows(0, d->mMinuteModel->rowCount()); - - d->resizeModel(d->mMinuteModel, d->mMinimumDate.time().minute(), d->mMaximumDate.time().minute(), - d->mMinimumDate.time().minute(), d->mMaximumDate.time().minute(),&HbDateTimePickerPrivate::localeMinute, interval); + d->setMinuteRange(start,end); } } @@ -560,7 +717,6 @@ } /*! - \deprecated HbDateTimePicker::primitive(HbStyle::Primitive) is deprecated. diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbdatetimepicker_p.cpp --- a/src/hbwidgets/widgets/hbdatetimepicker_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbdatetimepicker_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -26,7 +26,7 @@ #include "hbdatetimepicker_p.h" #include "hbdatetimepicker.h" #include "hbstyleoption_p.h" -#include "hbfeaturemanager_p.h" +#include "hbfeaturemanager_r.h" //TODO:remove frameitem dependency #include "hbframeitem.h" @@ -36,11 +36,12 @@ #include #include #include -#include -#include #include -#define HBDATETIMEPICKER_DEBUG +//#define HBDATETIMEPICKER_DEBUG +#ifdef HBDATETIMEPICKER_DEBUG +#include +#endif //////////HbDateTimeParser - Implementaion may change in future.////////////// @@ -346,6 +347,7 @@ q->style()->setItemName(mContent,"content"); mDateTimeMode = dateTimeMode; + mIntervals[QDateTimeEdit::MinuteSection]=1; //read the format from locale mFormat = localeDateTimeFormat(dateTimeMode); @@ -446,21 +448,36 @@ { Q_Q(HbDateTimePicker); - deleteAndNull(mYearPicker); - deleteAndNull(mMonthPicker); - deleteAndNull(mDayPicker); - deleteAndNull(mHourPicker); - deleteAndNull(mMinutePicker); - deleteAndNull(mSecondPicker); - deleteAndNull(mAmPmPicker); - - deleteAndNull(mYearModel); - deleteAndNull(mDayModel); - deleteAndNull(mMonthModel); - deleteAndNull(mHourModel); - deleteAndNull(mMinuteModel); - deleteAndNull(mSecondModel); - deleteAndNull(mAmPmModel); + if(!(mParser.mDisplaySections & (HbDateTimeParser::YearSection| + HbDateTimeParser::YearSection2Digits))) { + deleteAndNull(mYearPicker); + mYearModel = 0; + } + if(!(mParser.mDisplaySections & HbDateTimeParser::MonthSection)) { + deleteAndNull(mMonthPicker); + mMonthModel = 0; + } + if(!(mParser.mDisplaySections & HbDateTimeParser::DaySection)) { + deleteAndNull(mDayPicker); + mDayModel = 0; + } + if(!(mParser.mDisplaySections & (HbDateTimeParser::Hour12Section| + HbDateTimeParser::Hour24Section))) { + deleteAndNull(mHourPicker); + mHourModel = 0; + } + if(!(mParser.mDisplaySections & HbDateTimeParser::MinuteSection)) { + deleteAndNull(mMinutePicker); + mMinuteModel = 0; + } + if(!(mParser.mDisplaySections & HbDateTimeParser::SecondSection)) { + deleteAndNull(mSecondPicker); + mSecondModel = 0; + } + if(!(mParser.mDisplaySections & HbDateTimeParser::AmPmSection)) { + deleteAndNull(mAmPmPicker); + mAmPmModel = 0; + } mYearOffset = -1; mMonthOffset = -1; @@ -469,93 +486,95 @@ mMinuteOffset = -1; mSecondOffset = -1; - QPointer lastAdded; + while(mLayout->count()) { + mLayout->removeAt(0); + } + + QPointer lastAdded; for(int i=0;isetModel(mAmPmModel); - //mAmPmPicker->setLoopingEnabled(true); + if(!mAmPmPicker) { + mAmPmPicker = new VIEWER(q); + mAmPmModel = static_cast(mAmPmPicker->model()); + } mLayout->addItem(mAmPmPicker); - mAmPmPicker->primitive("highlight")->hide(); - mAmPmPicker->primitive("separator")->show(); lastAdded = mAmPmPicker; break; case HbDateTimeParser::DaySection: case HbDateTimeParser::DayOfWeekSection: - mDayPicker = new HbTumbleView(q); - mDayModel = new QStringListModel(q); - mDayPicker->setModel(mDayModel); - //mDayPicker->setLoopingEnabled(true); + if(!mDayPicker) { + mDayPicker = new VIEWER(q); + mDayModel = static_cast(mDayPicker->model()); + mDayPicker->setLoopingEnabled(true); + } mLayout->addItem(mDayPicker); - mDayPicker->primitive("highlight")->hide(); - mDayPicker->primitive("separator")->show(); lastAdded = mDayPicker; break; case HbDateTimeParser::MonthSection: - mMonthPicker = new HbTumbleView(q); - mMonthModel = new QStringListModel(q); - mMonthPicker->setModel(mMonthModel); - //mMonthPicker->setLoopingEnabled(true); + if(!mMonthPicker) { + mMonthPicker = new VIEWER(q); + mMonthModel = static_cast(mMonthPicker->model()); + mMonthPicker->setLoopingEnabled(true); + } mLayout->addItem(mMonthPicker); - mMonthPicker->primitive("highlight")->hide(); - mMonthPicker->primitive("separator")->show(); lastAdded = mMonthPicker; break; case HbDateTimeParser::YearSection: case HbDateTimeParser::YearSection2Digits: - mYearPicker = new HbTumbleView(q); - mYearModel = new QStringListModel(q); - mYearPicker->setModel(mYearModel); - //mYearPicker->setLoopingEnabled(true); + if(!mYearPicker) { + mYearPicker = new VIEWER(q); + mYearModel = static_cast(mYearPicker->model()); + mYearPicker->setLoopingEnabled(true); + } mLayout->addItem(mYearPicker); - mYearPicker->primitive("highlight")->hide(); - mYearPicker->primitive("separator")->show(); lastAdded = mYearPicker; break; case HbDateTimeParser::SecondSection: - mSecondPicker = new HbTumbleView(q); - mSecondModel = new QStringListModel(q); - mSecondPicker->setModel(mSecondModel); - //mSecondPicker->setLoopingEnabled(false); + if(!mSecondPicker) { + mSecondPicker = new VIEWER(q); + mSecondModel = static_cast(mSecondPicker->model()); + mSecondPicker->setLoopingEnabled(true); + } mLayout->addItem(mSecondPicker); - mSecondPicker->primitive("highlight")->hide(); - mSecondPicker->primitive("separator")->show(); lastAdded = mSecondPicker; break; case HbDateTimeParser::MinuteSection: - mMinutePicker = new HbTumbleView(q); - mMinuteModel = new QStringListModel(q); - mMinutePicker->setModel(mMinuteModel); - //mMinutePicker->setLoopingEnabled(false); + if(!mMinutePicker) { + mMinutePicker = new VIEWER(q); + mMinuteModel = static_cast(mMinutePicker->model()); + mMinutePicker->setLoopingEnabled(true); + } mLayout->addItem(mMinutePicker); - mMinutePicker->primitive("highlight")->hide(); - mMinutePicker->primitive("separator")->show(); lastAdded = mMinutePicker; break; case HbDateTimeParser::Hour12Section: case HbDateTimeParser::Hour24Section: - mHourPicker = new HbTumbleView(q); - mHourModel = new QStringListModel(q); - mHourPicker->setModel(mHourModel); - //mHourPicker->setLoopingEnabled(true); + if(!mHourPicker) { + mHourPicker = new VIEWER(q); + mHourModel = static_cast(mHourPicker->model()); + mHourPicker->setLoopingEnabled(true); + } mLayout->addItem(mHourPicker); - mHourPicker->primitive("highlight")->hide(); - mHourPicker->primitive("separator")->show(); lastAdded = mHourPicker; break; default: break; } + + if(lastAdded){ + lastAdded->primitive("highlight")->hide(); + lastAdded->primitive("separator")->show(); + } + } //For the last added tumble view, hide the separator. @@ -632,6 +651,9 @@ void HbDateTimePickerPrivate::setRanges() { + //clear all data before inserting + if(mYearModel) mYearModel->removeRows(0,mYearModel->rowCount()); + //insert data if(mIsTwoDigitYearFormat) { mYearOffset = mMinimumDate.date().year()%100; setYearRange(mMinimumDate.date().year()%100,mMaximumDate.date().year()%100); @@ -640,21 +662,27 @@ setYearRange(mMinimumDate.date().year(),mMaximumDate.date().year()); } + if(mMonthModel) mMonthModel->removeRows(0,mMonthModel->rowCount()); mMonthOffset = 1; setMonthRange(1,12);//default all months + if(mDayModel) mDayModel->removeRows(0,mDayModel->rowCount()); mDayOffset = 1; setDayRange(1,31);//default all days + if(mHourModel) mHourModel->removeRows(0,mHourModel->rowCount()); mHourOffset = 0; setHourRange(0,23); + if(mMinuteModel) mMinuteModel->removeRows(0,mMinuteModel->rowCount()); mMinuteOffset = 0; setMinuteRange(0,59); + if(mSecondModel) mSecondModel->removeRows(0,mSecondModel->rowCount()); mSecondOffset = 0; setSecondRange(0,59); + if(mAmPmModel) mAmPmModel->removeRows(0,mAmPmModel->rowCount()); setAmPm(); } @@ -818,9 +846,31 @@ if(mHourPicker) { mHourPicker->setSelected(newDateTime.time().hour()-mHourOffset); } + if(mMinutePicker) { - mMinutePicker->setSelected(newDateTime.time().minute()-mMinuteOffset); + int index = newDateTime.time().minute()-mMinuteOffset; + if(mIntervals[QDateTimeEdit::MinuteSection] > 1){ + for(int i = 0; i < mMinuteModel->rowCount(); i++){ + + if(mMinuteModel->index(i,0).data().toInt() <= newDateTime.time().minute()){ + index = i; + } + else{ + break; + } + + //TODO: if minute is not in the model data then nearest value should be selected. + } + } + else{ + index = newDateTime.time().minute()-mMinuteOffset; + } +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "setMinuteRange:selecting= " << index; +#endif + mMinutePicker->setSelected(index); } + if(mSecondPicker) { #ifdef HBDATETIMEPICKER_DEBUG qDebug() << "setDateTime before: secondOffset=" << mSecondOffset << " time=" << newDateTime.time(); @@ -1001,11 +1051,12 @@ } #ifdef HBDATETIMEPICKER_DEBUG qDebug() << "setMinuteRange: " << start << " ," << end; + qDebug() << "setMinuteRange:interval=" << mIntervals[QDateTimeEdit::MinuteSection]; #endif //calculate the index it should be after resize //the currentIndex gets reset after the resize and gets set to 0 //to work around that issue this is added - int newIndex = mMinutePicker->selected()-(start-mMinuteOffset); + int newIndex = mMinuteModel->index(mMinutePicker->selected(),0).data().toInt(); if(newIndex < 0) { newIndex = 0; } @@ -1013,13 +1064,25 @@ newIndex = end-start; } - resizeModel(mMinuteModel, - mMinuteOffset,mMinuteOffset+mMinuteModel->rowCount()-1, - start,end, - &HbDateTimePickerPrivate::localeMinute, mIntervals[QDateTimeEdit::MinuteSection]); + resizeModel(mMinuteModel, + mMinuteOffset,mMinuteModel->index(mMinuteModel->rowCount() - 1).data().toInt(), + start,end, + &HbDateTimePickerPrivate::localeMinute, + mIntervals[QDateTimeEdit::MinuteSection]); mMinuteOffset = start; - mMinutePicker->setSelected(newIndex); + //Select the nearest value when the range is set. + int index = 0; + + for(int i=start;i 1) { return hourAm.at(0); } @@ -1138,83 +1201,154 @@ to each of the models to resize them its the same logic. but to populate the data need the appropriate locale and format converted data. which is passed as a function pointer instead of creating seven different QStringListModel derived - model classes with one interface/virtual fuction specialization. + model classes with one interface/virtual function specialization. */ void HbDateTimePickerPrivate::resizeModel(QStringListModel *model, int oldStart, int oldEnd, int newStart, int newEnd, QString (HbDateTimePickerPrivate::*localeFunc)(int), int interval) { - if(interval > 1){ - model->removeRows(0, model->rowCount()); - } - - if((model->rowCount() == 0) && (newEnd-newStart>=0)) { - //initialize condition - - for(int i=0;i<=newEnd-newStart;i++) { - //model->setData(index,(this->*localeFunc)(i+newStart));//TODO:add a readable typedef - QString text; + class ConnectionRemover { + public: + ConnectionRemover(HbDateTimePickerPrivate *priv){ + this->priv = priv; + priv->removeConnections(); + } + ~ConnectionRemover() { + priv->makeConnections(); + } + HbDateTimePickerPrivate *priv; + }Obj(this); - if(interval > 1){ - if(((newStart + interval) * i) <= newEnd){ - model->insertRow(i); - text = (this->*localeFunc)(!((newStart + interval)*i) ? newStart : (newStart + interval)*i); +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel: oldStart=" << oldStart + << " oldEnd=" << oldEnd << " newStart=" + << newStart << " newEnd=" << newEnd + << " interval=" << interval; +#endif + bool b1=false,b2=false; + int oldinterval=model->rowCount()>1 ? (model->index(1,0).data().toInt(&b1)-model->index(0,0).data().toInt(&b2)):0; +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:sameoldInterval=" << oldinterval; +#endif + if(b1 && b2 && (oldinterval == interval) && (newStart == oldStart)) { + if(newEnd>oldEnd) { + int rowCount=model->rowCount(); +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:sameinserting(" << rowCount << "," <<(newEnd-oldEnd)/interval << ")"; +#endif + model->insertRows(rowCount,(newEnd-oldEnd)/interval); + for(int i=0;i<((newEnd-oldEnd)/interval);++i) { + QModelIndex index=model->index(i+rowCount,0); + if(index.isValid()) { + model->setData(index,(this->*localeFunc)(((i+1)*interval)+oldEnd)); +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:samesetData(" << ((i+1)*interval)+oldEnd << "," << (this->*localeFunc)((i+1)*interval+oldEnd) << ")"; +#endif + } + } } - else{ - break; + if(oldEnd>newEnd) { + //if the start offset is preset more items can fit at end + int stay=((newEnd-newStart)/interval)+1; + int count=model->rowCount()-stay; +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:removing(" <rowCount()-count << "," << count << ")" + << " data=" << model->index((model->rowCount()-count),0).data().toString(); +#endif + model->removeRows((model->rowCount()-count),count); } - } - else{ - model->insertRow(i); - text = (this->*localeFunc)(i+newStart); + return;//optimizing inserts when interval is set + } else { + if(b1 && b2) { + model->removeRows(0,model->rowCount()); + oldStart = oldEnd = 0; + } } + if((model->rowCount() == 0) && (newEnd-newStart>=0)) { +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:default addition inserting(0," << (newEnd-newStart+1)/interval << ")"; +#endif + + model->insertRows(0,((newEnd-newStart)/interval)+1); + for(int i=0;i<=((newEnd-newStart)/interval);++i) { + QString text=(this->*localeFunc)((i*interval)+newStart); #ifdef HB_TEXT_MEASUREMENT_UTILITY - if ( localeFunc == &HbDateTimePickerPrivate::localeMonth && - HbFeatureManager::instance()->featureStatus( HbFeatureManager::TextMeasurement ) ) { + if ( localeFunc == &HbDateTimePickerPrivate::localeMonth && + HbFeatureManager::instance()->featureStatus( HbFeatureManager::TextMeasurement ) ) { text.append(QChar(LOC_TEST_START)); text.append("qtl_datetimepicker_popup_month_sec"); text.append(QChar(LOC_TEST_END)); - } + } #endif - QModelIndex index=model->index(i,0); - if(index.isValid()) { - model->setData(index,text);//TODO:add a readable typedef + QModelIndex index=model->index(i,0); + if(index.isValid()) { + model->setData(index,text); +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:setData(" << i << "," << text << ")"; +#endif + } } - + return; } - return; - } - if(newStart < oldStart) { - model->insertRows(0,oldStart-newStart); - for(int i=0;iindex(i,0); - if(index.isValid()) { - model->setData(index,(this->*localeFunc)(i+newStart)); + if(newStartinsertRows(0,(oldStart-newStart)/interval); + for(int i=0;i<((oldStart-newStart)/interval);++i) { + QModelIndex index=model->index(i,0); + if(index.isValid()) { + model->setData(index,(this->*localeFunc)((i*interval)+newStart)); +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:setData(" << i << "," << (this->*localeFunc)((i*interval)+newStart) << ")"; +#endif + } } } - } - if(newEnd > oldEnd) { - int rowCount = model->rowCount(); - model->insertRows(rowCount,newEnd-oldEnd); - for(int i=0;iindex(rowCount+i,0); - if(index.isValid()) { - model->setData(index,(this->*localeFunc)(oldEnd+i+1)); + + if(newEnd>oldEnd) { + int rowCount=model->rowCount(); +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:inserting(" << rowCount << "," <<(newEnd-oldEnd)/interval << ")"; +#endif + model->insertRows(rowCount,(newEnd-oldEnd)/interval); + for(int i=0;i<((newEnd-oldEnd)/interval);++i) { + QModelIndex index=model->index(i+rowCount,0); + if(index.isValid()) { + model->setData(index,(this->*localeFunc)(((i+1)*interval)+oldEnd)); +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:setData(" << i << "," << (this->*localeFunc)((i+1)*interval+oldEnd) << ")"; +#endif + } } } - } + if(newStart>oldStart) { +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:removing(0," << (newStart-oldStart)/interval << ")" + << " data=" << model->index((newStart-oldStart)/interval,0).data().toString(); +#endif + model->removeRows(0,(newStart-oldStart)/interval); + } - if(newStart > oldStart) { - model->removeRows(0,newStart-oldStart); - } + if(oldEnd>newEnd) { +//#ifdef HBDATETIMEPICKER_DEBUG +// qDebug() << "resizeModel:removing(" <rowCount()-((oldEnd-newEnd)/interval)<<"," << (oldEnd-newEnd)/interval << ")"; +//#endif +// model->removeRows((model->rowCount()-((oldEnd-newEnd)/interval)),(oldEnd-newEnd)/interval); + //if the start offset is preset more items can fit at end + int stay=((newEnd-newStart)/interval)+1; + int count=model->rowCount()-stay; +#ifdef HBDATETIMEPICKER_DEBUG + qDebug() << "resizeModel:removing(" <rowCount()-count << "," << count << ")" + << " data=" << model->index((model->rowCount()-count),0).data().toString(); +#endif + model->removeRows((model->rowCount()-count),count); + } +} - if(oldEnd > newEnd) { - model->removeRows((model->rowCount()-(oldEnd-newEnd)),oldEnd-newEnd); - } -} void HbDateTimePickerPrivate::createPrimitives() { @@ -1322,7 +1456,9 @@ void HbDateTimePickerPrivate::_q_yearChanged(int index) { +#ifdef HBDATETIMEPICKER_DEBUG qDebug() << "_q_yearChanged:" << index; +#endif //Q_Q(HbDateTimePicker); QDate newDate(mDateTime.date()); if(mIsTwoDigitYearFormat) { @@ -1421,10 +1557,14 @@ if(mMinutePicker) { start=mMinuteOffset; end=start+mMinuteModel->rowCount()-1; - if(isMinimumHour()) { + if(isMinimumHour() ) { start = mMinimumDate.time().minute(); - } else { - start = 0; + } else { + if(mIntervals[QDateTimeEdit::MinuteSection]!=1 && (mIntervals[QDateTimeEdit::MinuteSection]>0)) { + start = mMinimumDate.time().minute()%mIntervals[QDateTimeEdit::MinuteSection]; + } else { + start = 0; + } } if(isMaximumHour()) { end = mMaximumDate.time().minute(); @@ -1482,10 +1622,12 @@ void HbDateTimePickerPrivate::_q_minutesChanged(int index) { + bool *bOk = false; #ifdef HBDATETIMEPICKER_DEBUG qDebug() << "_q_minutesChanged:" << index; + qDebug() << mLocale.toInt(mMinuteModel->index(mMinuteOffset+index,0).data().toString(),bOk, 10); #endif - QTime newTime(mDateTime.time().hour(),mLocale.toInt(mMinuteModel->index(mMinuteOffset+index,0).data().toString()),mDateTime.time().second()); + QTime newTime(mDateTime.time().hour(),mLocale.toInt(mMinuteModel->index(index,0).data().toString(),bOk, 10),mDateTime.time().second()); if(newTime.isValid()) { mDateTime.setTime(newTime); } diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbdatetimepicker_p.h --- a/src/hbwidgets/widgets/hbdatetimepicker_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbdatetimepicker_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,6 +39,8 @@ #include #include +#define VIEWER HbTumbleView + #define HBDATETIMEPICKER_TIME_MIN QTime(0, 0, 0, 0) #define HBDATETIMEPICKER_TIME_MAX QTime(23, 59, 59, 999) @@ -163,9 +165,8 @@ int newStart, int newEnd, QString (HbDateTimePickerPrivate::*localeFuncPtr)(int), int interval = 1); - void createPrimitives(); - void deleteAndNull(HbTumbleView*& t) { + void deleteAndNull(VIEWER*& t) { delete t;t=0; } void deleteAndNull(QStringListModel*& t) { @@ -182,13 +183,13 @@ void _q_ampmChanged(int index); public: - HbTumbleView *mDayPicker; - HbTumbleView *mMonthPicker; - HbTumbleView *mYearPicker; - HbTumbleView *mHourPicker; - HbTumbleView *mMinutePicker; - HbTumbleView *mSecondPicker; - HbTumbleView *mAmPmPicker; + VIEWER *mDayPicker; + VIEWER *mMonthPicker; + VIEWER *mYearPicker; + VIEWER *mHourPicker; + VIEWER *mMinutePicker; + VIEWER *mSecondPicker; + VIEWER *mAmPmPicker; QStringListModel *mDayModel; QStringListModel *mMonthModel; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbgroupbox.cpp --- a/src/hbwidgets/widgets/hbgroupbox.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbgroupbox.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -52,6 +52,8 @@ :HbWidgetPrivate(), mContentWidget( 0 ), mHeadingWidget( 0 ), + collapsed( false), + collapsable( true ), mGroupBoxType( GroupBoxTypeUnknown ) { } @@ -89,7 +91,7 @@ /*! \internal - Sets the group box type + Sets the groupbox type */ void HbGroupBoxPrivate::setGroupBoxType( GroupBoxType type ) { @@ -106,48 +108,19 @@ // set the type and makes necesary primitive creation/deletion switch(mGroupBoxType) { case GroupBoxSimpleLabel: - { - if(mHeadingWidget){ - mHeadingWidget->setType(type); - mHeadingWidget->setVisible(true); - - }else{ - createHeadingWidget(); - } - - if(mContentWidget){ - mContentWidget->setVisible(false); - HbStyle::setItemName( mContentWidget , ""); - } - + { + mHeadingWidget->setType(type); } break; case GroupBoxRichLabel: { - if(mHeadingWidget){ - mHeadingWidget->setVisible(false); - - } - if(mContentWidget){ mContentWidget->setType(type); - mContentWidget->setVisible(true); HbStyle::setItemName( mContentWidget , "contentwidget"); - }else{ - createContentWidget(); - } - } break; case GroupBoxCollapsingContainer: { - if((mHeadingWidget)){ mHeadingWidget->setType(type); - mHeadingWidget->setVisible(true); - }else{ - createHeadingWidget(); - } - - if(mContentWidget){ mContentWidget->setType(type); if(!q->isCollapsed()){ mContentWidget->setVisible(true); @@ -156,9 +129,6 @@ mContentWidget->setVisible(false); HbStyle::setItemName( mContentWidget , ""); } - }else{ - createContentWidget(); - } } break; default: @@ -171,59 +141,60 @@ /*! - @alpha + @beta @hbwidgets \class HbGroupBox \brief HbGroupBox shows the user that a set of controls belong together. - HbGroupBox is a container that provides the following : + HbGroupBox is a container, which can have following Elementes: - \li Heading: text only - \li Body content: arbitrary content (any HbWidget) - \li Disclosure mechanism: expands and collapses the body content; + \li Heading: A heading contains one row text and disclosure indicator if the disclosure mechanism is on. + \li Body content: Can have arbitrary content (any HbWidget)and application is responsible for its layout. + \li Disclosure Indicator: Indicates the expands and collapses state of body; There are three types of GroupBox: - \li Simple Label - it's only function is to show relationship between items. - simple Label shows a heading with marquee, no disclosure mechanism, and - no body content. Marquee is disabled by default.Also it is not focusable. + \li Simple Label - Simple Label is to indicate the users position in the application hierarchy + or to display a textual label and its noninteractive. + Simple Label has a heading text with marquee, no disclosure mechanism, and + no body content.Simple label only has heading element. + Marquee is disabled by default, can be enabled using setMarqueeHeading () .Also it is not focusable. Example usage: For SimpleLabel type groupbox \code // create groupBox and set only heading; without any body content HbGroupBox *simpleLabel = new HbGroupBox(); simpleLabel->setHeading("Simple label groupBox comes with marquee disabled by default"); + //to make marqee enabled + simpleLabel->setMarqueeHeading(true); \endcode \image html simpleLabelgroupbox.png A SimpleLabel groupbox - \li Rich Label - does not show a heading and all content is in the body area - with no marquee and no disclosure control.Body Content must describe its own behavior and layout. + \li Rich Label - Rich label can contain dynamic content,which themselves can be interactive,or informative + with no heading ,no marquee and no disclosure control.Body Content must describe its own behavior and layout. Example usage: For RichLabel type groupbox \code // create groupBox and set only content; without any heading - HbGroupBox *richHeading = new HbGroupBox(); - // content widget can be any HbWidget - // layouting and interaction behaviour inside Content widget is application's responsiblity - HbPushButton *button = new HbPushButton(HbIcon(":/icons/ovi.png"),"Ovi"); + HbGroupBox *richLabel = new HbGroupBox(); + HbPushButton *button = new HbPushButton(HbIcon(QString("qtg_large_info")),"Ovi"); button->setAdditionalText("Launch Ovi Music store"); - button->setOrientation(Qt::Vertical); - button->setTextAlignment(Qt::AlignLeft); - richHeading->setContentWidget(button); + richLabel->setContentWidget(button); + mainlayout->addItem(richLabel); \endcode \image html richLabelgroupbox.png A RichLabel groupbox. In RichLabel type, groupbox provides background for body content. - \li Collapsing container - also allows the user to show or hide the content of the groupBox. + \li Collapsing container - Collapsing container allows the user to show or hide the content of the groupBox. It always has a heading and body content; optionally has a disclosure mechanism. - The heading does not marquee.The collapse/expand disclosure mechanism is located - in the heading and is the chief utility of this type of group box. + The heading does not marquee.The body content must describe its own behavior and layout. + The collapse/expand disclosure mechanism is located in the heading and is the chief utility of this type of groupbox. - If disclosure mechanism is Off, then heading will appear without expand/collapse indication icon + If disclosure mechanism is Off,then heading will appear without expand/collapse indication icon heading.Also the user will not be able to expand/collapse the body content. Example usage:For collapsingContainer groupbox @@ -241,7 +212,7 @@ \image html collapsableContainergroupbox.png A Collapsing container groupbox. In this type, groupBox body content can be expanded/collapsed, - depending on whether or not the group box is collapsed. + depending on whether or not the groupbox is collapsed. CollapsingContainer type groupBox comes with disclosure mechanism On by default. @@ -262,7 +233,7 @@ This signal is emitted only in case of richLabel and collapsing container groupbox, whenever click happened on body content.If the body content set is an interactive widget - and consumes mouse press event, then clicked signal will not get emitted from groupBox in that case. + and consumes mouse press event, then in that case clicked signal will not get emitted from groupBox. */ /*! @@ -273,8 +244,8 @@ */ /*! - @alpha - Constructs a group box with the given \a parent. + @beta + Constructs a groupbox with the given \a parent. */ HbGroupBox::HbGroupBox( QGraphicsItem *parent) : HbWidget(*new HbGroupBoxPrivate, parent) @@ -294,18 +265,22 @@ } /*! - Destructs the group box. + Destructs the groupbox. */ HbGroupBox::~HbGroupBox() { } /*! - @alpha + @beta - Sets the group box heading + Sets the groupbox heading Note: heading property is valid for simpleLabel & collapsing container type. + In case of collapsing container, + if empty heading is set on runtime Groupbox will change to RichLabel. + For Collapsing container, + if body content is collapsible ,heading will appear along with Disclosure indicator. If heading is set on richLabel type groupBox, it will be ignored \sa heading @@ -314,19 +289,32 @@ { Q_D( HbGroupBox ); - if(!d->mHeadingWidget) - d->createHeadingWidget(); - - d->mHeadingWidget->setHeading(text); - - if(d->mContentWidget){ - d->setGroupBoxType(GroupBoxCollapsingContainer); - }else - d->setGroupBoxType(GroupBoxSimpleLabel); + if( !text.isEmpty() ){ + if( !d->mHeadingWidget ){ + d->createHeadingWidget( ); + } + d->mHeadingWidget->setHeading( text ); + if( d->mContentWidget ){ + d->setGroupBoxType(GroupBoxCollapsingContainer); + }else { + d->setGroupBoxType(GroupBoxSimpleLabel); + } + }else{ + if( d->mHeadingWidget ){ + delete d->mHeadingWidget; + d->mHeadingWidget = 0; + if( d->mContentWidget ) { + d->setGroupBoxType( GroupBoxRichLabel ); + }else{ + d->setGroupBoxType( GroupBoxTypeUnknown ); + } + } + } + repolish(); } /*! - @alpha + @beta Returns text shown on the groupBox heading. @@ -346,7 +334,7 @@ } /*! - @alpha + @beta Sets whether the groupbox is collapsable or not @@ -362,19 +350,19 @@ Q_D( HbGroupBox ); if(d->mGroupBoxType == GroupBoxCollapsingContainer){ - if(d->mHeadingWidget->collapsable == collapsable) + if(d->collapsable == collapsable) { return; } - d->mHeadingWidget->collapsable = collapsable; + d->collapsable = collapsable; d->mHeadingWidget->createPrimitives(); - // make it expand otherwise groupBox can't be expanded at all, after this scenario - if(!collapsable && d->mHeadingWidget->collapsed){ + // make it expand otherwise groupBox can't be collapsed at all, after this scenario + if(!collapsable && d->collapsed){ d->mContentWidget->setVisible(true); HbStyle::setItemName( d->mContentWidget , "contentwidget"); - d->mHeadingWidget->collapsed = false; + d->collapsed = false; } d->mHeadingWidget->updatePrimitives(); repolish(); @@ -382,11 +370,11 @@ } /*! - @alpha + @beta Returns whether the groupbox is collapsable or not - By default, group boxes are collapsable. + By default, groupbox is collapsable. \sa setCollapsable */ @@ -394,23 +382,23 @@ { Q_D( const HbGroupBox ); if(d->mHeadingWidget && d->mGroupBoxType == GroupBoxCollapsingContainer) - return d->mHeadingWidget->collapsable; + return d->collapsable; return false; } /*! - @alpha + @beta Sets whether the groupbox collapsed or expanded - If the groupbox is collapsed,the group box's content widget are hidden; + If the groupbox is collapsed,the groupbox's content widget are hidden; otherwise they will be visible setCollapsed on groupbox will emit signal toggled( bool ) upon collapse\expand of content widget - Only collapsable groupboxes can be collapsed. (i.e)this API will not do anything - if group box is not collapsable.By default, group boxes are not collapsed. + Only collapsable groupbox can be collapsed. (i.e)this API will not do anything + if groupbox is not collapsable.By default, groupbox is not collapsed. Note: collapsed property is valid only for collapsing container type. If collapsed is set on simpleLabel or richLabel type groupBox, it will be ignored @@ -421,22 +409,22 @@ { Q_D( HbGroupBox ); if(d->mGroupBoxType == GroupBoxCollapsingContainer){ - if( d->mContentWidget && d->mHeadingWidget->collapsable) { - if ( d->mHeadingWidget->collapsed == collapsed ) + if( d->mContentWidget && d->collapsable) { + if ( d->collapsed == collapsed ) return; - d->mHeadingWidget->collapsed = collapsed; + d->collapsed = collapsed; #ifdef HB_EFFECTS HbEffectInternal::add(HB_GROUPBOX_TYPE,"groupbox_expand", "expand"); //HbEffectInternal::add(HB_GROUPBOX_TYPE,"groupbox_collapse", "collapse"); #endif - if ( d->mHeadingWidget->collapsed ) { + if ( d->collapsed ) { #ifdef HB_EFFECTS HbEffect::start( d->mContentWidget, HB_GROUPBOX_TYPE, "collapse"); #endif - HbStyle::setItemName( d->mContentWidget , ""); + HbStyle::setItemName( d->mContentWidget , QString()); d->mContentWidget->setVisible(false); } else { @@ -445,19 +433,20 @@ #endif HbStyle::setItemName( d->mContentWidget , "contentwidget"); d->mContentWidget->setVisible(true); + repolish(); } d->mHeadingWidget->updatePrimitives(); - emit toggled( d->mHeadingWidget->collapsed ); + emit toggled( d->collapsed ); } - } + } } /*! - @alpha + @beta - Returns whether the group box is collapsed or expanded + Returns whether the groupbox is collapsed or expanded - By default, groupboxes are not collapsed. + By default, groupbox is not collapsed. \sa setCollapsed \sa setCollapsable */ @@ -465,13 +454,13 @@ { Q_D ( const HbGroupBox ); if(d->mGroupBoxType == GroupBoxCollapsingContainer) - return d->mHeadingWidget->collapsed; + return d->collapsed; return false; } /*! - @alpha + @beta Enables the marquee for heading if marqueeHeading is true, otherwise the heading will not marquee. @@ -491,7 +480,7 @@ } /*! - @alpha + @beta Returns true if marquee is enabled for groupbox heading; otherwise returns false. @@ -511,7 +500,7 @@ /*! - @alpha + @beta Sets the groupbox content widget @@ -519,6 +508,7 @@ Ownership of the content widget is transferred to groupbox. If \a widget to set is NULL then content is removed. + And Groupbox type is changed to simpleLabel , if heading is present. contentWidget is valid only for richLabel & collapsing container type. If content Widget is set on simpleLabel type groupBox, it will be ignored @@ -537,25 +527,30 @@ if(!d->mContentWidget) d->createContentWidget(); - d->mContentWidget->setContentWidget(widget); - - if(d->mHeadingWidget){ - d->setGroupBoxType(GroupBoxCollapsingContainer); - }else - d->setGroupBoxType(GroupBoxRichLabel); + if(widget){ + d->mContentWidget->setContentWidget(widget); + if(d->mHeadingWidget){ + d->setGroupBoxType(GroupBoxCollapsingContainer); + }else{ + d->setGroupBoxType(GroupBoxRichLabel); + } + // update content widget primitve + d->mContentWidget->updatePrimitives(); - // collapsed property is set before setContentWidget - if ( d->mGroupBoxType == GroupBoxCollapsingContainer && d->mHeadingWidget->collapsed ) { - d->mContentWidget->setVisible(false); - HbStyle::setItemName( d->mContentWidget , ""); + }else{ + delete d->mContentWidget; + d->mContentWidget = 0; + if(d->mHeadingWidget){ + d->setGroupBoxType(GroupBoxSimpleLabel); + }else{ + d->setGroupBoxType(GroupBoxTypeUnknown); + } } - // update content widget primitve - d->mContentWidget->updatePrimitives(); repolish(); } /*! - @alpha + @beta Returns groupbox content widget @@ -608,6 +603,21 @@ /*! \reimp +*/ + +QSizeF HbGroupBox::sizeHint( Qt::SizeHint which, const QSizeF &constraint ) const +{ + Q_D( const HbGroupBox ); + + //group box will have size zero in case contentwidget and heading not their. + if( !d->mHeadingWidget && !d->mContentWidget ) + return QSizeF( 0.f, 0.f ); + return HbWidget::sizeHint(which, constraint); +} + + +/*! + \reimp */ void HbGroupBox::updatePrimitives() { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbgroupbox.h --- a/src/hbwidgets/widgets/hbgroupbox.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbgroupbox.h Thu Jul 22 16:36:53 2010 +0100 @@ -39,6 +39,7 @@ Q_PROPERTY( bool marqueeHeading READ marqueeHeading WRITE setMarqueeHeading ) public: + explicit HbGroupBox( QGraphicsItem *parent = 0 ); ~HbGroupBox( ); @@ -48,7 +49,7 @@ bool isCollapsable( ) const; bool isCollapsed( ) const; - void setMarqueeHeading( bool marquee = false ); + void setMarqueeHeading( bool marquee = true ); bool marqueeHeading( ) const; void setContentWidget( HbWidget *widget ); @@ -56,20 +57,31 @@ virtual QGraphicsItem *primitive( HbStyle::Primitive primitive ) const; - enum { Type = Hb::ItemType_GroupBox }; - int type( ) const { return Type; } + enum { + Type = Hb::ItemType_GroupBox + }; + + int type( ) const { + return Type; + } +protected: + + QSizeF sizeHint( Qt::SizeHint which, const QSizeF &constraint = QSizeF() ) const; public slots: + void updatePrimitives( ); void setCollapsed( bool collapsed = true ); void setCollapsable( bool collapsable = true ); - signals: +signals: + void clicked(); - void longPress(const QPointF &delta); - void toggled(bool state); + void longPress( const QPointF &delta ); + void toggled( bool state ); protected: + HbGroupBox( HbGroupBoxPrivate &dd, QGraphicsItem *parent ); private: diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbgroupbox_p.h --- a/src/hbwidgets/widgets/hbgroupbox_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbgroupbox_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -57,9 +57,12 @@ void createContentWidget(); void setGroupBoxType(GroupBoxType type); +public: HbGroupBoxContentWidget *mContentWidget; HbGroupBoxHeadingWidget *mHeadingWidget; + bool collapsed; + bool collapsable; GroupBoxType mGroupBoxType; }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbgroupboxcontentwidget_p.cpp --- a/src/hbwidgets/widgets/hbgroupboxcontentwidget_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbgroupboxcontentwidget_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -32,7 +32,8 @@ #include #include #include -#endif +#include +#endif /* internal @@ -123,11 +124,13 @@ if( groupBoxType != type ){ groupBoxType = type; // set dynamic properties for type - if(groupBoxType == GroupBoxCollapsingContainer) + if(groupBoxType == GroupBoxCollapsingContainer){ setProperty("groupBoxType",3); - else if(groupBoxType == GroupBoxRichLabel) + } + else if(groupBoxType == GroupBoxRichLabel){ + contentPressed = false; setProperty("groupBoxType",2); - + } if(groupBoxType != GroupBoxSimpleLabel){ createPrimitives(); //createConnection(); @@ -142,22 +145,15 @@ */ void HbGroupBoxContentWidget::setContentWidget( HbWidget *widget ) { - // delete old content set - if ( mContent ) { - delete mContent; - mContent = 0; - } - // if NULL widget is passed don't do anything - if ( !widget ) { - return; - } - - mContent = widget; - style()->setItemName( mContent , "content" ); - mContent->setParentItem( this); - - if(groupBoxType == GroupBoxRichLabel){ - contentPressed = false; + if ( widget != mContent ) { + // delete old content set + if ( mContent ) { + delete mContent; + mContent = 0; + } + mContent = widget; + style()->setItemName( mContent , "content" ); + mContent->setParentItem( this); } } @@ -199,7 +195,8 @@ case ItemChildRemovedChange: repolish(); break; - case ItemSceneHasChanged: + case ItemSceneHasChanged: + case ItemVisibleChange: updatePrimitives(); break; default: @@ -272,10 +269,17 @@ if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { switch(tap->state()) { case Qt::GestureStarted: // + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + if (!tap->property(HbPrivate::ThresholdRect.latin1()).toRect().isValid()) { + tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); + } + contentPressed=true; updatePrimitives(); break; case Qt::GestureCanceled: // Reset state + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + contentPressed=false; updatePrimitives(); break; @@ -285,6 +289,7 @@ } break; case Qt::GestureFinished: // emit clicked + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); contentPressed=false; updatePrimitives(); if(tap->tapStyleHint() == HbTapGesture::Tap) { diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbgroupboxheadingwidget_p.cpp --- a/src/hbwidgets/widgets/hbgroupboxheadingwidget_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbgroupboxheadingwidget_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -35,7 +35,9 @@ #endif #ifdef HB_GESTURE_FW #include +#include #include +#include #endif #include @@ -55,8 +57,6 @@ mIconItem( 0 ), mTextItem( 0 ), mBackgroundItem( 0 ), - collapsable( true ), - collapsed( false), marqueeEnabled( false ), headingPressed(false), groupBoxType( GroupBoxTypeUnknown ) @@ -80,11 +80,7 @@ */ void HbGroupBoxHeadingWidget::init( ) { - createPrimitives( ); - if ( groupBoxType == GroupBoxCollapsingContainer ){ - createConnection( ); - } #ifdef HB_GESTURE_FW grabGesture( Qt::TapGesture ); #endif @@ -95,7 +91,7 @@ */ void HbGroupBoxHeadingWidget::createPrimitives() { - if( groupBoxType == GroupBoxCollapsingContainer && collapsable ){ + if( groupBoxType == GroupBoxCollapsingContainer && groupBox->isCollapsable() ){ if ( !mIconItem ) { mIconItem = style( )->createPrimitive( HbStyle::P_GroupBoxHeading_icon , this ); } @@ -181,7 +177,7 @@ if( groupBoxType == GroupBoxCollapsingContainer ){ createConnection(); // collapsed is false by default for CollapsingContainer - collapsed = false; + //collapsed = false; // marquee is disabled by default for CollapsingContainer marqueeEnabled = false; } @@ -200,18 +196,17 @@ */ void HbGroupBoxHeadingWidget::setHeading( const QString &text ) { - if( headingText == text ) - return; - - headingText = text; + if( headingText != text ){ + headingText = text; - HbStyleOptionGroupBox groupBoxOption; - initStyleOption( &groupBoxOption ); - if ( groupBoxType == GroupBoxCollapsingContainer ) { - style( )->updatePrimitive( mTextItem , HbStyle::P_GroupBoxHeading_text , &groupBoxOption ); - } - else { - style( )->updatePrimitive( mTextItem , HbStyle::P_GroupBoxMarquee_text , &groupBoxOption ); + HbStyleOptionGroupBox groupBoxOption; + initStyleOption( &groupBoxOption ); + if ( groupBoxType == GroupBoxCollapsingContainer ) { + style( )->updatePrimitive( mTextItem , HbStyle::P_GroupBoxHeading_text , &groupBoxOption ); + } + else { + style( )->updatePrimitive( mTextItem , HbStyle::P_GroupBoxMarquee_text , &groupBoxOption ); + } } } @@ -221,14 +216,13 @@ */ void HbGroupBoxHeadingWidget::setMarqueeHeading( bool marquee ) { - if( marqueeEnabled == marquee ) - return; + if( marqueeEnabled != marquee ){ + marqueeEnabled = marquee; - marqueeEnabled = marquee; - - HbStyleOptionGroupBox groupBoxOption; - initStyleOption( &groupBoxOption ); - style()->updatePrimitive( mTextItem, HbStyle::P_GroupBoxMarquee_text, &groupBoxOption); + HbStyleOptionGroupBox groupBoxOption; + initStyleOption( &groupBoxOption ); + style()->updatePrimitive( mTextItem, HbStyle::P_GroupBoxMarquee_text, &groupBoxOption); + } } /*! @@ -263,7 +257,8 @@ void HbGroupBoxHeadingWidget::initStyleOption( HbStyleOptionGroupBox *option ) const { HbWidget::initStyleOption( option ); - option->collapsed = collapsed; + //option->collapsed = collapsed; + option->collapsed = groupBox->isCollapsed(); option->heading = headingText; option->marqueeEnabled = marqueeEnabled; // state & type info reqd fo background primitve updation @@ -284,25 +279,10 @@ QVariant HbGroupBoxHeadingWidget::itemChange( GraphicsItemChange change, const QVariant &value ) { switch ( change ) { - case ItemVisibleHasChanged: { - /*if (value.toBool() == true){ - if (mTextItem) { - HbStyleOptionGroupBox groupBoxOption; - initStyleOption(&groupBoxOption); - style()->updatePrimitive( mTextItem, HbStyle::P_GroupBoxHeading_text, &groupBoxOption); - } - }*/ - } + case ItemVisibleChange: + case ItemSceneHasChanged: + updatePrimitives(); break; - - case ItemSceneHasChanged: { - if(!value.isNull()) - - - updatePrimitives(); - } - break; - case ItemChildAddedChange: case ItemChildRemovedChange: repolish(); @@ -322,7 +302,7 @@ Q_UNUSED( event ) #else HbWidget::mousePressEvent( event ); - if ( !collapsable ){ + if ( !( groupBox->isCollapsable( ) ) ){ event->ignore(); return; } @@ -389,11 +369,16 @@ switch( tap->state() ) { case Qt::GestureStarted: // { - if ( !collapsable ){ + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),Qt::TapGesture); + if (!tap->property(HbPrivate::ThresholdRect.latin1()).toRect().isValid()) { + tap->setProperty(HbPrivate::ThresholdRect.latin1(), mapRectToScene(boundingRect()).toRect()); + } + + if ( !(groupBox->isCollapsable( )) ){ event->ignore( tap ); return; } - if ( collapsable ) { + if ( groupBox->isCollapsable( ) ) { HbWidgetFeedback::triggered( this, Hb::InstantPressed, Hb::ModifierCollapsedItem ); } else { @@ -413,6 +398,8 @@ break; case Qt::GestureCanceled: // Reset state { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + headingPressed = false; HbStyleOptionGroupBox groupBoxOption; @@ -424,7 +411,9 @@ } case Qt::GestureFinished: // emit clicked { - if ( collapsable ) { + scene()->setProperty(HbPrivate::OverridingGesture.latin1(),QVariant()); + + if ( groupBox->isCollapsable( ) ) { HbWidgetFeedback::triggered( this, Hb::InstantReleased, Hb::ModifierCollapsedItem ); } else { HbWidgetFeedback::triggered( this, Hb::InstantReleased ); @@ -436,7 +425,7 @@ HbEffect::start( mIconItem, HB_GROUPBOX_HEADING_TYPE, "iconclick" ); #endif } - emit clicked( !collapsed ); + emit clicked( !(groupBox->isCollapsed()) ); } // background primitive updation, upon mouse release headingPressed = false; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbgroupboxheadingwidget_p.h --- a/src/hbwidgets/widgets/hbgroupboxheadingwidget_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbgroupboxheadingwidget_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -63,8 +63,6 @@ QGraphicsItem *mBackgroundItem; QString headingText; - bool collapsable; - bool collapsed; bool marqueeEnabled; bool headingPressed; GroupBoxType groupBoxType; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hblabel.cpp --- a/src/hbwidgets/widgets/hblabel.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hblabel.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -30,13 +30,13 @@ #include #include -#include "hblabel.h" #include "hbiconitem.h" #include "hbinstance.h" #include "hbcolorscheme.h" #include "hbwidget_p.h" #include "hbstyleoptionlabel_p.h" #include "hbwidgetbase.h" +#include "hblabel.h" /*! @alpha @@ -125,7 +125,7 @@ mElideMode(Qt::ElideRight), mTextWrapping(Hb::TextNoWrap), mAspectRatioMode(Qt::KeepAspectRatio), - mPrimitiveItem(NULL), + mPrimitiveItem(0), mActivePrimitive(HbStyle::P_None) { } @@ -134,7 +134,7 @@ { if (mPrimitiveItem) { delete mPrimitiveItem; - mPrimitiveItem = NULL; + mPrimitiveItem = 0; mActivePrimitive = HbStyle::P_None; } @@ -160,7 +160,7 @@ if (mActivePrimitive != primitiveId) { mActivePrimitive = primitiveId; createPrimitives(); - q->repolish(); // reconecting new primitive to HbMeshLayout so it is really needed! + q->repolish(); // reconecting new primitive to HbAnchorLayout so it is really needed! } q->updatePrimitives(); } @@ -185,7 +185,7 @@ if (mActivePrimitive != HbStyle::P_Label_icon) { mActivePrimitive = HbStyle::P_Label_icon; createPrimitives(); - q->repolish(); // reconecting new primitive to HbMeshLayout so it is really needed! + q->repolish(); // reconecting new primitive to HbAnchorLayout so it is really needed! } q->updatePrimitives(); } @@ -199,7 +199,7 @@ { Q_Q(HbLabel); - Q_ASSERT(mPrimitiveItem==NULL); + Q_ASSERT(mPrimitiveItem==0); if (mActivePrimitive != HbStyle::P_None) { mPrimitiveItem = q->style()->createPrimitive(mActivePrimitive, q); @@ -544,6 +544,14 @@ } } +QSizeF HbLabel::sizeHint ( Qt::SizeHint which, const QSizeF & constraint ) const +{ + if (isEmpty()) { + return QSizeF(0,0); + } + return HbWidget::sizeHint(which,constraint); +} + /*! Slot to be called when the style primitives need to be updated. This function does not initiate redrawing this widget. diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hblabel.h --- a/src/hbwidgets/widgets/hblabel.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hblabel.h Thu Jul 22 16:36:53 2010 +0100 @@ -93,6 +93,7 @@ HbLabel(HbLabelPrivate &dd, QGraphicsItem *parent); void initStyleOption(HbStyleOptionLabel *option) const; + QSizeF sizeHint ( Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const; private: Q_DECLARE_PRIVATE_D(d_ptr, HbLabel) diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbpushbutton.cpp --- a/src/hbwidgets/widgets/hbpushbutton.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbpushbutton.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -42,7 +42,8 @@ #include #include #include - +#include +#include /*! @beta @@ -217,17 +218,6 @@ } } - - -void HbPushButtonPrivate::_q_handleLongPress(QPointF point) -{ - Q_Q(HbPushButton); - if(!longPress){ - longPress = true; - emit q->longPress( point ); - } -} - void HbPushButtonPrivate::_q_handleLongKeyPress( ) { Q_Q( HbPushButton ); @@ -382,6 +372,9 @@ HbStyleOptionPushButton buttonOption; initStyleOption( &buttonOption ); style( )->updatePrimitive( d->textItem, HbStyle::P_PushButton_text, &buttonOption); + if ( isEnabled() ) { + setProperty("state", "normal"); + } } if(doPolish) { repolish( ); @@ -424,6 +417,9 @@ HbStyleOptionPushButton buttonOption; initStyleOption( &buttonOption ); style( )->updatePrimitive( d->additionalTextItem, HbStyle::P_PushButton_additionaltext, &buttonOption); + if ( isEnabled() ) { + setProperty("state", "normal"); + } } if( doPolish ) { repolish(); @@ -456,7 +452,8 @@ Q_D(HbPushButton); if ( d->icon != icon ) { - bool doPolish = icon.isNull( ) || d->icon.isNull(); + //checking for d->polished to avoid extra polish loop + bool doPolish = (icon.isNull( ) || d->icon.isNull()) && d->polished; d->icon = icon; d->createPrimitives( ); //updatePrimitives(); @@ -464,6 +461,9 @@ HbStyleOptionPushButton buttonOption; initStyleOption( &buttonOption ); style()->updatePrimitive( d->iconItem, HbStyle::P_PushButton_icon, &buttonOption ); + if ( isEnabled() ) { + setProperty("state", "normal"); + } } if( doPolish ) { @@ -694,6 +694,7 @@ } /*! + \reimp Initializes \a option with the values from this HbPushButton. This method is useful for subclasses when they need a HbStyleOptionPushButton, but don't want to fill in all the information themselves. @@ -747,7 +748,8 @@ case Qt::Key_Up: case Qt::Key_Left: case Qt::Key_Right: - case Qt::Key_Down:{ + case Qt::Key_Down: + if( d->keyNavigation()) { d->navigationKeyPress = true; } break; @@ -779,7 +781,8 @@ case Qt::Key_Up: case Qt::Key_Left: case Qt::Key_Right: - case Qt::Key_Down:{ + case Qt::Key_Down: + if ( d->keyNavigation() ) { d->navigationKeyPress = false; } break; @@ -858,46 +861,46 @@ { Q_D(HbPushButton); if(HbTapGesture *tap = qobject_cast(event->gesture(Qt::TapGesture))) { + bool hit = hitButton(mapFromScene(event->mapToGraphicsScene(tap->position()))); switch(tap->state()) { - case Qt::GestureStarted:{ + case Qt::GestureStarted: + if( hit ){ #ifdef HB_EFFECTS - HbEffect::start( this, HB_PUSHBUTTON_TYPE, "pressed" ); + HbEffect::start( this, HB_PUSHBUTTON_TYPE, "pressed" ); #endif + if( d->checkable && !d->checked) { + setProperty( "state", "latched" ); + }else if(!d->checkable) { + setProperty( "state", "pressed" ); + } + } + break; + case Qt::GestureUpdated: + if(tap->tapStyleHint() == HbTapGesture::TapAndHold && hit) { + d->longPress = true; + emit longPress( event->mapToGraphicsScene(tap->position()) ); + } + break; + case Qt::GestureCanceled: + setProperty( "state", "normal" ); + break; + case Qt::GestureFinished: + if( hit ){ +#ifdef HB_EFFECTS + HbEffect::start( this, HB_PUSHBUTTON_TYPE, "released" ); +#endif + } if( d->checkable && !d->checked) { setProperty( "state", "latched" ); - }else if(!d->checkable) { - setProperty( "state", "pressed" ); - } - } - break; - case Qt::GestureUpdated: - if(tap->tapStyleHint() == HbTapGesture::TapAndHold) { - d->longPress = true; - emit longPress( event->mapToGraphicsScene(tap->position()) ); - } - break; - case Qt::GestureCanceled: - setProperty( "state", "normal" ); - break; - case Qt::GestureFinished:{ -#ifdef HB_EFFECTS - HbEffect::start( this, HB_PUSHBUTTON_TYPE, "released" ); -#endif - if( d->checkable && !d->checked) { - setProperty( "state", "latched" ); - }else { + }else { setProperty( "state", "normal" ); } - - } - break; - default: - break; + break; + default: + break; } } - HbAbstractButton::gestureEvent( event ); - } #endif diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbpushbutton.h --- a/src/hbwidgets/widgets/hbpushbutton.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbpushbutton.h Thu Jul 22 16:36:53 2010 +0100 @@ -122,7 +122,6 @@ Q_DECLARE_PRIVATE_D( d_ptr, HbPushButton ) Q_DISABLE_COPY( HbPushButton ) - Q_PRIVATE_SLOT( d_func(),void _q_handleLongPress(QPointF) ) Q_PRIVATE_SLOT( d_func(),void _q_handleLongKeyPress( ) ) }; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbpushbutton_p.h --- a/src/hbwidgets/widgets/hbpushbutton_p.h Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbpushbutton_p.h Thu Jul 22 16:36:53 2010 +0100 @@ -60,7 +60,6 @@ void createPrimitives(); void initialize(); - void _q_handleLongPress(QPointF point); void _q_handleLongKeyPress( ); QGraphicsItem *textItem; diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbsearchpanel_p.cpp --- a/src/hbwidgets/widgets/hbsearchpanel_p.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbsearchpanel_p.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -65,7 +65,6 @@ constructUi(); //set default values - q->setAttribute(Hb::InputMethodNeutral); q->setFlag(QGraphicsItem::ItemIsFocusable); // connect initial state signals @@ -163,6 +162,7 @@ if(mCancelEnabled) { addCancelButton(); } + q->setFocusProxy(mLineEdit); } void HbSearchPanelPrivate::_q_hideClicked() diff -r 730c025d4b77 -r f378acbc9cfb src/hbwidgets/widgets/hbtransparentwindow.cpp --- a/src/hbwidgets/widgets/hbtransparentwindow.cpp Thu Jul 15 14:03:49 2010 +0100 +++ b/src/hbwidgets/widgets/hbtransparentwindow.cpp Thu Jul 22 16:36:53 2010 +0100 @@ -60,6 +60,7 @@ HbTransparentWindow::HbTransparentWindow(QGraphicsItem *parent) : HbWidget(parent) { + setFlag(QGraphicsItem::ItemUsesExtendedStyleOption, true); } diff -r 730c025d4b77 -r f378acbc9cfb src/src.pro --- a/src/src.pro Thu Jul 15 14:03:49 2010 +0100 +++ b/src/src.pro Thu Jul 22 16:36:53 2010 +0100 @@ -83,3 +83,4 @@ } include(hbcommon.pri) +include(symbian_installs/symbian_installs.pri) diff -r 730c025d4b77 -r f378acbc9cfb src/symbian_installs/backup_20022E82/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/symbian_installs/backup_20022E82/backup_registration.xml Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,5 @@ + + + + + diff -r 730c025d4b77 -r f378acbc9cfb src/symbian_installs/hb.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/symbian_installs/hb.pkg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,93 @@ +; +; Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; Contact: Nokia Corporation (developer.feedback@nokia.com) +; +; This file is part of the HbCore module of the UI Extensions for Mobile. +; +; GNU Lesser General Public License Usage +; This file may be used under the terms of the GNU Lesser General Public +; License version 2.1 as published by the Free Software Foundation and +; appearing in the file LICENSE.LGPL included in the packaging of this file. +; Please review the following information to ensure the GNU Lesser General +; Public License version 2.1 requirements will be met: +; http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +; +; In addition, as a special exception, Nokia gives you certain additional +; rights. These rights are described in the Nokia Qt LGPL Exception +; version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +; +; If you have questions regarding the use of this file, please contact +; Nokia at developer.feedback@nokia.com. + + +; Language +&EN + + +; SIS header: name, uid, version +#{"Hb"},(0x2002FF63),1,0,0,TYPE=SA, RU + +; Localised Vendor name +%{"Nokia, Qt Software"} + +; Unique Vendor name +:"Nokia, Qt Software" + + +; Dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} +(0x2001E61C),4,6,0,{"QtLibs pre-release"} + + +; DEPLOYMENT + +; Hb +"/epoc32/release/armv5/urel/HbCore.dll" - "!:/sys/bin/HbCore.dll" +"/epoc32/release/armv5/urel/HbWidgets.dll" - "!:/sys/bin/HbWidgets.dll" +"/epoc32/release/armv5/urel/HbUtils.dll" - "!:/sys/bin/HbUtils.dll" + +; Servers +"/epoc32/release/armv5/urel/hbthemeserver.exe" - "!:/sys/bin/hbthemeserver.exe" +"/epoc32/release/armv5/urel/hbthemechanger.exe"- "!:/sys/bin/hbthemechanger.exe" +"/epoc32/release/armv5/urel/hbsplashgenerator.exe" - "!:/sys/bin/hbsplashgenerator.exe" +"/epoc32/release/armv5/urel/hbdevicedialogappserver.exe" - "!:/sys/bin/hbdevicedialogappserver.exe" +"/epoc32/release/armv5/urel/hbiconpreloader.exe" - "!:/sys/bin/hbiconpreloader.exe" + +; Plugins +"/epoc32/release/armv5/urel/HbDeviceNotificationDialogPlugin.dll" - "!:/sys/bin/HbDeviceNotificationDialogPlugin.dll" +"/epoc32/release/armv5/urel/HbIndicatorMenuPlugin.dll" - "!:/sys/bin/HbIndicatorMenuPlugin.dll" +"/epoc32/release/armv5/urel/HbDeviceProgressDialogPlugin.dll" - "!:/sys/bin/HbDeviceProgressDialogPlugin.dll" +"/epoc32/release/armv5/urel/HbDeviceMessageBoxPlugin.dll" - "!:/sys/bin/HbDeviceMessageBoxPlugin.dll" + +; EcomPlugins +"/epoc32/data/z/resource/plugins/hbthemeserveroogmplugin.rsc"- "!:/resource/plugins/hbthemeserveroogmplugin.rsc" +"/epoc32/release/armv5/urel/hbthemeserveroogmplugin.dll" - "!:/sys/bin/hbthemeserveroogmplugin.dll" + +; HbFeedback +"/epoc32/release/armv5/urel/HbFeedback.dll" - "!:/sys/bin/HbFeedback.dll" +"/epoc32/release/armv5/urel/HbFeedbackEffectPlugin.dll" - "!:/sys/bin/HbFeedbackEffectPlugin.dll" + +; HbInput +"/epoc32/release/armv5/urel/HbInput.dll" - "!:/sys/bin/HbInput.dll" +"/epoc32/release/armv5/urel/HbTouchInput.dll" - "!:/sys/bin/HbTouchInput.dll" +"/epoc32/release/armv5/urel/HbAutoComplete.dll" - "!:/sys/bin/HbAutoComplete.dll" +"/epoc32/data/z/resource/plugins/inputengines/HbAutoComplete.qtplugin" - "!:/resource/plugins/HbAutoComplete.qtplugin" +"/epoc32/data/z/resource/plugins/inputmethods/HbTouchInput.qtplugin" - "!:/resource/plugins/HbTouchInput.qtplugin" + +; Misc +"/epoc32/winscw/c/resource/hbi18n/translations/directorylocalizer_en_GB.qm" - "!:/resource/hbi18n/translations/directorylocalizer_en_GB.qm" +"/epoc32/winscw/c/resource/hbi18n/translations/directorylocalizer_de_DE.qm" - "!:/resource/hbi18n/translations/directorylocalizer_de_DE.qm" +"/epoc32/winscw/c/resource/hbi18n/translations/languages.qm" - "!:/resource/hbi18n/translations/languages.qm" +"/epoc32/winscw/c/resource/hbi18n/translations/language_list.txt" - "!:/resource/hbi18n/translations/language_list.txt" + +"/epoc32/data/z/resource/displaydefinition.xml" - "!:/resource/displaydefinition.xml" + +; Central repository files +"/epoc32/data/z/private/10202BE9/2002C304.txt" -"!:/system/data/10202BE9/2002C304.txt" +"/epoc32/data/z/private/10202BE9/2002C3AE.txt" -"!:/system/data/10202BE9/2002C3AE.txt" +"/epoc32/data/z/private/10202BE9/2002C384.txt" -"!:/system/data/10202BE9/2002C384.txt" +"/epoc32/data/z/private/10202BE9/20022E82.txt" -"!:/system/data/10202BE9/20022E82.txt" diff -r 730c025d4b77 -r f378acbc9cfb src/symbian_installs/hb_stub.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/symbian_installs/hb_stub.pkg Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,82 @@ +; +; Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +; All rights reserved. +; Contact: Nokia Corporation (developer.feedback@nokia.com) +; +; This file is part of the HbCore module of the UI Extensions for Mobile. +; +; GNU Lesser General Public License Usage +; This file may be used under the terms of the GNU Lesser General Public +; License version 2.1 as published by the Free Software Foundation and +; appearing in the file LICENSE.LGPL included in the packaging of this file. +; Please review the following information to ensure the GNU Lesser General +; Public License version 2.1 requirements will be met: +; http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +; +; In addition, as a special exception, Nokia gives you certain additional +; rights. These rights are described in the Nokia Qt LGPL Exception +; version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +; +; If you have questions regarding the use of this file, please contact +; Nokia at developer.feedback@nokia.com. + +; Description: Installation file for Hb stub SIS + +; Languages +&EN + +; SIS header: name, uid, version +# {"Hb"}, (0x2002FF63), 1, 0, 0, TYPE=SA + +; Localised Vendor name +%{"Nokia, Qt Software"} + +; Unique Vendor name +:"Nokia, Qt Software" + +; Install files + +; Hb +""- "z:\sys\bin\HbCore.dll" +""- "z:\sys\bin\HbWidgets.dll" +""- "z:\sys\bin\HbUtils.dll" + +; Servers +""- "z:\sys\bin\hbthemeserver.exe" +""- "z:\sys\bin\hbthemechanger.exe" +""- "z:\sys\bin\hbsplashgenerator.exe" +""- "z:\sys\bin\hbdevicedialogappserver.exe" + +; Plugins +""- "z:\sys\bin\HbDeviceNotificationDialogPlugin.dll" +""- "z:\sys\bin\HbIndicatorMenuPlugin.dll" +""- "z:\sys\bin\HbDeviceProgressDialogPlugin.dll" +""- "z:\sys\bin\HbDeviceMessageBoxPlugin.dll" + +; EcomPlugins +""- "z:\resource\plugins\hbthemeserveroogmplugin.rsc" +""- "z:\sys\bin\hbthemeserveroogmplugin.dll" + +; HbFeedback +""- "z:\sys\bin\HbFeedback.dll" +""- "z:\sys\bin\HbFeedbackEffectPlugin.dll" + +; HbInput +""- "z:\sys\bin\HbInput.dll" +""- "z:\sys\bin\HbTouchInput.dll" +""- "z:\sys\bin\HbAutoComplete.dll" +""- "z:\resource\plugins\HbAutoComplete.qtplugin" +""- "z:\resource\plugins\HbTouchInput.qtplugin" + +; Misc +""- "z:\resource\hbi18n\translations\directorylocalizer_en_GB.qm" +""- "z:\resource\hbi18n\translations\directorylocalizer_de_DE.qm" +""- "z:\resource\hbi18n\translations\languages.qm" +""- "z:\resource\hbi18n\translations\language_list.txt" +""- "z:\resource\displaydefinition.xml" + +; Central repository files +""-"z:\system\data\10202BE9\2002C304.txt" +""-"z:\system\data\10202BE9\2002C3AE.txt" +""-"z:\system\data\10202BE9\2002C384.txt" +""-"z:\system\data\10202BE9\20022E82.txt" diff -r 730c025d4b77 -r f378acbc9cfb src/symbian_installs/symbian_deployment.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/symbian_installs/symbian_deployment.pri Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,64 @@ +# +############################################################################# +## +## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# +# + +# installation file generation +symbian { + load(data_caging_paths) + + vendorinfo = \ + "; Localised Vendor name" \ + "%{\"Nokia\"}" \ + " " \ + "; Unique Vendor name" \ + ":\"Nokia\"" \ + " " + orbitHeader = "$${LITERAL_HASH}{"Hb"},(0x2002FF63),0,1,0,TYPE=SA, RU" + orbitBinaries.pkg_prerules = vendorinfo orbitHeader + + orbitBinaries.sources = hbthemechanger.exe hbsplashgenerator.exe hbdevicedialogappserver.exe hbiconpreloader.exe \ + HbDeviceNotificationDialogPlugin.dll HbIndicatorMenuPlugin.dll HbDeviceProgressDialogPlugin.dll HbDeviceMessageBoxPlugin.dll \ + hbthemeserveroogmplugin.dll hbthemeserver.exe + orbitBinaries.path = !:/sys/bin + DEPLOYMENT += orbitBinaries + + orbitPlugins.sources = HbAutoComplete.dll HbTouchInput.dll + orbitPlugins.path = !:/resource/plugins + orbitPlugins.sources += $${EPOCROOT}$${HW_ZDIR}/resource/plugins/hbthemeserveroogmplugin.rsc + DEPLOYMENT += orbitPlugins + + hbi18n.sources += directorylocalizer_en_GB.qm directorylocalizer_de_DE.qm languages.qm language_list.txt + hbi18n.path = !:/resource/hbi18n/translations + DEPLOYMENT += hbi18n + + displaydef.sources += displaydefinition.xml + displaydef.path = !:/resource + DEPLOYMENT += displaydef + + cenrep.sources += 2002C304.txt 2002C3AE.txt 2002C384.txt 20022E82.txt + cenrep.path = !:/system/data/10202BE9 + DEPLOYMENT += cenrep +} diff -r 730c025d4b77 -r f378acbc9cfb src/symbian_installs/symbian_installs.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/symbian_installs/symbian_installs.pri Thu Jul 22 16:36:53 2010 +0100 @@ -0,0 +1,33 @@ +# +############################################################################# +## +## Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). +## All rights reserved. +## Contact: Nokia Corporation (developer.feedback@nokia.com) +## +## This file is part of the UI Extensions for Mobile. +## +## GNU Lesser General Public License Usage +## This file may be used under the terms of the GNU Lesser General Public +## License version 2.1 as published by the Free Software Foundation and +## appearing in the file LICENSE.LGPL included in the packaging of this file. +## Please review the following information to ensure the GNU Lesser General +## Public License version 2.1 requirements will be met: +## http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +## +## In addition, as a special exception, Nokia gives you certain additional +## rights. These rights are described in the Nokia Qt LGPL Exception +## version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +## +## If you have questions regarding the use of this file, please contact +## Nokia at developer.feedback@nokia.com. +## +############################################################################# +# + + +# Backup registration files +symbian { + BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/backup_20022E82/backup_registration.xml $${EPOCROOT}epoc32/winscw/c/private/20022E82/backup_registration.xml" + BLD_INF_RULES.prj_exports += "$$section(PWD, ":", 1)/backup_20022E82/backup_registration.xml $${EPOCROOT}epoc32/data/z/private/20022E82/backup_registration.xml" +} diff -r 730c025d4b77 -r f378acbc9cfb tsrc/resources/cssTestdata/css1.css --- a/tsrc/resources/cssTestdata/css1.css Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -@variables -{ - BodyColor: #000000, #000000, #000000, #000000, #000000; - BackgroundColor: #00ff00, #ff0000, #0000ff, #00ff00, #ff0000; - BorderColor: #00ff00, #ff0000, #0000ff, #ff0000, #0000ff; - HighlightColor: var(BorderColor); - label_disabled: #555555; -} - -HbWidget -{ - body-color: #00ff00, #ff0000, #0000ff; - background-color: var(BackgroundColor); - hcolor: var(HighlightColor); - text-color: var(BorderColor); -} - -HbWidget#TestWidget -{ - body-color: #010200, #ff0000, #0000ff; - background-color: var(BackgroundColor); - hcolor: var(HighlightColor); - text-color: var(BorderColor); -} - -HbLabel -{ - body-color: #000000, #000000, #000000, #000000, #000000; - background-color: #000000, #000000, #000000, #000000, #000000; - hcolor: #000000, #000000, #000000, #000000, #000000; - text-color: #000000, #000000, #000000, #000000, #000000; -} - -HbLabel[plainText="TestLabel"] -{ - body-color: var(HighlightColor); - background-color: #010200, #ff0000, #0000ff; - hcolor: var(BackgroundColor); - text-color: var(BorderColor); -} - -HbLabel[!enabled] -{ - body-color: var(label_disabled); - background-color: #010200, #ff0000, #0000ff; - hcolor: var(BackgroundColor); - text-color: var(BorderColor); -} - -HbWidget HbToolBar -{ - body-color: #000000, #234567, #345678, #456789, #567890; -} - - - -HbLabel > HbToolBar -{ - body-color: #123456, #234567, #345678, #456789, #567890; -} - - -HbWidget HbDialog -{ - body-color: #010101, #234567, #345678, #456789, #567890; -} - - -HbLabel HbDialog -{ - body-color: #010203, #234567, #345678, #456789, #567890; -} diff -r 730c025d4b77 -r f378acbc9cfb tsrc/resources/cssTestdata/css2.css --- a/tsrc/resources/cssTestdata/css2.css Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,117 +0,0 @@ -* { - border-color: black; - } - -* { - Float: black ; - UnknownProperty: red ; - BackgroundColor: blue ; - Color: green ; - Font: white ; - FontFamily: red ; - FontSize: blue ; - FontStyle: green ; - FontWeight: black ; - Margin: white ; - MarginBottom: red ; - MarginLeft: blue ; - MarginRight: green ; - MarginTop: black ; - QtBlockIndent: white ; - QtListIndent: red ; - QtParagraphType: blue ; - QtTableType: green ; - QtUserState: black ; - TextDecoration: white ; - TextIndent: red ; - TextUnderlineStyle: blue ; - VerticalAlignment: green ; - Whitespace: black ; - QtSelectionForeground: white ; - QtSelectionBackground: red ; - Border: blue ; - BorderLeft: green ; - BorderRight: black ; - BorderTop: white ; - BorderBottom: red ; - Padding: blue ; - PaddingLeft: green ; - PaddingRight: black ; - PaddingTop: white ; - PaddingBottom: red ; - PageBreakBefore: blue ; - PageBreakAfter: green ; - QtAlternateBackground: black ; - BorderLeftStyle: white ; - BorderRightStyle: red ; - BorderTopStyle: blue ; - BorderBottomStyle: green ; - BorderStyles: black ; - BorderLeftColor: white ; - BorderRightColor: red ; - BorderTopColor: blue ; - BorderBottomColor: green ; - BorderColor: black ; - BorderLeftWidth: white ; - BorderRightWidth: red ; - BorderTopWidth: blue ; - BorderBottomWidth: green ; - BorderWidth: black ; - BorderTopLeftRadius: white ; - BorderTopRightRadius: red ; - BorderBottomLeftRadius: blue ; - BorderBottomRightRadius: green ; - BorderRadius: black ; - Background: white ; - BackgroundOrigin: red ; - BackgroundClip: blue ; - BackgroundRepeat: green ; - BackgroundPosition: black ; - BackgroundAttachment: white ; - BackgroundImage: red ; - BorderImage: blue ; - QtSpacing: green ; - Width: black ; - Height: white ; - MinimumWidth: red ; - MinimumHeight: blue ; - MaximumWidth: green ; - MaximumHeight: black ; - QtImage: white ; - Left: red ; - Right: blue ; - Top: green ; - Bottom: black ; - QtOrigin: white ; - QtPosition: red ; - Position: blue ; - QtStyleFeatures: green ; - QtBackgroundRole: black ; - ListStyleType: white ; - ListStyle: red ; - QtImageAlignment: blue ; - TextAlignment: green ; - Outline: black ; - OutlineOffset: white ; - OutlineWidth: red ; - OutlineColor: blue ; - OutlineStyle: green ; - OutlineRadius: black ; - OutlineTopLeftRadius: white ; - OutlineTopRightRadius: red ; - OutlineBottomLeftRadius: blue ; - OutlineBottomRightRadius: green ; - FontVariant: black ; - TextTransform: white ; - HbSpacingHorizontal: red ; - HbSpacingVertical: blue ; - HbColumnNarrowWidth: green ; - HbColumnWideWidth: black ; - HbIndent: white ; - HbSmallIconSize: red ; - HbLargeIconSize: blue ; - HbTopMarginWeight: green ; - HbIconLeftAlignmentWeight: black ; - HbStretchable: white ; - NumProperties red ; - } diff -r 730c025d4b77 -r f378acbc9cfb tsrc/resources/cssTestdata/css3.css --- a/tsrc/resources/cssTestdata/css3.css Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -.MyWidget { - border-color: black; - } - -.MyWidget { - body-color: blue; - } \ No newline at end of file diff -r 730c025d4b77 -r f378acbc9cfb tsrc/resources/cssTestdata/testcsssharing.css --- a/tsrc/resources/cssTestdata/testcsssharing.css Thu Jul 15 14:03:49 2010 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ -HbWidget -{ -width: 45; -height: 45; -} \ No newline at end of file