qtzeitgeist-0.7.0/0000755000175000017500000000000011564026365014312 5ustar lisandrolisandroqtzeitgeist-0.7.0/COPYING0000644000175000017500000006363711544132142015351 0ustar lisandrolisandro GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! qtzeitgeist-0.7.0/QZeitgeistConfig.cmake.in0000644000175000017500000000033611544132142021126 0ustar lisandrolisandroinclude(@CMAKE_INSTALL_PREFIX@/share/qzeitgeist/cmake/QZeitgeistExport.cmake) set(QZEITGEIST_LIBRARY QZEITGEIST_qzeitgeist) set(QZEITGEIST_INCLUDE_DIR @CMAKE_INSTALL_PREFIX@/include/QtZeitgeist) set(QZEITGEIST_FOUND TRUE) qtzeitgeist-0.7.0/scripts/0000755000175000017500000000000011564026365016001 5ustar lisandrolisandroqtzeitgeist-0.7.0/scripts/generate_header.sh0000755000175000017500000000046511544132142021434 0ustar lisandrolisandro#!/bin/sh header="$1" source="$2" xml="$3" if test "x$xml" = "x"; then echo "Usage:" echo " $0
" exit 1 fi INCLUDE="" test "x$header" != "x" && INCLUDE="-i header/$header" #qdbusxml2cpp -i QtZeitgeist/BaseTypes $INCLUDE -p $source: $xml qdbusxml2cpp -p $source: $xml qtzeitgeist-0.7.0/scripts/generate_source.sh0000755000175000017500000000027711544132142021505 0ustar lisandrolisandro#!/bin/sh header="$1" source="$2" xml="$3" if test "x$xml" = "x" ; then echo "Usage:" echo " $0
" exit 1 fi qdbusxml2cpp -i $header -p :$source $xml qtzeitgeist-0.7.0/scripts/onto2cpp.py0000644000175000017500000000555411544132142020115 0ustar lisandrolisandro# # Utility to transcode the Zeitgeist ontology from Python code # to a CPP header file defining a collection of definitions for the # members of the ontology. # import sys import getopt import zeitgeist.datamodel as dm def symbolname (symbol): try: ns, name = symbol[symbol.rfind("/")+1:].split("#") return "%s%s" % (ns.upper(), name) except Exception, e: return symbol.uri.rpartition("#")[2].upper() def buildCdoc(name, symbol, docprefix=""): """ Builds a C-style docstring """ # Strip trailing ``(Display name: 'ReceiveEvent')`` text doc = symbol.__doc__ doc = docprefix + doc doc = doc[:doc.find("``") - 1] # Fix link to external ontology doc = doc.replace(symbol.uri, '%s' % (symbol.uri, symbol.uri.replace("#", "#"))) # Convert docstring to doxygen style C comment doc = doc.replace("\n", "\n *") doc = "/**\n * %s\n *\n * %s\n */" % (name, doc) return doc def dumpFile(namespace, fields): # Print local namespace print "namespace %s\n{\n\n" % (namespace) zgitems = [] sditems = [] for item in fields: try: name = symbolname (item) doc = buildCdoc(name, item, docprefix="Macro defining the %s type " % (namespace)) stmt = '%s\nconst char %s[] = "%s";' % (doc, name, item.uri) if "zeitgeist-project" in (item): zgitems.append(stmt) elif "semanticdesktop" in (item): sditems.append(stmt) except Exception, e: print >> sys.stderr, "Failed to convert %s: %s" % (item, e) # Sort both lists zgitems.sort() sditems.sort() if len(zgitems): print "namespace Event\n{\n\n" for item in zgitems: print item print "" print "\n};\n" if len(sditems): print "namespace Subject\n{\n\n" for item in sditems: print item print "" print "\n};\n" # Close local namespace print "\n};\n" def printHeader(opts): header = ( "/*\n" " * This file was generated by onto2cpp tool.\n" " * Command line was: onto2cpp %s\n\n" " * This is an auto-generated file.\n" " * Do not edit! All changes made to it will be lost.\n" " */\n\n" % (opts)) print header def main(argv): try: opts, args = getopt.getopt(argv, "o:", ["onto="]) except getopt.GetoptError: print "Usage: onto2cpp -o [Interpretation:Manifestation]" sys.exit(2) printHeader(opts) fields = [] for opt, arg in opts: if opt in ("-o", "--onto"): if arg == "Interpretation": fields = dm.Interpretation.get_all_children() elif arg == "Manifestation": fields = dm.Manifestation.get_all_children() # Print header guard. guard = "QTZEITGEIST_%s_H" % (arg.upper()) print "#ifndef %s" % (guard) print "#define %s\n\n" % (guard) # Print Global namespace print "namespace QtZeitgeist\n{\n\n" # Dump definitions to the stdout dumpFile(arg, fields) # Close Global namespace print "\n};\n" # Close header guard print "#endif // %s" % (guard) if __name__ == "__main__": main(sys.argv[1:]) qtzeitgeist-0.7.0/CMakeLists.txt0000644000175000017500000000340211544132142017036 0ustar lisandrolisandroproject(QtZeitgeist) # Minimal CMAKE version cmake_minimum_required(VERSION 2.6) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) find_package(Qt4 4.7.0 COMPONENTS QtCore QtDBus QtTest REQUIRED) set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MINOR "7") set(CPACK_PACKAGE_VERSION_PATCH "0") set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "QtZeitgeist-${CPACK_PACKAGE_VERSION}") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") #use CPack for packaging code up include(CPack) if(QT4_FOUND) include_directories(${QT_INCLUDE_DIR}) include_directories(${QT_QT_INCLUDE_DIR}) include_directories(${QT_QTCORE_INCLUDE_DIR}) include_directories(${QT_QTDBUS_INCLUDE_DIR}) endif(QT4_FOUND) set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) configure_file( "${CMAKE_SOURCE_DIR}/cmake/modules/cmake_uninstall.cmake.in" "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY) add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") # Generate pkg-config file configure_file(${CMAKE_SOURCE_DIR}/QtZeitgeist.pc.in ${CMAKE_BINARY_DIR}/QtZeitgeist.pc) install(FILES ${CMAKE_BINARY_DIR}/QtZeitgeist.pc DESTINATION lib/pkgconfig) add_subdirectory(include) add_subdirectory(src) add_subdirectory(tests) # Generate cmake file get_target_property(QZEITGEIST_LIBRARY qzeitgeist LOCATION) configure_file(QZeitgeistConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/QZeitgeistConfig.cmake @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QZeitgeistConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/share/qzeitgeist/cmake) qtzeitgeist-0.7.0/tests/0000755000175000017500000000000011564026365015454 5ustar lisandrolisandroqtzeitgeist-0.7.0/tests/CMakeLists.txt0000644000175000017500000000023611544132142020202 0ustar lisandrolisandroinclude(${QT_USE_FILE}) set(INC_DIR ${CMAKE_SOURCE_DIR}/include) include_directories(${INC_DIR}) add_subdirectory(datasourceregistry) add_subdirectory(log) qtzeitgeist-0.7.0/tests/datasourceregistry/0000755000175000017500000000000011564026365021377 5ustar lisandrolisandroqtzeitgeist-0.7.0/tests/datasourceregistry/CMakeLists.txt0000644000175000017500000000057011544132142024126 0ustar lisandrolisandroinclude(${QT_USE_FILE}) set(INC_DIR ${CMAKE_SOURCE_DIR}/include) include_directories(${INC_DIR}) set(test-dsr_SRCS test-dsr.cpp ) set(test-dsr_HDRS test-dsr.h ) QT4_WRAP_CPP(test-dsr_MOC_SRCS ${test-dsr_HDRS}) QT4_AUTOMOC(${test-dsr_SRCS}) add_executable(test-dsr ${test-dsr_SRCS} ${test-dsr_MOC_SRCS}) target_link_libraries(test-dsr qzeitgeist ${QT_LIBRARIES}) qtzeitgeist-0.7.0/tests/datasourceregistry/test-dsr.cpp0000644000175000017500000000574411544132142023647 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test-dsr.h" #include void DataSourceRegistryTest::initTestCase() { // Initialize QtZeitgeist types. QtZeitgeist::init(); // Create the object to be tested. m_registry = new QtZeitgeist::DataSourceRegistry(this); m_testId = "registry-test"; }; void DataSourceRegistryTest::cleanupTestCase() { // Clear m_registry; delete m_registry; }; void DataSourceRegistryTest::registerSourceTest() { QString name = "datasource registry test"; QString description = "DataSource to test the datasource registry."; QtZeitgeist::DataModel::EventList events; QDBusPendingReply reply = m_registry->registerDataSource(m_testId, name, description, events); // Block and wait for reply. reply.waitForFinished(); // Check if the return is valid. QVERIFY(reply.isValid()); } void DataSourceRegistryTest::getSourcesTest() { // Get sources from Zeitgeist. QDBusPendingReply reply = m_registry->getDataSources(); // Block and wait for reply. reply.waitForFinished(); // Check if the return is valid. QVERIFY(reply.isValid()); // Check if the return is not empty. QVERIFY(reply.value().size() > 0); // Check the ids are not blank. for (uint i = 0; i < reply.value().size(); ++i) QVERIFY(reply.value()[i].uniqueId().isEmpty() == false); } void DataSourceRegistryTest::enableSourceTest() { QSignalSpy spy(m_registry, SIGNAL(dataSourceEnabled(const QString&, bool))); // First test we can disable our source. m_registry->setDataSourceEnabled(m_testId, false); while (spy.count() == 0) QTest::qWait(5); QList arguments = spy.takeFirst(); QVERIFY(arguments.at(1).type() == QVariant::Bool); QVERIFY(arguments.at(1).toBool() == false); // Then test that we can enable our source. m_registry->setDataSourceEnabled(m_testId, true); while (spy.count() == 0) QTest::qWait(5); arguments = spy.takeFirst(); QVERIFY(arguments.at(1).type() == QVariant::Bool); QVERIFY(arguments.at(1).toBool() == true); } QTEST_MAIN(DataSourceRegistryTest) qtzeitgeist-0.7.0/tests/datasourceregistry/test-dsr.h0000644000175000017500000000237111544132142023305 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "QtZeitgeist/QtZeitgeist" #include "QtZeitgeist/DataSourceRegistry" class DataSourceRegistryTest : public QObject { Q_OBJECT private slots: void initTestCase(); void cleanupTestCase(); void registerSourceTest(); void getSourcesTest(); void enableSourceTest(); private: QtZeitgeist::DataSourceRegistry *m_registry; QString m_testId; }; qtzeitgeist-0.7.0/tests/log/0000755000175000017500000000000011564026365016235 5ustar lisandrolisandroqtzeitgeist-0.7.0/tests/log/test-log.h0000644000175000017500000000262311544132142020134 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #include #include "QtZeitgeist/QtZeitgeist" #include "QtZeitgeist/Log" #include "QtZeitgeist/Monitor" class LogTest : public QObject { Q_OBJECT private slots: void initTestCase(); void cleanupTestCase(); void insertEventsTest(); void getEventsTest(); void findEventIdsTest(); void findEventsTest(); void deleteEventsTest(); void installMonitor(); void removeMonitor(); private: QtZeitgeist::Log *m_log; const QtZeitgeist::Monitor *m_monitor; QtZeitgeist::DataModel::EventIdList m_ids; }; qtzeitgeist-0.7.0/tests/log/CMakeLists.txt0000644000175000017500000000057011544132142020764 0ustar lisandrolisandroinclude(${QT_USE_FILE}) set(INC_DIR ${CMAKE_SOURCE_DIR}/include) include_directories(${INC_DIR}) set(test-log_SRCS test-log.cpp ) set(test-log_HDRS test-log.h ) QT4_WRAP_CPP(test-log_MOC_SRCS ${test-log_HDRS}) QT4_AUTOMOC(${test-log_SRCS}) add_executable(test-log ${test-log_SRCS} ${test-log_MOC_SRCS}) target_link_libraries(test-log qzeitgeist ${QT_LIBRARIES}) qtzeitgeist-0.7.0/tests/log/test-log.cpp0000644000175000017500000001632511544132142020473 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test-log.h" void LogTest::initTestCase() { // Initialize QtZeitgeist types. QtZeitgeist::init(); // Create the object to be tested. m_log = new QtZeitgeist::Log(this); // Initialize the monitor. m_monitor = 0; }; void LogTest::cleanupTestCase() { // Clear m_log; delete m_log; // Clear the id list. m_ids.clear(); }; void LogTest::insertEventsTest() { // Event list to be inserted. QtZeitgeist::DataModel::EventList events; // Event item 1. QtZeitgeist::DataModel::Event event1; event1.setInterpretation("foo://Interp"); event1.setManifestation("foo://Manif"); event1.setActor("app://firefox.desktop"); QtZeitgeist::DataModel::Subject subject1; subject1.setUri("file:///tmp/bar.txt"); subject1.setInterpretation("foo://TextDoc"); subject1.setManifestation("foo://File"); subject1.setOrigin("file:///tmp"); subject1.setMimeType("text/plain"); subject1.setText("bar.txt"); subject1.setStorage("bfb486f6-f5f8-4296-8871-0cc749cf8ef7"); QtZeitgeist::DataModel::SubjectList subjects1; subjects1 << subject1; event1.setSubjects(subjects1); events.append(event1); // Event item 2. QtZeitgeist::DataModel::Event event2; event2.setInterpretation("foo://Interp2"); event2.setManifestation("foo://Manif2"); event2.setActor("app://firefox.desktop"); QtZeitgeist::DataModel::Subject subject2; subject2.setUri("file:///tmp/bar.txt2"); subject2.setInterpretation("foo://TextDoc"); subject2.setManifestation("foo://File"); subject2.setOrigin("file:///tmp"); subject2.setMimeType("text/plain"); subject2.setText("bar.txt"); subject2.setStorage("bfb486f6-f5f8-4296-8871-0cc749cf8ef7"); QtZeitgeist::DataModel::SubjectList subjects2; subjects2 << subject2; event2.setSubjects(subjects2); events.append(event2); // Insert events into Zeitgeist. QDBusPendingReply reply = m_log->insertEvents(events); // Block and wait for reply. reply.waitForFinished(); // Check if the return is valid. QVERIFY (reply.isValid() == true); // Check if the return is not empty QVERIFY (reply.value().size() > 0); // Check if the id is not 0; for (uint i = 0; i < reply.value().size(); ++i) QVERIFY(reply.value()[i] != 0); // Assign to our id list. m_ids = reply.value(); }; void LogTest::getEventsTest() { QVERIFY(m_ids.size() > 0); // Get events from Zeitgeist. QDBusPendingReply reply = m_log->getEvents(m_ids); // Block and wait for reply. reply.waitForFinished(); // Check if the return is valid. QVERIFY (reply.isValid() == true); // Check if the return is not empty QVERIFY (reply.value().size() > 0); // Check if the id is not 0; for (uint i = 0; i < reply.value().size(); ++i) QVERIFY(reply.value()[i].id() != 0); }; void LogTest::findEventIdsTest() { QtZeitgeist::DataModel::Event event; QtZeitgeist::DataModel::EventList events; // Set the template to search for. event.setActor("app://firefox.desktop"); event.setSubjects(QtZeitgeist::DataModel::SubjectList()); // Add to the event list. events << event; // Query for all events since Epoch. QtZeitgeist::DataModel::TimeRange timeRange = QtZeitgeist::DataModel::TimeRange::timeRangeToNow(); // Search on Zeitgeist. QDBusPendingReply reply = m_log->findEventIds(timeRange, events, QtZeitgeist::Log::Any, 10, QtZeitgeist::Log::MostRecentEvents); // Block and wait for reply. reply.waitForFinished(); // Check if the return is valid. QVERIFY (reply.isValid() == true); // Check if the return is not empty QVERIFY (reply.value().size() > 0); // Check if the id is 0; for (uint i = 0; i < reply.value().size(); ++i) QVERIFY(reply.value()[i] != 0); } void LogTest::findEventsTest() { QtZeitgeist::DataModel::Event event; QtZeitgeist::DataModel::EventList events; // Set the template to search for. event.setActor("app://firefox.desktop"); event.setSubjects(QtZeitgeist::DataModel::SubjectList()); // Add to the event list. events << event; // Query for all events since Epoch. QtZeitgeist::DataModel::TimeRange timeRange = QtZeitgeist::DataModel::TimeRange::timeRangeToNow(); // Search on Zeitgeist. QDBusPendingReply reply = m_log->findEvents(timeRange, events, QtZeitgeist::Log::Any, 10, QtZeitgeist::Log::MostRecentEvents); // Block and wait for reply. reply.waitForFinished(); // Check if the return is valid. QVERIFY (reply.isValid() == true); // Check if the return is not empty QVERIFY (reply.value().size() > 0); // Check if the id is 0; for (uint i = 0; i < reply.value().size(); ++i) QVERIFY(reply.value()[i].id() != 0); } void LogTest::deleteEventsTest() { QVERIFY(m_ids.size() > 0); // Get events from Zeitgeist. m_log->deleteEvents(m_ids); // Get the supposed deleted events from Zeitgeist. QDBusPendingReply reply = m_log->getEvents(m_ids); // Block and wait for reply. reply.waitForFinished(); // Check if the return is valid. QVERIFY (reply.isValid() == true); // Check if the return is not empty QVERIFY (reply.value().size() > 0); // Check if the id is 0; for (uint i = 0; i < reply.value().size(); ++i) QVERIFY(reply.value()[i].id() == 0); }; void LogTest::installMonitor() { QtZeitgeist::DataModel::Event event; QtZeitgeist::DataModel::EventList events; // Set the template to search for. event.setActor("app://firefox.desktop"); // Add to the event list. events << event; // Query for all events since Epoch. QtZeitgeist::DataModel::TimeRange timeRange = QtZeitgeist::DataModel::TimeRange::timeRangeToNow(); // Ask to register a monitor. m_monitor = m_log->installMonitor(timeRange, events); // Check if it was created. QVERIFY(m_monitor != 0); } void LogTest::removeMonitor() { QVERIFY(m_monitor != 0); // Ask to remove the monitor. m_log->removeMonitor(const_cast(m_monitor)); } QTEST_MAIN(LogTest) qtzeitgeist-0.7.0/xml/0000755000175000017500000000000011564026365015112 5ustar lisandrolisandroqtzeitgeist-0.7.0/xml/org.gnome.zeitgeist.Log.xml0000644000175000017500000001027011544132142022242 0ustar lisandrolisandro qtzeitgeist-0.7.0/xml/org.gnome.zeitgeist.Monitor.xml0000644000175000017500000000222711544132142023153 0ustar lisandrolisandro qtzeitgeist-0.7.0/xml/org.gnome.zeitgeist.Blacklist.xml0000644000175000017500000000137111544132142023433 0ustar lisandrolisandro qtzeitgeist-0.7.0/xml/org.gnome.zeitgeist.Index.xml0000644000175000017500000000152511544132142022573 0ustar lisandrolisandro qtzeitgeist-0.7.0/xml/org.gnome.zeitgeist.DataSourceRegistry.xml0000644000175000017500000000322211544132142025303 0ustar lisandrolisandro qtzeitgeist-0.7.0/src/0000755000175000017500000000000011564026365015101 5ustar lisandrolisandroqtzeitgeist-0.7.0/src/qtzeitgeist.cpp0000644000175000017500000000307311544132142020151 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/QtZeitgeist" #include "QtZeitgeist/DataModel/DataSource" #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" #include namespace QtZeitgeist { void init() { static bool registered = false; if (!registered) { qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType(); qDBusRegisterMetaType(); registered = true; } } }; qtzeitgeist-0.7.0/src/CMakeLists.txt0000644000175000017500000000306311544132142017630 0ustar lisandrolisandroset(QT_DONT_USE_QTGUI "YES") include(${QT_USE_FILE}) set(INC_DIR ${CMAKE_SOURCE_DIR}/include) include_directories(${INC_DIR}) set(generated_SRCS _gen/blacklistinterface.cpp _gen/datasourceinterface.cpp _gen/loginterface.cpp _gen/monitoradaptor.cpp ) set(generated_HDRS _gen/blacklistinterface.h _gen/datasourceinterface.h _gen/loginterface.h _gen/monitoradaptor.h ) set(library_SRCS ${generated_SRCS} qtzeitgeist.cpp datasourceregistry.cpp log.cpp monitor.cpp datamodel/datasource.cpp datamodel/event.cpp datamodel/subject.cpp datamodel/timerange.cpp ) set(library_MOC_HDRS ${generated_HDRS} ${INC_DIR}/QtZeitgeist/datasourceregistry.h ${INC_DIR}/QtZeitgeist/log.h ${INC_DIR}/QtZeitgeist/monitor.h ${INC_DIR}/QtZeitgeist/qtzeitgeist.h ${INC_DIR}/QtZeitgeist/DataModel/datasource.h ${INC_DIR}/QtZeitgeist/DataModel/event.h ${INC_DIR}/QtZeitgeist/DataModel/subject.h ${INC_DIR}/QtZeitgeist/DataModel/timerange.h monitor_p.h ) qt4_wrap_cpp(library_MOC_SRCS ${library_MOC_HDRS}) add_library(qzeitgeist SHARED ${library_SRCS} ${library_MOC_SRCS}) target_link_libraries(qzeitgeist ${QT_LIBRARIES} ${QDBUS_LDFLAGS}) set_target_properties(qzeitgeist PROPERTIES VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}" SOVERSION ${CPACK_PACKAGE_VERSION_MAJOR}) install(TARGETS qzeitgeist EXPORT QZeitgeistExport DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) install(EXPORT QZeitgeistExport DESTINATION ${CMAKE_INSTALL_PREFIX}/share/qzeitgeist/cmake NAMESPACE QZEITGEIST_) qtzeitgeist-0.7.0/src/datamodel/0000755000175000017500000000000011564026365017033 5ustar lisandrolisandroqtzeitgeist-0.7.0/src/datamodel/datasource.cpp0000644000175000017500000000727711544132142021673 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/DataModel/DataSource" #include #include namespace QtZeitgeist { namespace DataModel { class DataSourcePrivate { public : QString uniqueId; QString name; QString description; EventList eventTemplates; bool running; QDateTime lastSeen; bool enabled; }; DataSource::DataSource(QObject *parent) : d(new DataSourcePrivate()) { Q_ASSERT(d); // Initialize the last seen time. d->lastSeen.setTime_t(0); } DataSource::DataSource(const DataSource & source, QObject *parent) : d(new DataSourcePrivate()) { Q_ASSERT(d); // Copy the source attribute's value. d->uniqueId = source.d->uniqueId; d->name = source.d->name; d->description = source.d->description; d->eventTemplates = source.d->eventTemplates; d->running = source.d->running; d->lastSeen = source.d->lastSeen; d->enabled = source.d->enabled; } DataSource::~DataSource() { delete d; } QString DataSource::uniqueId() const { return d->uniqueId; } QString DataSource::name() const { return d->name; } QString DataSource::description() const { return d->description; } EventList DataSource::eventTemplates() const { return d->eventTemplates; } bool DataSource::running() const { return d->running; } QDateTime DataSource::lastSeen() const { return d->lastSeen; } bool DataSource::enabled() const { return d->enabled; } DataSource &DataSource::operator = (const DataSource & source) { // Copy the source attribute's value. if (this != &source) { d->uniqueId = source.d->uniqueId; d->name = source.d->name; d->description = source.d->description; d->eventTemplates = source.d->eventTemplates; d->running = source.d->running; d->lastSeen = source.d->lastSeen; d->enabled = source.d->enabled; } return *this; } QDBusArgument & operator << (QDBusArgument &argument, const DataSource &datasource) { argument.beginStructure(); argument << datasource.d->uniqueId << datasource.d->name << datasource.d->description << datasource.d->eventTemplates << datasource.d->running << datasource.d->lastSeen.toMSecsSinceEpoch() << datasource.d->enabled; argument.endStructure(); return argument; } const QDBusArgument & operator >> (const QDBusArgument &argument, DataSource &datasource) { argument.beginStructure(); qint64 lastSeenMSecs; argument >> datasource.d->uniqueId >> datasource.d->name >> datasource.d->description >> datasource.d->eventTemplates >> datasource.d->running >> lastSeenMSecs >> datasource.d->enabled; // Translate the last seen string datasource.d->lastSeen.setMSecsSinceEpoch(lastSeenMSecs); argument.endStructure(); return argument; } }; }; qtzeitgeist-0.7.0/src/datamodel/timerange.cpp0000644000175000017500000000561711544132142021510 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/DataModel/TimeRange" #include namespace QtZeitgeist { namespace DataModel { class TimeRangePrivate { public : TimeRangePrivate(qint64 _begin = 0, qint64 _end = 0) : begin(_begin), end(_end) { } qint64 begin; qint64 end; }; TimeRange::TimeRange(QObject *parent) : d(new TimeRangePrivate()) { Q_ASSERT(d); } TimeRange::TimeRange(const TimeRange & source, QObject *parent) : d(new TimeRangePrivate()) { Q_ASSERT(d); // Copy the source attribute's value. d->begin = source.d->begin; d->end = source.d->end; } TimeRange::TimeRange(qint64 begin, qint64 end) : d(new TimeRangePrivate(begin, end)) { } TimeRange::~TimeRange() { delete d; } qint64 TimeRange::begin() const { return d->begin; } void TimeRange::setBegin(qint64 begin) { d->begin = begin; } qint64 TimeRange::end() const { return d->end; } void TimeRange::setEnd(qint64 end) { d->end = end; } TimeRange TimeRange::timeRangeToNow() { return TimeRange(0, QDateTime::currentDateTime().toMSecsSinceEpoch()); } TimeRange TimeRange::timeRangeFromNow() { return TimeRange(QDateTime::currentDateTime().toMSecsSinceEpoch(), std::numeric_limits::max()); } TimeRange TimeRange::always() { return TimeRange(0, std::numeric_limits::max()); } TimeRange &TimeRange::operator = (const TimeRange &source) { // Copy the source attribute's value. if (this != &source) { d->begin = source.d->begin; d->end = source.d->end; } return *this; } QDBusArgument & operator << (QDBusArgument &argument, const TimeRange &timeRange) { argument.beginStructure(); argument << timeRange.d->begin << timeRange.d->end; argument.endStructure(); return argument; } const QDBusArgument & operator >> (const QDBusArgument &argument, TimeRange &timeRange) { argument.beginStructure(); argument >> timeRange.d->begin >> timeRange.d->end; argument.endStructure(); return argument; } }; }; qtzeitgeist-0.7.0/src/datamodel/subject.cpp0000644000175000017500000000612111544132142021163 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/DataModel/Subject" namespace QtZeitgeist { namespace DataModel { class SubjectPrivate { public : QString uri; QString origin; QString mimeType; QString text; QString storage; QString interpretation; QString manifestation; }; Subject::Subject(QObject *parent) : d(new SubjectPrivate()) { Q_ASSERT(d); } Subject::Subject(const Subject & source, QObject *parent) : d(new SubjectPrivate()) { Q_ASSERT(d); // Copy the source attribute's value. d->uri = source.d->uri; d->origin = source.d->origin; d->mimeType = source.d->mimeType; d->text = source.d->text; d->storage = source.d->storage; d->interpretation = source.d->interpretation; d->manifestation = source.d->manifestation; } Subject::~Subject() { delete d; } QString Subject::uri() const { return d->uri; } void Subject::setUri(const QString &uri) { d->uri = uri; } QString Subject::interpretation() const { return d->interpretation; } void Subject::setInterpretation(const QString &interpretation) { d->interpretation = interpretation; } QString Subject::manifestation() const { return d->manifestation; } void Subject::setManifestation(const QString &manifestation) { d->manifestation = manifestation; } QString Subject::origin() const { return d->origin; } void Subject::setOrigin(const QString &origin) { d->origin = origin; } QString Subject::mimeType() const { return d->mimeType; } void Subject::setMimeType(const QString &mimeType) { d->mimeType = mimeType; } QString Subject::text() const { return d->text; } void Subject::setText(const QString &text) { d->text = text; } QString Subject::storage() const { return d->storage; } void Subject::setStorage(const QString &storage) { d->storage = storage; } Subject &Subject::operator = (const Subject & source) { // Copy the source attribute's value. if (this != &source) { d->uri = source.d->uri; d->interpretation = source.d->interpretation; d->manifestation = source.d->manifestation; d->origin = source.d->origin; d->mimeType = source.d->mimeType; d->text = source.d->text; d->storage = source.d->storage; } return *this; } }; }; qtzeitgeist-0.7.0/src/datamodel/event.cpp0000644000175000017500000001301511544132142020645 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/DataModel/Event" #include #include namespace QtZeitgeist { namespace DataModel { class EventPrivate { public : EventPrivate() { id = 0; timestamp.setTimeSpec(Qt::UTC); timestamp.setTime_t(0); } quint32 id; QDateTime timestamp; QString interpretation; QString manifestation; QString actor; SubjectList subjects; QByteArray payload; }; Event::Event(QObject *parent) : d(new EventPrivate()) { Q_ASSERT(d); } Event::Event(const Event & source, QObject *parent) : d(new EventPrivate()) { Q_ASSERT(d); // Copy the source attribute's value. d->id = source.d->id; d->timestamp = source.d->timestamp; d->interpretation = source.d->interpretation; d->manifestation = source.d->manifestation; d->actor = source.d->actor; d->subjects = source.d->subjects; d->payload = source.d->payload; } Event::~Event() { delete d; } quint32 Event::id() const { return d->id; } QDateTime Event::timestamp() const { return d->timestamp; } void Event::setTimestamp(const QDateTime ×tamp) { d->timestamp = timestamp; } QString Event::interpretation() const { return d->interpretation; } void Event::setInterpretation(const QString &interpretation) { d->interpretation = interpretation; } QString Event::manifestation() const { return d->manifestation; } void Event::setManifestation(const QString &manifestation) { d->manifestation = manifestation; } QString Event::actor() const { return d->actor; } void Event::setActor(const QString &actor) { d->actor = actor; } SubjectList Event::subjects() const { return d->subjects; } void Event::setSubjects(const SubjectList &subjects) { d->subjects = subjects; } QByteArray Event::payload() const { return d->payload; } void Event::setPayload(const QByteArray &payload) { d->payload = payload; } void Event::addSubject(const Subject &subject) { d->subjects.append(subject); } Event &Event::operator = (const Event & source) { // Copy the source attribute's value. if (this != &source) { d->id = source.d->id; d->timestamp = source.d->timestamp; d->interpretation = source.d->interpretation; d->manifestation = source.d->manifestation; d->actor = source.d->actor; d->subjects = source.d->subjects; d->payload = source.d->payload; } return *this; } QDBusArgument & operator << (QDBusArgument &argument, const Event &event) { QStringList eventData; eventData << QString(event.d->id) << QString::number(event.d->timestamp.toMSecsSinceEpoch()) << event.d->interpretation << event.d->manifestation << event.d->actor; QList subjectList; uint subjectsSize = event.d->subjects.size(); for (uint i = 0; i < subjectsSize; ++i) { QStringList subjectData; Subject subject = event.d->subjects[i];; subjectData << subject.uri(); subjectData << subject.interpretation(); subjectData << subject.manifestation(); subjectData << subject.origin(); subjectData << subject.mimeType(); subjectData << subject.text(); subjectData << subject.storage(); subjectList << subjectData; } argument.beginStructure(); argument << eventData << subjectList << event.d->payload; argument.endStructure(); return argument; } const QDBusArgument & operator >> (const QDBusArgument &argument, Event &event) { QStringList eventData; QList subjectList; argument.beginStructure(); argument >> eventData >> subjectList >> event.d->payload; argument.endStructure(); if (!eventData.isEmpty()) { event.d->id = eventData[0].toUInt(); event.d->timestamp.setMSecsSinceEpoch(eventData[1].toLongLong()); event.d->interpretation = eventData[2]; event.d->manifestation = eventData[3]; event.d->actor = eventData[4]; } if (!subjectList.isEmpty()) { uint subjectsSize = subjectList.size(); for (uint i = 0; i < subjectsSize; ++i) { QStringList subjectString = subjectList[i]; Subject subject; subject.setUri(subjectString[0]); subject.setInterpretation(subjectString[1]); subject.setManifestation(subjectString[2]); subject.setOrigin(subjectString[3]); subject.setMimeType(subjectString[4]); subject.setText(subjectString[5]); subject.setStorage(subjectString[6]); event.d->subjects << subject; } } return argument; } }; }; qtzeitgeist-0.7.0/src/_gen/0000755000175000017500000000000011564026365016011 5ustar lisandrolisandroqtzeitgeist-0.7.0/src/_gen/LogInterface0000644000175000017500000000003211544132142020256 0ustar lisandrolisandro#include "loginterface.h" qtzeitgeist-0.7.0/src/_gen/BlackListInterface0000644000175000017500000000004011544132142021404 0ustar lisandrolisandro#include "blacklistinterface.h" qtzeitgeist-0.7.0/src/_gen/monitoradaptor.cpp0000644000175000017500000000327511544132142021553 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -i monitoradaptor.h -i QtZeitgeist/DataModel/Event -i QtZeitgeist/DataModel/TimeRange -a :monitoradaptor.cpp ../xml/org.gnome.zeitgeist.Monitor.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #include "monitoradaptor.h" #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" #include #include #include #include #include #include #include /* * Implementation of adaptor class MonitorAdaptor */ MonitorAdaptor::MonitorAdaptor(QObject *parent) : QDBusAbstractAdaptor(parent) { // constructor setAutoRelaySignals(true); } MonitorAdaptor::~MonitorAdaptor() { // destructor } void MonitorAdaptor::NotifyDelete(const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventIdList &event_ids) { // handle method call org.gnome.zeitgeist.Monitor.NotifyDelete QMetaObject::invokeMethod(parent(), "NotifyDelete", Q_ARG(QtZeitgeist::DataModel::TimeRange, time_range), Q_ARG(QtZeitgeist::DataModel::EventIdList, event_ids)); } void MonitorAdaptor::NotifyInsert(const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventList &events) { // handle method call org.gnome.zeitgeist.Monitor.NotifyInsert QMetaObject::invokeMethod(parent(), "NotifyInsert", Q_ARG(QtZeitgeist::DataModel::TimeRange, time_range), Q_ARG(QtZeitgeist::DataModel::EventList, events)); } qtzeitgeist-0.7.0/src/_gen/loginterface.cpp0000644000175000017500000000170111544132142021143 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -i loginterface.h -i QtZeitgeist/DataModel/Event -i QtZeitgeist/DataModel/TimeRange -p :loginterface.cpp ../xml/org.gnome.zeitgeist.Log.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * This file may have been hand-edited. Look for HAND-EDIT comments * before re-generating it. */ #include "loginterface.h" #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" /* * Implementation of interface class OrgGnomeZeitgeistLogInterface */ OrgGnomeZeitgeistLogInterface::OrgGnomeZeitgeistLogInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) { } OrgGnomeZeitgeistLogInterface::~OrgGnomeZeitgeistLogInterface() { } qtzeitgeist-0.7.0/src/_gen/DataSourceInterface0000644000175000017500000000004111544132142021567 0ustar lisandrolisandro#include "datasourceinterface.h" qtzeitgeist-0.7.0/src/_gen/datasourceinterface.h0000644000175000017500000000515711544132142022172 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -p datasourceinterface.h: ../../xml/org.gnome.zeitgeist.DataSourceRegistry.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef DATASOURCEINTERFACE_H_1292453039 #define DATASOURCEINTERFACE_H_1292453039 #include #include #include #include #include #include #include #include #include "QtZeitgeist/DataModel/DataSource" /* * Proxy class for interface org.gnome.zeitgeist.DataSourceRegistry */ class OrgGnomeZeitgeistDataSourceRegistryInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() { return "org.gnome.zeitgeist.DataSourceRegistry"; } public: OrgGnomeZeitgeistDataSourceRegistryInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); ~OrgGnomeZeitgeistDataSourceRegistryInterface(); public Q_SLOTS: // METHODS inline QDBusPendingReply GetDataSources() { QList argumentList; return asyncCallWithArgumentList(QLatin1String("GetDataSources"), argumentList); } inline QDBusPendingReply RegisterDataSource(const QString &unique_id, const QString &name, const QString &description, const QtZeitgeist::DataModel::EventList &event_templates) { QList argumentList; argumentList << qVariantFromValue(unique_id) << qVariantFromValue(name) << qVariantFromValue(description) << qVariantFromValue(event_templates); return asyncCallWithArgumentList(QLatin1String("RegisterDataSource"), argumentList); } inline QDBusPendingReply<> SetDataSourceEnabled(const QString &unique_id, bool enabled) { QList argumentList; argumentList << qVariantFromValue(unique_id) << qVariantFromValue(enabled); return asyncCallWithArgumentList(QLatin1String("SetDataSourceEnabled"), argumentList); } Q_SIGNALS: // SIGNALS void DataSourceDisconnected(const QtZeitgeist::DataModel::DataSource &in0); void DataSourceEnabled(const QString &unique_id, bool enabled); void DataSourceRegistered(const QtZeitgeist::DataModel::DataSource &in0); }; namespace org { namespace gnome { namespace zeitgeist { typedef ::OrgGnomeZeitgeistDataSourceRegistryInterface DataSourceRegistry; } } } #endif qtzeitgeist-0.7.0/src/_gen/loginterface.h0000644000175000017500000001212511544132142020612 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -i QtZeitgeist/DataModel/Event -i QtZeitgeist/DataModel/TimeRange -p loginterface.h: ../xml/org.gnome.zeitgeist.Log.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef LOGINTERFACE_H_1292511727 #define LOGINTERFACE_H_1292511727 #include #include #include #include #include #include #include #include #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" /* * Proxy class for interface org.gnome.zeitgeist.Log */ class OrgGnomeZeitgeistLogInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() { return "org.gnome.zeitgeist.Log"; } public: OrgGnomeZeitgeistLogInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); ~OrgGnomeZeitgeistLogInterface(); public Q_SLOTS: // METHODS inline QDBusPendingReply<> DeleteEvents(const QtZeitgeist::DataModel::EventIdList &event_ids) { QList argumentList; argumentList << qVariantFromValue(event_ids); return asyncCallWithArgumentList(QLatin1String("DeleteEvents"), argumentList); } inline QDBusPendingReply<> DeleteLog() { QList argumentList; return asyncCallWithArgumentList(QLatin1String("DeleteLog"), argumentList); } inline QDBusPendingReply FindEventIds(const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventList &event_templates, uint storage_state, uint num_events, uint result_type) { QList argumentList; argumentList << qVariantFromValue(time_range) << qVariantFromValue(event_templates) << qVariantFromValue(storage_state) << qVariantFromValue(num_events) << qVariantFromValue(result_type); return asyncCallWithArgumentList(QLatin1String("FindEventIds"), argumentList); } inline QDBusPendingReply FindEvents(const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventList &event_templates, uint storage_state, uint num_events, uint result_type) { QList argumentList; argumentList << qVariantFromValue(time_range) << qVariantFromValue(event_templates) << qVariantFromValue(storage_state) << qVariantFromValue(num_events) << qVariantFromValue(result_type); return asyncCallWithArgumentList(QLatin1String("FindEvents"), argumentList); } inline QDBusPendingReply FindRelatedUris(const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventList &event_templates, const QtZeitgeist::DataModel::EventList &result_event_templates, uint storage_state, uint num_events, uint result_type) { QList argumentList; argumentList << qVariantFromValue(time_range) << qVariantFromValue(event_templates) << qVariantFromValue(result_event_templates) << qVariantFromValue(storage_state) << qVariantFromValue(num_events) << qVariantFromValue(result_type); return asyncCallWithArgumentList(QLatin1String("FindRelatedUris"), argumentList); } inline QDBusPendingReply GetEvents(const QtZeitgeist::DataModel::EventIdList &event_ids) { QList argumentList; argumentList << qVariantFromValue(event_ids); return asyncCallWithArgumentList(QLatin1String("GetEvents"), argumentList); } inline QDBusPendingReply InsertEvents(const QtZeitgeist::DataModel::EventList &events) { QList argumentList; argumentList << qVariantFromValue(events); return asyncCallWithArgumentList(QLatin1String("InsertEvents"), argumentList); } inline QDBusPendingReply<> InstallMonitor(const QDBusObjectPath &monitor_path, const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventList &event_templates) { QList argumentList; argumentList << qVariantFromValue(monitor_path) << qVariantFromValue(time_range) << qVariantFromValue(event_templates); return asyncCallWithArgumentList(QLatin1String("InstallMonitor"), argumentList); } inline QDBusPendingReply<> Quit() { QList argumentList; return asyncCallWithArgumentList(QLatin1String("Quit"), argumentList); } inline QDBusPendingReply<> RemoveMonitor(const QDBusObjectPath &monitor_path) { QList argumentList; argumentList << qVariantFromValue(monitor_path); return asyncCallWithArgumentList(QLatin1String("RemoveMonitor"), argumentList); } Q_SIGNALS: // SIGNALS }; namespace org { namespace gnome { namespace zeitgeist { typedef ::OrgGnomeZeitgeistLogInterface Log; } } } #endif qtzeitgeist-0.7.0/src/_gen/datasourceinterface.cpp0000644000175000017500000000164011544132142022516 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -i datasourceinterface.h -p :datasourceinterface.cpp ../../xml/org.gnome.zeitgeist.DataSourceRegistry.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * This file may have been hand-edited. Look for HAND-EDIT comments * before re-generating it. */ #include "datasourceinterface.h" /* * Implementation of interface class OrgGnomeZeitgeistDataSourceRegistryInterface */ OrgGnomeZeitgeistDataSourceRegistryInterface::OrgGnomeZeitgeistDataSourceRegistryInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) { } OrgGnomeZeitgeistDataSourceRegistryInterface::~OrgGnomeZeitgeistDataSourceRegistryInterface() { } qtzeitgeist-0.7.0/src/_gen/blacklistinterface.cpp0000644000175000017500000000154311544132142022336 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -i blacklistinterface.h -p :blacklistinterface.cpp ../xml/org.gnome.zeitgeist.Blacklist.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * This file may have been hand-edited. Look for HAND-EDIT comments * before re-generating it. */ #include "blacklistinterface.h" /* * Implementation of interface class OrgGnomeZeitgeistBlacklistInterface */ OrgGnomeZeitgeistBlacklistInterface::OrgGnomeZeitgeistBlacklistInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) { } OrgGnomeZeitgeistBlacklistInterface::~OrgGnomeZeitgeistBlacklistInterface() { } qtzeitgeist-0.7.0/src/_gen/monitoradaptor.h0000644000175000017500000000513511544132142021215 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -i QtZeitgeist/DataModel/Event -i QtZeitgeist/DataModel/TimeRange -a monitoradaptor.h: ../xml/org.gnome.zeitgeist.Monitor.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * This file may have been hand-edited. Look for HAND-EDIT comments * before re-generating it. */ #ifndef MONITORADAPTOR_H_1292508978 #define MONITORADAPTOR_H_1292508978 #include #include #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" class QByteArray; template class QList; template class QMap; class QString; class QStringList; class QVariant; /* * Adaptor class for interface org.gnome.zeitgeist.Monitor */ class MonitorAdaptor: public QDBusAbstractAdaptor { Q_OBJECT Q_CLASSINFO("D-Bus Interface", "org.gnome.zeitgeist.Monitor") Q_CLASSINFO("D-Bus Introspection", "" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" " \n" "") public: MonitorAdaptor(QObject *parent); virtual ~MonitorAdaptor(); public: // PROPERTIES public Q_SLOTS: // METHODS void NotifyDelete(const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventIdList &event_ids); void NotifyInsert(const QtZeitgeist::DataModel::TimeRange &time_range, const QtZeitgeist::DataModel::EventList &events); Q_SIGNALS: // SIGNALS }; #endif qtzeitgeist-0.7.0/src/_gen/MonitorAdaptor0000644000175000017500000000003411544132142020660 0ustar lisandrolisandro#include "monitoradaptor.h" qtzeitgeist-0.7.0/src/_gen/blacklistinterface.h0000644000175000017500000000344511544132142022006 0ustar lisandrolisandro/* * This file was generated by qdbusxml2cpp version 0.7 * Command line was: qdbusxml2cpp -p blacklistinterface.h: ../xml/org.gnome.zeitgeist.Blacklist.xml * * qdbusxml2cpp is Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef BLACKLISTINTERFACE_H_1292020236 #define BLACKLISTINTERFACE_H_1292020236 #include #include #include #include #include #include #include #include #include "QtZeitgeist/DataModel/Event" /* * Proxy class for interface org.gnome.zeitgeist.Blacklist */ class OrgGnomeZeitgeistBlacklistInterface: public QDBusAbstractInterface { Q_OBJECT public: static inline const char *staticInterfaceName() { return "org.gnome.zeitgeist.Blacklist"; } public: OrgGnomeZeitgeistBlacklistInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); ~OrgGnomeZeitgeistBlacklistInterface(); public Q_SLOTS: // METHODS inline QDBusPendingReply GetBlacklist() { QList argumentList; return asyncCallWithArgumentList(QLatin1String("GetBlacklist"), argumentList); } inline QDBusPendingReply<> SetBlacklist(const QtZeitgeist::DataModel::EventList &events) { QList argumentList; argumentList << qVariantFromValue(events); return asyncCallWithArgumentList(QLatin1String("SetBlacklist"), argumentList); } Q_SIGNALS: // SIGNALS }; namespace org { namespace gnome { namespace zeitgeist { typedef ::OrgGnomeZeitgeistBlacklistInterface Blacklist; } } } #endif qtzeitgeist-0.7.0/src/monitor_p.h0000644000175000017500000000441111544132142017245 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_MONITOR_P_H_ #define QTZEITGEIST_MONITOR_P_H_ #include #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" class MonitorAdaptor; namespace QtZeitgeist { class Monitor; /* * Private. * * @author Abner Silva */ class MonitorPrivate : public QObject { Q_OBJECT Q_DISABLE_COPY(MonitorPrivate) public: /** * Default constructor. */ explicit MonitorPrivate(quint64 monitorId, QtZeitgeist::DataModel::TimeRange monitorTimeRange, QtZeitgeist::DataModel::EventList monitorTemplates, Monitor* parent = 0); /** * Destructor. */ virtual ~MonitorPrivate(); public Q_SLOTS: // Adaptor slots. void NotifyDelete(const QtZeitgeist::DataModel::TimeRange &timeRange, const QtZeitgeist::DataModel::EventIdList &eventIds); void NotifyInsert(const QtZeitgeist::DataModel::TimeRange &timeRange, const QtZeitgeist::DataModel::EventList &events); public: // Monitor id. quint64 id; // Monitor time range. QtZeitgeist::DataModel::TimeRange timeRange; // Monitor templates. QtZeitgeist::DataModel::EventList eventTemplates; // Registered object path. QString regObjPath; // Pointer to the adaptor. MonitorAdaptor *monitorAdaptor; // D Pointer. class Monitor * const q; }; }; #endif // QTZEITGEIST_MONITOR_P_H_ qtzeitgeist-0.7.0/src/monitor.cpp0000644000175000017500000000564611544132142017274 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/Monitor" #include "monitor_p.h" #include "_gen/MonitorAdaptor" namespace QtZeitgeist { // Monitor's DBus Object Path. const QString objPath = "/org/gnome/zeitgeist/monitor"; // Monitor's DBus Service Name. const QString serviceName = "org.gnome.zeitgeist.Monitor"; // Implements the private section. D pointer. MonitorPrivate::MonitorPrivate(quint64 monitorId, QtZeitgeist::DataModel::TimeRange monitorTimeRange, QtZeitgeist::DataModel::EventList monitorTemplates, Monitor *parent) : QObject(parent), id(monitorId), timeRange(monitorTimeRange), eventTemplates(monitorTemplates), q(parent) { // Create the needed DBus Monitor Adaptor. monitorAdaptor = new MonitorAdaptor(this); regObjPath = QString(objPath + "/%1").arg(id); QDBusConnection connection = QDBusConnection::sessionBus(); connection.registerService(serviceName); connection.registerObject(regObjPath, this); } MonitorPrivate::~MonitorPrivate() { // Free the interface. delete monitorAdaptor; } void MonitorPrivate::NotifyDelete( const QtZeitgeist::DataModel::TimeRange &timeRange, const QtZeitgeist::DataModel::EventIdList &eventIds) { emit q->eventsDeleted(timeRange, eventIds); } void MonitorPrivate::NotifyInsert( const QtZeitgeist::DataModel::TimeRange &timeRange, const QtZeitgeist::DataModel::EventList &events) { emit q->eventsInserted(timeRange, events); } // Implements the Monitor class. Monitor::Monitor(quint64 id, QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList templates, QObject *parent) : QObject(parent), d(new MonitorPrivate(id, timeRange, templates, this)) { Q_ASSERT(d); } Monitor::~Monitor() { delete d; } QString Monitor::objectPath() const { return d->regObjPath; } quint64 Monitor::id() const { return d->id; } QtZeitgeist::DataModel::TimeRange Monitor::timeRange() const { return d->timeRange; } QtZeitgeist::DataModel::EventList Monitor::eventTemplates() const { return d->eventTemplates; } }; qtzeitgeist-0.7.0/src/datasourceregistry.cpp0000644000175000017500000000572311544132142021524 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/DataSourceRegistry" #include "_gen/DataSourceInterface" namespace QtZeitgeist { // DataSourceRegistry's DBus Object Path. const QString objectPath = "/org/gnome/zeitgeist/data_source_registry"; // DataSourceRegistry's DBus Service Name. const QString serviceName = "org.gnome.zeitgeist.Engine"; class DataSourceRegistryPrivate { public : DataSourceRegistryPrivate() { // Create the needed DBus DataSourceRegistry Interface. registryInterface = new org::gnome::zeitgeist::DataSourceRegistry( serviceName, objectPath, QDBusConnection::sessionBus()); } ~DataSourceRegistryPrivate() { // Free the interface. delete registryInterface; } org::gnome::zeitgeist::DataSourceRegistry *registryInterface; }; DataSourceRegistry::DataSourceRegistry(QObject *parent) : d(new DataSourceRegistryPrivate()) { Q_ASSERT(d); connect(d->registryInterface, SIGNAL(DataSourceDisconnected(const QtZeitgeist::DataModel::DataSource&)), SIGNAL(dataSourceDisconnected(const QtZeitgeist::DataModel::DataSource&))); connect(d->registryInterface, SIGNAL(DataSourceEnabled(const QString &, bool)), SIGNAL(dataSourceEnabled(const QString &, bool))); connect(d->registryInterface, SIGNAL(DataSourceRegistered(const QtZeitgeist::DataModel::DataSource &)), SIGNAL(dataSourceRegistered(const QtZeitgeist::DataModel::DataSource &))); } DataSourceRegistry::~DataSourceRegistry() { delete d; } QDBusPendingReply DataSourceRegistry::registerDataSource(const QString &id, const QString &name, const QString &description, DataModel::EventList &event_templates) { Q_ASSERT(!id.isEmpty()); return d->registryInterface->RegisterDataSource(id, name, description, event_templates); } QDBusPendingReply DataSourceRegistry::getDataSources() { return d->registryInterface->GetDataSources(); } void DataSourceRegistry::setDataSourceEnabled(const QString &unique_id, bool enabled) { d->registryInterface->SetDataSourceEnabled(unique_id, enabled); } }; qtzeitgeist-0.7.0/src/log.cpp0000644000175000017500000001054011544132142016353 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "QtZeitgeist/Log" #include "_gen/LogInterface" #include "QtZeitgeist/Monitor" namespace QtZeitgeist { // Log's DBus Object Path. const QString objectPath = "/org/gnome/zeitgeist/log/activity"; // Log's DBus Service Name. const QString serviceName = "org.gnome.zeitgeist.Engine"; class LogPrivate { public : LogPrivate() { // Create the needed DBus Log Interface. logInterface = new org::gnome::zeitgeist::Log( serviceName, objectPath, QDBusConnection::sessionBus()); } ~LogPrivate() { // Free the interface. delete logInterface; } static quint64 monitorIdIndex; org::gnome::zeitgeist::Log *logInterface; }; quint64 LogPrivate::monitorIdIndex = 0; Log::Log(QObject *parent) : d(new LogPrivate()) { Q_ASSERT(d); } Log::~Log() { delete d; } QDBusPendingReply Log::insertEvents( const QtZeitgeist::DataModel::EventList events) { Q_ASSERT(events.size() > 0); QtZeitgeist::DataModel::EventIdList ids; return d->logInterface->InsertEvents(events); } void Log::deleteLog() { d->logInterface->DeleteLog(); } QDBusPendingReply Log::findRelatedUris( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList, QtZeitgeist::DataModel::EventList resultEventTemplateList, StorageState state, uint maxEvents, ResultType type) { Q_ASSERT(eventTemplateList.size() > 0); Q_ASSERT(resultEventTemplateList.size() > 0); return d->logInterface->FindRelatedUris(timeRange, eventTemplateList, resultEventTemplateList, state, maxEvents, type); } QDBusPendingReply Log::findEvents( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList, StorageState state, uint maxEvents, ResultType type) { Q_ASSERT(eventTemplateList.size() > 0); return d->logInterface->FindEvents(timeRange, eventTemplateList, state, maxEvents, type); } QDBusPendingReply Log::findEventIds( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList, StorageState state, uint maxEvents, ResultType type) { Q_ASSERT(eventTemplateList.size() > 0); return d->logInterface->FindEventIds(timeRange, eventTemplateList, state, maxEvents, type); } void Log::deleteEvents(QtZeitgeist::DataModel::EventIdList ids) { Q_ASSERT(ids.size() > 0); d->logInterface->DeleteEvents(ids); } QDBusPendingReply Log::getEvents( QtZeitgeist::DataModel::EventIdList ids) { Q_ASSERT(ids.size() > 0); return d->logInterface->GetEvents(ids); } const QtZeitgeist::Monitor *Log::installMonitor( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList) { Q_ASSERT(eventTemplateList.size() > 0); LogPrivate::monitorIdIndex++; QtZeitgeist::Monitor *monitor = new QtZeitgeist::Monitor( LogPrivate::monitorIdIndex, timeRange, eventTemplateList, this); d->logInterface->InstallMonitor(QDBusObjectPath(monitor->objectPath()), timeRange, eventTemplateList); return monitor; } void Log::removeMonitor(QtZeitgeist::Monitor *monitor) { Q_ASSERT(monitor != 0); d->logInterface->RemoveMonitor(QDBusObjectPath(monitor->objectPath())); monitor->deleteLater(); } }; qtzeitgeist-0.7.0/include/0000755000175000017500000000000011564026365015735 5ustar lisandrolisandroqtzeitgeist-0.7.0/include/QtZeitgeist/0000755000175000017500000000000011564026365020211 5ustar lisandrolisandroqtzeitgeist-0.7.0/include/QtZeitgeist/QtZeitgeist0000644000175000017500000000003111544132142022367 0ustar lisandrolisandro#include "qtzeitgeist.h" qtzeitgeist-0.7.0/include/QtZeitgeist/Manifestation0000644000175000017500000000003311544132142022716 0ustar lisandrolisandro#include "manifestation.h" qtzeitgeist-0.7.0/include/QtZeitgeist/qtzeitgeist.h0000644000175000017500000000237011544132142022725 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_H_ #define QTZEITGEIST_H_ namespace QtZeitgeist { /** * Initialize the library. * * Before start using the QtZeitgeist library it's necessary to call the init * function. The function will get the library ready to use, initalizing and * registering custom types. * Note: It's really important to call this function before using the library. */ void init(); }; #endif // QTZEITGEIST_H_ qtzeitgeist-0.7.0/include/QtZeitgeist/Monitor0000644000175000017500000000002511544132142021545 0ustar lisandrolisandro#include "monitor.h" qtzeitgeist-0.7.0/include/QtZeitgeist/manifestation.h0000644000175000017500000002537111544132142023220 0ustar lisandrolisandro/* * This file was generated by onto2cpp tool. * Command line was: onto2cpp [('-o', 'Manifestation')] * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef QTZEITGEIST_MANIFESTATION_H #define QTZEITGEIST_MANIFESTATION_H namespace QtZeitgeist { namespace Manifestation { namespace Event { /** * ZGEventManifestation * * Macro defining the Manifestation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation * * Base class for event manifestation types. Please do no instantiate directly, but use one of the sub classes. The manifestation of an event describes 'how it happened'. Fx. 'the user did this' or 'the system notified the user'. */ const char ZGEventManifestation[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventManifestation"; /** * ZGHeuristicActivity * * Macro defining the Manifestation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity * * An event that is caused indirectly from user activity or deducted via analysis of other events. Fx. if an algorithm divides a user workflow into disjoint 'projects' based on temporal analysis it could insert heuristic events when the user changed project. */ const char ZGHeuristicActivity[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#HeuristicActivity"; /** * ZGScheduledActivity * * Macro defining the Manifestation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity * * An event that was directly triggered by some user initiated sequence of actions. For example a music player automatically changing to the next song in a playlist. */ const char ZGScheduledActivity[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ScheduledActivity"; /** * ZGSystemNotification * * Macro defining the Manifestation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification * * An event send to the user by the operating system. Examples could include when the user inserts a USB stick or when the system warns that the hard disk is full. */ const char ZGSystemNotification[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SystemNotification"; /** * ZGUserActivity * * Macro defining the Manifestation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity * * An event that was actively performed by the user. For example saving or opening a file by clicking on it in the file manager. */ const char ZGUserActivity[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#UserActivity"; /** * ZGWorldActivity * * Macro defining the Manifestation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity * * An event that was performed by an entity, usually human or organization, other than the user. An example could be logging the activities of other people in a team. */ const char ZGWorldActivity[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#WorldActivity"; }; namespace Subject { /** * NCALAttachment * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment * * An object attached to a calendar entity. This class has been introduced to serve as a structured value of the ncal:attach property. See the documentation of ncal:attach for details. */ const char NCALAttachment[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Attachment"; /** * NCALCalendarDataObject * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject * * A DataObject found in a calendar. It is usually interpreted as one of the calendar entity types (e.g. Event, Journal, Todo etc.). */ const char NCALCalendarDataObject[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#CalendarDataObject"; /** * NFOArchiveItem * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem * * A file entity inside an archive. */ const char NFOArchiveItem[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#ArchiveItem"; /** * NFODeletedResource * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource * * A file entity that has been deleted from the original source. Usually such entities are stored within various kinds of 'Trash' or 'Recycle Bin' folders. */ const char NFODeletedResource[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DeletedResource"; /** * NFOEmbeddedFileDataObject * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject * * A file embedded in another data object. There are many ways in which a file may be embedded in another one. Use this class directly only in cases if none of the subclasses gives a better description of your case. */ const char NFOEmbeddedFileDataObject[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#EmbeddedFileDataObject"; /** * NFOFileDataObject * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject * * A resource containing a finite sequence of bytes with arbitrary information, that is available to a computer program and is usually based on some kind of durable storage. A file is durable in the sense that it remains available for programs to use after the current program has finished. */ const char NFOFileDataObject[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FileDataObject"; /** * NFOHardDiskPartition * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition * * A partition on a hard disk. */ const char NFOHardDiskPartition[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HardDiskPartition"; /** * NFOMediaStream * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream * * A stream of multimedia content, usually contained within a media container such as a movie (containing both audio and video) or a DVD (possibly containing many streams of audio and video). Most common interpretations for such a DataObject include Audio and Video. */ const char NFOMediaStream[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaStream"; /** * NFORemoteDataObject * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject * * A file data object stored at a remote location. Don't confuse this class with a RemotePortAddress. This one applies to a particular resource, RemotePortAddress applies to an address, that can have various interpretations. */ const char NFORemoteDataObject[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemoteDataObject"; /** * NFORemotePortAddress * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress * * An address specifying a remote host and port. Such an address can be interpreted in many ways (examples of such interpretations include mailboxes, websites, remote calendars or filesystems), depending on an interpretation, various kinds of data may be extracted from such an address. */ const char NFORemotePortAddress[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RemotePortAddress"; /** * NFOSoftwareItem * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem * * A DataObject representing a piece of software. Examples of interpretations of a SoftwareItem include an Application and an OperatingSystem. */ const char NFOSoftwareItem[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareItem"; /** * NFOSoftwareService * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService * * A service published by a piece of software, either by an operating system or an application. Examples of such services may include calendar, addresbook and mailbox managed by a PIM application. This category is introduced to distinguish between data available directly from the applications (Via some Interprocess Communication Mechanisms) and data available from files on a disk. In either case both DataObjects would receive a similar interpretation (e.g. a Mailbox) and wouldn't differ on the content level. */ const char NFOSoftwareService[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SoftwareService"; /** * NMOMailboxDataObject * * Macro defining the Manifestation type http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject * * An entity encountered in a mailbox. Most common interpretations for such an entity include Message or Folder. */ const char NMOMailboxDataObject[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MailboxDataObject"; }; }; }; #endif // QTZEITGEIST_MANIFESTATION_H qtzeitgeist-0.7.0/include/QtZeitgeist/Log0000644000175000017500000000002111544132142020633 0ustar lisandrolisandro#include "log.h" qtzeitgeist-0.7.0/include/QtZeitgeist/interpretation.h0000644000175000017500000006121411544132142023422 0ustar lisandrolisandro/* * This file was generated by onto2cpp tool. * Command line was: onto2cpp [('-o', 'Interpretation')] * This is an auto-generated file. * Do not edit! All changes made to it will be lost. */ #ifndef QTZEITGEIST_INTERPRETATION_H #define QTZEITGEIST_INTERPRETATION_H namespace QtZeitgeist { namespace Interpretation { namespace Event { /** * ZGAccessEvent * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent * * Event triggered by opening, accessing, or starting a resource. Most zg:AccessEvents will have an accompanying zg:LeaveEvent, but this need not always be the case. */ const char ZGAccessEvent[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#AccessEvent"; /** * ZGCreateEvent * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#CreateEvent * * Event type triggered when an item is created. */ const char ZGCreateEvent[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#CreateEvent"; /** * ZGDeleteEvent * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DeleteEvent * * Event triggered because a resource has been deleted or otherwise made permanently unavailable. Fx. when deleting a file. FIXME: How about when moving to trash?. */ const char ZGDeleteEvent[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#DeleteEvent"; /** * ZGEventInterpretation * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventInterpretation * * Base class for event interpretations. Please do no instantiate directly, but use one of the sub classes. The interpretation of an event describes 'what happened' - fx. 'something was created' or 'something was accessed'. */ const char ZGEventInterpretation[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#EventInterpretation"; /** * ZGLeaveEvent * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#LeaveEvent * * Event triggered by closing, leaving, or stopping a resource. Most zg:LeaveEvents will be following a zg:Access event, but this need not always be the case. */ const char ZGLeaveEvent[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#LeaveEvent"; /** * ZGModifyEvent * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ModifyEvent * * Event triggered by modifying an existing resources. Fx. when editing and saving a file on disk or correcting a typo in the name of a contact. */ const char ZGModifyEvent[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ModifyEvent"; /** * ZGReceiveEvent * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ReceiveEvent * * Event triggered when something is received from an external party. The event manifestation must be set according to the world view of the receiving party. Most often the item that is being received will be some sort of message - an email, instant message, or broadcasted media such as micro blogging. */ const char ZGReceiveEvent[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#ReceiveEvent"; /** * ZGSendEvent * * Macro defining the Interpretation type http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SendEvent * * Event triggered when something is send to an external party. The event manifestation must be set according to the world view of the sending party. Most often the item that is being send will be some sort of message - an email, instant message, or broadcasted media such as micro blogging. */ const char ZGSendEvent[] = "http://www.zeitgeist-project.com/ontologies/2010/01/27/zg#SendEvent"; }; namespace Subject { /** * NCALAlarm * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Alarm * * Provide a grouping of component properties that define an alarm. */ const char NCALAlarm[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Alarm"; /** * NCALCalendar * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Calendar * * A calendar. Inspirations for this class can be traced to the VCALENDAR component defined in RFC 2445 sec. 4.4, but it may just as well be used to represent any kind of Calendar. */ const char NCALCalendar[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Calendar"; /** * NCALEvent * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Event * * Provide a grouping of component properties that describe an event. */ const char NCALEvent[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Event"; /** * NCALFreebusy * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Freebusy * * Provide a grouping of component properties that describe either a request for free/busy time, describe a response to a request for free/busy time or describe a published set of busy time. */ const char NCALFreebusy[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Freebusy"; /** * NCALJournal * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Journal * * Provide a grouping of component properties that describe a journal entry. */ const char NCALJournal[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Journal"; /** * NCALTimezone * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Timezone * * Provide a grouping of component properties that defines a time zone. */ const char NCALTimezone[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Timezone"; /** * NCALTodo * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Todo * * Provide a grouping of calendar properties that describe a to-do. */ const char NCALTodo[] = "http://www.semanticdesktop.org/ontologies/2007/04/02/ncal#Todo"; /** * NFOApplication * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Application * * An application. */ const char NFOApplication[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Application"; /** * NFOArchive * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Archive * * A compressed file. May contain other files or folder inside. */ const char NFOArchive[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Archive"; /** * NFOAudio * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio * * A file containing audio content. */ const char NFOAudio[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio"; /** * NFOBookmark * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark * * A bookmark of a webbrowser. Use nie:title for the name/label, nie:contentCreated to represent the date when the user added the bookmark, and nie:contentLastModified for modifications. nfo:bookmarks to store the link. */ const char NFOBookmark[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Bookmark"; /** * NFOBookmarkFolder * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#BookmarkFolder * * A folder with bookmarks of a webbrowser. Use nfo:containsBookmark to relate Bookmarks. Folders can contain subfolders, use containsBookmarkFolder to relate them. */ const char NFOBookmarkFolder[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#BookmarkFolder"; /** * NFOCursor * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Cursor * * A Cursor. */ const char NFOCursor[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Cursor"; /** * NFODataContainer * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DataContainer * * A superclass for all entities, whose primary purpose is to serve as containers for other data object. They usually don't have any "meaning" by themselves. Examples include folders, archives and optical disc images. */ const char NFODataContainer[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#DataContainer"; /** * NFODocument * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document * * A generic document. A common superclass for all documents on the desktop. */ const char NFODocument[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Document"; /** * NFOExecutable * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable * * An executable file. */ const char NFOExecutable[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Executable"; /** * NFOFilesystem * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Filesystem * * A filesystem. Examples of filesystems include hard disk partitions, removable media, but also images thereof stored in files. */ const char NFOFilesystem[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Filesystem"; /** * NFOFilesystemImage * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FilesystemImage * * An image of a filesystem. Instances of this class may include CD images, DVD images or hard disk partition images created by various pieces of software (e.g. Norton Ghost). */ const char NFOFilesystemImage[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#FilesystemImage"; /** * NFOFolder * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder * * A folder/directory. Examples of folders include folders on a filesystem and message folders in a mailbox. */ const char NFOFolder[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Folder"; /** * NFOFont * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font * * A font. */ const char NFOFont[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Font"; /** * NFOHtmlDocument * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HtmlDocument * * A HTML document, may contain links to other files. */ const char NFOHtmlDocument[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#HtmlDocument"; /** * NFOIcon * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Icon * * An Icon (regardless of whether it's a raster or a vector icon. A resource representing an icon could have two types (Icon and Raster, or Icon and Vector) if required. */ const char NFOIcon[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Icon"; /** * NFOImage * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image * * A file containing an image. */ const char NFOImage[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Image"; /** * NFOMedia * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Media * * A piece of media content. This class may be used to express complex media containers with many streams of various media content (both aural and visual). */ const char NFOMedia[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Media"; /** * NFOMediaList * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaList * * A file containing a list of media files.e.g. a playlist. */ const char NFOMediaList[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MediaList"; /** * NFOMindMap * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MindMap * * A MindMap, created by a mind-mapping utility. Examples might include FreeMind or mind mapper. */ const char NFOMindMap[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#MindMap"; /** * NFOOperatingSystem * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#OperatingSystem * * An OperatingSystem. */ const char NFOOperatingSystem[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#OperatingSystem"; /** * NFOPaginatedTextDocument * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PaginatedTextDocument * * A file containing a text document, that is unambiguously divided into pages. Examples might include PDF, DOC, PS, DVI etc. */ const char NFOPaginatedTextDocument[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PaginatedTextDocument"; /** * NFOPlainTextDocument * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument * * A file containing plain text (ASCII, Unicode or other encodings). Examples may include TXT, HTML, XML, program source code etc. */ const char NFOPlainTextDocument[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#PlainTextDocument"; /** * NFOPresentation * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation * * A Presentation made by some presentation software (Corel Presentations, OpenOffice Impress, MS Powerpoint etc.). */ const char NFOPresentation[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Presentation"; /** * NFORasterImage * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage * * A raster image. */ const char NFORasterImage[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#RasterImage"; /** * NFOSoftware * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software * * A piece of software. Examples may include applications and the operating system. This interpretation most commonly applies to SoftwareItems. */ const char NFOSoftware[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Software"; /** * NFOSourceCode * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode * * Code in a compilable or interpreted programming language. */ const char NFOSourceCode[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#SourceCode"; /** * NFOSpreadsheet * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Spreadsheet * * A spreadsheet, created by a spreadsheet application. Examples might include Gnumeric, OpenOffice Calc or MS Excel. */ const char NFOSpreadsheet[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Spreadsheet"; /** * NFOTextDocument * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument * * A text document. */ const char NFOTextDocument[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#TextDocument"; /** * NFOTrash * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Trash * * Represents a container for deleted files, a feature common in modern operating systems. */ const char NFOTrash[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Trash"; /** * NFOVectorImage * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#VectorImage * * . */ const char NFOVectorImage[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#VectorImage"; /** * NFOVideo * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video * * A video file. */ const char NFOVideo[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Video"; /** * NFOVisual * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Visual * * File containing visual content. */ const char NFOVisual[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Visual"; /** * NFOWebsite * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Website * * A website, usually a container for remote resources, that may be interpreted as HTMLDocuments, images or other types of content. */ const char NFOWebsite[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Website"; /** * NMMMovie * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#Movie * * A Movie. */ const char NMMMovie[] = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#Movie"; /** * NMMMusicAlbum * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum * * The music album as provided by the publisher. Not to be confused with media lists or collections. */ const char NMMMusicAlbum[] = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicAlbum"; /** * NMMMusicPiece * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece * * Used to assign music-specific properties such a BPM to video and audio. */ const char NMMMusicPiece[] = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#MusicPiece"; /** * NMMTVSeries * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVSeries * * A TV Series has multiple seasons and episodes. */ const char NMMTVSeries[] = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVSeries"; /** * NMMTVShow * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVShow * * A TV Show. */ const char NMMTVShow[] = "http://www.semanticdesktop.org/ontologies/2009/02/19/nmm#TVShow"; /** * NMOEmail * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email * * An email. */ const char NMOEmail[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Email"; /** * NMOIMMessage * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#IMMessage * * A message sent with Instant Messaging software. */ const char NMOIMMessage[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#IMMessage"; /** * NMOMailbox * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Mailbox * * A mailbox - container for MailboxDataObjects. */ const char NMOMailbox[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Mailbox"; /** * NMOMessage * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Message * * A message. Could be an email, instant messanging message, SMS message etc. */ const char NMOMessage[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#Message"; /** * NMOMimeEntity * * Macro defining the Interpretation type http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MimeEntity * * A MIME entity, as defined in RFC2045, Section 2.4. */ const char NMOMimeEntity[] = "http://www.semanticdesktop.org/ontologies/2007/03/22/nmo#MimeEntity"; }; }; }; #endif // QTZEITGEIST_INTERPRETATION_H qtzeitgeist-0.7.0/include/QtZeitgeist/CMakeLists.txt0000644000175000017500000000047411544132142022743 0ustar lisandrolisandroset(library_HDRS DataSourceRegistry datasourceregistry.h Log log.h Monitor monitor.h QtZeitgeist qtzeitgeist.h Interpretation interpretation.h Manifestation manifestation.h ) install(FILES ${library_HDRS} DESTINATION include/QtZeitgeist) add_subdirectory(DataModel) qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/0000755000175000017500000000000011564026365022043 5ustar lisandrolisandroqtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/TimeRange0000644000175000017500000000002711544132142023625 0ustar lisandrolisandro#include "timerange.h" qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/CMakeLists.txt0000644000175000017500000000031311544132142024565 0ustar lisandrolisandroset(library_HDRS DataSource datasource.h Event event.h Subject subject.h TimeRange timerange.h ) install(FILES ${library_HDRS} DESTINATION include/QtZeitgeist/DataModel) qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/datasource.h0000644000175000017500000000766711544132142024353 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_DATASOURCE_H_ #define QTZEITGEIST_DATASOURCE_H_ #include #include #include #include #include "event.h" namespace QtZeitgeist { namespace DataModel { class DataSourcePrivate; /** * @class DataSource datasource.h datasource.h * @brief DataSource object that represents a datasource. * * @see Event. * * @author Jeremy Whiting */ class Q_DECL_EXPORT DataSource : public QObject { Q_OBJECT Q_PROPERTY(QString uniqueId READ uniqueId) Q_PROPERTY(QString name READ name) Q_PROPERTY(QString description READ description) Q_PROPERTY(EventList eventTemplates READ eventTemplates) Q_PROPERTY(bool running READ running) Q_PROPERTY(QDateTime lastSeen READ lastSeen) Q_PROPERTY(bool enabled READ enabled) public: /** * Default constructor. */ explicit DataSource(QObject *parent = 0); /** * Copy constructor. */ DataSource(const DataSource &source, QObject *parent = 0); /** * Destructor. */ virtual ~DataSource(); /** * Get the datasource unique-id which was passed in from the application * when it was registered. * * @return The unique-id. */ QString uniqueId() const; /** * The datasource's name which was passed in from the application when it * was registered. * * @return The datasource name. */ QString name() const; /** * The datasource's description which was passed in from the application * when it was registered. * * @return The datasource description. */ QString description() const; /** * Get the event templates. * * When an application registers itself as a data-source it can tell * the registry which types of events it will be logging. This method * retreives those event templates given at registration time. * * @returns The eventTemplates. */ EventList eventTemplates() const; /** * Get the running value. * * @return True if this datasource is running. */ bool running() const; /** * Get the lastseen time. * * The last time the data-source was seen by the zeitgeist daemon. * * @return The last seen time. */ QDateTime lastSeen() const; /** * Get the enabled value. * * @return True if this datasource is enabled, false otherwise. */ bool enabled() const; DataSource & operator = (const DataSource &source); private: // D Pointer. class DataSourcePrivate * const d; // Marshalers operators. friend QDBusArgument & operator << (QDBusArgument &argument, const DataSource &datasource); friend const QDBusArgument & operator >> (const QDBusArgument &argument, DataSource &datasource); }; // Create additional types. typedef QList DataSourceList; }; }; // Declare types as Qt Meta Type. Q_DECLARE_METATYPE(QtZeitgeist::DataModel::DataSource) Q_DECLARE_METATYPE(QtZeitgeist::DataModel::DataSourceList) #endif // QTZEITGEIST_DATASOURCE_H_ qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/subject.h0000644000175000017500000001104611544132142023642 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_SUBJECT_H_ #define QTZEITGEIST_SUBJECT_H_ #include #include #include namespace QtZeitgeist { namespace DataModel { class SubjectPrivate; /** * @class Subject subject.h subject.h * @brief The Subject objects abstract subjects returned from Zeitgeist queries. * * The Subject class is one of the primary elements for communicating with the * Zeitgeist daemon. * * @see Event. * * @author Jeremy Whiting */ class Q_DECL_EXPORT Subject : public QObject { Q_OBJECT Q_PROPERTY(QString uri READ uri WRITE setUri) Q_PROPERTY(QString interpretation READ interpretation WRITE setInterpretation) Q_PROPERTY(QString manifestation READ manifestation WRITE setManifestation) Q_PROPERTY(QString origin READ origin WRITE setOrigin) Q_PROPERTY(QString mimeType READ mimeType WRITE setMimeType) Q_PROPERTY(QString text READ text WRITE setText) Q_PROPERTY(QString storage READ storage WRITE setStorage) public: /** * Default constructor. */ explicit Subject(QObject *parent = 0); /** * Copy constructor. */ Subject(const Subject &source, QObject *parent = 0); /** * Destructor. */ virtual ~Subject(); /** * The URI of the subject. * * @returns the URI of the subject. */ QString uri() const; /** * Set the subject URI. * * @param uri the new URI of the subject. */ void setUri(const QString &uri); /** * The subject interpretation represents what type of subject it is. * * @return the subject interpretation as a URI or empty if unset. */ QString interpretation() const; /** * Set the subject interpretation. * * @param interpretation the URI designating the interpretation type of * the subject. */ void setInterpretation(const QString &interpretation); /** * The subject manifestation represents how did it happen. * * @return the subject interpretation as a URI or empty if unset. */ QString manifestation() const; /** * Set the subject manifestation. * * @param manifestation the URI designating the manifestation type of * the subject. */ void setManifestation(const QString &manifestation); /** * The origin of the subject. * * @returns the origin of the subject. */ QString origin() const; /** * Set the origin of the subject. * * @param origin the new origin of theh subject. */ void setOrigin(const QString &origin); /** * The mime-type of the subject. * * @returns the mime-type of the subject. */ QString mimeType() const; /** * Set the mime-type of the subject. * * @param mimeType the new mime-type of the subject. */ void setMimeType(const QString &mimeType); /** * The text of the subject. * * @returns the text of the subject. */ QString text() const; /** * Set the text of the subject. * * @param text the new text of the subject. */ void setText(const QString &text); /** * The storage of the subject. * * @returns the storage of the subject. */ QString storage() const; /** * Set the storage of the subject. * * @param storage the new storage of the subject. */ void setStorage(const QString &storage); Subject & operator = (const Subject &source); private: // D Pointer. class SubjectPrivate * const d; }; // Create additional types. typedef QList SubjectList; }; }; Q_DECLARE_METATYPE(QtZeitgeist::DataModel::Subject) #endif // QTZEITGEIST_SUBJECT_H_ qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/timerange.h0000644000175000017500000000736111544132142024163 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_TIMERANGE_H_ #define QTZEITGEIST_TIMERANGE_H_ #include #include #include namespace QtZeitgeist { namespace DataModel { class TimeRangePrivate; /** * @class TimeRange timerange.h timerange.h * @brief The representation of an interval in time, marked by a * beginning and an end. * * The start and the end point are represented in number of milliseconds * since the Unix Epoch. * @author Abner Silva */ class Q_DECL_EXPORT TimeRange : public QObject { Q_OBJECT Q_PROPERTY(qint64 begin READ begin WRITE setBegin) Q_PROPERTY(qint64 end READ end WRITE setEnd) public: /** * Default constructor. */ explicit TimeRange(QObject *parent = 0); /** * Copy constructor. */ TimeRange(const TimeRange &source, QObject *parent = 0); /** * Data initializing constructor. * * @param startTime the start point of the time range. * @param endTime the end point of the time range. */ TimeRange(qint64 startTime, qint64 endTime); /** * Destructor. */ virtual ~TimeRange(); /** * Returns the start point of the time range. * * @returns the begin of the time range. */ qint64 begin() const; /** * Set the start value/point of the time range. * * @param begin a value for the start point in milliseconds. */ void setBegin(qint64 begin); /** * Returns the end point of the time range. * * @returns the end of the time range. */ qint64 end() const; /** * Set the end value/point of the time range. * * @param end a value for the start point in milliseconds. */ void setEnd(qint64 end); /** * Returns a new time range starting from the beginning of the Unix Epoch * and ending at the moment of the invocation. * * @returns a TimeRange starting from Epoch to the current time. */ static TimeRange timeRangeToNow(); /** * Returns a new time range starting from the moment of invocation to the * end of time. * * @returns a TimeRange starting from now to the end of time. */ static TimeRange timeRangeFromNow(); /** * Returns a new time range starting from the Unix Epoch and ending at the * end of time. * * @returns A TimeRange representing always. */ static TimeRange always(); TimeRange & operator = (const TimeRange &source); private: // D Pointer. class TimeRangePrivate * const d; // Marshalers operators. friend QDBusArgument & operator << (QDBusArgument &argument, const TimeRange &event); friend const QDBusArgument & operator >> (const QDBusArgument &argument, TimeRange &event); }; }; }; // Declare types as Qt Meta Type. Q_DECLARE_METATYPE(QtZeitgeist::DataModel::TimeRange) #endif // QTZEITGEIST_TIMERANGE_H_ qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/DataSource0000644000175000017500000000003011544132142023776 0ustar lisandrolisandro#include "datasource.h" qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/Event0000644000175000017500000000002311544132142023027 0ustar lisandrolisandro#include "event.h" qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/event.h0000644000175000017500000001513711544132142023331 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_EVENT_H_ #define QTZEITGEIST_EVENT_H_ #include #include #include #include #include "QtZeitgeist/DataModel/Subject" namespace QtZeitgeist { namespace DataModel { class EventPrivate; /** * @class Event event.h event.h * @brief The Event objects abstract events returned from Zeitgeist queries. * * The Event class is one of the primary elements for communicating with the * Zeitgeist daemon. The Event serve two purposes: * Unsurprisingly they represent events that have happened, but they also * can act as templates. * * @see Subject. * * @author Abner Silva */ class Q_DECL_EXPORT Event : public QObject { Q_OBJECT Q_PROPERTY(quint32 id READ id) Q_PROPERTY(QDateTime timestamp READ timestamp WRITE setTimestamp) Q_PROPERTY(QString interpretation READ interpretation WRITE setInterpretation) Q_PROPERTY(QString manifestation READ manifestation WRITE setManifestation) Q_PROPERTY(QString actor READ actor WRITE setActor) Q_PROPERTY(SubjectList subjects READ subjects WRITE setSubjects) Q_PROPERTY(QByteArray payload READ payload WRITE setPayload) public: /** * Default constructor. */ explicit Event(QObject *parent = 0); /** * Copy constructor. */ Event(const Event &source, QObject *parent = 0); /** * Destructor. */ virtual ~Event(); /** * Get the event id as assigned by the Zeitgeist engine. * * @return The event id or 0 if it's unset. An event retrieved from the * Zeitgeist engine will always have an event id. */ quint32 id() const; /** * Get the event timestamp. * * The timestamp is in milliseconds since the Unix epoch. * * @return The event timestamp. Note that 0 is ambiguous as it denotes both * an unset timestamp and the time of the Unix Epoch. */ QDateTime timestamp() const; /** * Set the event timestamp. * * The timestamp is in milliseconds since the Unix epoch. * * @param timestamp the timestamp to set the event for. * * Note that the if you insert events into the Zeitgeist log without a * timestamp set the Zeiteist daemon will automatically assign the * timestamp of the logging time to the event. */ void setTimestamp(const QDateTime ×tamp); /** * The event interpretation represents what happened. * * It is encoded as URI defined by the Zeitgeist Event Ontology. * Examples could be "something was opened" or "something was modified". * * @return The event interpretation as a URI or empty if unset. */ QString interpretation() const; /** * Set the event interpretation. * * @param interpretation the URI designating the interpretation type of * the event. */ void setInterpretation(const QString &interpretation); /** * The event manifestation represents how did it happen. * * It is encoded as URI defined by the Zeitgeist Event Ontology. Examples * could be "the user did it" or "the system send a notification". * * @return The event interpretation as a URI or empty if unset. */ QString manifestation() const; /** * Set the event manifestation. * * @param manifestation the URI designating the manifestation type of * the event. */ void setManifestation(const QString &manifestation); /** * Get the event actor. * * The actor represents the party responsible for triggering the event. * When the actor is an application (which it almost always is) the actor * is encoded in the app:// URI scheme with the base name of the .desktop * file for the application appended. Eg.app://firefox.desktop * * @return A URI designating the actor of the event. */ QString actor() const; /** * Set the event actor. * * @param The URI designating the actor triggering the event. */ void setActor(const QString &actor); /** * Get the subject list of this event. * * @return A list containing all event's subjects. */ SubjectList subjects() const; /** * Set the event's subject list. * * @param subjects the list of subjects to set. */ void setSubjects(const SubjectList &subjects); /** * Get the event's payload. * * Look up the free form binary payload of @Event. * * @return The event payload or NULL (empty) if unset. */ QByteArray payload() const; /** * Set the event's payload. * * Attach a a free form binary payload to @Event. Payloads are application * specific and can not be assumed to have any particular format unless * you have other contextual information about the event. * * @param payload the payload to add to @Event. */ void setPayload(const QByteArray &payload); /** * Append a @Subject to the list of subjects for @Event. * * @param subject the subject to be added to the event. */ void addSubject(const Subject &subject); Event & operator = (const Event &source); private: // D Pointer. class EventPrivate * const d; // Marshalers operators. friend QDBusArgument & operator << (QDBusArgument &argument, const Event &event); friend const QDBusArgument & operator >> (const QDBusArgument &argument, Event &event); }; // Create additional types. typedef QList EventList; typedef QList EventIdList; }; }; // Declare types as Qt Meta Type. Q_DECLARE_METATYPE(QtZeitgeist::DataModel::Event) Q_DECLARE_METATYPE(QtZeitgeist::DataModel::EventList) Q_DECLARE_METATYPE(QtZeitgeist::DataModel::EventIdList) #endif // QTZEITGEIST_EVENT_H_ qtzeitgeist-0.7.0/include/QtZeitgeist/DataModel/Subject0000644000175000017500000000002511544132142023347 0ustar lisandrolisandro#include "subject.h" qtzeitgeist-0.7.0/include/QtZeitgeist/log.h0000644000175000017500000002035511544132142021135 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_LOG_H_ #define QTZEITGEIST_LOG_H_ #include #include #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" namespace QtZeitgeist { class Monitor; class LogPrivate; /** * @class Log log.h log.h * @brief Primary access point for talking to the Zeitgeist daemon. * * @Log encapsulates the low level access to the Zeitgeist daemon. * You can use it to manage the log by inserting and deleting entries as well * as do queries on the logged data. * * It's important to realize that the @Log class does not expose * any API that does synchronous communications with the message bus - * everything is asynchronous. Thus, instead of the real result, each * asynchronous operation will return a DBus pending reply object, that can * be used to watch and fetch the real operation return/result. * * Example: * * QDBusPendingCall async = log->asyncCall(value1, value2); * QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(async, this); * * QObject::connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), * this, SLOT(callFinishedSlot(QDBusPendingCallWatcher*))); * * * @see Event * * @author Abner Silva */ class Q_DECL_EXPORT Log : public QObject { Q_OBJECT Q_DISABLE_COPY(Log) Q_ENUMS(StorageState) Q_ENUMS(ResultType) public: enum StorageState { NotAvailable = 0, Available, Any }; enum ResultType { MostRecentEvents = 0, LeastRecentEvents, MostRecentSubjects, LeastRecentSubjects, MostPopularSubjects, LeastPopularSubjects, MostPopularActor, LeastPopularActor, MostRecentActor, LeastRecentActor }; /** * Default constructor. */ explicit Log(QObject *parent = 0); /** * Destructor. */ virtual ~Log(); /** * Asynchronously send a set of events to the Zeitgeist daemon, requesting * they be inserted into the log. * * @param events the list of events to be inserted. * * returns The Id list of the inserted events. */ QDBusPendingReply insertEvents( const QtZeitgeist::DataModel::EventList events); /** * Delete the log file and all its content. * * Note: This is a dangerous method. Once it's called it will request * Zeitgeist to delete the entire log file and all its content in one go. * To delete specific subsets use @findEventIds combined with * @deleteEvents(). * * @see findEventIds * @see deleteEvents */ void deleteLog(); /** * Get a list of URIs of subjects which frequently occur together with * events matching the event templates within time range. * * The resulting URIs must occur as subjects of events matching given * result event templates and have the given storage state. * * @param timeRange two timestamps defining the timerange for the query. * @param eventTemplateList a list of event templates which you want URIs * that relate to. * @param resultEventTemplateList a list of event templates which the * returned URIs must occur as subjects of. * @param state whether the item is currently known to be available. * @param maxEvents maximal amount of returned events. * @param type the Order in which the result should be made available. * * @returns A list of URI strings. */ QDBusPendingReply findRelatedUris( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList, QtZeitgeist::DataModel::EventList resultEventTemplateList, StorageState state, uint maxEvents, ResultType type); /** * Get events matching a given set of templates. * * The matching is done where unset fields in the templates are treated as * wildcards. If a template has more than one subject then events will * match the template if any one of their subjects match any one of the * subject templates. * * @param timeRange two timestamps defining the timerange for the query. * @param eventTemplateList a list of event templates which you want URIs * that relate to. * @param state whether the item is currently known to be available. * @param maxEvents maximal amount of returned events. * @param type the Order in which the result should be made available. * * @returns A list of Events. */ QDBusPendingReply findEvents( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList, StorageState state, uint maxEvents, ResultType type); /** * Search for events matching a given set of templates and return the IDs * of matching events. * * The matching is done where unset fields in the templates are treated as * wildcards. If a template has more than one subject then events will * match the template if any one of their subjects match any one of the * subject templates. * * @param timeRange two timestamps defining the timerange for the query. * @param eventTemplateList a list of event templates which you want URIs * that relate to. * @param state whether the item is currently known to be available. * @param maxEvents maximal amount of returned events. * @param type the Order in which the result should be made available. * * @returns A list of Event Ids. */ QDBusPendingReply findEventIds( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList, StorageState state, uint maxEvents, ResultType type); /** * Delete a set of events from the log given their IDs. * * @param ids list of event IDs. */ void deleteEvents(QtZeitgeist::DataModel::EventIdList ids); /** * Get full event data for a set of event IDs. * * @param ids a list of event IDs. * * @returns A list of Events. */ QDBusPendingReply getEvents( QtZeitgeist::DataModel::EventIdList ids); /** * Request the installation of a new monitor. * * Register a client side monitor object to receive callbacks when * events matching time range and event templates are inserted or deleted. * * @param timeRange a @TimeRange with the time range monitored events * must fall within. * @param eventTemplateList Event templates that events must match in * order to trigger the monitor. * * @return A const @Monitor instance. */ const QtZeitgeist::Monitor *installMonitor( QtZeitgeist::DataModel::TimeRange timeRange, QtZeitgeist::DataModel::EventList eventTemplateList); /** * Request the removing of the given monitor. * * Remove from Zeitgeist daemon an installed @Monitor. * Note: Once the @Monitor is removed, the @Log class will automatically * delete the @Monitor instance and should not be used after it. * * @param monitor an installed @Monitor instance to be removed. */ void removeMonitor(QtZeitgeist::Monitor *monitor); private: // D Pointer. class LogPrivate * const d; }; }; #endif // QTZEITGEIST_LOG_H_ qtzeitgeist-0.7.0/include/QtZeitgeist/DataSourceRegistry0000644000175000017500000000004011544132142023676 0ustar lisandrolisandro#include "datasourceregistry.h" qtzeitgeist-0.7.0/include/QtZeitgeist/Interpretation0000644000175000017500000000003411544132142023125 0ustar lisandrolisandro#include "interpretation.h" qtzeitgeist-0.7.0/include/QtZeitgeist/datasourceregistry.h0000644000175000017500000001022211544132142024267 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_DATASOURCEREGISTRY_H_ #define QTZEITGEIST_DATASOURCEREGISTRY_H_ #include #include #include "QtZeitgeist/DataModel/DataSource" #include "QtZeitgeist/DataModel/Event" namespace QtZeitgeist { class DataSourceRegistryPrivate; /** * @class DataSourceRegistry datasourceregistry.h datasourceregistry.h * @brief Primary access point for accessing the Zeitgeist data-sources. * * @DataSourceRegistry encapsulates the low level access to the Zeitgeist * data-sources. You can use it to manage the data-sources by registering * a data source, enabling/disabling data-sources and getting all data-sources. * * It's important to realize that the @DataSourceRegistry class does not expose * any API that does synchronous communications with the message bus - * everything is asynchronous. Thus, instead of the real result, each * asynchronous operation will return a DBus pending reply object, that can * be used to watch and fetch the real operation return/result. * * @see Event * * @author Jeremy Whiting */ class Q_DECL_EXPORT DataSourceRegistry : public QObject { Q_OBJECT Q_DISABLE_COPY(DataSourceRegistry) public: /** * Default constructor. */ explicit DataSourceRegistry(QObject *parent = 0); /** * Destructor. */ virtual ~DataSourceRegistry(); /** * Asynchronously register a data source. * * Register a data-source as currently running. If the data-source was * already in the database, its metadata (name, description and * event_templates) are updated. * * @param unique_id unique ASCII string identifying the data-source. * @param name data-source name (may be translated). * @param description data-source description (may be translated). * @param event_templates optional templates of events the datasource logs. * * @returns Enabled, true if the datasource is enabled, false if it's * disabled. */ QDBusPendingReply registerDataSource(const QString &unique_id, const QString &name, const QString &description, DataModel::EventList &event_templates); /** * Asynchronously get the existing data sources. * * Get the list of known data-sources. * * @returns a list of data sources. */ QDBusPendingReply getDataSources(); /** * Asynchronously enable or disable a data source. * * @param unique_id unique string identifying a data-source. * @param enabled whether the data-source is to be enabled or disabled. */ void setDataSourceEnabled(const QString &unique_id, bool enabled); Q_SIGNALS: /** * This signal is emitted whenever the last running instance of a * data-source disconnects. */ void dataSourceDisconnected(const QtZeitgeist::DataModel::DataSource&); /** * This signal is emitted whenever a data-source is enabled or disabled. */ void dataSourceEnabled(const QString &, bool); /** * This signal is emitted whenever a data-source registers itself. */ void dataSourceRegistered(const QtZeitgeist::DataModel::DataSource &); private: // D Pointer. class DataSourceRegistryPrivate * const d; }; }; #endif // QTZEITGEIST_DATASOURCEREGISTRY_H_ qtzeitgeist-0.7.0/include/QtZeitgeist/monitor.h0000644000175000017500000001001211544132142022030 0ustar lisandrolisandro/* * This file is part of QtZeitgeist. * * Copyright (C) 2010 Collabora Ltd. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef QTZEITGEIST_MONITOR_H_ #define QTZEITGEIST_MONITOR_H_ #include #include "QtZeitgeist/Log" #include "QtZeitgeist/DataModel/Event" #include "QtZeitgeist/DataModel/TimeRange" namespace QtZeitgeist { class MonitorPrivate; /** * @class Monitor monitor.h monitor.h * @brief Class for monitoring the Zeitgeist log for certain types of events. * * @Monitor listens for updates to the Zeitgeist event log matching a given * set of templates and with timestamps in some predefined time range. * * @see Log * * @author Abner Silva */ class Q_DECL_EXPORT Monitor : public QObject { Q_OBJECT Q_DISABLE_COPY(Monitor) Q_PROPERTY(quint64 id READ id) Q_PROPERTY(QtZeitgeist::DataModel::TimeRange timeRange READ timeRange) Q_PROPERTY(QtZeitgeist::DataModel::EventList eventTemplates READ eventTemplates) public: /** * Return the Monitor ID. * * Note: The Monitor ID is not related to any data stored or referenced by * the Zeitgeist daemon. It's only an unique identification of the monitor * instance. * * @returns An unique ID. */ quint64 id() const; /** * Return the Monitor Time Range. * * @returns the time range used to create the monitor. */ QtZeitgeist::DataModel::TimeRange timeRange() const; /** * Return the Monitor Event Templates. * * @returns the event templates used to create the monitor. */ QtZeitgeist::DataModel::EventList eventTemplates() const; protected: /** * Default constructor. */ explicit Monitor(quint64 id, QtZeitgeist::DataModel::TimeRange monitorTimeRange, QtZeitgeist::DataModel::EventList monitorTemplates, QObject *parent = 0); /** * Destructor. */ virtual ~Monitor(); Q_SIGNALS: /** * Signal to notify inserted events. * * Emitted when events matching the event templates and with timestamps * within the time range of the monitor has been inserted into the log. * * @param timeRange a @TimeRange that specifies the minimum and maximum * of the timestamps in @events. * @param events a @EventList holding the events that have been inserted * into the log. */ void eventsInserted(const QtZeitgeist::DataModel::TimeRange &timeRange, const QtZeitgeist::DataModel::EventList &events); /** * Signal to notify deleted events. * * Emitted when events with timestamps within the time range of this * monitor has been deleted from the log. Note that the deleted events * may not match the event templates for the monitor. * * @param timeRange A @TimeRange that specifies the minimum and maximum * timestamps of the deleted events. * @param eventIds A @EventIdList holding the ids of the deleted events. */ void eventsDeleted(const QtZeitgeist::DataModel::TimeRange &timeRange, const QtZeitgeist::DataModel::EventIdList &eventIds); private: QString objectPath() const; friend class Log; friend class MonitorPrivate; // D Pointer. class MonitorPrivate * const d; }; }; #endif // QTZEITGEIST_MONITOR_H_ qtzeitgeist-0.7.0/include/CMakeLists.txt0000644000175000017500000000003611544132142020461 0ustar lisandrolisandroadd_subdirectory(QtZeitgeist) qtzeitgeist-0.7.0/QtZeitgeist.pc.in0000644000175000017500000000057011544132142017506 0ustar lisandrolisandroprefix=${CMAKE_INSTALL_PREFIX} exec_prefix=${CMAKE_INSTALL_PREFIX} libdir=${CMAKE_INSTALL_PREFIX}/lib includedir=${CMAKE_INSTALL_PREFIX}/include Name: QtZeitgeist Description: Qt Zeitgeist library Version: 0.0.1 Requires: QtCore QtDBus Libs: -L${CMAKE_INSTALL_PREFIX}/lib -lQtZeitgeist Cflags: -I${CMAKE_INSTALL_PREFIX}/include/QtZeitgeist -I${CMAKE_INSTALL_PREFIX}/include/ qtzeitgeist-0.7.0/cmake/0000755000175000017500000000000011564026365015372 5ustar lisandrolisandroqtzeitgeist-0.7.0/cmake/modules/0000755000175000017500000000000011564026365017042 5ustar lisandrolisandroqtzeitgeist-0.7.0/cmake/modules/cmake_uninstall.cmake.in0000644000175000017500000000151511544132142023611 0ustar lisandrolisandroIF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") ENDIF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") FILE(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) STRING(REGEX REPLACE "\n" ";" files "${files}") FOREACH(file ${files}) MESSAGE(STATUS "Uninstalling \"${file}\"") IF(EXISTS "${file}") EXEC_PROGRAM( "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" OUTPUT_VARIABLE rm_out RETURN_VALUE rm_retval ) IF("${rm_retval}" STREQUAL 0) ELSE("${rm_retval}" STREQUAL 0) MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"") ENDIF("${rm_retval}" STREQUAL 0) ELSE(EXISTS "${file}") MESSAGE(STATUS "File \"${file}\" does not exist.") ENDIF(EXISTS "${file}") ENDFOREACH(file) qtzeitgeist-0.7.0/README0000644000175000017500000000002511544132142015154 0ustar lisandrolisandroQt Zeitgeist Library