pax_global_header00006660000000000000000000000064117440245300014512gustar00rootroot0000000000000052 comment=bcf0c04045f9db62c4e6a6070c6a26d7d68df1a9 ofono-qt-1.5+git20120419+bcf0c04/000077500000000000000000000000001174402453000156405ustar00rootroot00000000000000ofono-qt-1.5+git20120419+bcf0c04/.gitignore000066400000000000000000000001001174402453000176170ustar00rootroot00000000000000*.o *.a *.moc moc_* Makefile* *.so* *.pc *.prl doxygen.cfg doc/ ofono-qt-1.5+git20120419+bcf0c04/AUTHORS000066400000000000000000000001321174402453000167040ustar00rootroot00000000000000Alexander Kanavin Jukka Saunamäki ofono-qt-1.5+git20120419+bcf0c04/COPYING000066400000000000000000000636421174402453000167060ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, 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 Street, 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! ofono-qt-1.5+git20120419+bcf0c04/HACKING000066400000000000000000000020171174402453000166270ustar00rootroot00000000000000The Qt coding style is defined at http://qt.gitorious.org/qt/pages/QtCodingStyle so let's follow that. Overall, the basic rule is simple: follow the coding style, and the design and functionality patterns that are already there. There are patterns for getting and setting oFono properties, calling methods and getting the method call result, setting the errors, and receiving out-of-band signals. Hopefully that should be enough for any remaining APIs which are currently missing (some APIs such as SIM toolkit require implementing a d-bus agent for which there is no example yet). For any new API that is added, there should also be a test case. Again, try to imitate existing test cases. It is not necessary to thoroughly test the functionality; it is enough to go through all properties, methods and signals and check that they work, return sane values and match the actual oFono API. The tests should be written against Phonesim phone simulator and it's preferred that they should be able to run without manual intervention. ofono-qt-1.5+git20120419+bcf0c04/README000066400000000000000000000001241174402453000165150ustar00rootroot00000000000000This package contains Qt bindings to a number of oFono cellular service interfaces. ofono-qt-1.5+git20120419+bcf0c04/TODO000066400000000000000000000017411174402453000163330ustar00rootroot00000000000000Amount of effort required: * small ** medium *** large Implement missing APIs: org.ofono.AssistedSatelliteNavigation and org.ofono.PositioningRequestAgent ** org.ofono.AudioSettings * org.ofono.CallMeter * (class implementation exists, but lots of missing stuff) org.ofono.cdma.ConnectionManager ** org.ofono.cdma.MessageManager *** org.ofono.cdma.NetworkRegistration ** org.ofono.cdma.VoiceCallManager ** org.ofono.CellBroadcast ** org.ofono.Handsfree * org.ofono.LocationReporting * org.ofono.PushNotification and org.ofono.PushNotificationAgent ** org.ofono.SmartMessaging and org.ofono.SmartMessagingAgent ** org.ofono.SimToolkit and org.ofono.SimToolkitAgent *** org.ofono.TextTelephony * Call History - that seems to be a separately available plugin and I can't find where it is. More formal "certification" of ofono-qt to specific ofono versions - the versioning should match ofono's - when new version of ofono is out, diff of ofono/doc/* can serve as a list of things to fix ofono-qt-1.5+git20120419+bcf0c04/doxygen.cfg.in000066400000000000000000001641361174402453000204160ustar00rootroot00000000000000# Doxyfile 1.5.6 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "Qt bindings for oFono cellular services" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = doc # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, # and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = YES # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # For Microsoft's IDL there are propget and propput attributes to indicate getter # and setter methods for a property. Setting this option to YES (the default) # will make doxygen to replace the get and set methods by a property in the # documentation. This will only work if the methods are indeed getting or # setting a simple type. If this is not the case, or you want to show the # methods anyway, you should set this option to NO. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # Set the SHOW_FILES tag to NO to disable the generation of the Files page. # This will remove the Files entry from the Quick Index and from the # Folder Tree View (if specified). The default is YES. SHOW_FILES = YES # Set the SHOW_NAMESPACES tag to NO to disable the generation of the # Namespaces page. This will remove the Namespaces entry from the Quick Index # and from the Folder Tree View (if specified). The default is YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = lib # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.h *.dox # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = *_priv.h # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = OfonoModemStruct OfonoOperatorStruct OfonoInterface # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING # is used to encode HtmlHelp index (hhk), content (hhc) and project file # content. CHM_INDEX_ENCODING = # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index # structure should be generated to display hierarchical information. # If the tag value is set to FRAME, a side panel will be generated # containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. Other possible values # for this tag are: HIERARCHIES, which will generate the Groups, Directories, # and Class Hiererachy pages using a tree view instead of an ordered list; # ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which # disables this behavior completely. For backwards compatibility with previous # releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE # respectively. GENERATE_TREEVIEW = NONE # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 # Use this tag to change the font size of Latex formulas included # as images in the HTML documentation. The default is 10. Note that # when you change the font size after a successful doxygen run you need # to manually remove any form_*.png images from the HTML output directory # to force them to be regenerated. FORMULA_FONTSIZE = 10 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # By default doxygen will write a font called FreeSans.ttf to the output # directory and reference it in all dot files that doxygen generates. This # font does not include all possible unicode characters however, so when you need # these (or just want a differently looking font) you can specify the font name # using DOT_FONTNAME. You need need to make sure dot is able to find the font, # which can be done by putting it in a standard location or by setting the # DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory # containing the font. DOT_FONTNAME = FreeSans # By default doxygen will tell dot to use the output directory to look for the # FreeSans.ttf font (which doxygen will put there itself). If you specify a # different font using DOT_FONTNAME you can set the path where dot # can find it using this tag. DOT_FONTPATH = # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is enabled by default, which results in a transparent # background. Warning: Depending on the platform used, enabling this option # may lead to badly anti-aliased labels on the edges of a graph (i.e. they # become hard to read). DOT_TRANSPARENT = YES # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO ofono-qt-1.5+git20120419+bcf0c04/lib/000077500000000000000000000000001174402453000164065ustar00rootroot00000000000000ofono-qt-1.5+git20120419+bcf0c04/lib/lib.pro000066400000000000000000000042141174402453000176770ustar00rootroot00000000000000include(../version.pri) TEMPLATE = lib TARGET = ofono-qt CONFIG += debug DEFINES += BUILD_OFONO_QT_LIBRARY QT += dbus QT -= gui INCLUDEPATH += ../ PUBLIC_HEADERS += libofono-qt_global.h PUBLIC_HEADERS += ofonopropertysetting.h PUBLIC_HEADERS += ofonomodeminterface.h PUBLIC_HEADERS += ofonomodemmanager.h PUBLIC_HEADERS += ofonomodem.h PUBLIC_HEADERS += ofonophonebook.h PUBLIC_HEADERS += ofonomessagemanager.h PUBLIC_HEADERS += ofonomessagewaiting.h PUBLIC_HEADERS += ofonoradiosettings.h PUBLIC_HEADERS += ofonosimmanager.h PUBLIC_HEADERS += ofonocallbarring.h PUBLIC_HEADERS += ofonocallforwarding.h PUBLIC_HEADERS += ofonocallmeter.h PUBLIC_HEADERS += ofonocallsettings.h PUBLIC_HEADERS += ofononetworkoperator.h PUBLIC_HEADERS += ofononetworkregistration.h PUBLIC_HEADERS += ofonosupplementaryservices.h PUBLIC_HEADERS += ofonovoicecallmanager.h PUBLIC_HEADERS += ofonovoicecall.h PUBLIC_HEADERS += ofonocallvolume.h PUBLIC_HEADERS += ofonomessage.h PUBLIC_HEADERS += ofonoconnman.h PUBLIC_HEADERS += ofonoconnmancontext.h HEADERS += $$PUBLIC_HEADERS HEADERS += ofonointerface.h SOURCES += ofonointerface.cpp SOURCES += ofonomodeminterface.cpp SOURCES += ofonomodemmanager.cpp SOURCES += ofonomodem.cpp SOURCES += ofonophonebook.cpp SOURCES += ofonomessagemanager.cpp SOURCES += ofonomessagewaiting.cpp SOURCES += ofonoradiosettings.cpp SOURCES += ofonosimmanager.cpp SOURCES += ofonocallbarring.cpp SOURCES += ofonocallforwarding.cpp SOURCES += ofonocallmeter.cpp SOURCES += ofonocallsettings.cpp SOURCES += ofononetworkoperator.cpp SOURCES += ofononetworkregistration.cpp SOURCES += ofonosupplementaryservices.cpp SOURCES += ofonovoicecallmanager.cpp SOURCES += ofonovoicecall.cpp SOURCES += ofonocallvolume.cpp SOURCES += ofonomessage.cpp SOURCES += ofonoconnman.cpp SOURCES += ofonoconnmancontext.cpp target.path = $$[QT_INSTALL_PREFIX]/lib headers.files = $$PUBLIC_HEADERS headers.path = $$[QT_INSTALL_PREFIX]/include/ofono-qt CONFIG += create_pc create_prl QMAKE_PKGCONFIG_DESTDIR = pkgconfig QMAKE_PKGCONFIG_INCDIR = $$headers.path qtconfig.path = $$[QT_INSTALL_PREFIX]/share/qt4/mkspecs/features qtconfig.files = ofono-qt.prf INSTALLS += target headers qtconfig ofono-qt-1.5+git20120419+bcf0c04/lib/libofono-qt_global.h000066400000000000000000000020721174402453000223310ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONO_QT_GLOBAL_H #define OFONO_QT_GLOBAL_H #include #ifdef BUILD_OFONO_QT_LIBRARY # define OFONO_QT_EXPORT Q_DECL_EXPORT #else # define OFONO_QT_EXPORT Q_DECL_IMPORT #endif #endif // OFONO_QT_GLOBAL_H ofono-qt-1.5+git20120419+bcf0c04/lib/main.dox000066400000000000000000000017061174402453000200520ustar00rootroot00000000000000/** * \mainpage ofono-qt - Qt Bindings to Cellular Services * * \section intro Introduction * * ofono-qt is a high-level Qt binding to oFono cellular services provided via DBus * * Development is done in the Git repository here. * * \section building Building * * Building ofono-qt requires: * \li Qt, including QtDBus * \li qmake * * After installing all dependencies, run: * * \verbatim $ qmake $ make $ make install \endverbatim * * \section running Running * * In order to run ofono-qt, you need a working * installation of ofono daemon. This is the backend with which the * ofono-qt bindings communicate. * * In order to set up ofono, you will need a working PhoNet stack and * a device connected via USB or a running phonesim modem simulator. * * More information: * http://git.kernel.org/?p=network/ofono/phonesim.git;a=blob;f=HACKING;hb=HEAD * */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofono-qt.prf000066400000000000000000000002441174402453000206610ustar00rootroot00000000000000prefix=/usr exec_prefix=$${prefix} DEPENDPATH += $${prefix}/include/ofono-qt INCLUDEPATH += $${prefix}/include/ofono-qt LIBS += -L $${exec_prefix}/lib -lofono-qt ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallbarring.cpp000066400000000000000000000136731174402453000224450ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonocallbarring.h" #include "ofonointerface.h" #define SET_PROPERTY_TIMEOUT 300000 OfonoCallBarring::OfonoCallBarring(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.CallBarring", OfonoGetAllOnFirstRequest, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); connect(m_if, SIGNAL(requestPropertyComplete(bool, const QString&, const QVariant&)), this, SLOT(requestPropertyComplete(bool, const QString&, const QVariant&))); connect(modem(), SIGNAL(pathChanged(QString)), this, SLOT(pathChanged(const QString&))); connectDbusSignals(path()); } OfonoCallBarring::~OfonoCallBarring() { } void OfonoCallBarring::pathChanged(const QString& path) { connectDbusSignals(path); } void OfonoCallBarring::connectDbusSignals(const QString& /*path*/) { } void OfonoCallBarring::changePassword(const QString &old_password, const QString &new_password) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "ChangePassword"); request << old_password << new_password; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(changePasswordResp()), SLOT(changePasswordErr(const QDBusError&))); } void OfonoCallBarring::disableAll(const QString &password) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "DisableAll"); request << password; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(disableAllResp()), SLOT(disableAllErr(const QDBusError&))); } void OfonoCallBarring::disableAllIncoming(const QString &password) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "DisableAllIncoming"); request << password; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(disableAllIncomingResp()), SLOT(disableAllIncomingErr(const QDBusError&))); } void OfonoCallBarring::disableAllOutgoing(const QString &password) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "DisableAllOutgoing"); request << password; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(disableAllOutgoingResp()), SLOT(disableAllOutgoingErr(const QDBusError&))); } void OfonoCallBarring::requestVoiceIncoming() { m_if->requestProperty("VoiceIncoming"); } void OfonoCallBarring::setVoiceIncoming(const QString &barrings, const QString &password) { m_if->setProperty("VoiceIncoming", qVariantFromValue(barrings), password); } void OfonoCallBarring::requestVoiceOutgoing() { m_if->requestProperty("VoiceOutgoing"); } void OfonoCallBarring::setVoiceOutgoing(const QString &barrings, const QString &password) { m_if->setProperty("VoiceOutgoing", qVariantFromValue(barrings), password); } void OfonoCallBarring::propertyChanged(const QString& property, const QVariant& value) { if (property == "VoiceIncoming") { emit voiceIncomingChanged(value.value()); } else if (property == "VoiceOutgoing") { emit voiceOutgoingChanged(value.value()); } } void OfonoCallBarring::setPropertyFailed(const QString& property) { if (property == "VoiceIncoming") { emit setVoiceIncomingFailed(); } else if (property == "VoiceOutgoing") { emit setVoiceOutgoingFailed(); } } void OfonoCallBarring::requestPropertyComplete(bool success, const QString& property, const QVariant& value) { if (property == "VoiceIncoming") { emit voiceIncomingComplete(success, value.value()); } else if (property == "VoiceOutgoing") { emit voiceOutgoingComplete(success, value.value()); } } void OfonoCallBarring::changePasswordResp() { emit changePasswordComplete(TRUE); } void OfonoCallBarring::changePasswordErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit changePasswordComplete(FALSE); } void OfonoCallBarring::disableAllResp() { emit disableAllComplete(TRUE); } void OfonoCallBarring::disableAllErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit disableAllComplete(FALSE); } void OfonoCallBarring::disableAllIncomingResp() { emit disableAllIncomingComplete(TRUE); } void OfonoCallBarring::disableAllIncomingErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit disableAllIncomingComplete(FALSE); } void OfonoCallBarring::disableAllOutgoingResp() { emit disableAllOutgoingComplete(TRUE); } void OfonoCallBarring::disableAllOutgoingErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit disableAllOutgoingComplete(FALSE); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallbarring.h000066400000000000000000000061331174402453000221030ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOCALLBARRING_H #define OFONOCALLBARRING_H #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono call barring API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/call-barring-api.txt */ class OFONO_QT_EXPORT OfonoCallBarring : public OfonoModemInterface { Q_OBJECT public: OfonoCallBarring(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoCallBarring(); public slots: /* Properties */ void requestVoiceIncoming(); void setVoiceIncoming(const QString &barrings, const QString &password); void requestVoiceOutgoing(); void setVoiceOutgoing(const QString &barrings, const QString &password); /* Methods */ void changePassword(const QString &old_password, const QString &new_password); void disableAll(const QString &password); void disableAllIncoming(const QString &password); void disableAllOutgoing(const QString &password); signals: void voiceIncomingComplete(bool success, const QString &barrings); void voiceOutgoingComplete(bool success, const QString &barrings); void voiceIncomingChanged(const QString &barrings); void voiceOutgoingChanged(const QString &barrings); void setVoiceIncomingFailed(); void setVoiceOutgoingFailed(); void changePasswordComplete(bool success); void disableAllComplete(bool success); void disableAllIncomingComplete(bool success); void disableAllOutgoingComplete(bool success); private slots: void pathChanged(const QString& path); void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); void changePasswordResp(); void changePasswordErr(QDBusError error); void disableAllResp(); void disableAllErr(QDBusError error); void disableAllIncomingResp(); void disableAllIncomingErr(QDBusError error); void disableAllOutgoingResp(); void disableAllOutgoingErr(QDBusError error); void requestPropertyComplete(bool success, const QString& property, const QVariant& value); private: void connectDbusSignals(const QString& path); }; #endif /* !OFONOCALLBARRING_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallforwarding.cpp000066400000000000000000000132571174402453000231610ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonocallforwarding.h" #include "ofonointerface.h" OfonoCallForwarding::OfonoCallForwarding(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.CallForwarding", OfonoGetAllOnFirstRequest, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); connect(m_if, SIGNAL(requestPropertyComplete(bool, const QString&, const QVariant&)), this, SLOT(requestPropertyComplete(bool, const QString&, const QVariant&))); } OfonoCallForwarding::~OfonoCallForwarding() { } void OfonoCallForwarding::disableAll(const QString &type) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "DisableAll"); request << type; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(disableAllResp()), SLOT(disableAllErr(const QDBusError&))); } void OfonoCallForwarding::requestVoiceUnconditional() { m_if->requestProperty("VoiceUnconditional"); } void OfonoCallForwarding::setVoiceUnconditional(const QString &property) { m_if->setProperty("VoiceUnconditional", qVariantFromValue(property)); } void OfonoCallForwarding::requestVoiceBusy() { m_if->requestProperty("VoiceBusy"); } void OfonoCallForwarding::setVoiceBusy(const QString &property) { return m_if->setProperty("VoiceBusy", qVariantFromValue(property)); } void OfonoCallForwarding::requestVoiceNoReply() { m_if->requestProperty("VoiceNoReply"); } void OfonoCallForwarding::setVoiceNoReply(const QString &property) { return m_if->setProperty("VoiceNoReply", qVariantFromValue(property)); } void OfonoCallForwarding::requestVoiceNoReplyTimeout() { m_if->requestProperty("VoiceNoReplyTimeout"); } void OfonoCallForwarding::setVoiceNoReplyTimeout(ushort timeout) { return m_if->setProperty("VoiceNoReplyTimeout", qVariantFromValue(timeout)); } void OfonoCallForwarding::requestVoiceNotReachable() { m_if->requestProperty("VoiceNotReachable"); } void OfonoCallForwarding::setVoiceNotReachable(const QString &property) { return m_if->setProperty("VoiceNotReachable", qVariantFromValue(property)); } void OfonoCallForwarding::requestForwardingFlagOnSim() { m_if->requestProperty("ForwardingFlagOnSim"); } void OfonoCallForwarding::propertyChanged(const QString& property, const QVariant& value) { if (property == "VoiceUnconditional") { emit voiceUnconditionalChanged(value.value()); } else if (property == "VoiceBusy") { emit voiceBusyChanged(value.value()); } else if (property == "VoiceNoReply") { emit voiceNoReplyChanged(value.value()); } else if (property == "VoiceNoReplyTimeout") { emit voiceNoReplyTimeoutChanged(value.value()); } else if (property == "VoiceNotReachable") { emit voiceNotReachableChanged(value.value()); } else if (property == "ForwardingFlagOnSim") { emit forwardingFlagOnSimChanged(value.value()); } } void OfonoCallForwarding::setPropertyFailed(const QString& property) { if (property == "VoiceUnconditional") { emit setVoiceUnconditionalFailed(); } else if (property == "VoiceBusy") { emit setVoiceBusyFailed(); } else if (property == "VoiceNoReply") { emit setVoiceNoReplyFailed(); } else if (property == "VoiceNoReplyTimeout") { emit setVoiceNoReplyTimeoutFailed(); } else if (property == "VoiceNotReachable") { emit setVoiceNotReachableFailed(); } } void OfonoCallForwarding::requestPropertyComplete(bool success, const QString& property, const QVariant& value) { if (property == "VoiceUnconditional") { emit voiceUnconditionalComplete(success, value.value()); } else if (property == "VoiceBusy") { emit voiceBusyComplete(success, value.value()); } else if (property == "VoiceNoReply") { emit voiceNoReplyComplete(success, value.value()); } else if (property == "VoiceNoReplyTimeout") { emit voiceNoReplyTimeoutComplete(success, value.value()); } else if (property == "VoiceNotReachable") { emit voiceNotReachableComplete(success, value.value()); } else if (property == "ForwardingFlagOnSim") { emit forwardingFlagOnSimComplete(success, value.value()); } } void OfonoCallForwarding::disableAllResp() { emit disableAllComplete(TRUE); } void OfonoCallForwarding::disableAllErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit disableAllComplete(FALSE); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallforwarding.h000066400000000000000000000065551174402453000226310ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOCALLFORWARDING_H #define OFONOCALLFORWARDING_H #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono call forwarding API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/call-forwarding-api.txt */ class OFONO_QT_EXPORT OfonoCallForwarding : public OfonoModemInterface { Q_OBJECT public: OfonoCallForwarding(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoCallForwarding(); public slots: /* Properties */ void requestVoiceUnconditional(); /* "" | phonenumber */ void setVoiceUnconditional(const QString &property); void requestVoiceBusy(); void setVoiceBusy(const QString &property); void requestVoiceNoReply(); void setVoiceNoReply(const QString &property); void requestVoiceNoReplyTimeout(); void setVoiceNoReplyTimeout(ushort timeout); void requestVoiceNotReachable(); void setVoiceNotReachable(const QString &property); void requestForwardingFlagOnSim(); /* Methods */ void disableAll(const QString &type); /* "all" | "conditional" */ signals: void voiceUnconditionalComplete(bool success, const QString &property); void voiceBusyComplete(bool success, const QString &property); void voiceNoReplyComplete(bool success, const QString &property); void voiceNoReplyTimeoutComplete(bool success, ushort timeout); void voiceNotReachableComplete(bool success, const QString &property); void forwardingFlagOnSimComplete(bool success, bool property); void voiceUnconditionalChanged(const QString &property); void voiceBusyChanged(const QString &property); void voiceNoReplyChanged(const QString &property); void voiceNoReplyTimeoutChanged(ushort timeout); void voiceNotReachableChanged(const QString &property); void forwardingFlagOnSimChanged(bool property); void setVoiceUnconditionalFailed(); void setVoiceBusyFailed(); void setVoiceNoReplyFailed(); void setVoiceNoReplyTimeoutFailed(); void setVoiceNotReachableFailed(); void disableAllComplete(bool success); private slots: void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); void requestPropertyComplete(bool success, const QString& property, const QVariant& value); void disableAllResp(); void disableAllErr(QDBusError error); }; #endif /* !OFONOCALLFORWARDING_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallmeter.cpp000066400000000000000000000037711174402453000221330ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonocallmeter.h" #include "ofonointerface.h" OfonoCallMeter::OfonoCallMeter(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.CallMeter", OfonoGetAllOnFirstRequest, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(requestPropertyComplete(bool, const QString&, const QVariant&)), this, SLOT(requestPropertyComplete(bool, const QString&, const QVariant&))); } OfonoCallMeter::~OfonoCallMeter() { } void OfonoCallMeter::requestCallMeter() { m_if->requestProperty("CallMeter"); } void OfonoCallMeter::requestPropertyComplete(bool success, const QString& property, const QVariant& value) { if (property == "CallMeter") { emit callMeterComplete(success, value.value()); } } void OfonoCallMeter::propertyChanged(const QString& property, const QVariant& value) { if (property == "CallMeter") { emit callMeterChanged(value.value()); } } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallmeter.h000066400000000000000000000033741174402453000215770ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOCALLMETER_H #define OFONOCALLMETER_H #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono call meter API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/call-meter-api.txt */ class OFONO_QT_EXPORT OfonoCallMeter : public OfonoModemInterface { Q_OBJECT public: OfonoCallMeter(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoCallMeter(); public slots: /* Properties */ void requestCallMeter(); signals: void callMeterComplete(bool success, uint value); void callMeterChanged(uint value); private slots: void propertyChanged(const QString& property, const QVariant& value); void requestPropertyComplete(bool success, const QString& property, const QVariant& value); }; #endif /* !OFONOCALLMETER_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallsettings.cpp000066400000000000000000000124011174402453000226450ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonocallsettings.h" #include "ofonointerface.h" OfonoCallSettings::OfonoCallSettings(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.CallSettings", OfonoGetAllOnFirstRequest, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); connect(m_if, SIGNAL(requestPropertyComplete(bool, const QString&, const QVariant&)), this, SLOT(requestPropertyComplete(bool, const QString&, const QVariant&))); } OfonoCallSettings::~OfonoCallSettings() { } void OfonoCallSettings::requestCallingLinePresentation() { m_if->requestProperty("CallingLinePresentation"); } void OfonoCallSettings::requestCalledLinePresentation() { m_if->requestProperty("CalledLinePresentation"); } void OfonoCallSettings::requestCallingNamePresentation() { m_if->requestProperty("CallingNamePresentation"); } void OfonoCallSettings::requestConnectedLinePresentation() { m_if->requestProperty("ConnectedLinePresentation"); } void OfonoCallSettings::requestConnectedLineRestriction() { m_if->requestProperty("ConnectedLineRestriction"); } void OfonoCallSettings::requestCallingLineRestriction() { m_if->requestProperty("CallingLineRestriction"); } void OfonoCallSettings::requestHideCallerId() { m_if->requestProperty("HideCallerId"); } void OfonoCallSettings::requestVoiceCallWaiting() { m_if->requestProperty("VoiceCallWaiting"); } void OfonoCallSettings::setHideCallerId(const QString &preference) { return m_if->setProperty("HideCallerId", qVariantFromValue(preference)); } void OfonoCallSettings::setVoiceCallWaiting(const QString &preference) { return m_if->setProperty("VoiceCallWaiting", qVariantFromValue(preference)); } void OfonoCallSettings::requestPropertyComplete(bool success, const QString& property, const QVariant& value) { if (property == "CallingLinePresentation") { emit callingLinePresentationComplete(success, value.value()); } else if (property == "CalledLinePresentation") { emit calledLinePresentationComplete(success, value.value()); } else if (property == "CallingNamePresentation") { emit callingNamePresentationComplete(success, value.value()); } else if (property == "ConnectedLinePresentation") { emit connectedLinePresentationComplete(success, value.value()); } else if (property == "ConnectedLineRestriction") { emit connectedLineRestrictionComplete(success, value.value()); } else if (property == "CallingLineRestriction") { emit callingLineRestrictionComplete(success, value.value()); } else if (property == "HideCallerId") { emit hideCallerIdComplete(success, value.value()); } else if (property == "VoiceCallWaiting") { emit voiceCallWaitingComplete(success, value.value()); } } void OfonoCallSettings::propertyChanged(const QString& property, const QVariant& value) { if (property == "CallingLinePresentation") { emit callingLinePresentationChanged(value.value()); } else if (property == "CalledLinePresentation") { emit calledLinePresentationChanged(value.value()); } else if (property == "CallingNamePresentation") { emit callingNamePresentationChanged(value.value()); } else if (property == "ConnectedLinePresentation") { emit connectedLinePresentationChanged(value.value()); } else if (property == "ConnectedLineRestriction") { emit connectedLineRestrictionChanged(value.value()); } else if (property == "CallingLineRestriction") { emit callingLineRestrictionChanged(value.value()); } else if (property == "HideCallerId") { emit hideCallerIdChanged(value.value()); } else if (property == "VoiceCallWaiting") { emit voiceCallWaitingChanged(value.value()); } } void OfonoCallSettings::setPropertyFailed(const QString& property) { if (property == "HideCallerId") { emit setHideCallerIdFailed(); } else if (property == "VoiceCallWaiting") { emit setVoiceCallWaitingFailed(); } } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallsettings.h000066400000000000000000000064701174402453000223230ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOCALLSETTINGS_H #define OFONOCALLSETTINGS_H #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono call settings API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/call-settings-api.txt */ class OFONO_QT_EXPORT OfonoCallSettings : public OfonoModemInterface { Q_OBJECT public: OfonoCallSettings(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoCallSettings(); public slots: /* Properties */ void requestCallingLinePresentation(); void requestCalledLinePresentation(); void requestCallingNamePresentation(); void requestConnectedLinePresentation(); void requestConnectedLineRestriction(); void requestCallingLineRestriction(); void requestHideCallerId(); void setHideCallerId(const QString &setting); void requestVoiceCallWaiting(); void setVoiceCallWaiting(const QString &setting); signals: void callingLinePresentationComplete(bool success, const QString &setting); void calledLinePresentationComplete(bool success, const QString &setting); void callingNamePresentationComplete(bool success, const QString &setting); void connectedLinePresentationComplete(bool success, const QString &setting); void connectedLineRestrictionComplete(bool success, const QString &setting); void callingLineRestrictionComplete(bool success, const QString &setting); void hideCallerIdComplete(bool success, const QString &setting); void voiceCallWaitingComplete(bool success, const QString &setting); void callingLinePresentationChanged(const QString &setting); void calledLinePresentationChanged(const QString &setting); void callingNamePresentationChanged(const QString &setting); void connectedLinePresentationChanged(const QString &setting); void connectedLineRestrictionChanged(const QString &setting); void callingLineRestrictionChanged(const QString &setting); void hideCallerIdChanged(const QString &setting); void voiceCallWaitingChanged(const QString &setting); void setHideCallerIdFailed(); void setVoiceCallWaitingFailed(); private slots: void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); void requestPropertyComplete(bool success, const QString& property, const QVariant& value); }; #endif /* !OFONOCALLSETTINGS_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallvolume.cpp000066400000000000000000000055451174402453000223270ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonocallvolume.h" #include "ofonointerface.h" OfonoCallVolume::OfonoCallVolume(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.CallVolume", OfonoGetAllOnStartup, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); } OfonoCallVolume::~OfonoCallVolume() { } void OfonoCallVolume::propertyChanged(const QString &property, const QVariant &value) { if (property == "SpeakerVolume") { emit speakerVolumeChanged(value.value()); } else if (property == "MicrophoneVolume") { emit microphoneVolumeChanged(value.value()); } else if (property == "Muted") { emit mutedChanged(value.value()); } } quint8 OfonoCallVolume::speakerVolume() const { return m_if->properties()["SpeakerVolume"].value(); } quint8 OfonoCallVolume::microphoneVolume() const { return m_if->properties()["MicrophoneVolume"].value(); } bool OfonoCallVolume::muted() const { return m_if->properties()["Muted"].value(); } void OfonoCallVolume::setMuted(const bool value) { m_if->setProperty("Muted",QVariant(value)); } void OfonoCallVolume::setPropertyFailed(const QString &property) { if (property == "SpeakerVolume") { emit setSpeakerVolumeFailed(); } else if (property == "MicrophoneVolume") { emit setMicrophoneVolumeFailed(); } else if (property == "Muted") { emit setMutedFailed(); } } void OfonoCallVolume::setSpeakerVolume(const quint8 &spvolume) { m_if->setProperty("SpeakerVolume",qVariantFromValue(spvolume)); } void OfonoCallVolume::setMicrophoneVolume(const quint8 &mpvolume) { m_if->setProperty("MicrophoneVolume",qVariantFromValue(mpvolume)); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonocallvolume.h000066400000000000000000000045571174402453000217760ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOCALLVOLUME_H #define OFONOCALLVOLUME_H #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono call volume API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/call-volume-api.txt */ class OFONO_QT_EXPORT OfonoCallVolume : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(bool muted READ muted WRITE setMuted NOTIFY mutedChanged) Q_PROPERTY(quint8 speakerVolume READ speakerVolume WRITE setSpeakerVolume NOTIFY speakerVolumeChanged) Q_PROPERTY(quint8 microphoneVolume READ microphoneVolume WRITE setMicrophoneVolume NOTIFY microphoneVolumeChanged) public: OfonoCallVolume(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoCallVolume(); /* Properties */ bool muted() const; quint8 speakerVolume() const; quint8 microphoneVolume()const ; public slots: void setMuted(const bool mute); void setSpeakerVolume(const quint8 &spvolume); void setMicrophoneVolume(const quint8 &mpvolume); signals: void mutedChanged(const bool &muted); void speakerVolumeChanged(const quint8 &volume); void microphoneVolumeChanged(const quint8 &mvolume); void setMutedFailed(); void setSpeakerVolumeFailed(); void setMicrophoneVolumeFailed(); private slots: void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); }; #endif // OFONOCALLVOLUME_H ofono-qt-1.5+git20120419+bcf0c04/lib/ofonoconnman.cpp000066400000000000000000000207201174402453000216050ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonoconnman.h" #include "ofonointerface.h" #define DEACTIVATE_TIMEOUT 30000 #define ADD_TIMEOUT 30000 #define REMOVE_TIMEOUT 30000 QDBusArgument &operator<<(QDBusArgument &argument, const OfonoConnmanStruct &context) { argument.beginStructure(); argument << context.path << context.properties; argument.endStructure(); return argument; } const QDBusArgument &operator>>(const QDBusArgument &argument, OfonoConnmanStruct &context) { argument.beginStructure(); argument >> context.path >> context.properties; argument.endStructure(); return argument; } OfonoConnMan::OfonoConnMan(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.ConnectionManager", OfonoGetAllOnStartup, parent) { qDBusRegisterMetaType(); qDBusRegisterMetaType(); m_contextlist = getContextList(); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); connect(this, SIGNAL(validityChanged(bool)), this, SLOT(validityChanged(bool))); connect(modem(), SIGNAL(pathChanged(QString)), this, SLOT(pathChanged(const QString&))); connectDbusSignals(path()); } OfonoConnMan::~OfonoConnMan() { } void OfonoConnMan::validityChanged(bool /*validity*/) { m_contextlist = getContextList(); } void OfonoConnMan::pathChanged(const QString& path) { connectDbusSignals(path); } QStringList OfonoConnMan::getContextList() { QDBusReply reply; OfonoConnmanList contexts; QStringList contextList; QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "GetContexts"); reply = QDBusConnection::systemBus().call(request); contexts = reply; foreach(OfonoConnmanStruct context, contexts) { contextList << context.path.path(); } return contextList; } void OfonoConnMan::connectDbusSignals(const QString& path) { QDBusConnection::systemBus().disconnect("org.ofono",QString(),m_if->ifname(), "ContextAdded", this, SLOT(contextAddedChanged(const QDBusObjectPath&, const QVariantMap&))); QDBusConnection::systemBus().disconnect("org.ofono",QString(),m_if->ifname(), "ContextRemoved", this, SLOT(contextRemovedChanged(const QDBusObjectPath&))); QDBusConnection::systemBus().connect("org.ofono",path,m_if->ifname(), "ContextAdded", this, SLOT(contextAddedChanged(const QDBusObjectPath&, const QVariantMap&))); QDBusConnection::systemBus().connect("org.ofono",path,m_if->ifname(), "ContextRemoved", this, SLOT(contextRemovedChanged(const QDBusObjectPath&))); } void OfonoConnMan::deactivateAll() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "DeactivateAll"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(deactivateAllResp()), SLOT(deactivateAllErr(const QDBusError&)), DEACTIVATE_TIMEOUT); } void OfonoConnMan::deactivateAllResp() { emit deactivateAllComplete(TRUE); } void OfonoConnMan::deactivateAllErr(const QDBusError& error) { m_if->setError(error.name(), error.message()); emit deactivateAllComplete(FALSE); } void OfonoConnMan::addContext(const QString& type) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "AddContext"); QListarg; arg.append(QVariant(type)); request.setArguments(arg); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(addContextResp(const QDBusObjectPath &)), SLOT(addContextErr(const QDBusError&)), ADD_TIMEOUT); } void OfonoConnMan::addContextResp(const QDBusObjectPath &path) { emit addContextComplete(TRUE, path.path()); } void OfonoConnMan::addContextErr(const QDBusError& error) { m_if->setError(error.name(), error.message()); emit addContextComplete(FALSE, QString()); } void OfonoConnMan::removeContext(const QString& contextpath) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "RemoveContext"); QList argumentList; QDBusObjectPath context (contextpath); argumentList << qVariantFromValue(context); request.setArguments(argumentList); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(removeContextResp()), SLOT(removeContextErr(const QDBusError&)), REMOVE_TIMEOUT); } void OfonoConnMan::removeContextResp() { emit removeContextComplete(TRUE); } void OfonoConnMan::removeContextErr(const QDBusError& error) { m_if->setError(error.name(), error.message()); emit removeContextComplete(FALSE); } bool OfonoConnMan::attached() const { return m_if->properties()["Attached"].value(); } QString OfonoConnMan::bearer() const { return m_if->properties()["Bearer"].value(); } bool OfonoConnMan::suspended() const { return m_if->properties()["Suspended"].value(); } bool OfonoConnMan::roamingAllowed() const { return m_if->properties()["RoamingAllowed"].value(); } bool OfonoConnMan::powered() const { return m_if->properties()["Powered"].value(); } void OfonoConnMan::propertyChanged(const QString& property, const QVariant& value) { if (property == "Attached") { emit attachedChanged(value.value()); } else if (property == "Bearer") { emit bearerChanged(value.value()); } else if (property == "Suspended") { emit suspendedChanged(value.value()); } else if (property == "RoamingAllowed") { emit roamingAllowedChanged(value.value()); } else if (property == "Powered") { emit poweredChanged(value.value()); } } QStringList OfonoConnMan::getContexts() { return m_contextlist; } void OfonoConnMan::contextAddedChanged(const QDBusObjectPath &path, const QVariantMap& /*values*/) { m_contextlist << path.path(); emit contextAdded(path.path()); } void OfonoConnMan::contextRemovedChanged(const QDBusObjectPath &path) { m_contextlist.removeAll(path.path()); emit contextRemoved(path.path()); } void OfonoConnMan::setPowered(const bool value) { m_if->setProperty("Powered",QVariant(value)); } void OfonoConnMan::setRoamingAllowed(const bool value) { m_if->setProperty("RoamingAllowed",QVariant(value)); } void OfonoConnMan::setPropertyFailed(const QString &property) { if (property == "Powered") { emit setPoweredFailed(); } else if (property == "RoamingAllowed") { emit setRoamingAllowedFailed(); } } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonoconnman.h000066400000000000000000000073561174402453000212640ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOCONNMAN_H #define OFONOCONNMAN_H #include #include #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" struct OfonoConnmanStruct { QDBusObjectPath path; QVariantMap properties; }; typedef QList OfonoConnmanList; Q_DECLARE_METATYPE(OfonoConnmanStruct) Q_DECLARE_METATYPE(OfonoConnmanList) //! This class is used to access oFono connman API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/connman-api.txt */ class OFONO_QT_EXPORT OfonoConnMan : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(bool attached READ attached NOTIFY attachedChanged) Q_PROPERTY(QString bearer READ bearer NOTIFY bearerChanged) Q_PROPERTY(bool suspended READ suspended NOTIFY suspendedChanged) Q_PROPERTY(bool roamingAllowed READ roamingAllowed WRITE setRoamingAllowed NOTIFY roamingAllowedChanged) Q_PROPERTY(bool powered READ powered WRITE setPowered NOTIFY poweredChanged) public: OfonoConnMan(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoConnMan(); Q_INVOKABLE QStringList getContexts(); /* Properties */ bool attached() const; QString bearer() const; bool suspended() const; bool roamingAllowed() const; bool powered() const; public slots: void setPowered(const bool); void setRoamingAllowed(const bool); void deactivateAll(); void addContext(const QString& type); void removeContext(const QString& path); signals: void attachedChanged(const bool value); void bearerChanged(const QString &bearer); void suspendedChanged(const bool suspnd); void roamingAllowedChanged(const bool roaming); void poweredChanged(const bool powrd); void contextAdded(const QString& path); void contextRemoved(const QString& path); void deactivateAllComplete(bool success); void addContextComplete(bool success, const QString& path); void removeContextComplete(bool success); void setPoweredFailed(); void setRoamingAllowedFailed(); private slots: void validityChanged(bool); void pathChanged(const QString& path); void propertyChanged(const QString& property, const QVariant& value); void contextAddedChanged(const QDBusObjectPath &path, const QVariantMap &properties); void contextRemovedChanged(const QDBusObjectPath &path); void deactivateAllResp(); void deactivateAllErr(const QDBusError& error); void addContextResp(const QDBusObjectPath &path); void addContextErr(const QDBusError& error); void removeContextResp(); void removeContextErr(const QDBusError& error); void setPropertyFailed(const QString& property); private: QStringList getContextList(); void connectDbusSignals(const QString& path); private: QStringList m_contextlist; }; #endif /* !OFONOCONNMAN_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonoconnmancontext.cpp000066400000000000000000000152321174402453000232140ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include "ofonointerface.h" #include "ofonoconnman.h" #include "ofonoconnmancontext.h" OfonoConnmanContext::OfonoConnmanContext(const QString& contextId, QObject *parent) : QObject(parent) { m_if = new OfonoInterface(contextId, "org.ofono.ConnectionContext", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); } OfonoConnmanContext::OfonoConnmanContext(const OfonoConnmanContext& context) : QObject(context.parent()) { m_if = new OfonoInterface(context.path(), "org.ofono.ConnectionContext", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); } bool OfonoConnmanContext::operator==(const OfonoConnmanContext &context) { return path() == context.path(); } OfonoConnmanContext::~OfonoConnmanContext() { } bool OfonoConnmanContext::active() const { return m_if->properties()["Active"].value(); } QString OfonoConnmanContext::accessPointName() const { return m_if->properties()["AccessPointName"].value(); } QString OfonoConnmanContext::name() const { return m_if->properties()["Name"].value(); } QString OfonoConnmanContext::type() const { return m_if->properties()["Type"].value(); } QString OfonoConnmanContext::username() const { return m_if->properties()["Username"].value(); } QString OfonoConnmanContext::password() const { return m_if->properties()["Password"].value(); } QString OfonoConnmanContext::protocol() const { return m_if->properties()["Protocol"].value(); } QString OfonoConnmanContext::messageProxy() const { return m_if->properties()["MessageProxy"].value(); } QString OfonoConnmanContext::messageCenter() const { return m_if->properties()["MessageCenter"].value(); } void OfonoConnmanContext::propertyChanged(const QString &property, const QVariant &value) { if (property == "Active") { emit activeChanged(value.value()); } else if (property == "Name") { emit nameChanged(value.value()); } else if (property == "AccessPointName") { emit accessPointNameChanged(value.value()); } else if (property == "Type") { emit typeChanged(value.value()); } else if (property == "Username") { emit usernameChanged(value.value()); } else if (property == "Password") { emit passwordChanged(value.value()); } else if (property == "Protocol") { emit protocolChanged(value.value()); } else if (property == "MessageProxy") { emit messageProxyChanged(value.value()); } else if (property == "MessageCenter") { emit messageCenterChanged(value.value()); } else if (property == "Settings") { QVariantMap map; value.value()>>map; emit settingsChanged(map); } else if (property == "IPv6.Settings") { QVariantMap map; value.value()>>map; emit IPv6SettingsChanged(map); } } QVariantMap OfonoConnmanContext::settings() const { QVariantMap map; m_if->properties()["Settings"].value()>>map; return map; } QVariantMap OfonoConnmanContext::IPv6Settings() const { QVariantMap map; m_if->properties()["IPv6.Settings"].value()>>map; return map; } QString OfonoConnmanContext::path() const { return m_if->path(); } QString OfonoConnmanContext::errorName() const { return m_if->errorName(); } QString OfonoConnmanContext::errorMessage() const { return m_if->errorMessage(); } /* Set Property*/ void OfonoConnmanContext::setActive(const bool value) { m_if->setProperty("Active",QVariant(value)); } void OfonoConnmanContext::setAccessPointName(const QString& value) { m_if->setProperty("AccessPointName",QVariant(value)); } void OfonoConnmanContext::setType(const QString& value) { m_if->setProperty("Type",QVariant(value)); } void OfonoConnmanContext::setUsername(const QString& value) { m_if->setProperty("Username",QVariant(value)); } void OfonoConnmanContext::setPassword(const QString& value) { m_if->setProperty("Password",QVariant(value)); } void OfonoConnmanContext::setProtocol(const QString& value) { m_if->setProperty("Protocol",QVariant(value)); } void OfonoConnmanContext::setName(const QString& value) { m_if->setProperty("Name",QVariant(value)); } void OfonoConnmanContext::setMessageProxy(const QString& value) { m_if->setProperty("MessageProxy",QVariant(value)); } void OfonoConnmanContext::setMessageCenter(const QString& value) { m_if->setProperty("MessageCenter",QVariant(value)); } void OfonoConnmanContext::setPropertyFailed(const QString &property) { if (property == "Active") { emit setActiveFailed(); } else if (property == "AccessPointName") { emit setAccessPointNameFailed(); } else if (property == "Type") { emit setTypeFailed(); } else if (property == "Username") { emit setUsernameFailed(); } else if (property == "Password") { emit setPasswordFailed(); } else if (property == "Protocol") { emit setProtocolFailed(); } else if (property == "Name") { emit setNameFailed(); } else if (property == "MessageProxy") { emit setMessageProxyFailed(); } else if (property == "MessageCenter") { emit setMessageCenterFailed(); } } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonoconnmancontext.h000066400000000000000000000117131174402453000226610ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOCONNMANCONTEXT_H #define OFONOCONNMANCONTEXT_H #include #include #include #include #include "libofono-qt_global.h" class OfonoInterface; //! This class is used to access oFono connman context API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=doc/connman-api.txt */ class OFONO_QT_EXPORT OfonoConnmanContext : public QObject { Q_OBJECT Q_PROPERTY(QString path READ path) Q_PROPERTY(QString errorName READ errorName) Q_PROPERTY(QString errorMessage READ errorMessage) Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged) Q_PROPERTY(QString accessPointName READ accessPointName WRITE setAccessPointName NOTIFY accessPointNameChanged) Q_PROPERTY(QString type READ type WRITE setType NOTIFY nameChanged) Q_PROPERTY(QString username READ username WRITE setUsername NOTIFY usernameChanged) Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) Q_PROPERTY(QString protocol READ protocol WRITE setProtocol NOTIFY protocolChanged) Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(QString messageProxy READ messageProxy WRITE setMessageProxy NOTIFY messageProxyChanged) Q_PROPERTY(QString messageCenter READ messageCenter WRITE setMessageCenter NOTIFY messageCenterChanged) Q_PROPERTY(QVariantMap settings READ settings NOTIFY settingsChanged) Q_PROPERTY(QVariantMap IPv6Settings READ IPv6Settings NOTIFY IPv6SettingsChanged) public: OfonoConnmanContext(const QString &contextPath, QObject *parent=0); OfonoConnmanContext(const OfonoConnmanContext &op); ~OfonoConnmanContext(); OfonoConnmanContext operator=(const OfonoConnmanContext &op); bool operator==(const OfonoConnmanContext &op); //! Returns the D-Bus object path of the voice call object QString path() const; //! Get the D-Bus error name of the last operation. /*! * Returns the D-Bus error name of the last operation (setting a property * or calling a method) if it has failed */ QString errorName() const; //! Get the D-Bus error message of the last operation. /*! * Returns the D-Bus error message of the last operation (setting a property * or calling a method) if it has failed */ QString errorMessage() const; /* Properties for context*/ bool active() const; QString accessPointName() const; QString type() const; QString username() const; QString password() const; QString protocol() const; QString name() const; QString messageProxy() const; QString messageCenter() const; QVariantMap settings() const; QVariantMap IPv6Settings() const; public slots: void setActive(const bool); void setAccessPointName(const QString&); void setType(const QString&); void setUsername(const QString&); void setPassword(const QString&); void setProtocol(const QString&); void setName(const QString&); void setMessageProxy(const QString&); void setMessageCenter(const QString&); signals: void activeChanged(const bool); void accessPointNameChanged(const QString &apn); void nameChanged(const QString &name); void typeChanged(const QString &type); void usernameChanged(const QString &uname); void passwordChanged(const QString &pw); void protocolChanged(const QString &proto); void messageProxyChanged(const QString &proxy); void messageCenterChanged(const QString &msc); void setActiveFailed(); void setAccessPointNameFailed(); void setTypeFailed(); void setUsernameFailed(); void setPasswordFailed(); void setProtocolFailed(); void setNameFailed(); void setMessageProxyFailed(); void setMessageCenterFailed(); /* Settings change notification*/ void settingsChanged(const QVariantMap&); void IPv6SettingsChanged(const QVariantMap&); private slots: void propertyChanged(const QString &property, const QVariant &value); void setPropertyFailed(const QString& property); private: OfonoInterface *m_if; }; #endif //OFONOCONNMANCONTEXT_H ofono-qt-1.5+git20120419+bcf0c04/lib/ofonointerface.cpp000066400000000000000000000146371174402453000221260ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonointerface.h" #define GET_PROPERTIES_TIMEOUT 300000 #define SET_PROPERTY_TIMEOUT 300000 OfonoInterface::OfonoInterface(const QString& path, const QString& ifname, OfonoGetPropertySetting setting, QObject *parent) : QObject(parent) , m_path(path), m_ifname(ifname), m_getpropsetting(setting) { QDBusConnection::systemBus().connect("org.ofono", path, ifname, "PropertyChanged", this, SLOT(onPropertyChanged(QString, QDBusVariant))); if (setting == OfonoGetAllOnStartup && path != "/") m_properties = getAllPropertiesSync(); } OfonoInterface::~OfonoInterface() { } void OfonoInterface::setPath(const QString& path) { QDBusConnection::systemBus().disconnect("org.ofono", m_path, m_ifname, "PropertyChanged", this, SLOT(onPropertyChanged(QString, QDBusVariant))); m_path = path; QDBusConnection::systemBus().connect("org.ofono", m_path, m_ifname, "PropertyChanged", this, SLOT(onPropertyChanged(QString, QDBusVariant))); if (m_getpropsetting == OfonoGetAllOnStartup) m_properties = getAllPropertiesSync(); else resetProperties(); } QVariantMap OfonoInterface::properties() const { return m_properties; } void OfonoInterface::resetProperties() { m_properties = QVariantMap(); } QVariantMap OfonoInterface::getAllPropertiesSync() { QDBusReply reply; QVariantMap map; QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", m_path, m_ifname, "GetProperties"); reply = QDBusConnection::systemBus().call(request); map = reply; foreach (QString property, map.keys()) { emit propertyChanged(property, map[property]); } return map; } void OfonoInterface::requestProperty(const QString& name) { if (m_pendingProperty.length() > 0) { // FIXME: should indicate that a get/setProperty is already in progress setError(QString(), QString("Already in progress")); emit requestPropertyComplete(false, name, QVariant()); return; } if (m_properties.keys().contains(name)) { emit requestPropertyComplete(true, name, m_properties[name]); return; } QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", m_path, m_ifname, "GetProperties"); bool result = QDBusConnection::systemBus().callWithCallback(request, this, SLOT(getPropertiesAsyncResp(QVariantMap)), SLOT(getPropertiesAsyncErr(const QDBusError&)), GET_PROPERTIES_TIMEOUT); if (!result) { // FIXME: should indicate that sending a message failed setError(QString(), QString("Sending a message failed")); emit requestPropertyComplete(false, name, QVariant()); return; } m_pendingProperty = name; } void OfonoInterface::getPropertiesAsyncResp(QVariantMap properties) { QString prop = m_pendingProperty; m_properties = properties; m_pendingProperty = QString(); if (m_properties.keys().contains(prop)) { emit requestPropertyComplete(true, prop, m_properties[prop]); } else { // FIXME: should indicate that property is not available setError(QString(), QString("Property not available")); emit requestPropertyComplete(false, prop, QVariant()); } foreach (QString property, properties.keys()) { emit propertyChanged(property, properties[property]); } } void OfonoInterface::getPropertiesAsyncErr(const QDBusError& error) { QString prop = m_pendingProperty; setError(error.name(), error.message()); m_pendingProperty = QString(); emit requestPropertyComplete(false, prop, QVariant()); } void OfonoInterface::onPropertyChanged(QString property, QDBusVariant value) { m_properties[property] = value.variant(); emit propertyChanged(property, value.variant()); } void OfonoInterface::setProperty(const QString& name, const QVariant& property, const QString& password) { if (m_pendingProperty.length() > 0) { // FIXME: should indicate that a get/setProperty is already in progress setError(QString(), QString("Already in progress")); emit setPropertyFailed(name); return; } QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", m_path, m_ifname, "SetProperty"); QVariantList arguments; arguments << QVariant(name) << QVariant::fromValue(QDBusVariant(property)); if (!password.isNull()) arguments << QVariant(password); request.setArguments(arguments); bool result = QDBusConnection::systemBus().callWithCallback(request, this, SLOT(setPropertyResp()), SLOT(setPropertyErr(const QDBusError&)), SET_PROPERTY_TIMEOUT); if (!result) { // FIXME: should indicate that sending a message failed setError(QString(), QString("Sending a message failed")); emit setPropertyFailed(name); return; } m_pendingProperty = name; } void OfonoInterface::setPropertyResp() { m_pendingProperty = QString(); // emit nothing; we will get a PropertyChanged signal } void OfonoInterface::setPropertyErr(const QDBusError& error) { QString prop = m_pendingProperty; setError(error.name(), error.message()); m_pendingProperty = QString(); emit setPropertyFailed(prop); } void OfonoInterface::setError(const QString& errorName, const QString& errorMessage) { m_errorName = errorName; m_errorMessage = errorMessage; } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonointerface.h000066400000000000000000000115171174402453000215650ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOINTERFACE_H #define OFONOINTERFACE_H #include #include #include #include #include "ofonopropertysetting.h" #include "libofono-qt_global.h" //! Basic oFono interface class /*! * This class implements basic access to properties of oFono interfaces. * It should not be instantiated directly; instead you should instantiate * interface-specific classes. */ class OFONO_QT_EXPORT OfonoInterface : public QObject { Q_OBJECT public: /*! * \param path D-Bus path to the interface * \param ifname D-Bus name of the interface * \param setting specifies how the object should handle oFono properties of the interface */ OfonoInterface(const QString &path, const QString &ifname, OfonoGetPropertySetting setting, QObject *parent=0); ~OfonoInterface(); //! Get all properties /*! * Returns the full set of current properties. If the object was constructed with * OfonoInterface::GetAllOnFirstRequest, and no properties have been explicitly queried yet * via requestProperty(), then returns nothing. */ QVariantMap properties() const; //! Request a property asynchronously. /*! * Result is returned via requestPropertyComplete() signal. */ void requestProperty(const QString &name); //! Set a property asynchronously. /*! * Result is returned via propertyChanged() signal * if setting is successful or via setPropertyFailed() signal if setting has failed. */ void setProperty(const QString &name, const QVariant &property, const QString& password=0); //! Resets the property cache. void resetProperties(); //! Get the interface D-Bus path QString path() const {return m_path;} //! Get the interface D-Bus name QString ifname() const {return m_ifname;} //! Get the D-Bus error name of the last operation. /*! * Returns the D-Bus error name of the last operation (setting a property * or calling a method) if it has failed */ QString errorName() const {return m_errorName;} //! Get the D-Bus error message of the last operation. /*! * Returns the D-Bus error message of the last operation (setting a property * or calling a method) if it has failed */ QString errorMessage() const {return m_errorMessage;} public slots: //! Changes the interface path /*! * This method changes the D-Bus path to the interface. * Properties are updated immediately if property setting is set to * GetAllOnStartup or reset otherwise. */ void setPath(const QString &path); //! Sets the last error explicitly void setError(const QString &errorName, const QString &errorMessage); signals: //! Issued when a property has changed /*! * \param name name of the property * \param property value of the property */ void propertyChanged(const QString &name, const QVariant &property); //! Issued when requesting a property has completed /*! * \param success true if requesting a property was successful, false if there was an error * \param name name of the property * \param property value of the property */ void requestPropertyComplete(bool success, const QString &name, const QVariant &property); //! Issued when setting a property has failed /*! * \param name name of the property */ void setPropertyFailed(const QString &name); private slots: void onPropertyChanged(QString property, QDBusVariant value); void getPropertiesAsyncResp(QVariantMap properties); void getPropertiesAsyncErr(const QDBusError&); void setPropertyResp(); void setPropertyErr(const QDBusError& error); protected slots: private: QVariantMap getAllPropertiesSync(); protected: QString m_errorName; QString m_errorMessage; private: QString m_path; QString m_ifname; QVariantMap m_properties; QString m_pendingProperty; OfonoGetPropertySetting m_getpropsetting; }; #endif ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomessage.cpp000066400000000000000000000043341174402453000216030ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonointerface.h" #include "ofonomessage.h" OfonoMessage::OfonoMessage(const QString& messageId, QObject *parent) : QObject(parent) { m_if = new OfonoInterface(messageId, "org.ofono.Message", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); } OfonoMessage::OfonoMessage(const OfonoMessage& message) : QObject(message.parent()) { m_if = new OfonoInterface(message.path(), "org.ofono.Message", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); } bool OfonoMessage::operator==(const OfonoMessage &message) { return path() == message.path(); } OfonoMessage::~OfonoMessage() { } QString OfonoMessage::state() const { return m_if->properties()["State"].value(); } void OfonoMessage::propertyChanged(const QString &property, const QVariant &value) { if (property == "State") { emit stateChanged(value.value()); } } QString OfonoMessage::path() const { return m_if->path(); } QString OfonoMessage::errorName() const { return m_if->errorName(); } QString OfonoMessage::errorMessage() const { return m_if->errorMessage(); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomessage.h000066400000000000000000000047611174402453000212540ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOMESSAGE_H #define OFONOMESSAGE_H #include #include #include #include #include "libofono-qt_global.h" class OfonoInterface; //! This class is used to access oFono message API /*! * oFono message API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/message-api.txt */ class OFONO_QT_EXPORT OfonoMessage : public QObject { Q_OBJECT Q_PROPERTY(QString path READ path) Q_PROPERTY(QString errorName READ errorName) Q_PROPERTY(QString errorMessage READ errorMessage) Q_PROPERTY(QString state READ state NOTIFY stateChanged) public: OfonoMessage(const QString &messageId, QObject *parent=0); OfonoMessage(const OfonoMessage &message); ~OfonoMessage(); OfonoMessage operator=(const OfonoMessage &message); bool operator==(const OfonoMessage &message); //! Returns the D-Bus object path of the message object QString path() const; //! Get the D-Bus error name of the last operation. /*! * Returns the D-Bus error name of the last operation (setting a property * or calling a method) if it has failed */ QString errorName() const; //! Get the D-Bus error message of the last operation. /*! * Returns the D-Bus error message of the last operation (setting a property * or calling a method) if it has failed */ QString errorMessage() const; QString state() const; signals: void stateChanged(const QString &state); private slots: void propertyChanged(const QString &property, const QVariant &value); private: OfonoInterface *m_if; }; #endif // OFONOMESSAGE_H ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomessagemanager.cpp000066400000000000000000000222611174402453000231350ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonomessagemanager.h" #include "ofonointerface.h" QDBusArgument &operator<<(QDBusArgument &argument, const OfonoMessageManagerStruct &message) { argument.beginStructure(); argument << message.path << message.properties; argument.endStructure(); return argument; } const QDBusArgument &operator>>(const QDBusArgument &argument, OfonoMessageManagerStruct &message) { argument.beginStructure(); argument >> message.path >> message.properties; argument.endStructure(); return argument; } OfonoMessageManager::OfonoMessageManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.MessageManager", OfonoGetAllOnFirstRequest, parent) { qDBusRegisterMetaType(); qDBusRegisterMetaType(); m_messagelist = getMessageList(); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); connect(m_if, SIGNAL(requestPropertyComplete(bool, const QString&, const QVariant&)), this, SLOT(requestPropertyComplete(bool, const QString&, const QVariant&))); connect(this, SIGNAL(validityChanged(bool)), this, SLOT(validityChanged(bool))); connect(modem(), SIGNAL(pathChanged(QString)), this, SLOT(pathChanged(const QString&))); connectDbusSignals(path()); } OfonoMessageManager::~OfonoMessageManager() { } void OfonoMessageManager::validityChanged(bool /*validity*/) { m_messagelist = getMessageList(); } void OfonoMessageManager::pathChanged(const QString& path) { connectDbusSignals(path); } QStringList OfonoMessageManager::getMessageList() { QDBusReply reply; OfonoMessageManagerList messages; QDBusMessage request; QStringList messageList; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "GetMessages"); reply = QDBusConnection::systemBus().call(request); messages = reply; foreach(OfonoMessageManagerStruct message, messages) { messageList << message.path.path(); } return messageList; } void OfonoMessageManager::connectDbusSignals(const QString& path) { QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "MessageAdded", this, SLOT(onMessageAdded(const QDBusObjectPath&, const QVariantMap&))); QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "MessageRemoved", this, SLOT(onMessageRemoved(const QDBusObjectPath&))); QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "IncomingMessage", this, SIGNAL(incomingMessage(QString, QVariantMap))); QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "ImmediateMessage", this, SIGNAL(immediateMessage(QString, QVariantMap))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "MessageAdded", this, SLOT(onMessageAdded(const QDBusObjectPath&, const QVariantMap&))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "MessageRemoved", this, SLOT(onMessageRemoved(const QDBusObjectPath&))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "IncomingMessage", this, SIGNAL(incomingMessage(QString, QVariantMap))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "ImmediateMessage", this, SIGNAL(immediateMessage(QString, QVariantMap))); } void OfonoMessageManager::requestServiceCenterAddress() { m_if->requestProperty("ServiceCenterAddress"); } void OfonoMessageManager::setServiceCenterAddress(QString address) { m_if->setProperty("ServiceCenterAddress", qVariantFromValue(address)); } void OfonoMessageManager::requestUseDeliveryReports() { m_if->requestProperty("UseDeliveryReports"); } void OfonoMessageManager::setUseDeliveryReports(bool useDeliveryReports) { m_if->setProperty("UseDeliveryReports", qVariantFromValue(useDeliveryReports)); } void OfonoMessageManager::requestBearer() { m_if->requestProperty("Bearer"); } void OfonoMessageManager::setBearer(QString bearer) { m_if->setProperty("Bearer", qVariantFromValue(bearer)); } void OfonoMessageManager::requestAlphabet() { m_if->requestProperty("Alphabet"); } void OfonoMessageManager::setAlphabet(QString alphabet) { m_if->setProperty("Alphabet", qVariantFromValue(alphabet)); } void OfonoMessageManager::sendMessage(const QString &to, const QString &message) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "SendMessage"); request << to << message; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(sendMessageResp(const QDBusObjectPath&)), SLOT(sendMessageErr(const QDBusError&))); } void OfonoMessageManager::requestPropertyComplete(bool success, const QString& property, const QVariant& value) { if (property == "ServiceCenterAddress") { emit serviceCenterAddressComplete(success, value.value()); } else if (property == "UseDeliveryReports") { emit useDeliveryReportsComplete(success, value.value()); } else if (property == "Bearer") { emit bearerComplete(success, value.value()); } else if (property == "Alphabet") { emit alphabetComplete(success, value.value()); } } void OfonoMessageManager::propertyChanged(const QString& property, const QVariant& value) { if (property == "ServiceCenterAddress") { emit serviceCenterAddressChanged(value.value()); } else if (property == "UseDeliveryReports") { emit useDeliveryReportsChanged(value.value()); } else if (property == "Bearer") { emit bearerChanged(value.value()); } else if (property == "Alphabet") { emit alphabetChanged(value.value()); } } void OfonoMessageManager::setPropertyFailed(const QString& property) { if (property == "ServiceCenterAddress") { emit setServiceCenterAddressFailed(); } else if (property == "UseDeliveryReports") { emit setUseDeliveryReportsFailed(); } else if (property == "Bearer") { emit setBearerFailed(); } else if (property == "Alphabet") { emit setAlphabetFailed(); } } void OfonoMessageManager::sendMessageResp(const QDBusObjectPath& objectPath) { emit sendMessageComplete(true, objectPath.path()); } void OfonoMessageManager::sendMessageErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit sendMessageComplete(false, QString()); } QStringList OfonoMessageManager::getMessages() const { return m_messagelist; } void OfonoMessageManager::onMessageAdded(const QDBusObjectPath &path, const QVariantMap& /*properties*/) { m_messagelist << path.path(); emit messageAdded(path.path()); } void OfonoMessageManager::onMessageRemoved(const QDBusObjectPath &path) { m_messagelist.removeAll(path.path()); emit messageRemoved(path.path()); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomessagemanager.h000066400000000000000000000075431174402453000226100ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOMESSAGEMANAGER_H #define OFONOMESSAGEMANAGER_H #include #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" struct OfonoMessageManagerStruct { QDBusObjectPath path; QVariantMap properties; }; typedef QList OfonoMessageManagerList; Q_DECLARE_METATYPE(OfonoMessageManagerStruct) Q_DECLARE_METATYPE(OfonoMessageManagerList) //! This class is used to access oFono message manager API /*! * oFono message manager API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/messagemanager-api.txt */ class OFONO_QT_EXPORT OfonoMessageManager : public OfonoModemInterface { Q_OBJECT public: OfonoMessageManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoMessageManager(); Q_INVOKABLE QStringList getMessages() const; public slots: /* Properties */ void requestServiceCenterAddress(); void setServiceCenterAddress(QString address); void requestUseDeliveryReports(); void setUseDeliveryReports(bool useDeliveryReports); void requestBearer(); void setBearer(QString bearer); void requestAlphabet(); void setAlphabet(QString alphabet); void sendMessage(const QString &to, const QString &message); signals: void serviceCenterAddressChanged(const QString &address); void useDeliveryReportsChanged(const bool &useDeliveryReports); void bearerChanged(const QString &bearer); void alphabetChanged(const QString &alphabet); void serviceCenterAddressComplete(bool success, const QString &address); void useDeliveryReportsComplete(bool success, const bool &useDeliveryReports); void bearerComplete(bool success, const QString &bearer); void alphabetComplete(bool success, const QString &alphabet); void sendMessageComplete(bool success, const QString& path); void setServiceCenterAddressFailed(); void setUseDeliveryReportsFailed(); void setBearerFailed(); void setAlphabetFailed(); void messageAdded(const QString &message); void messageRemoved(const QString &message); void immediateMessage(const QString &message, const QVariantMap &info); void incomingMessage(const QString &message, const QVariantMap &info); private slots: void validityChanged(bool); void pathChanged(const QString& path); void propertyChanged(const QString &property, const QVariant &value); void setPropertyFailed(const QString &property); void requestPropertyComplete(bool success, const QString &property, const QVariant &value); void onMessageAdded(const QDBusObjectPath &message, const QVariantMap &properties); void onMessageRemoved(const QDBusObjectPath &message); void sendMessageResp(const QDBusObjectPath& objectPath); void sendMessageErr(QDBusError error); private: QStringList getMessageList(); void connectDbusSignals(const QString& path); private: QStringList m_messagelist; }; #endif /* !OFONOMESSAGEMANAGER_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomessagewaiting.cpp000066400000000000000000000051641174402453000231700ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonomessagewaiting.h" #include "ofonointerface.h" OfonoMessageWaiting::OfonoMessageWaiting(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.MessageWaiting", OfonoGetAllOnStartup, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); } OfonoMessageWaiting::~OfonoMessageWaiting() { } bool OfonoMessageWaiting::voicemailWaiting() const { return m_if->properties()["VoicemailWaiting"].value(); } int OfonoMessageWaiting::voicemailMessageCount() const { return m_if->properties()["VoicemailMessageCount"].value(); } QString OfonoMessageWaiting::voicemailMailboxNumber() const { return m_if->properties()["VoicemailMailboxNumber"].value(); } void OfonoMessageWaiting::setVoicemailMailboxNumber(QString mailboxnumber) { m_if->setProperty("VoicemailMailboxNumber", qVariantFromValue(mailboxnumber)); } void OfonoMessageWaiting::setPropertyFailed(const QString& property) { if (property == "VoicemailMailboxNumber") emit setVoicemailMailboxNumberFailed(); } void OfonoMessageWaiting::propertyChanged(const QString& property, const QVariant& value) { if (property == "VoicemailWaiting") emit voicemailWaitingChanged(value.value()); else if (property == "VoicemailMessageCount") emit voicemailMessageCountChanged(value.value()); else if (property == "VoicemailMailboxNumber") emit voicemailMailboxNumberChanged(value.value()); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomessagewaiting.h000066400000000000000000000045371174402453000226400ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOMESSAGEWAITING_H #define OFONOMESSAGEWAITING_H #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono message waiting API /*! * oFono message manager API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/message-waiting-api.txt */ class OFONO_QT_EXPORT OfonoMessageWaiting : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(bool voicemailWaiting READ voicemailWaiting NOTIFY voicemailWaitingChanged) Q_PROPERTY(int voicemailMessageCount READ voicemailMessageCount NOTIFY voicemailMessageCountChanged) Q_PROPERTY(QString voicemailMailboxNumber READ voicemailMailboxNumber WRITE setVoicemailMailboxNumber NOTIFY voicemailMailboxNumberChanged) public: OfonoMessageWaiting(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoMessageWaiting(); bool voicemailWaiting() const; int voicemailMessageCount() const; QString voicemailMailboxNumber() const; public slots: void setVoicemailMailboxNumber(QString mailboxnumber); signals: void voicemailWaitingChanged(bool waiting); void voicemailMessageCountChanged(int count); void voicemailMailboxNumberChanged(const QString &mailboxnumber); void setVoicemailMailboxNumberFailed(); private slots: void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); }; #endif /* !OFONOMESSAGEWAITING_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomodem.cpp000066400000000000000000000142741174402453000212640ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonomodem.h" #include "ofonointerface.h" #include "ofonomodemmanager.h" OfonoModem::OfonoModem(SelectionSetting setting, const QString &modemPath, QObject *parent) : QObject(parent), m_selectionSetting(setting) { m_mm = new OfonoModemManager(this); connect(m_mm, SIGNAL(modemAdded(QString)), this, SLOT(modemAdded(QString))); connect(m_mm, SIGNAL(modemRemoved(QString)), this, SLOT(modemRemoved(QString))); QString finalModemPath; if (setting == AutomaticSelect) finalModemPath = m_mm->modems().value(0); else if (setting == ManualSelect) if (m_mm->modems().contains(modemPath)) finalModemPath = modemPath; if (finalModemPath.isEmpty()) { finalModemPath = "/"; } m_if = new OfonoInterface(finalModemPath, "org.ofono.Modem", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); m_isValid = m_mm->modems().contains(finalModemPath); } OfonoModem::~OfonoModem() { } void OfonoModem::propertyChanged(const QString& property, const QVariant& value) { if (property == "Online") emit onlineChanged(value.value()); else if (property == "Powered") emit poweredChanged(value.value()); else if (property == "Lockdown") emit lockdownChanged(value.value()); else if (property == "Emergency") emit emergencyChanged(value.value()); else if (property == "Name") emit nameChanged(value.value()); else if (property == "Manufacturer") emit manufacturerChanged(value.value()); else if (property == "Model") emit modelChanged(value.value()); else if (property == "Revision") emit revisionChanged(value.value()); else if (property == "Serial") emit serialChanged(value.value()); else if (property == "Type") emit typeChanged(value.value()); else if (property == "Features") emit featuresChanged(value.value()); else if (property == "Interfaces") emit interfacesChanged(value.value()); } void OfonoModem::setPropertyFailed(const QString& property) { if (property == "Online") emit setOnlineFailed(); else if (property == "Powered") emit setPoweredFailed(); else if (property == "Lockdown") emit setLockdownFailed(); } void OfonoModem::modemAdded(const QString& /*modem*/) { modemsChanged(); } void OfonoModem::modemRemoved(const QString& /*modem*/) { modemsChanged(); } void OfonoModem::modemsChanged() { // validity has changed if (isValid() != m_mm->modems().contains(path())) { m_isValid = m_mm->modems().contains(path()); emit validityChanged(isValid()); } if (!m_mm->modems().contains(path())) { if (m_selectionSetting == AutomaticSelect) { QString modemPath = m_mm->modems().value(0); if (modemPath.isEmpty()) { modemPath = "/"; } m_if->setPath(modemPath); emit pathChanged(modemPath); } else if (m_selectionSetting == ManualSelect) { m_if->setPath("/"); } } // validity has changed if (isValid() != m_mm->modems().contains(path())) { m_isValid = m_mm->modems().contains(path()); emit validityChanged(isValid()); } } bool OfonoModem::isValid() const { return m_isValid; } QString OfonoModem::path() const { return m_if->path(); } QString OfonoModem::errorName() const { return m_if->errorMessage(); } QString OfonoModem::errorMessage() const { return m_if->errorMessage(); } bool OfonoModem::powered() const { return m_if->properties()["Powered"].value(); } void OfonoModem::setPowered(bool powered) { m_if->setProperty("Powered", qVariantFromValue(powered)); } bool OfonoModem::online() const { return m_if->properties()["Online"].value(); } void OfonoModem::setOnline(bool online) { m_if->setProperty("Online", qVariantFromValue(online)); } bool OfonoModem::lockdown() const { return m_if->properties()["Lockdown"].value(); } void OfonoModem::setLockdown(bool lockdown) { m_if->setProperty("Lockdown", qVariantFromValue(lockdown)); } bool OfonoModem::emergency() const { return m_if->properties()["Emergency"].value(); } QString OfonoModem::name() const { return m_if->properties()["Name"].value(); } QString OfonoModem::manufacturer() const { return m_if->properties()["Manufacturer"].value(); } QString OfonoModem::model() const { return m_if->properties()["Model"].value(); } QString OfonoModem::revision() const { return m_if->properties()["Revision"].value(); } QString OfonoModem::serial() const { return m_if->properties()["Serial"].value(); } QString OfonoModem::type() const { return m_if->properties()["Type"].value(); } QStringList OfonoModem::features() const { return m_if->properties()["Features"].value(); } QStringList OfonoModem::interfaces() const { return m_if->properties()["Interfaces"].value(); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomodem.h000066400000000000000000000126701174402453000207270ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOMODEM_H #define OFONOMODEM_H #include #include #include "libofono-qt_global.h" class OfonoModemManager; class OfonoInterface; //! This class is used to access an oFono modem object and its properties /*! * oFono modem properties are documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/modem-api.txt */ class OFONO_QT_EXPORT OfonoModem : public QObject { Q_OBJECT Q_PROPERTY(bool isValid READ isValid NOTIFY validityChanged) Q_PROPERTY(QString path READ path NOTIFY pathChanged) Q_PROPERTY(QString errorName READ errorName) Q_PROPERTY(QString errorMessage READ errorMessage) Q_PROPERTY(bool powered READ powered WRITE setPowered NOTIFY poweredChanged) Q_PROPERTY(bool online READ online WRITE setOnline NOTIFY onlineChanged) Q_PROPERTY(bool lockdown READ lockdown WRITE setLockdown NOTIFY lockdownChanged) Q_PROPERTY(bool emergency READ emergency NOTIFY emergencyChanged) Q_PROPERTY(QString name READ name NOTIFY nameChanged) Q_PROPERTY(QString manufacturer READ manufacturer NOTIFY manufacturerChanged) Q_PROPERTY(QString model READ model NOTIFY modelChanged) Q_PROPERTY(QString revision READ revision NOTIFY revisionChanged) Q_PROPERTY(QString serial READ serial NOTIFY serialChanged) Q_PROPERTY(QString type READ type NOTIFY typeChanged) Q_PROPERTY(QStringList features READ features NOTIFY featuresChanged) Q_PROPERTY(QStringList interfaces READ interfaces NOTIFY interfacesChanged) public: //! How the modem object should select a modem enum SelectionSetting { AutomaticSelect, /*!< Select the first available modem automatically; * if that modem becomes unavailable, select the first available * modem again. */ ManualSelect /*!< Do not select a modem automatically, * use the modem path provided in the constructor, and do not * attempt to select another modem if the first one becomes * unavailable. */ }; /*! * \param setting sets the modem selection policy for the object * \param modemPath if modem selection policy is ManualSelect, then this contains * the D-Bus path to the modem object. Otherwise, it is ignored. */ OfonoModem(SelectionSetting setting, const QString& modemPath, QObject *parent=0); ~OfonoModem(); //! Returns true if D-Bus modem object exists. bool isValid() const; //! Returns the D-Bus object path of the modem QString path() const; //! Get the D-Bus error name of the last operation. /*! * Returns the D-Bus error name of the last operation (setting a property * or calling a method) if it has failed */ QString errorName() const; //! Get the D-Bus error message of the last operation. /*! * Returns the D-Bus error message of the last operation (setting a property * or calling a method) if it has failed */ QString errorMessage() const; bool powered() const; bool online() const; bool lockdown() const; bool emergency() const; QString name() const; QString manufacturer() const; QString model() const; QString revision() const; QString serial() const; QString type() const; QStringList features() const; QStringList interfaces() const; public slots: void setPowered(bool powered); void setOnline(bool online); void setLockdown(bool lockdown); signals: //! Issued when a modem becomes unavailable or available again void validityChanged(bool validity); //! Issued when the object has switched to another modem void pathChanged(QString modemPath); void poweredChanged(bool powered); void setPoweredFailed(); void onlineChanged(bool online); void setOnlineFailed(); void lockdownChanged(bool lockdown); void setLockdownFailed(); void emergencyChanged(bool emergency); void nameChanged(const QString &name); void manufacturerChanged(const QString &manufacturer); void modelChanged(const QString &model); void revisionChanged(const QString &revision); void serialChanged(const QString &serial); void typeChanged(const QString &type); void featuresChanged(const QStringList &features); void interfacesChanged(const QStringList &interfaces); private slots: void propertyChanged(const QString &property, const QVariant &value); void setPropertyFailed(const QString& property); void modemAdded(const QString &modem); void modemRemoved(const QString &modem); private: void modemsChanged(); private: OfonoModemManager *m_mm; OfonoInterface *m_if; SelectionSetting m_selectionSetting; bool m_isValid; }; #endif ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomodeminterface.cpp000066400000000000000000000050161174402453000231370ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonomodeminterface.h" #include "ofonomodem.h" #include "ofonointerface.h" OfonoModemInterface::OfonoModemInterface(OfonoModem::SelectionSetting modemSetting, const QString& modemPath, const QString& ifname, OfonoGetPropertySetting propertySetting, QObject *parent) : QObject(parent) { m_m = new OfonoModem(modemSetting, modemPath, this); connect(m_m, SIGNAL(validityChanged(bool)), this, SLOT(modemValidityChanged(bool))); connect(m_m, SIGNAL(interfacesChanged(QStringList)), this, SLOT(interfacesChanged(QStringList))); m_if = new OfonoInterface(m_m->path(), ifname, propertySetting, this); connect(m_m, SIGNAL(pathChanged(QString)), m_if, SLOT(setPath(const QString&))); m_isValid = checkValidity(); } OfonoModemInterface::~OfonoModemInterface() { } bool OfonoModemInterface::isValid() const { return m_isValid; } OfonoModem* OfonoModemInterface::modem() const { return m_m; } bool OfonoModemInterface::checkValidity() { return (m_m->isValid() && m_m->interfaces().contains(m_if->ifname())); } void OfonoModemInterface::updateValidity() { if (isValid() != checkValidity()) { m_isValid = checkValidity(); emit validityChanged(isValid()); } } void OfonoModemInterface::modemValidityChanged(bool /*validity*/) { updateValidity(); } void OfonoModemInterface::interfacesChanged(const QStringList& /*interfaces*/) { updateValidity(); } QString OfonoModemInterface::path() const { return m_if->path(); } QString OfonoModemInterface::errorName() const { return m_if->errorName(); } QString OfonoModemInterface::errorMessage() const { return m_if->errorMessage(); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomodeminterface.h000066400000000000000000000070551174402453000226110ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOMODEMINTERFACE_H #define OFONOMODEMINTERFACE_H #include #include #include "ofonomodem.h" #include "ofonopropertysetting.h" #include "libofono-qt_global.h" class OfonoInterface; //! This class implements a generic modem interface object /*! * It provides validity checking and modem binding. * It should not be instantiated directly; instead you should instantiate * interface-specific subclasses. */ class OFONO_QT_EXPORT OfonoModemInterface : public QObject { Q_OBJECT Q_PROPERTY(bool isValid READ isValid NOTIFY validityChanged) Q_PROPERTY(QString path READ path) Q_PROPERTY(QString errorName READ errorName) Q_PROPERTY(QString errorMessage READ errorMessage) public: //! Construct a modem interface object /*! * \param modemSetting modem selection setting * \param modemPath path to the modem (may not be significant, depending on modemSetting) * \param ifname d-bus interface name * \param propertySetting oFono d-bus properties setting */ OfonoModemInterface(OfonoModem::SelectionSetting modemSetting, const QString& modemPath, const QString& ifname, OfonoGetPropertySetting propertySetting, QObject *parent=0); ~OfonoModemInterface(); //! Check that the modem interface object is valid /*! * This means that a modem d-bus object * exists and has the d-bus interface specified in the contstructor. */ bool isValid() const; //! Get the modem object that this interface belongs to. /*! * The ownership of the modem object stays with the OfonoModemInterface object. */ OfonoModem *modem() const; //! Returns the D-Bus object path of the interface QString path() const; //! Get the D-Bus error name of the last operation. /*! * Returns the D-Bus error name of the last operation (setting a property * or calling a method) if it has failed */ QString errorName() const; //! Get the D-Bus error message of the last operation. /*! * Returns the D-Bus error message of the last operation (setting a property * or calling a method) if it has failed */ QString errorMessage() const; signals: //! Interface validity has changed /*! * This may mean that modem has become unavailable * (or available again) or that the modem interface has become unavailable * (or available again) */ void validityChanged(bool validity); private: bool checkValidity(); void updateValidity(); private slots: void modemValidityChanged(bool validity); void interfacesChanged(const QStringList &interfaces); protected: OfonoInterface *m_if; private: OfonoModem *m_m; bool m_isValid; }; #endif ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomodemmanager.cpp000066400000000000000000000055511174402453000226150ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonomodemmanager.h" #include "ofonointerface.h" struct OfonoModemStruct { QDBusObjectPath path; QVariantMap properties; }; typedef QList OfonoModemList; Q_DECLARE_METATYPE(OfonoModemStruct) Q_DECLARE_METATYPE(OfonoModemList) QDBusArgument &operator<<(QDBusArgument &argument, const OfonoModemStruct &modem) { argument.beginStructure(); argument << modem.path << modem.properties; argument.endStructure(); return argument; } const QDBusArgument &operator>>(const QDBusArgument &argument, OfonoModemStruct &modem) { argument.beginStructure(); argument >> modem.path >> modem.properties; argument.endStructure(); return argument; } OfonoModemManager::OfonoModemManager(QObject *parent) : QObject(parent) { QDBusReply reply; OfonoModemList modems; QDBusMessage request; qDBusRegisterMetaType(); qDBusRegisterMetaType(); request = QDBusMessage::createMethodCall("org.ofono", "/", "org.ofono.Manager", "GetModems"); reply = QDBusConnection::systemBus().call(request); modems = reply; foreach(OfonoModemStruct modem, modems) { m_modems << modem.path.path(); } QDBusConnection::systemBus().connect("org.ofono","/","org.ofono.Manager", "ModemAdded", this, SLOT(onModemAdded(const QDBusObjectPath&, const QVariantMap&))); QDBusConnection::systemBus().connect("org.ofono","/","org.ofono.Manager", "ModemRemoved", this, SLOT(onModemRemoved(const QDBusObjectPath&))); } OfonoModemManager::~OfonoModemManager() { } QStringList OfonoModemManager::modems() const { return m_modems; } void OfonoModemManager::onModemAdded(const QDBusObjectPath& path, const QVariantMap& /*map*/) { m_modems << path.path(); emit modemAdded(path.path()); } void OfonoModemManager::onModemRemoved(const QDBusObjectPath& path) { m_modems.removeAll(path.path()); emit modemRemoved(path.path()); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonomodemmanager.h000066400000000000000000000033601174402453000222560ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOMODEMMANAGER_H #define OFONOMODEMMANAGER_H #include #include #include #include #include "libofono-qt_global.h" //! Provides access to the list of available modems and changes in that list. class OFONO_QT_EXPORT OfonoModemManager : public QObject { Q_OBJECT public: OfonoModemManager(QObject *parent=0); ~OfonoModemManager(); //! Returns a list of d-bus object paths that represent available modems Q_INVOKABLE QStringList modems() const; signals: //! Issued when a modem has been added void modemAdded(const QString &modemPath); //! Issued when a modem has been removed void modemRemoved(const QString &modemPath); private slots: void onModemAdded(const QDBusObjectPath &path, const QVariantMap &map); void onModemRemoved(const QDBusObjectPath &path); private: QStringList m_modems; }; #endif ofono-qt-1.5+git20120419+bcf0c04/lib/ofononetworkoperator.cpp000066400000000000000000000100271174402453000234200ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonointerface.h" #include "ofononetworkoperator.h" #define REGISTER_TIMEOUT 300000 OfonoNetworkOperator::OfonoNetworkOperator(const QString& operatorId, QObject *parent) : QObject(parent) { m_if = new OfonoInterface(operatorId, "org.ofono.NetworkOperator", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); } OfonoNetworkOperator::OfonoNetworkOperator(const OfonoNetworkOperator& op) : QObject(op.parent()) { m_if = new OfonoInterface(op.path(), "org.ofono.NetworkOperator", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); } bool OfonoNetworkOperator::operator==(const OfonoNetworkOperator &op) { return path() == op.path(); } OfonoNetworkOperator::~OfonoNetworkOperator() { } void OfonoNetworkOperator::registerOp() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Register"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(registerResp()), SLOT(registerErr(const QDBusError&)), REGISTER_TIMEOUT); } void OfonoNetworkOperator::registerResp() { emit registerComplete(TRUE); } void OfonoNetworkOperator::registerErr(const QDBusError& error) { m_if->setError(error.name(), error.message()); emit registerComplete(FALSE); } QString OfonoNetworkOperator::name() const { return m_if->properties()["Name"].value(); } QString OfonoNetworkOperator::status() const { return m_if->properties()["Status"].value(); } QString OfonoNetworkOperator::mcc() const { return m_if->properties()["MobileCountryCode"].value(); } QString OfonoNetworkOperator::mnc() const { return m_if->properties()["MobileNetworkCode"].value(); } QStringList OfonoNetworkOperator::technologies() const { return m_if->properties()["Technologies"].value(); } QString OfonoNetworkOperator::additionalInfo() const { return m_if->properties()["AdditionalInformation"].value(); } void OfonoNetworkOperator::propertyChanged(const QString& property, const QVariant& value) { if (property == "Name") { emit nameChanged(value.value()); } else if (property == "Status") { emit statusChanged(value.value()); } else if (property == "MobileCountryCode") { emit mccChanged(value.value()); } else if (property == "MobileNetworkCode") { emit mncChanged(value.value()); } else if (property == "Technologies") { emit technologiesChanged(value.value()); } else if (property == "AdditionalInformation") { emit additionalInfoChanged(value.value()); } } QString OfonoNetworkOperator::path() const { return m_if->path(); } QString OfonoNetworkOperator::errorName() const { return m_if->errorName(); } QString OfonoNetworkOperator::errorMessage() const { return m_if->errorMessage(); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofononetworkoperator.h000066400000000000000000000067141174402453000230750ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONONETWORKOPERATOR_H #define OFONONETWORKOPERATOR_H #include #include #include #include #include "libofono-qt_global.h" class OfonoInterface; //! This class is used to access oFono network operator API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/network-api.txt */ class OFONO_QT_EXPORT OfonoNetworkOperator : public QObject { Q_OBJECT Q_PROPERTY(QString path READ path) Q_PROPERTY(QString errorName READ errorName) Q_PROPERTY(QString errorMessage READ errorMessage) Q_PROPERTY(QString name READ name NOTIFY nameChanged) Q_PROPERTY(QString status READ status NOTIFY statusChanged) Q_PROPERTY(QString mcc READ mcc NOTIFY mccChanged) Q_PROPERTY(QString mnc READ mnc NOTIFY mncChanged) Q_PROPERTY(QStringList technologies READ technologies NOTIFY technologiesChanged) Q_PROPERTY(QString additionalInfo READ additionalInfo NOTIFY additionalInfoChanged) public: OfonoNetworkOperator(const QString& operatorId, QObject *parent=0); OfonoNetworkOperator(const OfonoNetworkOperator& op); ~OfonoNetworkOperator(); OfonoNetworkOperator operator=(const OfonoNetworkOperator &op); bool operator==(const OfonoNetworkOperator &op); //! Returns the D-Bus object path of the network operator object QString path() const; //! Get the D-Bus error name of the last operation. /*! * Returns the D-Bus error name of the last operation (setting a property * or calling a method) if it has failed */ QString errorName() const; //! Get the D-Bus error message of the last operation. /*! * Returns the D-Bus error message of the last operation (setting a property * or calling a method) if it has failed */ QString errorMessage() const; QString name() const; QString status() const; QString mcc() const; QString mnc() const; QStringList technologies() const; QString additionalInfo() const; public slots: void registerOp(); signals: void registerComplete(bool success); void nameChanged(const QString &name); void statusChanged(const QString &status); void mccChanged(const QString &mcc); void mncChanged(const QString &mnc); void technologiesChanged(const QStringList &technologies); void additionalInfoChanged(const QString &additionalInfo); private: private slots: void propertyChanged(const QString& property, const QVariant& value); void registerResp(); void registerErr(const QDBusError& error); private: OfonoInterface *m_if; }; #endif ofono-qt-1.5+git20120419+bcf0c04/lib/ofononetworkregistration.cpp000066400000000000000000000142721174402453000243050ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofononetworkregistration.h" #include "ofonointerface.h" #define REGISTER_TIMEOUT 300000 #define SCAN_TIMEOUT 300000 QDBusArgument &operator<<(QDBusArgument &argument, const OfonoOperatorStruct &op) { argument.beginStructure(); argument << op.path << op.properties; argument.endStructure(); return argument; } const QDBusArgument &operator>>(const QDBusArgument &argument, OfonoOperatorStruct &op) { argument.beginStructure(); argument >> op.path >> op.properties; argument.endStructure(); return argument; } OfonoNetworkRegistration::OfonoNetworkRegistration(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.NetworkRegistration", OfonoGetAllOnStartup, parent) { qDBusRegisterMetaType(); qDBusRegisterMetaType(); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); } OfonoNetworkRegistration::~OfonoNetworkRegistration() { } void OfonoNetworkRegistration::registerOp() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Register"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(registerResp()), SLOT(registerErr(const QDBusError&)), REGISTER_TIMEOUT); } void OfonoNetworkRegistration::scan() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Scan"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(scanResp(OfonoOperatorList)), SLOT(scanErr(const QDBusError&)), REGISTER_TIMEOUT); } void OfonoNetworkRegistration::getOperators() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "GetOperators"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(getOperatorsResp(OfonoOperatorList)), SLOT(getOperatorsErr(const QDBusError&)), SCAN_TIMEOUT); } QString OfonoNetworkRegistration::mode() const { return m_if->properties()["Mode"].value(); } QString OfonoNetworkRegistration::status() const { return m_if->properties()["Status"].value(); } uint OfonoNetworkRegistration::locationAreaCode() const { return m_if->properties()["LocationAreaCode"].value(); } uint OfonoNetworkRegistration::cellId() const { return m_if->properties()["CellId"].value(); } QString OfonoNetworkRegistration::mcc() const { return m_if->properties()["MobileCountryCode"].value(); } QString OfonoNetworkRegistration::mnc() const { return m_if->properties()["MobileNetworkCode"].value(); } QString OfonoNetworkRegistration::technology() const { return m_if->properties()["Technology"].value(); } QString OfonoNetworkRegistration::name() const { return m_if->properties()["Name"].value(); } uint OfonoNetworkRegistration::strength() const { return m_if->properties()["Strength"].value(); } QString OfonoNetworkRegistration::baseStation() const { return m_if->properties()["BaseStation"].value(); } void OfonoNetworkRegistration::propertyChanged(const QString& property, const QVariant& value) { if (property == "Mode") { emit modeChanged(value.value()); } else if (property == "Status") { emit statusChanged(value.value()); } else if (property == "LocationAreaCode") { emit locationAreaCodeChanged(value.value()); } else if (property == "CellId") { emit cellIdChanged(value.value()); } else if (property == "MobileCountryCode") { emit mccChanged(value.value()); } else if (property == "MobileNetworkCode") { emit mncChanged(value.value()); } else if (property == "Technology") { emit technologyChanged(value.value()); } else if (property == "Name") { emit nameChanged(value.value()); } else if (property == "Strength") { emit strengthChanged(value.value()); } else if (property == "BaseStation") { emit baseStationChanged(value.value()); } } void OfonoNetworkRegistration::registerResp() { emit registerComplete(TRUE); } void OfonoNetworkRegistration::registerErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit registerComplete(FALSE); } void OfonoNetworkRegistration::getOperatorsResp(OfonoOperatorList list) { QStringList oplist; foreach(OfonoOperatorStruct op, list) { oplist << op.path.path(); } emit getOperatorsComplete(TRUE, oplist); } void OfonoNetworkRegistration::getOperatorsErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit getOperatorsComplete(FALSE, QStringList()); } void OfonoNetworkRegistration::scanResp(OfonoOperatorList list) { QStringList oplist; foreach(OfonoOperatorStruct op, list) { oplist << op.path.path(); } emit scanComplete(TRUE, oplist); } void OfonoNetworkRegistration::scanErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit scanComplete(FALSE, QStringList()); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofononetworkregistration.h000066400000000000000000000074211174402453000237500ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONONETWORKREGISTRATION_H #define OFONONETWORKREGISTRATION_H #include #include #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" struct OfonoOperatorStruct { QDBusObjectPath path; QVariantMap properties; }; typedef QList OfonoOperatorList; Q_DECLARE_METATYPE(OfonoOperatorStruct) Q_DECLARE_METATYPE(OfonoOperatorList) //! This class is used to access oFono network registration API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/network-api.txt */ class OFONO_QT_EXPORT OfonoNetworkRegistration : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(QString mode READ mode NOTIFY modeChanged) Q_PROPERTY(QString status READ status NOTIFY statusChanged) Q_PROPERTY(uint locationAreaCode READ locationAreaCode NOTIFY locationAreaCodeChanged) Q_PROPERTY(uint cellId READ cellId NOTIFY cellIdChanged) Q_PROPERTY(QString mcc READ mcc NOTIFY mccChanged) Q_PROPERTY(QString mnc READ mnc NOTIFY mncChanged) Q_PROPERTY(QString technology READ technology NOTIFY technologyChanged) Q_PROPERTY(QString name READ name NOTIFY nameChanged) Q_PROPERTY(uint strength READ strength NOTIFY strengthChanged) Q_PROPERTY(QString baseStation READ baseStation NOTIFY baseStationChanged) public: OfonoNetworkRegistration(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoNetworkRegistration(); /* Properties */ QString mode() const; QString status() const; uint locationAreaCode() const; uint cellId() const; QString mcc() const; QString mnc() const; QString technology() const; QString name() const; uint strength() const; QString baseStation() const; public slots: void registerOp(); void getOperators(); void scan(); signals: void modeChanged(const QString &mode); void statusChanged(const QString &status); void locationAreaCodeChanged(uint locationAreaCode); void cellIdChanged(uint cellId); void mccChanged(const QString &mcc); void mncChanged(const QString &mnc); void technologyChanged(const QString &technology); void nameChanged(const QString &name); void strengthChanged(uint strength); void baseStationChanged(const QString &baseStation); void registerComplete(bool success); void getOperatorsComplete(bool success, const QStringList &operatorIds); void scanComplete(bool success, const QStringList &operatorIds); private slots: void propertyChanged(const QString& property, const QVariant& value); void registerResp(); void registerErr(QDBusError error); void getOperatorsResp(OfonoOperatorList list); void getOperatorsErr(QDBusError error); void scanResp(OfonoOperatorList list); void scanErr(QDBusError error); private: }; #endif /* !OFONONETWORKREGISTRATION_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonophonebook.cpp000066400000000000000000000035511174402453000221430ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonophonebook.h" #include "ofonointerface.h" #define IMPORT_TIMEOUT 300000 OfonoPhonebook::OfonoPhonebook(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.Phonebook", OfonoGetAllOnFirstRequest, parent) { } OfonoPhonebook::~OfonoPhonebook() { } void OfonoPhonebook::import() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Import"); request.setArguments(QList()); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(importResp(QString)), SLOT(importErr(const QDBusError&)), IMPORT_TIMEOUT); } void OfonoPhonebook::importResp(const QString &entries) { emit importComplete(true, entries); } void OfonoPhonebook::importErr(const QDBusError& error) { m_if->setError(error.name(), error.message()); emit importComplete(false, QString()); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonophonebook.h000066400000000000000000000031701174402453000216050ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOPHONEBOOK_H #define OFONOPHONEBOOK_H #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono phonebook API /*! * oFono phonebook API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/phonebook-api.txt */ class OFONO_QT_EXPORT OfonoPhonebook : public OfonoModemInterface { Q_OBJECT public: OfonoPhonebook(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent); ~OfonoPhonebook(); public slots: void import(); signals: void importComplete(bool success, const QString &entries); private slots: void importResp(const QString &entries); void importErr(const QDBusError &error); private: }; #endif ofono-qt-1.5+git20120419+bcf0c04/lib/ofonopropertysetting.h000066400000000000000000000024321174402453000231030ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOPROPERTYSETTING_H #define OFONOPROPERTYSETTING_H //! How to handle getting the properties enum OfonoGetPropertySetting { OfonoGetAllOnStartup, /*!< Get all properties synchronously on startup; * they would be immediately available. */ OfonoGetAllOnFirstRequest /*!< Do not get properties on startup; * get them in an asynhronous way when the first * property is requested. */ }; #endif ofono-qt-1.5+git20120419+bcf0c04/lib/ofonoradiosettings.cpp000066400000000000000000000065131174402453000230370ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonoradiosettings.h" #include "ofonointerface.h" OfonoRadioSettings::OfonoRadioSettings(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.RadioSettings", OfonoGetAllOnStartup, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&)));} OfonoRadioSettings::~OfonoRadioSettings() { } QString OfonoRadioSettings::technologyPreference() const { return m_if->properties()["TechnologyPreference"].value(); } void OfonoRadioSettings::setTechnologyPreference(QString preference) { m_if->setProperty("TechnologyPreference", qVariantFromValue(preference)); } QString OfonoRadioSettings::gsmBand() const { return m_if->properties()["GsmBand"].value(); } void OfonoRadioSettings::setGsmBand(QString gsmBand) { m_if->setProperty("GsmBand", qVariantFromValue(gsmBand)); } QString OfonoRadioSettings::umtsBand() const { return m_if->properties()["UmtsBand"].value(); } void OfonoRadioSettings::setUmtsBand(QString umtsBand) { m_if->setProperty("UmtsBand", qVariantFromValue(umtsBand)); } bool OfonoRadioSettings::fastDormancy() const { return m_if->properties()["FastDormancy"].value(); } void OfonoRadioSettings::setFastDormancy(bool fastDormancy) { m_if->setProperty("FastDormancy", qVariantFromValue(fastDormancy)); } void OfonoRadioSettings::setPropertyFailed(const QString& property) { if (property == "TechnologyPreference") emit setTechnologyPreferenceFailed(); else if (property == "GsmBand") emit setGsmBandFailed(); else if (property == "UmtsBand") emit setUmtsBandFailed(); else if (property == "FastDormancy") emit setFastDormancyFailed(); } void OfonoRadioSettings::propertyChanged(const QString& property, const QVariant& value) { if (property == "TechnologyPreference") { emit technologyPreferenceChanged(value.value()); } else if (property == "GsmBand") { emit gsmBandChanged(value.value()); } else if (property == "UmtsBand") { emit umtsBandChanged(value.value()); } else if (property == "FastDormancy") { emit fastDormancyChanged(value.value()); } } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonoradiosettings.h000066400000000000000000000052261174402453000225040ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONORADIOSETTINGS_H #define OFONORADIOSETTINGS_H #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono radio settings API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/radio-settings-api.txt */ class OFONO_QT_EXPORT OfonoRadioSettings : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(QString technologyPreference READ technologyPreference WRITE setTechnologyPreference NOTIFY technologyPreferenceChanged) Q_PROPERTY(QString gsmBand READ gsmBand WRITE setGsmBand NOTIFY gsmBandChanged) Q_PROPERTY(QString umtsBand READ umtsBand WRITE setUmtsBand NOTIFY umtsBandChanged) Q_PROPERTY(bool fastDormancy READ fastDormancy WRITE setFastDormancy NOTIFY fastDormancyChanged) public: OfonoRadioSettings(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoRadioSettings(); QString technologyPreference() const; QString gsmBand() const; QString umtsBand() const; bool fastDormancy() const; public slots: void setTechnologyPreference(QString preference); void setGsmBand(QString gsmBand); void setUmtsBand(QString umtsBand); void setFastDormancy(bool fastDormancy); signals: void technologyPreferenceChanged(const QString &preference); void setTechnologyPreferenceFailed(); void gsmBandChanged(const QString &gsmBand); void setGsmBandFailed(); void umtsBandChanged(const QString &umtsBand); void setUmtsBandFailed(); void fastDormancyChanged(bool fastDormancy); void setFastDormancyFailed(); private slots: void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); }; #endif /* !OFONORADIOSETTINGS_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonosimmanager.cpp000066400000000000000000000213661174402453000223060ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonosimmanager.h" #include "ofonointerface.h" OfonoSimManager::OfonoSimManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.SimManager", OfonoGetAllOnStartup, parent) { qRegisterMetaType("OfonoServiceNumbers"); qRegisterMetaType("OfonoPinRetries"); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(m_if, SIGNAL(setPropertyFailed(const QString&)), this, SLOT(setPropertyFailed(const QString&))); } OfonoSimManager::~OfonoSimManager() { } void OfonoSimManager::changePin(const QString &pintype, const QString &oldpin, const QString &newpin) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "ChangePin"); request << pintype << oldpin << newpin; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(changePinResp()), SLOT(changePinErr(const QDBusError&))); } void OfonoSimManager::enterPin(const QString &pintype, const QString &pin) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "EnterPin"); request << pintype << pin; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(enterPinResp()), SLOT(enterPinErr(const QDBusError&))); } void OfonoSimManager::resetPin(const QString &pintype, const QString &puk, const QString &newpin) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "ResetPin"); request << pintype << puk << newpin; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(resetPinResp()), SLOT(resetPinErr(const QDBusError&))); } void OfonoSimManager::lockPin(const QString &pintype, const QString &pin) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "LockPin"); request << pintype << pin; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(lockPinResp()), SLOT(lockPinErr(const QDBusError&))); } void OfonoSimManager::unlockPin(const QString &pintype, const QString &pin) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "UnlockPin"); request << pintype << pin; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(unlockPinResp()), SLOT(unlockPinErr(const QDBusError&))); } void OfonoSimManager::getIcon(quint8 id) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "GetIcon"); request << qVariantFromValue(id); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(getIconResp(QByteArray)), SLOT(getIconErr(const QDBusError&))); } void OfonoSimManager::setSubscriberNumbers(const QStringList &numbers) { m_if->setProperty("SubscriberNumbers", qVariantFromValue(numbers)); } bool OfonoSimManager::present() const { return m_if->properties()["Present"].value(); } QString OfonoSimManager::subscriberIdentity() const { return m_if->properties()["SubscriberIdentity"].value(); } QString OfonoSimManager::mobileCountryCode() const { return m_if->properties()["MobileCountryCode"].value(); } QString OfonoSimManager::mobileNetworkCode() const { return m_if->properties()["MobileNetworkCode"].value(); } QStringList OfonoSimManager::subscriberNumbers() const { return m_if->properties()["SubscriberNumbers"].value(); } OfonoServiceNumbers OfonoSimManager::serviceNumbers() const { OfonoServiceNumbers map; m_if->properties()["ServiceNumbers"].value() >> map; return map; } QString OfonoSimManager::pinRequired() const { return m_if->properties()["PinRequired"].value(); } QStringList OfonoSimManager::lockedPins() const { return m_if->properties()["LockedPins"].value(); } QString OfonoSimManager::cardIdentifier() const { return m_if->properties()["CardIdentifier"].value(); } QStringList OfonoSimManager::preferredLanguages() const { return m_if->properties()["PreferredLanguages"].value(); } OfonoPinRetries OfonoSimManager::pinRetries() const { OfonoPinRetries retries; m_if->properties()["Retries"].value() >> retries; return retries; } bool OfonoSimManager::fixedDialing() const { return m_if->properties()["FixedDialing"].value(); } bool OfonoSimManager::barredDialing() const { return m_if->properties()["BarredDialing"].value(); } void OfonoSimManager::propertyChanged(const QString& property, const QVariant& value) { if (property == "Present") { emit presenceChanged(value.value()); } else if (property == "SubscriberIdentity") { emit subscriberIdentityChanged(value.value()); } else if (property == "MobileCountryCode") { emit mobileCountryCodeChanged(value.value()); } else if (property == "MobileNetworkCode") { emit mobileNetworkCodeChanged(value.value()); } else if (property == "SubscriberNumbers") { emit subscriberNumbersChanged(value.value()); } else if (property == "ServiceNumbers") { OfonoServiceNumbers map; value.value() >> map; emit serviceNumbersChanged(map); } else if (property == "PinRequired") { emit pinRequiredChanged(value.value()); } else if (property == "LockedPins") { emit lockedPinsChanged(value.value()); } else if (property == "CardIdentifier") { emit cardIdentifierChanged(value.value()); } else if (property == "PreferredLanguages") { emit preferredLanguagesChanged(value.value()); } else if (property == "Retries") { OfonoPinRetries retries; value.value() >> retries; emit pinRetriesChanged(retries); } else if (property == "FixedDialing") { emit fixedDialingChanged(value.value()); } else if (property == "BarredDialing") { emit barredDialingChanged(value.value()); } } void OfonoSimManager::setPropertyFailed(const QString& property) { if (property == "SubscriberNumbers") emit setSubscriberNumbersFailed(); } void OfonoSimManager::changePinResp() { emit changePinComplete(TRUE); } void OfonoSimManager::changePinErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit changePinComplete(FALSE); } void OfonoSimManager::enterPinResp() { emit enterPinComplete(TRUE); } void OfonoSimManager::enterPinErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit enterPinComplete(FALSE); } void OfonoSimManager::resetPinResp() { emit resetPinComplete(TRUE); } void OfonoSimManager::resetPinErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit resetPinComplete(FALSE); } void OfonoSimManager::lockPinResp() { emit lockPinComplete(TRUE); } void OfonoSimManager::lockPinErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit lockPinComplete(FALSE); } void OfonoSimManager::unlockPinResp() { emit unlockPinComplete(TRUE); } void OfonoSimManager::unlockPinErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit unlockPinComplete(FALSE); } void OfonoSimManager::getIconResp(QByteArray icon) { emit getIconComplete(TRUE, icon); } void OfonoSimManager::getIconErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit getIconComplete(FALSE, QByteArray()); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonosimmanager.h000066400000000000000000000123051174402453000217440ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOSIMMANAGER_H #define OFONOSIMMANAGER_H #include #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" typedef QMap OfonoServiceNumbers; Q_DECLARE_METATYPE(OfonoServiceNumbers); typedef QMap OfonoPinRetries; Q_DECLARE_METATYPE(OfonoPinRetries); //! This class is used to access oFono SIM API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/sim-api.txt */ class OFONO_QT_EXPORT OfonoSimManager : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(bool present READ present NOTIFY presenceChanged) Q_PROPERTY(QString subscriberIdentity READ subscriberIdentity NOTIFY subscriberIdentityChanged) Q_PROPERTY(QString mobileCountryCode READ mobileCountryCode NOTIFY mobileCountryCodeChanged) Q_PROPERTY(QString mobileNetworkCode READ mobileNetworkCode NOTIFY mobileNetworkCodeChanged) Q_PROPERTY(QStringList subscriberNumbers READ subscriberNumbers WRITE setSubscriberNumbers NOTIFY subscriberNumbersChanged) Q_PROPERTY(QString pinRequired READ pinRequired NOTIFY pinRequiredChanged) Q_PROPERTY(QStringList lockedPins READ lockedPins NOTIFY lockedPinsChanged) Q_PROPERTY(QString cardIdentifier READ cardIdentifier NOTIFY cardIdentifierChanged) Q_PROPERTY(QStringList preferredLanguages READ preferredLanguages NOTIFY preferredLanguagesChanged) Q_PROPERTY(OfonoPinRetries pinRetries READ pinRetries NOTIFY pinRetriesChanged) Q_PROPERTY(bool fixedDialing READ fixedDialing NOTIFY fixedDialingChanged) Q_PROPERTY(bool barredDialing READ barredDialing NOTIFY barredDialingChanged) public: OfonoSimManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoSimManager(); /* Properties */ bool present() const; QString subscriberIdentity() const; QString mobileCountryCode() const; QString mobileNetworkCode() const; QStringList subscriberNumbers() const; OfonoServiceNumbers serviceNumbers() const; QString pinRequired() const; QStringList lockedPins() const; QString cardIdentifier() const; QStringList preferredLanguages() const; OfonoPinRetries pinRetries() const; bool fixedDialing() const; bool barredDialing() const; public slots: void changePin(const QString &pintype, const QString &oldpin, const QString &newpin); void enterPin(const QString &pintype, const QString &pin); void resetPin(const QString &pintype, const QString &puk, const QString &newpin); void lockPin(const QString &pintype, const QString &pin); void unlockPin(const QString &pintype, const QString &pin); void getIcon(quint8 id); void setSubscriberNumbers(const QStringList &numbers); signals: void presenceChanged(bool ispresent); void subscriberIdentityChanged(const QString &imsi); void mobileCountryCodeChanged(const QString &mcc); void mobileNetworkCodeChanged(const QString &mnc); void subscriberNumbersChanged(const QStringList &msisdns); void setSubscriberNumbersFailed(); void serviceNumbersChanged(const OfonoServiceNumbers &sdns); void pinRequiredChanged(const QString &pintype); void lockedPinsChanged(const QStringList &pins); void cardIdentifierChanged(const QString &iccid); void preferredLanguagesChanged(const QStringList &languages); void pinRetriesChanged(const OfonoPinRetries &pinRetries); void fixedDialingChanged(bool fixedDialing); void barredDialingChanged(bool barredDialing); void changePinComplete(bool success); void enterPinComplete(bool success); void resetPinComplete(bool success); void lockPinComplete(bool success); void unlockPinComplete(bool success); void getIconComplete(bool success, const QByteArray &icon); private slots: void propertyChanged(const QString& property, const QVariant& value); void setPropertyFailed(const QString& property); void changePinResp(); void changePinErr(QDBusError error); void enterPinResp(); void enterPinErr(QDBusError error); void resetPinResp(); void resetPinErr(QDBusError error); void lockPinResp(); void lockPinErr(QDBusError error); void unlockPinResp(); void unlockPinErr(QDBusError error); void getIconResp(QByteArray icon); void getIconErr(QDBusError error); private: }; #endif /* !OFONOSIMMANAGER_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonosupplementaryservices.cpp000066400000000000000000000152261174402453000246350ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonosupplementaryservices.h" #include "ofonointerface.h" #define REQUEST_TIMEOUT 60000 OfonoSupplementaryServices::OfonoSupplementaryServices(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.SupplementaryServices", OfonoGetAllOnStartup, parent) { connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(modem(), SIGNAL(pathChanged(QString)), this, SLOT(pathChanged(const QString&))); connectDbusSignals(path()); } void OfonoSupplementaryServices::pathChanged(const QString& path) { connectDbusSignals(path); } void OfonoSupplementaryServices::connectDbusSignals(const QString& path) { QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "NotificationReceived", this, SIGNAL(notificationReceived(QString))); QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "RequestReceived", this, SIGNAL(requestReceived(QString))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "NotificationReceived", this, SIGNAL(notificationReceived(QString))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "RequestReceived", this, SIGNAL(requestReceived(QString))); } OfonoSupplementaryServices::~OfonoSupplementaryServices() { } void OfonoSupplementaryServices::initiate(const QString &command) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Initiate"); request << command; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(initiateResp(QString, QDBusVariant)), SLOT(initiateErr(const QDBusError&)), REQUEST_TIMEOUT); } void OfonoSupplementaryServices::respond(const QString &reply) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Respond"); request << reply; QDBusConnection::systemBus().callWithCallback(request, this, SLOT(respondResp(QString)), SLOT(respondErr(const QDBusError&)), REQUEST_TIMEOUT); } void OfonoSupplementaryServices::cancel() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Cancel"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(cancelResp()), SLOT(cancelErr(const QDBusError&)), REQUEST_TIMEOUT); } QString OfonoSupplementaryServices::state() const { return m_if->properties()["State"].value(); } void OfonoSupplementaryServices::propertyChanged(const QString& property, const QVariant& value) { if (property == "State") { emit stateChanged(value.value()); } } void OfonoSupplementaryServices::initiateResp(QString message, QDBusVariant details) { const QDBusArgument argument = details.variant().value(); if (message == "USSD") { QString ussdResp = details.variant().toString(); emit initiateUSSDComplete(ussdResp); } else if (message == "CallBarring") { QString ssOp, cbService; QVariantMap cbMap; argument.beginStructure(); argument >> ssOp >> cbService >> cbMap; argument.endStructure(); emit barringComplete(ssOp, cbService, cbMap); } else if (message == "CallForwarding") { QString ssOp, cfService; QVariantMap cfMap; argument.beginStructure(); argument >> ssOp >> cfService >> cfMap; argument.endStructure(); emit forwardingComplete(ssOp, cfService, cfMap); } else if (message == "CallWaiting") { QString ssOp; QVariantMap cwMap; argument.beginStructure(); argument >> ssOp >> cwMap; argument.endStructure(); emit waitingComplete(ssOp, cwMap); } else if (message == "CallingLinePresentation") { QString ssOp, status; argument.beginStructure(); argument >> ssOp >> status; argument.endStructure(); emit callingLinePresentationComplete(ssOp, status); } else if (message == "ConnectedLinePresentation") { QString ssOp, status; argument.beginStructure(); argument >> ssOp >> status; argument.endStructure(); emit connectedLinePresentationComplete(ssOp, status); } else if (message == "CallingLineRestriction") { QString ssOp, status; argument.beginStructure(); argument >> ssOp >> status; argument.endStructure(); emit callingLineRestrictionComplete(ssOp, status); } else if (message == "ConnectedLineRestriction") { QString ssOp, status; argument.beginStructure(); argument >> ssOp >> status; argument.endStructure(); emit connectedLineRestrictionComplete(ssOp, status); } else { m_if->setError(QString(), QString("Unknown initiate response")); emit initiateFailed(); } } void OfonoSupplementaryServices::initiateErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit initiateFailed(); } void OfonoSupplementaryServices::respondResp(QString message) { emit respondComplete(TRUE, message); } void OfonoSupplementaryServices::respondErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit respondComplete(FALSE, QString()); } void OfonoSupplementaryServices::cancelResp() { emit cancelComplete(TRUE); } void OfonoSupplementaryServices::cancelErr(QDBusError error) { m_if->setError(error.name(), error.message()); emit cancelComplete(FALSE); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonosupplementaryservices.h000066400000000000000000000062261174402453000243020ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOSUPPLEMENTARYSERVICES_H #define OFONOSUPPLEMENTARYSERVICES_H #include #include #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" //! This class is used to access oFono supplementary services API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/supplementaryservices-api.txt */ class OFONO_QT_EXPORT OfonoSupplementaryServices : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(QString state READ state) public: OfonoSupplementaryServices(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoSupplementaryServices(); /* Properties */ QString state() const; public slots: void initiate(const QString &command); void respond(const QString &reply); void cancel(); signals: void notificationReceived(const QString &message); void requestReceived(const QString &message); void stateChanged(const QString &state); void initiateUSSDComplete(const QString &ussdResp); void barringComplete(const QString &ssOp, const QString &cbService, const QVariantMap &cbMap); void forwardingComplete(const QString &ssOp, const QString &cfService, const QVariantMap &cfMap); void waitingComplete(const QString &ssOp, const QVariantMap &cwMap); void callingLinePresentationComplete(const QString &ssOp, const QString &status); void connectedLinePresentationComplete(const QString &ssOp, const QString &status); void callingLineRestrictionComplete(const QString &ssOp, const QString &status); void connectedLineRestrictionComplete(const QString &ssOp, const QString &status); void initiateFailed(); void respondComplete(bool success, const QString &message); void cancelComplete(bool success); private slots: void pathChanged(const QString& path); void propertyChanged(const QString& property, const QVariant& value); void initiateResp(QString message, QDBusVariant details); void initiateErr(QDBusError error); void respondResp(QString message); void respondErr(QDBusError error); void cancelResp(); void cancelErr(QDBusError error); private: void connectDbusSignals(const QString& path); }; #endif /* !OFONOSUPPLEMETARYSERVICES_H */ ofono-qt-1.5+git20120419+bcf0c04/lib/ofonovoicecall.cpp000066400000000000000000000157121174402453000221220ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonointerface.h" #include "ofonovoicecall.h" #define VOICECALL_TIMEOUT 30000 OfonoVoiceCall::OfonoVoiceCall(const QString& callId, QObject *parent) : QObject(parent) { m_if = new OfonoInterface(callId, "org.ofono.VoiceCall", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); QDBusConnection::systemBus().connect("org.ofono",path(),m_if->ifname(), "DisconnectReason", this, SIGNAL(disconnectReason(const QString&))); } OfonoVoiceCall::OfonoVoiceCall(const OfonoVoiceCall& call) : QObject(call.parent()) { m_if = new OfonoInterface(call.path(), "org.ofono.VoiceCall", OfonoGetAllOnStartup, this); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); QDBusConnection::systemBus().connect("org.ofono",path(),m_if->ifname(), "DisconnectReason", this, SIGNAL(disconnectReason(const QString&))); } bool OfonoVoiceCall::operator==(const OfonoVoiceCall &call) { return path() == call.path(); } OfonoVoiceCall::~OfonoVoiceCall() { } void OfonoVoiceCall::answer() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Answer"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(answerResp()), SLOT(answerErr(const QDBusError&)), VOICECALL_TIMEOUT); } void OfonoVoiceCall::hangup() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Hangup"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(hangupResp()), SLOT(hangupErr(const QDBusError&)), VOICECALL_TIMEOUT); } void OfonoVoiceCall::deflect(const QString &number) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Deflect"); QListarg; arg.append(QVariant(number)); request.setArguments(arg); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(deflectResp()), SLOT(deflectErr(const QDBusError&)), VOICECALL_TIMEOUT); } void OfonoVoiceCall::answerResp() { emit answerComplete(TRUE); } void OfonoVoiceCall::answerErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit answerComplete(FALSE); } void OfonoVoiceCall::hangupResp() { emit hangupComplete(TRUE); } void OfonoVoiceCall::hangupErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit hangupComplete(FALSE); } void OfonoVoiceCall::deflectResp() { emit deflectComplete(TRUE); } void OfonoVoiceCall::deflectErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit deflectComplete(FALSE); } QString OfonoVoiceCall::incomingLine() const { return m_if->properties()["IncomingLine"].value(); } QString OfonoVoiceCall::lineIdentification() const { return m_if->properties()["LineIdentification"].value(); } QString OfonoVoiceCall::name() const { return m_if->properties()["Name"].value(); } QString OfonoVoiceCall::state() const { return m_if->properties()["State"].value(); } QString OfonoVoiceCall::startTime() const { return m_if->properties()["StartTime"].value(); } QString OfonoVoiceCall::information() const { return m_if->properties()["Information"].value(); } bool OfonoVoiceCall::multiparty() const { return m_if->properties()["Multiparty"].value(); } bool OfonoVoiceCall::emergency() const { return m_if->properties()["Emergency"].value(); } quint8 OfonoVoiceCall::icon() const { return m_if->properties()["Icon"].value(); } bool OfonoVoiceCall::remoteHeld() const { return m_if->properties()["RemoteHeld"].value(); } bool OfonoVoiceCall::remoteMultiparty() const { return m_if->properties()["RemoteMultiparty"].value(); } void OfonoVoiceCall::propertyChanged(const QString &property, const QVariant &value) { if (property == "LineIdentification") { emit lineIdentificationChanged(value.value()); } else if (property == "Name") { emit nameChanged(value.value()); } else if (property == "State") { emit stateChanged(value.value()); } else if (property == "Information") { emit informationChanged(value.value()); } else if (property == "IncomingLine") { emit incomingLineChanged(value.value()); } else if (property == "Multiparty") { emit multipartyChanged(value.value()); } else if (property == "Emergency") { emit emergencyChanged(value.value()); } else if (property == "StartTime") { emit startTimeChanged(value.value()); } else if (property == "Icon") { emit iconChanged(value.value()); } else if (property == "RemoteHeld") { emit remoteHeldChanged(value.value()); } else if (property == "RemoteMultiparty") { emit remoteMultipartyChanged(value.value()); } } QString OfonoVoiceCall::path() const { return m_if->path(); } QString OfonoVoiceCall::errorName() const { return m_if->errorName(); } QString OfonoVoiceCall::errorMessage() const { return m_if->errorMessage(); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonovoicecall.h000066400000000000000000000104741174402453000215670ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOVOICECALL_H #define OFONOVOICECALL_H #include #include #include #include #include "libofono-qt_global.h" class OfonoInterface; //! This class is used to access oFono voice call API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob;f=doc/voicecall-api.txt */ class OFONO_QT_EXPORT OfonoVoiceCall : public QObject { Q_OBJECT Q_PROPERTY(QString path READ path) Q_PROPERTY(QString errorName READ errorName) Q_PROPERTY(QString errorMessage READ errorMessage) Q_PROPERTY(QString lineIdentification READ lineIdentification NOTIFY lineIdentificationChanged) Q_PROPERTY(QString incomingLine READ incomingLine NOTIFY incomingLineChanged) Q_PROPERTY(QString name READ name NOTIFY nameChanged) Q_PROPERTY(QString state READ state NOTIFY stateChanged) Q_PROPERTY(QString startTime READ startTime NOTIFY startTimeChanged) Q_PROPERTY(QString information READ information NOTIFY informationChanged) Q_PROPERTY(bool multiparty READ multiparty NOTIFY multipartyChanged) Q_PROPERTY(bool emergency READ emergency NOTIFY emergencyChanged) Q_PROPERTY(quint8 icon READ icon NOTIFY iconChanged) public: OfonoVoiceCall(const QString &callId, QObject *parent=0); OfonoVoiceCall(const OfonoVoiceCall &op); ~OfonoVoiceCall(); OfonoVoiceCall operator=(const OfonoVoiceCall &op); bool operator==(const OfonoVoiceCall &op); //! Returns the D-Bus object path of the voice call object QString path() const; //! Get the D-Bus error name of the last operation. /*! * Returns the D-Bus error name of the last operation (setting a property * or calling a method) if it has failed */ QString errorName() const; //! Get the D-Bus error message of the last operation. /*! * Returns the D-Bus error message of the last operation (setting a property * or calling a method) if it has failed */ QString errorMessage() const; QString lineIdentification() const; QString incomingLine() const; QString name() const; QString state() const; QString startTime() const; QString information() const; bool multiparty() const; bool emergency() const; quint8 icon() const; bool remoteHeld() const; bool remoteMultiparty() const; public slots: void answer(); void hangup(); void deflect(const QString &number); signals: void answerComplete(bool status); void hangupComplete(bool status); void deflectComplete(bool status); void lineIdentificationChanged(const QString &name); void nameChanged(const QString &name); void stateChanged(const QString &state); void startTimeChanged(const QString &time); void informationChanged(const QString &mcc); void incomingLineChanged(const QString &line); void disconnectReason(const QString &reason); void multipartyChanged(const bool multiparty); void iconChanged(const quint8 &icon); void emergencyChanged(const bool emergency); void remoteHeldChanged(const bool remoteHeld); void remoteMultipartyChanged(const bool remoteMultiparty); private slots: void propertyChanged(const QString &property, const QVariant &value); void answerResp(); void answerErr(const QDBusError &error); void hangupResp(); void hangupErr(const QDBusError &error); void deflectResp(); void deflectErr(const QDBusError &error); private: OfonoInterface *m_if; }; #endif // OFONOVOICECALL_H ofono-qt-1.5+git20120419+bcf0c04/lib/ofonovoicecallmanager.cpp000066400000000000000000000347001174402453000234530ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * Portions of this file are Copyright (C) 2011 Intel Corporation * Contact: Shane Bryan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 "ofonovoicecallmanager.h" #include "ofonointerface.h" #define DIAL_TIMEOUT 30000 #define TONE_TIMEOUT 10000 #define TRANSFER_TIMEOUT 20000 #define SWAP_TIMEOUT 20000 #define HANGUP_TIMEOUT 30000 #define HOLD_TIMEOUT 30000 #define PRIVATE_CHAT_TIMEOUT 30000 #define CREATE_MULTIPARTY_TIMEOUT 30000 QDBusArgument &operator<<(QDBusArgument &argument, const OfonoVoiceCallManagerStruct &call) { argument.beginStructure(); argument << call.path << call.properties; argument.endStructure(); return argument; } const QDBusArgument &operator>>(const QDBusArgument &argument, OfonoVoiceCallManagerStruct &call) { argument.beginStructure(); argument >> call.path >> call.properties; argument.endStructure(); return argument; } OfonoVoiceCallManager::OfonoVoiceCallManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent) : OfonoModemInterface(modemSetting, modemPath, "org.ofono.VoiceCallManager", OfonoGetAllOnStartup, parent) { qDBusRegisterMetaType(); qDBusRegisterMetaType(); m_calllist = getCallList(); connect(m_if, SIGNAL(propertyChanged(const QString&, const QVariant&)), this, SLOT(propertyChanged(const QString&, const QVariant&))); connect(this, SIGNAL(validityChanged(bool)), this, SLOT(validityChanged(bool))); connect(modem(), SIGNAL(pathChanged(QString)), this, SLOT(pathChanged(const QString&))); connectDbusSignals(path()); } OfonoVoiceCallManager::~OfonoVoiceCallManager() { } void OfonoVoiceCallManager::validityChanged(bool /*validity*/) { m_calllist = getCallList(); } void OfonoVoiceCallManager::pathChanged(const QString& path) { connectDbusSignals(path); } QStringList OfonoVoiceCallManager::getCallList() { QDBusReply reply; OfonoVoiceCallManagerList calls; QDBusMessage request; QStringList messageList; qDBusRegisterMetaType(); qDBusRegisterMetaType(); request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "GetCalls"); reply = QDBusConnection::systemBus().call(request); calls = reply; foreach(OfonoVoiceCallManagerStruct call, calls) { messageList<< call.path.path(); } return messageList; } void OfonoVoiceCallManager::connectDbusSignals(const QString& path) { QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "CallAdded", this, SLOT(callAddedChanged(const QDBusObjectPath&, const QVariantMap&))); QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "CallRemoved", this, SLOT(callRemovedChanged(const QDBusObjectPath&))); QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "BarringActive", this, SIGNAL(barringActive(const QString&))); QDBusConnection::systemBus().disconnect("org.ofono", QString(), m_if->ifname(), "Forwarded", this, SIGNAL(forwarded(const QString&))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "CallAdded", this, SLOT(callAddedChanged(const QDBusObjectPath&, const QVariantMap&))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "CallRemoved", this, SLOT(callRemovedChanged(const QDBusObjectPath&))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "BarringActive", this, SIGNAL(barringActive(const QString&))); QDBusConnection::systemBus().connect("org.ofono", path, m_if->ifname(), "Forwarded", this, SIGNAL(forwarded(const QString&))); } void OfonoVoiceCallManager::dial(const QString &number, const QString &callerid_hide) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Dial"); QListarg; arg.append(QVariant(number)); arg.append(QVariant(callerid_hide)); request.setArguments(arg); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(dialResp()), SLOT(dialErr(const QDBusError&)), DIAL_TIMEOUT); } void OfonoVoiceCallManager::hangupAll() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "HangupAll"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(hangupAllResp()), SLOT(hangupAllErr(const QDBusError&)), HANGUP_TIMEOUT); } void OfonoVoiceCallManager::sendTones(const QString &tonestring) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "SendTones"); QListarg; arg.append(QVariant(tonestring)); request.setArguments(arg); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(sendTonesResp()), SLOT(sendTonesErr(const QDBusError&)), (TONE_TIMEOUT*tonestring.length())); } void OfonoVoiceCallManager::transfer() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "Transfer"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(transferResp()), SLOT(transferErr(const QDBusError&)), TRANSFER_TIMEOUT); } void OfonoVoiceCallManager::swapCalls() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "SwapCalls"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(swapCallsResp()), SLOT(swapCallsErr(const QDBusError&)), SWAP_TIMEOUT); } void OfonoVoiceCallManager::releaseAndAnswer() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "ReleaseAndAnswer"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(releaseAndAnswerResp()), SLOT(releaseAndAnswerErr(const QDBusError&)), HANGUP_TIMEOUT); } void OfonoVoiceCallManager::holdAndAnswer() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "HoldAndAnswer"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(holdAndAnswerResp()), SLOT(holdAndAnswerErr(const QDBusError&)), HOLD_TIMEOUT); } void OfonoVoiceCallManager::privateChat(const QString &call) { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "PrivateChat"); QListarg; arg.append(qVariantFromValue(QDBusObjectPath(call))); request.setArguments(arg); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(privateChatResp(const QList&)), SLOT(privateChatErr(const QDBusError&)), PRIVATE_CHAT_TIMEOUT); } void OfonoVoiceCallManager::createMultiparty() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "CreateMultiparty"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(createMultipartyResp(const QList&)), SLOT(createMultipartyErr(const QDBusError&)), CREATE_MULTIPARTY_TIMEOUT); } void OfonoVoiceCallManager::hangupMultiparty() { QDBusMessage request; request = QDBusMessage::createMethodCall("org.ofono", path(), m_if->ifname(), "HangupMultiparty"); QDBusConnection::systemBus().callWithCallback(request, this, SLOT(hangupMultipartyResp()), SLOT(hangupMultipartyErr(const QDBusError&)), HANGUP_TIMEOUT); } void OfonoVoiceCallManager::hangupMultipartyResp() { emit hangupMultipartyComplete(TRUE); } void OfonoVoiceCallManager::hangupMultipartyErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit hangupMultipartyComplete(FALSE); } void OfonoVoiceCallManager::createMultipartyResp(const QList &paths) { QStringList calls; foreach(QDBusObjectPath path, paths) calls << path.path(); emit createMultipartyComplete(TRUE, calls); } void OfonoVoiceCallManager::createMultipartyErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit createMultipartyComplete(FALSE, QStringList()); } void OfonoVoiceCallManager::privateChatResp(const QList &paths) { QStringList calls; foreach(QDBusObjectPath path, paths) calls << path.path(); emit privateChatComplete(TRUE, calls); } void OfonoVoiceCallManager::privateChatErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit privateChatComplete(FALSE, QStringList()); } void OfonoVoiceCallManager::holdAndAnswerResp() { emit holdAndAnswerComplete(TRUE); } void OfonoVoiceCallManager::holdAndAnswerErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit holdAndAnswerComplete(FALSE); } void OfonoVoiceCallManager::releaseAndAnswerResp() { emit releaseAndAnswerComplete(TRUE); } void OfonoVoiceCallManager::releaseAndAnswerErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit releaseAndAnswerComplete(FALSE); } void OfonoVoiceCallManager::swapCallsResp() { emit swapCallsComplete(TRUE); } void OfonoVoiceCallManager::swapCallsErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit swapCallsComplete(FALSE); } void OfonoVoiceCallManager::dialResp() { emit dialComplete(TRUE); } void OfonoVoiceCallManager::dialErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit dialComplete(FALSE); } void OfonoVoiceCallManager::hangupAllResp() { emit hangupAllComplete(TRUE); } void OfonoVoiceCallManager::hangupAllErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit hangupAllComplete(FALSE); } void OfonoVoiceCallManager::sendTonesResp() { emit sendTonesComplete(TRUE); } void OfonoVoiceCallManager::sendTonesErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit sendTonesComplete(FALSE); } void OfonoVoiceCallManager::transferResp() { emit transferComplete(TRUE); } void OfonoVoiceCallManager::transferErr(const QDBusError &error) { m_if->setError(error.name(), error.message()); emit transferComplete(FALSE); } QStringList OfonoVoiceCallManager::emergencyNumbers() const { return m_if->properties()["EmergencyNumbers"].value(); } void OfonoVoiceCallManager::propertyChanged(const QString &property, const QVariant &value) { if (property == "EmergencyNumbers") { emit emergencyNumbersChanged(value.value()); } } QStringList OfonoVoiceCallManager::getCalls() const { return m_calllist; } void OfonoVoiceCallManager::callAddedChanged(const QDBusObjectPath &path, const QVariantMap& /*values*/) { m_calllist << path.path(); emit callAdded(path.path()); } void OfonoVoiceCallManager::callRemovedChanged(const QDBusObjectPath &path) { m_calllist.removeAll(path.path()); emit callRemoved(path.path()); } ofono-qt-1.5+git20120419+bcf0c04/lib/ofonovoicecallmanager.h000066400000000000000000000107471174402453000231250ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * Portions of this file are Copyright (C) 2011 Intel Corporation * Contact: Shane Bryan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 OFONOVOICECALLMANAGER_H #define OFONOVOICECALLMANAGER_H #include #include #include #include #include "ofonomodeminterface.h" #include "libofono-qt_global.h" struct OfonoVoiceCallManagerStruct { QDBusObjectPath path; QVariantMap properties; }; typedef QList OfonoVoiceCallManagerList; Q_DECLARE_METATYPE(OfonoVoiceCallManagerStruct) Q_DECLARE_METATYPE(OfonoVoiceCallManagerList) //! This class is used to access oFono voice call manager API /*! * The API is documented in * http://git.kernel.org/?p=network/ofono/ofono.git;a=blob_plain;f=doc/voicecallmanager-api.txt */ class OFONO_QT_EXPORT OfonoVoiceCallManager : public OfonoModemInterface { Q_OBJECT Q_PROPERTY(QStringList emergencyNumbers READ emergencyNumbers NOTIFY emergencyNumbersChanged) public: OfonoVoiceCallManager(OfonoModem::SelectionSetting modemSetting, const QString &modemPath, QObject *parent=0); ~OfonoVoiceCallManager(); /* Properties */ QStringList emergencyNumbers() const; Q_INVOKABLE QStringList getCalls() const; public slots: void dial(const QString &number, const QString &callerid_hide); void hangupAll(); void sendTones(const QString &tonestring); void transfer(); void swapCalls(); void releaseAndAnswer(); void holdAndAnswer(); void privateChat(const QString &path); void createMultiparty(); void hangupMultiparty(); signals: void emergencyNumbersChanged(const QStringList &numbers); void callAdded(const QString &call); void callRemoved(const QString &call); void dialComplete(const bool status); void hangupAllComplete(const bool status); void sendTonesComplete(const bool status); void transferComplete(const bool status); void swapCallsComplete(const bool status); void releaseAndAnswerComplete(const bool status); void holdAndAnswerComplete(const bool status); void privateChatComplete(const bool status, const QStringList& calls); void createMultipartyComplete(const bool status, const QStringList& calls); void hangupMultipartyComplete(const bool status); void barringActive(const QString &type); void forwarded(const QString &type); private slots: void validityChanged(bool); void pathChanged(const QString& path); void propertyChanged(const QString &property, const QVariant &value); void callAddedChanged(const QDBusObjectPath &call, const QVariantMap &properties); void callRemovedChanged(const QDBusObjectPath &call); void dialResp(); void dialErr(const QDBusError &error); void hangupAllResp(); void hangupAllErr(const QDBusError &error); void sendTonesResp(); void sendTonesErr(const QDBusError &error); void transferResp(); void transferErr(const QDBusError &error); void swapCallsResp(); void swapCallsErr(const QDBusError &error); void releaseAndAnswerResp(); void releaseAndAnswerErr(const QDBusError &error); void holdAndAnswerResp(); void holdAndAnswerErr(const QDBusError &error); void privateChatResp(const QList &paths); void privateChatErr(const QDBusError &error); void createMultipartyResp(const QList &paths); void createMultipartyErr(const QDBusError &error); void hangupMultipartyResp(); void hangupMultipartyErr(const QDBusError &error); private: QStringList getCallList(); void connectDbusSignals(const QString& path); private: QStringList m_calllist; }; #endif /* !OFONOVOICECALLMANAGER_H */ ofono-qt-1.5+git20120419+bcf0c04/ofono-qt.pro000066400000000000000000000006541174402453000201310ustar00rootroot00000000000000include(version.pri) TEMPLATE = subdirs CONFIG += ordered SUBDIRS += lib tests dox.target = doc dox.commands = sed 's/@VERSION@/'$$VERSION'/' doxygen.cfg.in > doxygen.cfg; \ doxygen doxygen.cfg dox.path = $$[QT_INSTALL_PREFIX]/share/doc/ofono-qt dox.files = doc/html dox.CONFIG = no_link dox.depends = FORCE dox.clean_commands = rm -fr doc/ dox.clean = doxygen.cfg INSTALLS += dox QMAKE_EXTRA_TARGETS += dox ofono-qt-1.5+git20120419+bcf0c04/tests/000077500000000000000000000000001174402453000170025ustar00rootroot00000000000000ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallbarring.cpp000066400000000000000000000122051174402453000240660ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoCallBarring : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoCallBarring(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoCallbarring() { QSignalSpy voiceIncomingComplete(m, SIGNAL(voiceIncomingComplete(bool, QString))); QSignalSpy voiceOutgoingComplete(m, SIGNAL(voiceOutgoingComplete(bool, QString))); QSignalSpy voiceIncomingChanged(m, SIGNAL(voiceIncomingChanged(QString))); QSignalSpy voiceOutgoingChanged(m, SIGNAL(voiceOutgoingChanged(QString))); QSignalSpy setVoiceIncomingFailed(m, SIGNAL(setVoiceIncomingFailed())); QSignalSpy setVoiceOutgoingFailed(m, SIGNAL(setVoiceOutgoingFailed())); QSignalSpy changePasswordComplete(m, SIGNAL(changePasswordComplete(bool))); QSignalSpy disableAllComplete(m, SIGNAL(disableAllComplete(bool))); QSignalSpy disableAllIncomingComplete(m, SIGNAL(disableAllIncomingComplete(bool))); QSignalSpy disableAllOutgoingComplete(m, SIGNAL(disableAllOutgoingComplete(bool))); m->requestVoiceIncoming(); QTest::qWait(1000); QCOMPARE(voiceIncomingComplete.count(), 1); QVariantList list = voiceIncomingComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("disabled")); QCOMPARE(voiceIncomingChanged.count(), 1); QCOMPARE(voiceIncomingChanged.takeFirst().at(0).toString(), QString("disabled")); m->requestVoiceOutgoing(); QTest::qWait(1000); QCOMPARE(voiceOutgoingComplete.count(), 1); list = voiceOutgoingComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("disabled")); QCOMPARE(voiceOutgoingChanged.count(), 1); QCOMPARE(voiceOutgoingChanged.takeFirst().at(0).toString(), QString("disabled")); m->setVoiceIncoming("always", "0000"); QTest::qWait(1000); QCOMPARE(setVoiceIncomingFailed.count(), 1); setVoiceIncomingFailed.takeFirst(); m->setVoiceOutgoing("always", "0000"); QTest::qWait(1000); QCOMPARE(setVoiceOutgoingFailed.count(), 1); setVoiceOutgoingFailed.takeFirst(); m->setVoiceIncoming("always", "3579"); QTest::qWait(1000); QCOMPARE(voiceIncomingChanged.count(), 1); QCOMPARE(voiceIncomingChanged.takeFirst().at(0).toString(), QString("always")); m->setVoiceOutgoing("international", "3579"); QTest::qWait(1000); QCOMPARE(voiceOutgoingChanged.count(), 1); QCOMPARE(voiceOutgoingChanged.takeFirst().at(0).toString(), QString("international")); m->disableAllIncoming("3579"); QTest::qWait(1000); QCOMPARE(disableAllIncomingComplete.count(), 1); QCOMPARE(disableAllIncomingComplete.takeFirst().at(0).toBool(), false); QCOMPARE(m->errorName(), QString("org.ofono.Error.Failed")); QCOMPARE(m->errorMessage(), QString("Operation failed")); m->disableAllOutgoing("3579"); QTest::qWait(1000); QCOMPARE(disableAllOutgoingComplete.count(), 1); QCOMPARE(disableAllOutgoingComplete.takeFirst().at(0).toBool(), false); QCOMPARE(m->errorName(), QString("org.ofono.Error.Failed")); QCOMPARE(m->errorMessage(), QString("Operation failed")); m->disableAll("3579"); QTest::qWait(1000); QCOMPARE(disableAllComplete.count(), 1); QCOMPARE(disableAllComplete.takeFirst().at(0).toBool(), true); QCOMPARE(voiceIncomingChanged.count(), 1); QCOMPARE(voiceIncomingChanged.takeFirst().at(0).toString(), QString("disabled")); QCOMPARE(voiceOutgoingChanged.count(), 1); QCOMPARE(voiceOutgoingChanged.takeFirst().at(0).toString(), QString("disabled")); m->changePassword("3579", "1234"); QTest::qWait(1000); m->changePassword("1234", "3579"); QTest::qWait(1000); QCOMPARE(changePasswordComplete.count(), 2); QCOMPARE(changePasswordComplete.takeFirst().at(0).toBool(), true); QCOMPARE(changePasswordComplete.takeFirst().at(0).toBool(), true); } void cleanupTestCase() { } private: OfonoCallBarring *m; }; QTEST_MAIN(TestOfonoCallBarring) #include "test_ofonocallbarring.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallbarring.pro000066400000000000000000000001211174402453000240760ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonocallbarring.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallforwarding.cpp000066400000000000000000000214131174402453000246050ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoCallForwarding : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoCallForwarding(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoCallForwarding() { QSignalSpy voiceUnconditionalComplete(m, SIGNAL(voiceUnconditionalComplete(bool, QString))); QSignalSpy voiceBusyComplete(m, SIGNAL(voiceBusyComplete(bool, QString))); QSignalSpy voiceNoReplyComplete(m, SIGNAL(voiceNoReplyComplete(bool, QString))); QSignalSpy voiceNoReplyTimeoutComplete(m, SIGNAL(voiceNoReplyTimeoutComplete(bool, ushort))); QSignalSpy voiceNotReachableComplete(m, SIGNAL(voiceNotReachableComplete(bool, QString))); QSignalSpy forwardingFlagOnSimComplete(m, SIGNAL(forwardingFlagOnSimComplete(bool, bool))); QSignalSpy voiceUnconditionalChanged(m, SIGNAL(voiceUnconditionalChanged(QString))); QSignalSpy voiceBusyChanged(m, SIGNAL(voiceBusyChanged(QString))); QSignalSpy voiceNoReplyChanged(m, SIGNAL(voiceNoReplyChanged(QString))); QSignalSpy voiceNoReplyTimeoutChanged(m, SIGNAL(voiceNoReplyTimeoutChanged(ushort))); QSignalSpy voiceNotReachableChanged(m, SIGNAL(voiceNotReachableChanged(QString))); QSignalSpy forwardingFlagOnSimChanged(m, SIGNAL(forwardingFlagOnSimChanged(bool))); QSignalSpy setVoiceUnconditionalFailed(m, SIGNAL(setVoiceUnconditionalFailed())); QSignalSpy setVoiceBusyFailed(m, SIGNAL(setVoiceBusyFailed())); QSignalSpy setVoiceNoReplyFailed(m, SIGNAL(setVoiceNoReplyFailed())); QSignalSpy setVoiceNoReplyTimeoutFailed(m, SIGNAL(setVoiceNoReplyTimeoutFailed())); QSignalSpy setVoiceNotReachableFailed(m, SIGNAL(setVoiceNotReachableFailed())); QSignalSpy disableAllComplete(m, SIGNAL(disableAllComplete(bool))); m->requestVoiceUnconditional(); QTest::qWait(1000); QCOMPARE(voiceUnconditionalComplete.count(), 1); QVariantList list = voiceUnconditionalComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("")); QCOMPARE(voiceUnconditionalChanged.count(), 1); QCOMPARE(voiceUnconditionalChanged.takeFirst().at(0).toString(), QString("")); m->requestVoiceBusy(); QTest::qWait(1000); QCOMPARE(voiceBusyComplete.count(), 1); list = voiceBusyComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("")); QCOMPARE(voiceBusyChanged.count(), 1); QCOMPARE(voiceBusyChanged.takeFirst().at(0).toString(), QString("")); m->requestVoiceNoReply(); QTest::qWait(1000); QCOMPARE(voiceNoReplyComplete.count(), 1); list = voiceNoReplyComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("")); QCOMPARE(voiceNoReplyChanged.count(), 1); QCOMPARE(voiceNoReplyChanged.takeFirst().at(0).toString(), QString("")); m->requestVoiceNoReplyTimeout(); QTest::qWait(1000); QCOMPARE(voiceNoReplyTimeoutComplete.count(), 1); list = voiceNoReplyTimeoutComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toUInt(), uint(20)); QCOMPARE(voiceNoReplyTimeoutChanged.count(), 1); QCOMPARE(voiceNoReplyTimeoutChanged.takeFirst().at(0).toUInt(), uint(20)); m->requestVoiceNotReachable(); QTest::qWait(1000); QCOMPARE(voiceNotReachableComplete.count(), 1); list = voiceNotReachableComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("")); QCOMPARE(voiceNotReachableChanged.count(), 1); QCOMPARE(voiceNotReachableChanged.takeFirst().at(0).toString(), QString("")); m->requestForwardingFlagOnSim(); QTest::qWait(1000); QCOMPARE(forwardingFlagOnSimComplete.count(), 1); list = forwardingFlagOnSimComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toBool(), false); QCOMPARE(forwardingFlagOnSimChanged.count(), 1); QCOMPARE(forwardingFlagOnSimChanged.takeFirst().at(0).toBool(), false); m->setVoiceUnconditional("abc"); QTest::qWait(1000); QCOMPARE(setVoiceUnconditionalFailed.count(), 1); setVoiceUnconditionalFailed.takeFirst(); m->setVoiceBusy("abc"); QTest::qWait(1000); QCOMPARE(setVoiceBusyFailed.count(), 1); setVoiceBusyFailed.takeFirst(); m->setVoiceNoReply("abc"); QTest::qWait(1000); QCOMPARE(setVoiceNoReplyFailed.count(), 1); setVoiceNoReplyFailed.takeFirst(); m->setVoiceNoReplyTimeout(-30); QTest::qWait(1000); QCOMPARE(setVoiceNoReplyTimeoutFailed.count(), 1); setVoiceNoReplyTimeoutFailed.takeFirst(); m->setVoiceNotReachable("abc"); QTest::qWait(1000); QCOMPARE(setVoiceNotReachableFailed.count(), 1); setVoiceNotReachableFailed.takeFirst(); m->setVoiceBusy("12345678"); QTest::qWait(1000); m->setVoiceNoReply("12345678"); QTest::qWait(1000); m->setVoiceNoReplyTimeout(30); QTest::qWait(1000); m->setVoiceNotReachable("12345678"); QTest::qWait(1000); m->setVoiceUnconditional("12345678"); QTest::qWait(1000); m->requestVoiceUnconditional(); QTest::qWait(1000); QCOMPARE(voiceUnconditionalComplete.count(), 1); list = voiceUnconditionalComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("12345678")); QCOMPARE(voiceUnconditionalChanged.count(), 1); QCOMPARE(voiceUnconditionalChanged.takeFirst().at(0).toString(), QString("12345678")); m->requestVoiceBusy(); QTest::qWait(1000); QCOMPARE(voiceBusyComplete.count(), 1); list = voiceBusyComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("12345678")); QCOMPARE(voiceBusyChanged.count(), 1); QCOMPARE(voiceBusyChanged.takeFirst().at(0).toString(), QString("12345678")); m->requestVoiceNoReply(); QTest::qWait(1000); QCOMPARE(voiceNoReplyComplete.count(), 1); list = voiceNoReplyComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("12345678")); QCOMPARE(voiceNoReplyChanged.count(), 1); QCOMPARE(voiceNoReplyChanged.takeFirst().at(0).toString(), QString("12345678")); m->requestVoiceNoReplyTimeout(); QTest::qWait(1000); QCOMPARE(voiceNoReplyTimeoutComplete.count(), 1); list = voiceNoReplyTimeoutComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toUInt(), uint(30)); QCOMPARE(voiceNoReplyTimeoutChanged.count(), 1); QCOMPARE(voiceNoReplyTimeoutChanged.takeFirst().at(0).toUInt(), uint(30)); m->requestVoiceNotReachable(); QTest::qWait(1000); QCOMPARE(voiceNotReachableComplete.count(), 1); list = voiceNotReachableComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("12345678")); QCOMPARE(voiceNotReachableChanged.count(), 1); QCOMPARE(voiceNotReachableChanged.takeFirst().at(0).toString(), QString("12345678")); m->disableAll("all"); QTest::qWait(1000); QCOMPARE(disableAllComplete.count(), 1); QCOMPARE(disableAllComplete.takeFirst().at(0).toBool(), true); QCOMPARE(voiceUnconditionalChanged.count(), 1); QCOMPARE(voiceUnconditionalChanged.takeFirst().at(0).toString(), QString("")); QCOMPARE(voiceBusyChanged.count(), 1); QCOMPARE(voiceBusyChanged.takeFirst().at(0).toString(), QString("")); QCOMPARE(voiceNoReplyChanged.count(), 1); QCOMPARE(voiceNoReplyChanged.takeFirst().at(0).toString(), QString("")); QCOMPARE(voiceNoReplyTimeoutChanged.count(), 1); QCOMPARE(voiceNoReplyTimeoutChanged.takeFirst().at(0).toUInt(), uint(20)); QCOMPARE(voiceNotReachableChanged.count(), 1); QCOMPARE(voiceNotReachableChanged.takeFirst().at(0).toString(), QString("")); } void cleanupTestCase() { } private: OfonoCallForwarding *m; }; QTEST_MAIN(TestOfonoCallForwarding) #include "test_ofonocallforwarding.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallforwarding.pro000066400000000000000000000001241174402453000246170ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonocallforwarding.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallmeter.cpp000066400000000000000000000041521174402453000235600ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoCallMeter : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoCallMeter(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoCallMeter() { QSignalSpy callMeterComplete(m, SIGNAL(callMeterComplete(bool, uint))); QSignalSpy callMeterChanged(m, SIGNAL(callMeterChanged(uint))); m->requestCallMeter(); QTest::qWait(1000); QCOMPARE(callMeterComplete.count(), 1); QVariantList list = callMeterComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toUInt(), uint(0)); QCOMPARE(callMeterChanged.count(), 1); QCOMPARE(callMeterChanged.takeFirst().at(0).toUInt(), uint(0)); // should also test change in call meter as a result of voice call } void cleanupTestCase() { } private: OfonoCallMeter *m; }; QTEST_MAIN(TestOfonoCallMeter) #include "test_ofonocallmeter.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallmeter.pro000066400000000000000000000001171174402453000235730ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonocallmeter.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallsettings.cpp000066400000000000000000000170611174402453000243070ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoCallSettings : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoCallSettings(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoCallSettings() { QSignalSpy callingLinePresentationComplete(m, SIGNAL(callingLinePresentationComplete(bool, QString))); QSignalSpy calledLinePresentationComplete(m, SIGNAL(calledLinePresentationComplete(bool, QString))); QSignalSpy callingNamePresentationComplete(m, SIGNAL(callingNamePresentationComplete(bool, QString))); QSignalSpy connectedLinePresentationComplete(m, SIGNAL(connectedLinePresentationComplete(bool, QString))); QSignalSpy connectedLineRestrictionComplete(m, SIGNAL(connectedLineRestrictionComplete(bool, QString))); QSignalSpy callingLineRestrictionComplete(m, SIGNAL(callingLineRestrictionComplete(bool, QString))); QSignalSpy hideCallerIdComplete(m, SIGNAL(hideCallerIdComplete(bool, QString))); QSignalSpy voiceCallWaitingComplete(m, SIGNAL(voiceCallWaitingComplete(bool, QString))); QSignalSpy callingLinePresentationChanged(m, SIGNAL(callingLinePresentationChanged(QString))); QSignalSpy calledLinePresentationChanged(m, SIGNAL(calledLinePresentationChanged(QString))); QSignalSpy callingNamePresentationChanged(m, SIGNAL(callingNamePresentationChanged(QString))); QSignalSpy connectedLinePresentationChanged(m, SIGNAL(connectedLinePresentationChanged(QString))); QSignalSpy connectedLineRestrictionChanged(m, SIGNAL(connectedLineRestrictionChanged(QString))); QSignalSpy callingLineRestrictionChanged(m, SIGNAL(callingLineRestrictionChanged(QString))); QSignalSpy hideCallerIdChanged(m, SIGNAL(hideCallerIdChanged(QString))); QSignalSpy voiceCallWaitingChanged(m, SIGNAL(voiceCallWaitingChanged(QString))); QSignalSpy setHideCallerIdFailed(m, SIGNAL(setHideCallerIdFailed())); QSignalSpy setVoiceCallWaitingFailed(m, SIGNAL(setVoiceCallWaitingFailed())); m->requestCallingLinePresentation(); QTest::qWait(5000); QCOMPARE(callingLinePresentationComplete.count(), 1); QVariantList list = callingLinePresentationComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("enabled")); QVERIFY(callingLinePresentationChanged.count() > 0); QCOMPARE(callingLinePresentationChanged.takeFirst().at(0).toString(), QString("enabled")); m->requestCalledLinePresentation(); QTest::qWait(1000); QCOMPARE(calledLinePresentationComplete.count(), 1); list = calledLinePresentationComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("enabled")); QVERIFY(calledLinePresentationChanged.count() > 0); QCOMPARE(calledLinePresentationChanged.takeFirst().at(0).toString(), QString("enabled")); m->requestCallingNamePresentation(); QTest::qWait(5000); QCOMPARE(callingNamePresentationComplete.count(), 1); list = callingNamePresentationComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("enabled")); QVERIFY(callingNamePresentationChanged.count() > 0); QCOMPARE(callingNamePresentationChanged.takeFirst().at(0).toString(), QString("enabled")); m->requestConnectedLinePresentation(); QTest::qWait(1000); QCOMPARE(connectedLinePresentationComplete.count(), 1); list = connectedLinePresentationComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("enabled")); QVERIFY(connectedLinePresentationChanged.count() > 0); QCOMPARE(connectedLinePresentationChanged.takeFirst().at(0).toString(), QString("enabled")); m->requestConnectedLineRestriction(); QTest::qWait(1000); QCOMPARE(connectedLineRestrictionComplete.count(), 1); list = connectedLineRestrictionComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("enabled")); QVERIFY(connectedLineRestrictionChanged.count() > 0); QCOMPARE(connectedLineRestrictionChanged.takeFirst().at(0).toString(), QString("enabled")); m->requestCallingLineRestriction(); QTest::qWait(1000); QCOMPARE(callingLineRestrictionComplete.count(), 1); list = callingLineRestrictionComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("on")); QVERIFY(callingLineRestrictionChanged.count() > 0); QCOMPARE(callingLineRestrictionChanged.takeFirst().at(0).toString(), QString("on")); m->requestHideCallerId(); QTest::qWait(1000); QCOMPARE(hideCallerIdComplete.count(), 1); list = hideCallerIdComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("default")); QVERIFY(hideCallerIdChanged.count() > 0); QCOMPARE(hideCallerIdChanged.takeFirst().at(0).toString(), QString("default")); m->requestVoiceCallWaiting(); QTest::qWait(1000); QCOMPARE(voiceCallWaitingComplete.count(), 1); list = voiceCallWaitingComplete.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QCOMPARE(list.at(1).toString(), QString("enabled")); QVERIFY(voiceCallWaitingChanged.count() > 0); QCOMPARE(voiceCallWaitingChanged.takeFirst().at(0).toString(), QString("enabled")); m->setHideCallerId("abc"); QTest::qWait(1000); QCOMPARE(setHideCallerIdFailed.count(), 1); setHideCallerIdFailed.takeFirst(); m->setVoiceCallWaiting("abc"); QTest::qWait(1000); QCOMPARE(setVoiceCallWaitingFailed.count(), 1); setVoiceCallWaitingFailed.takeFirst(); hideCallerIdChanged.clear(); m->setHideCallerId("enabled"); QTest::qWait(1000); m->setHideCallerId("default"); QTest::qWait(1000); QCOMPARE(hideCallerIdChanged.count(), 2); QCOMPARE(hideCallerIdChanged.takeFirst().at(0).toString(), QString("enabled")); QCOMPARE(hideCallerIdChanged.takeFirst().at(0).toString(), QString("default")); voiceCallWaitingChanged.clear(); m->setVoiceCallWaiting("disabled"); QTest::qWait(5000); m->setVoiceCallWaiting("enabled"); QTest::qWait(5000); QCOMPARE(voiceCallWaitingChanged.count(), 2); QCOMPARE(voiceCallWaitingChanged.takeFirst().at(0).toString(), QString("disabled")); QCOMPARE(voiceCallWaitingChanged.takeFirst().at(0).toString(), QString("enabled")); } void cleanupTestCase() { } private: OfonoCallSettings *m; }; QTEST_MAIN(TestOfonoCallSettings) #include "test_ofonocallsettings.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallsettings.pro000066400000000000000000000001221174402453000243130ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonocallsettings.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallvolume.cpp000066400000000000000000000062011174402453000237500ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * Author: Arun Ravindran * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoCallVolume : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoCallVolume(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoCallVolume() { QSignalSpy mutedChanged(m, SIGNAL(mutedChanged(const bool))); QSignalSpy speakerVolumeChanged(m, SIGNAL(speakerVolumeChanged(const quint8))); QSignalSpy microphoneVolumeChanged(m, SIGNAL(microphoneVolumeChanged(const quint8))); QSignalSpy spfail(m, SIGNAL(setSpeakerVolumeFailed())); QSignalSpy mvfail(m, SIGNAL(setMicrophoneVolumeFailed())); m->modem()->setPowered(false); QTest::qWait(5000); m->modem()->setPowered(true); QTest::qWait(5000); m->modem()->setOnline(true); QTest::qWait(5000); m->setMuted(true); QTest::qWait(2000); QCOMPARE(mutedChanged.count(), 1); QVERIFY(mutedChanged.takeFirst().at(0).toBool()==bool(true)); QVERIFY(m->muted()==bool(true)); m->setMuted(false); QTest::qWait(2000); QCOMPARE(mutedChanged.count(), 1); QVERIFY(mutedChanged.takeFirst().at(0).toBool()==bool(false)); QVERIFY(m->muted()==bool(false)); m->setSpeakerVolume(quint8(15)); QTest::qWait(2000); QCOMPARE(speakerVolumeChanged.count(), 1); QCOMPARE(quint8(speakerVolumeChanged.takeFirst().at(0).toUInt()), quint8(15)); QCOMPARE(m->speakerVolume(),quint8(15)); m->setSpeakerVolume(quint8(250)); QTest::qWait(2000); QCOMPARE(spfail.count(), 1); m->setMicrophoneVolume(quint8(10)); QTest::qWait(2000); QCOMPARE(mvfail.count(), 1); } void cleanupTestCase() { } private: OfonoCallVolume *m; }; QTEST_MAIN(TestOfonoCallVolume) #include "test_ofonocallvolume.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonocallvolume.pro000066400000000000000000000000721174402453000237660ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonocallvolume.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonoconnman.cpp000066400000000000000000000062161174402453000232440ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoConnMan : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoConnMan(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoConnMan() { QSignalSpy attch(m, SIGNAL(attachedChanged(const bool))); QSignalSpy sus(m,SIGNAL(suspendedChanged(const bool))); QSignalSpy ber(m, SIGNAL(bearerChanged(const QString&))); QSignalSpy roam(m,SIGNAL(roamingAllowedChanged(const bool))); QSignalSpy pow(m,SIGNAL(poweredChanged(const bool))); QSignalSpy add(m, SIGNAL(contextAdded(const QString&))); QSignalSpy rem(m, SIGNAL(contextRemoved(const QString&))); QSignalSpy cadd(m,SIGNAL(addContextComplete(bool, const QString&))); QSignalSpy crem(m,SIGNAL(removeContextComplete(bool))); QSignalSpy deact(m,SIGNAL(deactivateAllComplete(bool))); m->setPowered(false); QTest::qWait(5000); m->setPowered(true); QTest::qWait(5000); m->setRoamingAllowed(false); QTest::qWait(5000); m->setRoamingAllowed(true); QTest::qWait(5000); m->addContext(QString("internet")); QTest::qWait(10000); QCOMPARE(m->powered(),true); QCOMPARE(m->attached(),true); QCOMPARE(m->suspended(),false); QCOMPARE(m->roamingAllowed(),true); QCOMPARE(cadd.count(), 1); QCOMPARE(pow.count(), 2); QCOMPARE(roam.count(), 2); QCOMPARE(add.count(), 1); QString path = add.takeFirst().at(0).toString(); QString path2 = cadd.takeFirst().at(1).toString(); QCOMPARE(path, path2); m->removeContext(path); QTest::qWait(10000); QCOMPARE(rem.count(), 1); QCOMPARE(crem.count(), 1); m->deactivateAll(); QTest::qWait(5000); QCOMPARE(deact.count(), 1); } void cleanupTestCase() { } private: OfonoConnMan *m; }; QTEST_MAIN(TestOfonoConnMan) #include "test_ofonoconnman.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonoconnman.pro000066400000000000000000000000671174402453000232600ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonoconnman.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonoconnmancontext.cpp000066400000000000000000000111701174402453000246440ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include #include class TestOfonoConnmanContext : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoConnMan(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoConnmanContext () { QSignalSpy addcon(m,SIGNAL(addContextComplete(bool, const QString&))); QSignalSpy conadd(m, SIGNAL(contextAdded(const QString&))); QSignalSpy conrem(m, SIGNAL(contextRemoved(const QString&))); m->addContext("internet"); QTest::qWait(1000); QCOMPARE(addcon.count(), 1); QVariantList list = addcon.takeFirst(); QCOMPARE(list.at(0).toBool(),true); QCOMPARE(conadd.count(), 1); QString contextid = conadd.takeFirst().at(0).toString(); QCOMPARE(contextid, list.at(1).toString()); OfonoConnmanContext* context = new OfonoConnmanContext(contextid); QSignalSpy active(context, SIGNAL(activeChanged(const bool))); QSignalSpy apn(context,SIGNAL(accessPointNameChanged(const QString&))); QSignalSpy name(context, SIGNAL(nameChanged(const QString&))); QSignalSpy type (context, SIGNAL(typeChanged(const QString&))); QSignalSpy uname (context, SIGNAL(usernameChanged(const QString&))); QSignalSpy pw (context, SIGNAL(passwordChanged(const QString&))); QSignalSpy proto (context, SIGNAL(protocolChanged(const QString&))); QSignalSpy sett (context, SIGNAL(settingsChanged(const QVariantMap&))); QSignalSpy sett6 (context, SIGNAL(IPv6SettingsChanged(const QVariantMap&))); context->setAccessPointName("hyva"); QTest::qWait(5000); context->setUsername("huomenta"); QTest::qWait(5000); context->setPassword("HYVA"); QTest::qWait(5000); context->setName("yota"); QTest::qWait(5000); context->setType("mms"); QTest::qWait(5000); context->setProtocol("ipv6"); QTest::qWait(5000); context->setActive(true); QTest::qWait(10000); QCOMPARE(apn.count(),1); QCOMPARE(apn.takeFirst().at(0).toString(),QString("hyva")); QCOMPARE(uname.count(),1); QCOMPARE(uname.takeFirst().at(0).toString(),QString("huomenta")); QCOMPARE(pw.count(),1); QCOMPARE(pw.takeFirst().at(0).toString(),QString("HYVA")); QCOMPARE(name.count(),1); QCOMPARE(name.takeFirst().at(0).toString(),QString("yota")); QCOMPARE(type.count(),1); QCOMPARE(type.takeFirst().at(0).toString(),QString("mms")); QCOMPARE(sett.count(),0); QCOMPARE(sett6.count(),1); QVariantMap settings = context->IPv6Settings(); QCOMPARE(settings["Interface"].value().left(5),QString("dummy")); // "dummy" plus number QCOMPARE(proto.count(),1); QCOMPARE(proto.takeFirst().at(0).toString(),QString("ipv6")); QCOMPARE(active.count(),1); QCOMPARE(context->active(),true); context->setActive(false); QTest::qWait(5000); delete context; QTest::qWait(5000); m->removeContext(contextid); QTest::qWait(5000); QCOMPARE(active.count(),2); QCOMPARE(sett.count(),0); QCOMPARE(sett6.count(),2); QCOMPARE(conrem.count(), 1); } void cleanupTestCase() { } private: OfonoConnMan *m; }; QTEST_MAIN(TestOfonoConnmanContext) #include "test_ofonoconnmancontext.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonoconnmancontext.pro000066400000000000000000000000761174402453000246650ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonoconnmancontext.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonointerface.cpp000066400000000000000000000132771174402453000235600ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoInterface : public QObject { Q_OBJECT private slots: void initTestCase() { oi = new OfonoInterface("/phonesim", "org.ofono.Modem", OfonoGetAllOnStartup, this); if (oi->properties()["Powered"].toBool() == false) { oi->setProperty("Powered", qVariantFromValue(true)); QTest::qWait(5000); } if (oi->properties()["Online"].toBool() == false) { oi->setProperty("Online", qVariantFromValue(true)); QTest::qWait(5000); } } void testGetProperties() { QCOMPARE(oi->properties()["Manufacturer"].toString(), QString("MeeGo")); oi_async = new OfonoInterface("/phonesim", "org.ofono.Modem", OfonoGetAllOnFirstRequest, this); QCOMPARE(oi_async->properties().count(), 0); QSignalSpy spy_request(oi_async, SIGNAL(requestPropertyComplete(bool, const QString &, const QVariant &))); oi_async->requestProperty("Manufacturer"); oi_async->requestProperty("Model"); QCOMPARE(spy_request.count(), 1); QVariantList list = spy_request.takeFirst(); QCOMPARE(list[0].toBool(), false); QCOMPARE(list[1].toString(), QString("Model")); QCOMPARE(oi_async->errorMessage(), QString("Already in progress")); while (spy_request.count() != 1) { QTest::qWait(100); } list = spy_request.takeFirst(); QCOMPARE(list[0].toBool(), true); QCOMPARE(list[1].toString(), QString("Manufacturer")); QCOMPARE(list[2].value().toString(), QString("MeeGo")); oi_async->requestProperty("Model"); QCOMPARE(spy_request.count(), 1); list = spy_request.takeFirst(); QCOMPARE(list[0].toBool(), true); QCOMPARE(list[1].toString(), QString("Model")); QCOMPARE(list[2].value().toString(), QString("Synthetic Device")); oi_async->requestProperty("UnknownProperty"); while (spy_request.count() != 1) { QTest::qWait(100); } QCOMPARE(spy_request.count(), 1); list = spy_request.takeFirst(); QCOMPARE(list[0].toBool(), false); QCOMPARE(list[1].toString(), QString("UnknownProperty")); QCOMPARE(oi_async->errorMessage(), QString("Property not available")); } void testSetProperty() { QSignalSpy spy_changed(oi, SIGNAL(propertyChanged(const QString &, const QVariant &))); QSignalSpy spy_failed(oi, SIGNAL(setPropertyFailed(const QString &))); QVariantList list; bool online; bool online_found; oi->setProperty("Online", qVariantFromValue(false)); while (spy_changed.count() != 3 && spy_failed.count() == 0) { QTest::qWait(100); } QCOMPARE(spy_changed.count(), 3); QCOMPARE(spy_failed.count(), 0); online = false; online_found = false; while (spy_changed.count() > 0) { list = spy_changed.takeFirst(); if (list[0] == "Online") { online = list[1].value().toBool(); online_found = true; } } QCOMPARE(online_found, true); QCOMPARE(online, false); oi->setProperty("Online", qVariantFromValue(true)); while (spy_changed.count() < 3 && spy_failed.count() == 0) { QTest::qWait(100); } QVERIFY(spy_changed.count() > 3); QCOMPARE(spy_failed.count(), 0); online = false; online_found = false; while (spy_changed.count() > 0) { list = spy_changed.takeFirst(); if (list[0] == "Online") { online = list[1].value().toBool(); online_found = true; } } QCOMPARE(online_found, true); QCOMPARE(online, true); QTest::qWait(5000); } void testSetPropertyFailed() { QSignalSpy spy_changed(oi, SIGNAL(propertyChanged(const QString &, const QVariant &))); QSignalSpy spy_failed(oi, SIGNAL(setPropertyFailed(const QString &))); QVariantList list; oi->setProperty("Manufacturer", qVariantFromValue(QString("Nokia"))); while (spy_changed.count() == 0 && spy_failed.count() == 0) { QTest::qWait(100); } QCOMPARE(spy_changed.count(), 0); QCOMPARE(spy_failed.count(), 1); list = spy_failed.takeFirst(); QCOMPARE(list[0].toString(), QString("Manufacturer")); QCOMPARE(oi->errorName(), QString("org.ofono.Error.InvalidArguments")); QCOMPARE(oi->errorMessage(), QString("Invalid arguments in method call")); } void cleanupTestCase() { } private: OfonoInterface *oi; OfonoInterface *oi_async; }; QTEST_MAIN(TestOfonoInterface) #include "test_ofonointerface.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonointerface.pro000066400000000000000000000001171174402453000235630ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonointerface.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomessagemanager.cpp000066400000000000000000000230341174402453000245670ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include #include #include class TestOfonoMessageManager : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoMessageManager(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoMessageManager() { QSignalSpy sendMessage(m, SIGNAL(sendMessageComplete(bool, QString))); QSignalSpy messageAdded(m, SIGNAL(messageAdded(QString))); QSignalSpy messageRemoved(m, SIGNAL(messageRemoved(QString))); QSignalSpy immediateMessage(m, SIGNAL(immediateMessage(QString, QVariantMap))); QSignalSpy incomingMessage(m, SIGNAL(incomingMessage(QString, QVariantMap))); QStringList messages = m->getMessages(); QVERIFY(messages.count() == 0); m->sendMessage("99999", "success"); QTest::qWait(1000); QCOMPARE(sendMessage.count(), 1); QVariantList params = sendMessage.takeFirst(); QCOMPARE(params.at(0).toBool(), true); QString objectPath = params.at(1).value(); QVERIFY(objectPath.length() > 0); qDebug() << objectPath; QCOMPARE(messageAdded.count(), 1); QCOMPARE(messageRemoved.count(), 1); QString messageId = messageAdded.takeFirst().at(0).toString(); OfonoMessage* message = new OfonoMessage(messageId); QSignalSpy state(message, SIGNAL(stateChanged(const QString))); qDebug() << message->state(); m->sendMessage("abc", "fail"); QTest::qWait(1000); QCOMPARE(sendMessage.count(), 1); params = sendMessage.takeFirst(); QCOMPARE(params.at(0).toBool(), false); objectPath = params.at(1).value(); QVERIFY(objectPath.length() == 0); } void testOfonoMessageManagerSca() { QSignalSpy scaComplete(m, SIGNAL(serviceCenterAddressComplete(bool, QString))); m->requestServiceCenterAddress(); for (int i=0; i<30; i++) { if (scaComplete.count() > 0) break; QTest::qWait(1000); } QCOMPARE(scaComplete.count(), 1); QVariantList params = scaComplete.takeFirst(); QCOMPARE(params.at(0).toBool(), true); QString sca = params.at(1).toString(); QVERIFY(sca.length() > 0); qDebug() << sca; QSignalSpy setScaFailed(m, SIGNAL(setServiceCenterAddressFailed())); QSignalSpy scaChanged(m, SIGNAL(serviceCenterAddressChanged(QString))); m->setServiceCenterAddress("+12345678"); for (int i=0; i<30; i++) { if (setScaFailed.count() > 0 || scaChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setScaFailed.count(), 0); QCOMPARE(scaChanged.count(), 1); QCOMPARE(scaChanged.takeFirst().at(0).toString(), QString("+12345678")); m->setServiceCenterAddress(""); for (int i=0; i<30; i++) { if (setScaFailed.count() > 0 || scaChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setScaFailed.count(), 1); setScaFailed.takeFirst(); QCOMPARE(scaChanged.count(), 0); QCOMPARE(m->errorName(), QString("org.ofono.Error.InvalidFormat")); QCOMPARE(m->errorMessage(), QString("Argument format is not recognized")); m->setServiceCenterAddress(sca); for (int i=0; i<30; i++) { if (setScaFailed.count() > 0 || scaChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setScaFailed.count(), 0); QCOMPARE(scaChanged.count(), 1); QCOMPARE(scaChanged.takeFirst().at(0).toString(), sca); } void testOfonoMessageManagerUseDeliveryReports() { QSignalSpy useDeliveryReportsComplete(m, SIGNAL(useDeliveryReportsComplete(bool, bool))); QSignalSpy setUseDeliveryReportsFailed(m, SIGNAL(setUseDeliveryReportsFailed())); QSignalSpy useDeliveryReportsChanged(m, SIGNAL(useDeliveryReportsChanged(bool))); m->requestUseDeliveryReports(); for (int i=0; i<30; i++) { if (useDeliveryReportsComplete.count() > 0) break; QTest::qWait(1000); } QCOMPARE(useDeliveryReportsComplete.count(), 1); QVariantList params = useDeliveryReportsComplete.takeFirst(); QCOMPARE(params.at(0).toBool(), true); QCOMPARE(params.at(1).toBool(), false); m->setUseDeliveryReports(true); for (int i=0; i<30; i++) { if (setUseDeliveryReportsFailed.count() > 0 || useDeliveryReportsChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setUseDeliveryReportsFailed.count(), 0); QCOMPARE(useDeliveryReportsChanged.count(), 1); QCOMPARE(useDeliveryReportsChanged.takeFirst().at(0).toBool(), true); m->setUseDeliveryReports(false); for (int i=0; i<30; i++) { if (setUseDeliveryReportsFailed.count() > 0 || useDeliveryReportsChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setUseDeliveryReportsFailed.count(), 0); QCOMPARE(useDeliveryReportsChanged.count(), 1); QCOMPARE(useDeliveryReportsChanged.takeFirst().at(0).toBool(), false); } void testOfonoMessageManagerAlphabet() { QSignalSpy alphabetComplete(m, SIGNAL(alphabetComplete(bool, QString))); QSignalSpy setAlphabetFailed(m, SIGNAL(setAlphabetFailed())); QSignalSpy alphabetChanged(m, SIGNAL(alphabetChanged(QString))); m->requestAlphabet(); for (int i=0; i<30; i++) { if (alphabetComplete.count() > 0) break; QTest::qWait(1000); } QCOMPARE(alphabetComplete.count(), 1); QVariantList params = alphabetComplete.takeFirst(); QCOMPARE(params.at(0).toBool(), true); QString alphabet = params.at(1).toString(); QVERIFY(alphabet.length() > 0); QCOMPARE(alphabet, QString("default")); qDebug() << alphabet; m->setAlphabet("spanish"); for (int i=0; i<30; i++) { if (setAlphabetFailed.count() > 0 || alphabetChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setAlphabetFailed.count(), 0); QCOMPARE(alphabetChanged.count(), 1); QCOMPARE(alphabetChanged.takeFirst().at(0).toString(), QString("spanish")); m->setAlphabet(alphabet); for (int i=0; i<30; i++) { if (setAlphabetFailed.count() > 0 || alphabetChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setAlphabetFailed.count(), 0); QCOMPARE(alphabetChanged.count(), 1); QCOMPARE(alphabetChanged.takeFirst().at(0).toString(), alphabet); } void testOfonoMessageManagerBearer() { QSignalSpy bearerComplete(m, SIGNAL(bearerComplete(bool, QString))); QSignalSpy setBearerFailed(m, SIGNAL(setBearerFailed())); QSignalSpy bearerChanged(m, SIGNAL(bearerChanged(QString))); m->requestBearer(); for (int i=0; i<30; i++) { if (bearerComplete.count() > 0) break; QTest::qWait(1000); } QCOMPARE(bearerComplete.count(), 1); QVariantList params = bearerComplete.takeFirst(); QCOMPARE(params.at(0).toBool(), true); QString bearer = params.at(1).toString(); QVERIFY(bearer.length() > 0); QCOMPARE(bearer, QString("cs-preferred")); qDebug() << bearer; m->setBearer("ps-preferred"); for (int i=0; i<30; i++) { if (setBearerFailed.count() > 0 || bearerChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setBearerFailed.count(), 0); QCOMPARE(bearerChanged.count(), 1); QCOMPARE(bearerChanged.takeFirst().at(0).toString(), QString("ps-preferred")); m->setBearer(bearer); // change value for (int i=0; i<30; i++) { if (setBearerFailed.count() > 0 || bearerChanged.count() > 0) break; QTest::qWait(1000); } QCOMPARE(setBearerFailed.count(), 0); QCOMPARE(bearerChanged.count(), 1); QCOMPARE(bearerChanged.takeFirst().at(0).toString(), bearer); } void cleanupTestCase() { } private: OfonoMessageManager *m; }; QTEST_MAIN(TestOfonoMessageManager) #include "test_ofonomessagemanager.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomessagemanager.pro000066400000000000000000000001241174402453000246000ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonomessagemanager.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomessagewaiting.cpp000066400000000000000000000077621174402453000246310ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoMessageWaiting : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoMessageWaiting(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoMessageWaiting() { QSignalSpy waiting(m, SIGNAL(voicemailWaitingChanged(bool))); QSignalSpy messageCount(m, SIGNAL(voicemailMessageCountChanged(int))); QSignalSpy mailboxNumber(m, SIGNAL(voicemailMailboxNumberChanged(QString))); QSignalSpy setNumberFailed(m, SIGNAL(setVoicemailMailboxNumberFailed())); QCOMPARE(m->voicemailWaiting(), true); QCOMPARE(m->voicemailMessageCount(), 1); QCOMPARE(m->voicemailMailboxNumber(), QString("6789")); m->modem()->setOnline(false); QTest::qWait(5000); QCOMPARE(waiting.count(), 0); QCOMPARE(messageCount.count(), 0); QCOMPARE(mailboxNumber.count(), 0); QCOMPARE(setNumberFailed.count(), 0); m->modem()->setOnline(true); QTest::qWait(5000); QCOMPARE(waiting.count(), 1); QCOMPARE(waiting.takeFirst().at(0).toBool(), true); QCOMPARE(messageCount.count(), 1); QCOMPARE(messageCount.takeFirst().at(0).toInt(), 1); QCOMPARE(mailboxNumber.count(), 1); QCOMPARE(mailboxNumber.takeFirst().at(0).toString(), QString("6789")); QCOMPARE(setNumberFailed.count(), 0); } void testOfonoMessageWaitingSet() { QSignalSpy waiting(m, SIGNAL(voicemailWaitingChanged(bool))); QSignalSpy messageCount(m, SIGNAL(voicemailMessageCountChanged(int))); QSignalSpy mailboxNumber(m, SIGNAL(voicemailMailboxNumberChanged(QString))); QSignalSpy setNumberFailed(m, SIGNAL(setVoicemailMailboxNumberFailed())); QString number = m->voicemailMailboxNumber(); m->setVoicemailMailboxNumber(""); QTest::qWait(1000); QCOMPARE(waiting.count(), 0); QCOMPARE(messageCount.count(), 0); QCOMPARE(mailboxNumber.count(), 0); QCOMPARE(setNumberFailed.count(), 1); setNumberFailed.takeFirst(); m->setVoicemailMailboxNumber("1234"); QTest::qWait(1000); QCOMPARE(waiting.count(), 0); QCOMPARE(messageCount.count(), 0); QCOMPARE(mailboxNumber.count(), 1); QCOMPARE(mailboxNumber.takeFirst().at(0).toString(), QString("1234")); QCOMPARE(setNumberFailed.count(), 0); m->setVoicemailMailboxNumber(number); QTest::qWait(1000); QCOMPARE(waiting.count(), 0); QCOMPARE(messageCount.count(), 0); QCOMPARE(mailboxNumber.count(), 1); QCOMPARE(mailboxNumber.takeFirst().at(0).toString(), number); QCOMPARE(setNumberFailed.count(), 0); } void cleanupTestCase() { } private: OfonoMessageWaiting *m; }; QTEST_MAIN(TestOfonoMessageWaiting) #include "test_ofonomessagewaiting.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomessagewaiting.pro000066400000000000000000000001241174402453000246300ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonomessagewaiting.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomodem.cpp000066400000000000000000000207721174402453000227170ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoModem : public QObject { Q_OBJECT private slots: void initTestCase() { mm = new OfonoModem(OfonoModem::ManualSelect, "/phonesim", this); ma = new OfonoModem(OfonoModem::AutomaticSelect, QString(), this); if (!mm->powered()) { mm->setPowered(true); QTest::qWait(5000); } if (!mm->online()) { mm->setOnline(true); QTest::qWait(5000); } } void testOfonoModemManual() { QVERIFY(mm->isValid()); QVERIFY(mm->powered()); QVERIFY(mm->online()); QVERIFY(!mm->lockdown()); QVERIFY(!mm->emergency()); QVERIFY(mm->features().count() > 0); QVERIFY(mm->interfaces().count() > 0); QCOMPARE(mm->path(), QString("/phonesim")); QCOMPARE(mm->name(), QString()); QCOMPARE(mm->manufacturer(), QString("MeeGo")); QCOMPARE(mm->model(), QString("Synthetic Device")); QCOMPARE(mm->revision(), QString("REV1")); QCOMPARE(mm->serial(), QString("1234567890")); QCOMPARE(mm->type(), QString("hardware")); } void testOfonoModemAutomatic() { QVERIFY(ma->isValid()); QVERIFY(ma->path().length() > 1); } void testOfonoModemAddRemove() { QSignalSpy avalid(ma, SIGNAL(validityChanged(bool))); QSignalSpy valid(mm, SIGNAL(validityChanged(bool))); QSignalSpy amodemPath(ma, SIGNAL(pathChanged(QString))); QSignalSpy modemPath(mm, SIGNAL(pathChanged(QString))); qDebug() << "Please stop oFono and then start it again"; for (int i=0; i<30; i++) { if (avalid.count() == 2 && valid.count() == 1 && amodemPath.count() == 2 && modemPath.count() == 0) break; QTest::qWait(1000); } QCOMPARE(avalid.count(), 2); QCOMPARE(valid.count(), 1); QCOMPARE(amodemPath.count(), 2); QCOMPARE(modemPath.count(), 0); QCOMPARE(avalid.takeFirst().at(0).toBool(), false); QCOMPARE(avalid.takeFirst().at(0).toBool(), true); QCOMPARE(valid.takeFirst().at(0).toBool(), false); amodemPath.takeFirst(); QVERIFY(amodemPath.takeFirst().at(0).toString().length() > 1); QVERIFY(!mm->isValid()); QVERIFY(ma->isValid()); QVERIFY(ma->path().length() > 1); delete mm; mm = new OfonoModem(OfonoModem::ManualSelect, "/phonesim", this); if (!mm->powered()) { mm->setPowered(true); QTest::qWait(5000); } if (!mm->online()) { mm->setOnline(true); QTest::qWait(5000); } } void testOfonoModemPowercycle() { QSignalSpy powered(mm, SIGNAL(poweredChanged(bool))); QSignalSpy poweredFailed(mm, SIGNAL(setPoweredFailed())); QSignalSpy online(mm, SIGNAL(onlineChanged(bool))); QSignalSpy onlineFailed(mm, SIGNAL(setOnlineFailed())); QSignalSpy lockdown(mm, SIGNAL(lockdownChanged(bool))); QSignalSpy lockdownFailed(mm, SIGNAL(setLockdownFailed())); QSignalSpy emergency(mm, SIGNAL(emergencyChanged(bool))); QSignalSpy name(mm, SIGNAL(nameChanged(const QString &))); QSignalSpy manufacturer(mm, SIGNAL(manufacturerChanged(const QString &))); QSignalSpy model(mm, SIGNAL(modelChanged(const QString &))); QSignalSpy revision(mm, SIGNAL(revisionChanged(const QString &))); QSignalSpy serial(mm, SIGNAL(serialChanged(const QString &))); QSignalSpy type(mm, SIGNAL(typeChanged(const QString &))); QSignalSpy features(mm, SIGNAL(featuresChanged(const QStringList &))); QSignalSpy interfaces(mm, SIGNAL(interfacesChanged(const QStringList &))); mm->setOnline(false); QTest::qWait(5000); QCOMPARE(powered.count(), 0); QCOMPARE(poweredFailed.count(), 0); QCOMPARE(online.count(), 1); QCOMPARE(online.takeFirst().at(0).toBool(), false); QCOMPARE(onlineFailed.count(), 0); QCOMPARE(emergency.count(), 0); QCOMPARE(name.count(), 0); QCOMPARE(manufacturer.count(), 0); QCOMPARE(model.count(), 0); QCOMPARE(revision.count(), 0); QCOMPARE(serial.count(), 0); QCOMPARE(type.count(), 0); QCOMPARE(features.count(), 1); QVERIFY(features.takeFirst().at(0).toStringList().count() > 0); QCOMPARE(interfaces.count(), 1); QVERIFY(interfaces.takeFirst().at(0).toStringList().count() > 0); mm->setPowered(false); QTest::qWait(5000); QCOMPARE(powered.count(), 1); QCOMPARE(powered.takeFirst().at(0).toBool(), false); QCOMPARE(poweredFailed.count(), 0); QCOMPARE(online.count(), 0); QCOMPARE(onlineFailed.count(), 0); QCOMPARE(emergency.count(), 0); QCOMPARE(name.count(), 0); QCOMPARE(manufacturer.count(), 0); QCOMPARE(model.count(), 0); QCOMPARE(revision.count(), 0); QCOMPARE(serial.count(), 0); QCOMPARE(type.count(), 0); QCOMPARE(features.count(), 1); QCOMPARE(features.takeFirst().at(0).toStringList().count(), 0); QCOMPARE(interfaces.count(), 1); QCOMPARE(interfaces.takeFirst().at(0).toStringList().count(), 0); mm->setLockdown(true); QTest::qWait(5000); QCOMPARE(lockdown.count(), 1); QCOMPARE(lockdown.takeFirst().at(0).toBool(), true); QCOMPARE(lockdownFailed.count(), 0); mm->setLockdown(false); QTest::qWait(5000); QCOMPARE(lockdown.count(), 1); QCOMPARE(lockdown.takeFirst().at(0).toBool(), false); QCOMPARE(lockdownFailed.count(), 0); mm->setOnline(true); QTest::qWait(5000); QCOMPARE(onlineFailed.count(), 1); onlineFailed.takeFirst(); mm->setPowered(true); QTest::qWait(5000); QCOMPARE(powered.count(), 1); QCOMPARE(powered.takeFirst().at(0).toBool(), true); QCOMPARE(poweredFailed.count(), 0); QCOMPARE(online.count(), 0); QCOMPARE(onlineFailed.count(), 0); QCOMPARE(emergency.count(), 0); QCOMPARE(name.count(), 0); QCOMPARE(manufacturer.count(), 1); manufacturer.takeFirst(); QCOMPARE(model.count(), 1); model.takeFirst(); QCOMPARE(revision.count(), 1); revision.takeFirst(); QCOMPARE(serial.count(), 1); serial.takeFirst(); QCOMPARE(type.count(), 0); QVERIFY(features.count() > 0); QVERIFY(features.takeLast().at(0).toStringList().count() > 0); features.clear(); QVERIFY(interfaces.count() > 0); QVERIFY(interfaces.takeLast().at(0).toStringList().count() > 0); interfaces.clear(); mm->setOnline(true); QTest::qWait(5000); QCOMPARE(powered.count(), 0); QCOMPARE(poweredFailed.count(), 0); QCOMPARE(online.count(), 1); QCOMPARE(online.takeFirst().at(0).toBool(), true); QCOMPARE(onlineFailed.count(), 0); QCOMPARE(emergency.count(), 0); QCOMPARE(name.count(), 0); QCOMPARE(manufacturer.count(), 0); QCOMPARE(model.count(), 0); QCOMPARE(revision.count(), 0); QCOMPARE(serial.count(), 0); QCOMPARE(type.count(), 0); QVERIFY(features.count() > 0); QVERIFY(features.takeLast().at(0).toStringList().count() > 0); QVERIFY(interfaces.count() > 0); QVERIFY(interfaces.takeLast().at(0).toStringList().count() > 0); } void cleanupTestCase() { } private: OfonoModem *mm; OfonoModem *ma; }; QTEST_MAIN(TestOfonoModem) #include "test_ofonomodem.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomodem.pro000066400000000000000000000000641174402453000227250ustar00rootroot00000000000000include(testcase.pri) SOURCES = test_ofonomodem.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomodeminterface.cpp000066400000000000000000000057151174402453000246000ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoModemInterface : public QObject { Q_OBJECT private slots: void initTestCase() { mi = new OfonoModemInterface(OfonoModem::ManualSelect, "/phonesim", "org.ofono.NetworkRegistration", OfonoGetAllOnStartup, this); QCOMPARE(mi->modem()->isValid(), true); if (!mi->modem()->powered()) { mi->modem()->setPowered(true); QTest::qWait(5000); } if (!mi->modem()->online()) { mi->modem()->setOnline(true); QTest::qWait(5000); } } void testOfonoModemInterfaceOnlineOfflineModem() { QSignalSpy validity(mi, SIGNAL(validityChanged(bool))); QCOMPARE(mi->isValid(), true); mi->modem()->setOnline(false); QTest::qWait(5000); QCOMPARE(validity.count(), 1); QCOMPARE(validity.takeFirst().at(0).toBool(), false); mi->modem()->setOnline(true); QTest::qWait(5000); QCOMPARE(validity.count(), 1); QCOMPARE(validity.takeFirst().at(0).toBool(), true); } void testOfonoModemInterfaceAddRemoveModem() { QSignalSpy validity(mi, SIGNAL(validityChanged(bool))); qDebug() << "Please stop oFono and then start it again"; for (int i=0; i<30; i++) { if (validity.count() > 0) break; QTest::qWait(1000); } QCOMPARE(validity.count(), 1); QCOMPARE(validity.takeFirst().at(0).toBool(), false); delete mi; QTest::qWait(10000); mi = new OfonoModemInterface(OfonoModem::ManualSelect, "/phonesim", "org.ofono.NetworkRegistration", OfonoGetAllOnStartup, this); if (!mi->modem()->powered()) { mi->modem()->setPowered(true); QTest::qWait(5000); } if (!mi->modem()->online()) { mi->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(validity.count(), 0); } void cleanupTestCase() { } private: OfonoModemInterface *mi; }; QTEST_MAIN(TestOfonoModemInterface) #include "test_ofonomodeminterface.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomodeminterface.pro000066400000000000000000000000751174402453000246100ustar00rootroot00000000000000include(testcase.pri) SOURCES = test_ofonomodeminterface.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomodemmanager.cpp000066400000000000000000000040511174402453000242420ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include #include class TestOfonoModemManager : public QObject { Q_OBJECT private slots: void initTestCase() { mm = new OfonoModemManager(this); } void testOfonoModemManager() { QVERIFY(mm->modems().contains("/phonesim") == true); } void testOfonoModemManagerAddRemove() { QSignalSpy add(mm, SIGNAL(modemAdded(const QString &))); QSignalSpy remove(mm, SIGNAL(modemRemoved(const QString &))); qDebug() << "Please stop oFono and then start it again"; for (int i=0; i<30; i++) { if (add.count() > 0 && remove.count() > 0) break; QTest::qWait(1000); } QVERIFY(mm->modems().contains("/phonesim") == true); OfonoModem *m = new OfonoModem(OfonoModem::ManualSelect, "/phonesim", this); m->setPowered(true); QTest::qWait(5000); m->setOnline(true); QTest::qWait(5000); QVERIFY(remove.count() > 0); QVERIFY(add.count() > 0); } void cleanupTestCase() { } private: OfonoModemManager *mm; }; QTEST_MAIN(TestOfonoModemManager) #include "test_ofonomodemmanager.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomodemmanager.pro000066400000000000000000000001221174402453000242530ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonomodemmanager.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomultipartycall.cpp000066400000000000000000000316621174402453000246640ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * Portions of this file are Copyright (C) 2011 Intel Corporation * Contact: Shane Bryan * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include #include class TestOfonoMultipartyCall : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoVoiceCallManager(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoMultipartyCalls() { // Test for hangupMultiparty(): // 1. Dial a call // 2. Receive a call (dial "199" to trigger phonesim callback) // 3. Combine into multiparty call (2 participants) // 4. Verify createMultiparty() works as expected // 5. Put multiparty call on hold // 6. Dial a 3rd call // 7. Combine into multiparty call (3 participants) // 8. Split one call off to "private chat" // 9. Verify privateChat() works as expected // 10. Hangup multiparty call // 11. Verify hangupMultiparty() works as expected // 12. Hangup all calls QVariantList variantList; // VoiceCallManager Spy's QSignalSpy dialreg(m,SIGNAL(dialComplete(bool))); QSignalSpy dspy(m, SIGNAL(callAdded(QString))); QSignalSpy rspy(m, SIGNAL(callRemoved(QString))); QSignalSpy haspy(m, SIGNAL(hangupAllComplete(bool))); QSignalSpy haaspy(m, SIGNAL(holdAndAnswerComplete(bool))); QSignalSpy cmspy(m, SIGNAL(createMultipartyComplete(bool, QStringList))); QSignalSpy hmspy(m, SIGNAL(hangupMultipartyComplete(bool))); QSignalSpy scspy(m, SIGNAL(swapCallsComplete(bool))); QSignalSpy pcspy(m, SIGNAL(privateChatComplete(bool, QStringList))); // 1. Dial a call (outgoing) m->dial("123",""); QTest::qWait(1000); QCOMPARE(dialreg.count(), 1); QCOMPARE(dialreg.takeFirst().at(0).toBool(),true); QCOMPARE(dspy.count(), 1); QString c1id = dspy.takeFirst().at(0).toString(); OfonoVoiceCall* c1 = new OfonoVoiceCall(c1id); QSignalSpy c1state(c1, SIGNAL(stateChanged(const QString))); QSignalSpy c1discreason(c1,SIGNAL(disconnectReason(const QString))); QSignalSpy c1li (c1, SIGNAL(lineIdentificationChanged(QString))); QSignalSpy c1name (c1, SIGNAL(nameChanged(QString))); QSignalSpy c1info (c1, SIGNAL(informationChanged(QString))); QSignalSpy c1mp (c1, SIGNAL(multipartyChanged(bool))); QSignalSpy c1em (c1, SIGNAL(emergencyChanged(bool))); QSignalSpy c1st (c1, SIGNAL(startTimeChanged(QString))); QSignalSpy c1ic (c1, SIGNAL(iconChanged(quint8))); qDebug() << "Please find a call in 'Dialing' state in phonesim window and press 'Active' button"; QTest::qWait(15000); // - new call should have a state change, and be in "active" state QVERIFY(c1state.count()>0); QVERIFY(c1st.count()>0); QVERIFY(c1ic.count()==0); QVERIFY(c1em.count()==0); QVERIFY(c1mp.count()==0); QVERIFY(c1info.count()==0); QVERIFY(c1name.count()==0); QVERIFY(c1li.count()==0); QCOMPARE(c1->state(),QString("active")); QCOMPARE(c1->lineIdentification(),QString("123")); QCOMPARE(c1->emergency(),false); QCOMPARE(c1->multiparty(),false); QCOMPARE(c1->name(),QString("")); QCOMPARE(c1->information(),QString("")); // 2. Receive a call // - dial "199" to trigger phonesim callback m->dial("199",""); QTest::qWait(8000); QCOMPARE(dialreg.count(), 1); QCOMPARE(dialreg.takeFirst().at(0).toBool(),false); QCOMPARE(dspy.count(),1); QString c2id = dspy.takeFirst().at(0).toString(); OfonoVoiceCall* c2 = new OfonoVoiceCall(c2id); QSignalSpy c2state(c2, SIGNAL(stateChanged(const QString))); QSignalSpy c2time(c2,SIGNAL(startTimeChanged(const QString))); QSignalSpy c2discreason(c2,SIGNAL(disconnectReason(const QString))); QSignalSpy c2li (c2, SIGNAL(lineIdentificationChanged(QString))); QSignalSpy c2name (c2, SIGNAL(nameChanged(QString))); QSignalSpy c2info (c2, SIGNAL(informationChanged(QString))); QSignalSpy c2mp (c2, SIGNAL(multipartyChanged(bool))); QSignalSpy c2em (c2, SIGNAL(emergencyChanged(bool))); QSignalSpy c2ic (c2, SIGNAL(iconChanged(quint8))); QTest::qWait(3000); QCOMPARE(c2->state(),QString("waiting")); // - accept incoming call, placing first call on hold m->holdAndAnswer(); QTest::qWait(1000); QCOMPARE(haaspy.count(),1); QCOMPARE(haaspy.takeFirst().at(0).toBool(),true); QTest::qWait(3000); // - call #1 should be in "held" state QVERIFY(c1state.count()>0); QCOMPARE(c1->state(),QString("held")); // - call #2 should be in "active" state QVERIFY(c2state.count()>0); QCOMPARE(c2->state(),QString("active")); QCOMPARE(c2->lineIdentification(),QString("1234567")); QVERIFY(c2time.count()>0); QVERIFY(c2ic.count()==0); QVERIFY(c2em.count()==0); QVERIFY(c2mp.count()==0); QVERIFY(c2info.count()==0); QVERIFY(c2name.count()==0); QVERIFY(c2li.count()==0); // 3. Combine into multiparty call (2 participants) m->createMultiparty(); QTest::qWait(1000); QCOMPARE(cmspy.count(),1); variantList = cmspy.takeFirst(); QCOMPARE(variantList.at(0).toBool(),true); QVERIFY(variantList.at(1).toStringList().length() > 0); QTest::qWait(3000); // 4. Verify createMultiparty() works as expected // - call #1 should have a stateChanged signal triggered QVERIFY(c1state.count()>0); // - both calls should have a multipartyChanged signal triggered, // be in "active" state and have multiparty property set to "true" QVERIFY(c1mp.count()>0); QVERIFY(c2mp.count()>0); QCOMPARE(c1->state(),QString("active")); QCOMPARE(c2->state(),QString("active")); QCOMPARE(c1->multiparty(),true); QCOMPARE(c2->multiparty(),true); // 5. Put multiparty call on hold m->swapCalls(); QTest::qWait(1000); QCOMPARE(scspy.count(),1); QCOMPARE(scspy.takeFirst().at(0).toBool(),true); QTest::qWait(3000); // - both calls should have a stateChanged signal triggered // and be in "held" state QVERIFY(c1state.count()>0); QVERIFY(c2state.count()>0); QCOMPARE(c1->state(),QString("held")); QCOMPARE(c2->state(),QString("held")); // 6. Dial a 3rd call m->dial("456",""); QTest::qWait(1000); QCOMPARE(dialreg.count(), 1); QCOMPARE(dialreg.takeFirst().at(0).toBool(),true); QCOMPARE(dspy.count(), 1); QString c3id = dspy.takeFirst().at(0).toString(); OfonoVoiceCall* c3 = new OfonoVoiceCall(c3id); QSignalSpy c3state(c3, SIGNAL(stateChanged(const QString))); QSignalSpy c3discreason(c3,SIGNAL(disconnectReason(const QString))); QSignalSpy c3li (c3, SIGNAL(lineIdentificationChanged(QString))); QSignalSpy c3name (c3, SIGNAL(nameChanged(QString))); QSignalSpy c3info (c3, SIGNAL(informationChanged(QString))); QSignalSpy c3mp (c3, SIGNAL(multipartyChanged(bool))); QSignalSpy c3em (c3, SIGNAL(emergencyChanged(bool))); QSignalSpy c3st (c3, SIGNAL(startTimeChanged(QString))); QSignalSpy c3ic (c3, SIGNAL(iconChanged(quint8))); qDebug() << "Please find a call in 'Dialing' state in phonesim window and press 'Active' button"; QTest::qWait(15000); // - 3rd call should have a state change, and be in "active" state QVERIFY(c3state.count()>0); QVERIFY(c3st.count()>0); QVERIFY(c3ic.count()==0); QVERIFY(c3em.count()==0); QVERIFY(c3mp.count()==0); QVERIFY(c3info.count()==0); QVERIFY(c3name.count()==0); QVERIFY(c3li.count()==0); QCOMPARE(c3->state(),QString("active")); QCOMPARE(c3->lineIdentification(),QString("456")); QCOMPARE(c3->emergency(),false); QCOMPARE(c3->multiparty(),false); QCOMPARE(c3->name(),QString("")); QCOMPARE(c3->information(),QString("")); // 7. Combine into multiparty call (3 participants) m->createMultiparty(); QTest::qWait(1000); QCOMPARE(cmspy.count(),1); variantList = cmspy.takeFirst(); QCOMPARE(variantList.at(0).toBool(),true); QVERIFY(variantList.at(1).toStringList().length() > 0); QTest::qWait(3000); // - calls #1 and #2 should have a stateChanged signal triggered QVERIFY(c1state.count()>0); QVERIFY(c2state.count()>0); // - all calls should have a multipartyChanged signal triggered, // be in "active" state and have multiparty property set to "true" QVERIFY(c1mp.count()>0); QVERIFY(c2mp.count()>0); QVERIFY(c3mp.count()>0); QCOMPARE(c1->state(),QString("active")); QCOMPARE(c2->state(),QString("active")); QCOMPARE(c3->state(),QString("active")); QCOMPARE(c1->multiparty(),true); QCOMPARE(c2->multiparty(),true); QCOMPARE(c3->multiparty(),true); // 8. Split call #1 off to "private chat" m->privateChat(c1id); QTest::qWait(1000); QCOMPARE(pcspy.count(),1); variantList = pcspy.takeFirst(); QCOMPARE(variantList.at(0).toBool(),true); QVERIFY(variantList.at(1).toStringList().length() > 0); QTest::qWait(3000); // 9. Verify privateChat() works as expected // - call #1 should have a multipartyChanged signal triggered, // it's multiparty property set to false and be in "active" state QVERIFY(c1mp.count()>0); QCOMPARE(c1->multiparty(),false); QCOMPARE(c1->state(),QString("active")); // - calls #2 and #3 should have a stateChanged signal triggered // and be back in "held" state QVERIFY(c2state.count()>0); QVERIFY(c3state.count()>0); QCOMPARE(c2->state(),QString("held")); QCOMPARE(c3->state(),QString("held")); // 10. Hangup multiparty call m->hangupMultiparty(); QTest::qWait(1000); QCOMPARE(hmspy.count(), 1); QCOMPARE(hmspy.takeFirst().at(0).toBool(),true); QTest::qWait(3000); // 11. Verify hangupMultiparty() works as expected // - two calls should have been removed QVERIFY(rspy.count()==2); QString r2id = rspy.takeFirst().at(0).toString(); QString r3id = rspy.takeFirst().at(0).toString(); QCOMPARE(r2id,c2id); QCOMPARE(r3id,c3id); // - call #1 should still be in "active" state QCOMPARE(c1->state(),QString("active")); // - calls #2 and #3 should have a stateChanged signal triggered // and have a disconnect reason of "local" QVERIFY(c2state.count()>0); QVERIFY(c3state.count()>0); QCOMPARE(c2discreason.count(), 1); QCOMPARE(c3discreason.count(), 1); QCOMPARE(c2discreason.takeFirst().at(0).toString(), QString("local")); QCOMPARE(c3discreason.takeFirst().at(0).toString(), QString("local")); // 12. Hangup all calls m->hangupAll(); QTest::qWait(1000); QCOMPARE(haspy.count(), 1); QCOMPARE(haspy.takeFirst().at(0).toBool(),true); QTest::qWait(3000); QCOMPARE(c1discreason.count(), 1); QCOMPARE(c1discreason.takeFirst().at(0).toString(), QString("local")); delete c1; delete c2; delete c3; } void cleanupTestCase() { } private: OfonoVoiceCallManager *m; }; QTEST_MAIN(TestOfonoMultipartyCall) #include "test_ofonomultipartycall.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonomultipartycall.pro000066400000000000000000000000761174402453000246750ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonomultipartycall.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofononetworkoperator.cpp000066400000000000000000000104031174402453000250510ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include #include class TestOfonoNetworkOperator : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoNetworkRegistration(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoNetworkOperator() { QSignalSpy scan(m, SIGNAL(scanComplete(bool, QStringList))); m->scan(); QTest::qWait(5000); QCOMPARE(scan.count(), 1); QVariantList scanList = scan.takeFirst(); QCOMPARE(scanList.at(0).toBool(), true); QStringList opIdList = scanList.at(1).toStringList(); QVERIFY(opIdList.count() > 0); QList opList; foreach(QString opId, opIdList) { opList << OfonoNetworkOperator(opId); } int op1 = -1; int op2 = -1; foreach(OfonoNetworkOperator op, opList) { if (op1 == -1 && op.status() == "current") op1 = opList.indexOf(op); if (op2 == -1 && op.status() == "available") op2 = opList.indexOf(op); } QVERIFY(op1 != -1); QVERIFY(op2 != -1); QVERIFY(opList[op1].name().length() > 0); QVERIFY(opList[op2].name().length() > 0); QVERIFY(opList[op1].mcc().length() > 0); QVERIFY(opList[op2].mcc().length() > 0); QVERIFY(opList[op1].mnc().length() > 0); QVERIFY(opList[op2].mnc().length() > 0); QVERIFY(opList[op1].technologies().count() > 0); QVERIFY(opList[op2].technologies().count() > 0); QSignalSpy op1Register(&opList[op1], SIGNAL(registerComplete(bool))); QSignalSpy op2Register(&opList[op2], SIGNAL(registerComplete(bool))); QSignalSpy op1Status(&opList[op1], SIGNAL(statusChanged(QString))); QSignalSpy op2Status(&opList[op2], SIGNAL(statusChanged(QString))); QSignalSpy mode(m, SIGNAL(modeChanged(QString))); QSignalSpy status(m, SIGNAL(statusChanged(QString))); QSignalSpy lac(m, SIGNAL(locationAreaCodeChanged(uint))); QSignalSpy cellId(m, SIGNAL(cellIdChanged(uint))); QSignalSpy mcc(m, SIGNAL(mccChanged(QString))); QSignalSpy mnc(m, SIGNAL(mncChanged(QString))); QSignalSpy tech(m, SIGNAL(technologyChanged(QString))); QSignalSpy name(m, SIGNAL(nameChanged(QString))); QSignalSpy strength(m, SIGNAL(strengthChanged(uint))); QSignalSpy base(m, SIGNAL(baseStationChanged(QString))); opList[op2].registerOp(); QTest::qWait(5000); opList[op1].registerOp(); QTest::qWait(5000); QCOMPARE(op1Register.count(), 1); QCOMPARE(op1Register.takeFirst().at(0).toBool(), true); QCOMPARE(op2Register.count(), 1); QCOMPARE(op2Register.takeFirst().at(0).toBool(), true); QCOMPARE(op1Status.count(), 2); QCOMPARE(op1Status.takeFirst().at(0).toString(), QString("available")); QCOMPARE(op1Status.takeFirst().at(0).toString(), QString("current")); QCOMPARE(op2Status.count(), 2); QCOMPARE(op2Status.takeFirst().at(0).toString(), QString("current")); QCOMPARE(op2Status.takeFirst().at(0).toString(), QString("available")); QCOMPARE(mcc.count(), 2); QCOMPARE(mnc.count(), 2); QCOMPARE(name.count(), 2); } void cleanupTestCase() { } private: OfonoNetworkRegistration *m; }; QTEST_MAIN(TestOfonoNetworkOperator) #include "test_ofononetworkoperator.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofononetworkoperator.pro000066400000000000000000000001251174402453000250670ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofononetworkoperator.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofononetworkregistration.cpp000066400000000000000000000076531174402453000257450ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoNetworkRegistration : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoNetworkRegistration(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoNetworkRegistration() { QSignalSpy mode(m, SIGNAL(modeChanged(QString))); QSignalSpy status(m, SIGNAL(statusChanged(QString))); QSignalSpy lac(m, SIGNAL(locationAreaCodeChanged(uint))); QSignalSpy cellId(m, SIGNAL(cellIdChanged(uint))); QSignalSpy mcc(m, SIGNAL(mccChanged(QString))); QSignalSpy mnc(m, SIGNAL(mncChanged(QString))); QSignalSpy tech(m, SIGNAL(technologyChanged(QString))); QSignalSpy name(m, SIGNAL(nameChanged(QString))); QSignalSpy strength(m, SIGNAL(strengthChanged(uint))); QSignalSpy base(m, SIGNAL(baseStationChanged(QString))); QSignalSpy registerS(m, SIGNAL(registerComplete(bool))); QSignalSpy scan(m, SIGNAL(scanComplete(bool, QStringList))); QSignalSpy getOp(m, SIGNAL(getOperatorsComplete(bool, QStringList))); QVERIFY(m->mode().length() > 0); QCOMPARE(m->status(), QString("registered")); QCOMPARE(m->mcc(), QString("234")); QCOMPARE(m->mnc(), QString("01")); QVERIFY(m->name().length() > 0); QCOMPARE(m->strength(), uint(100)); m->scan(); QTest::qWait(5000); QCOMPARE(scan.count(), 1); QVariantList scanList = scan.takeFirst(); QCOMPARE(scanList.at(0).toBool(), true); QStringList scanOpList = scanList.at(1).toStringList(); QVERIFY(scanOpList.count() > 0); m->getOperators(); QTest::qWait(1000); QCOMPARE(getOp.count(), 1); QVariantList getList = getOp.takeFirst(); QCOMPARE(getList.at(0).toBool(), true); QStringList getOpList = getList.at(1).toStringList(); QVERIFY(getOpList.count() > 0); QCOMPARE(scanOpList, getOpList); m->registerOp(); QTest::qWait(5000); QCOMPARE(registerS.count(), 1); QCOMPARE(registerS.takeFirst().at(0).toBool(), true); QCOMPARE(m->mode(), QString("auto")); m->modem()->setOnline(false); QTest::qWait(5000); QCOMPARE(m->isValid(), false); m->modem()->setOnline(true); QTest::qWait(5000); QCOMPARE(status.count(), 1); QCOMPARE(status.takeFirst().at(0).toString(), QString("registered")); QCOMPARE(mcc.count(), 1); QCOMPARE(mcc.takeFirst().at(0).toString(), QString("234")); QCOMPARE(mnc.count(), 1); QCOMPARE(mnc.takeFirst().at(0).toString(), QString("01")); QCOMPARE(name.count(), 2); QVERIFY(name.takeFirst().at(0).toString().length() > 0); QVERIFY(name.takeFirst().at(0).toString().length() > 0); QCOMPARE(strength.count(), 1); QCOMPARE(strength.takeFirst().at(0).toUInt(), uint(100)); } void cleanupTestCase() { } private: OfonoNetworkRegistration *m; }; QTEST_MAIN(TestOfonoNetworkRegistration) #include "test_ofononetworkregistration.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofononetworkregistration.pro000066400000000000000000000001311174402453000257430ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofononetworkregistration.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonophonebook.cpp000066400000000000000000000037431174402453000236010ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoPhonebook : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoPhonebook(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoPhonebook() { QSignalSpy import(m, SIGNAL(importComplete(bool, QString))); m->import(); for (int i=0; i<30; i++) { if (import.count() > 0) break; QTest::qWait(1000); } QCOMPARE(import.count(), 1); QVariantList list = import.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QVERIFY(list.at(1).toStringList().length() > 0); } void cleanupTestCase() { } private: OfonoPhonebook *m; }; QTEST_MAIN(TestOfonoPhonebook) #include "test_ofonophonebook.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonophonebook.pro000066400000000000000000000001171174402453000236070ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonophonebook.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonoradiosettings.cpp000066400000000000000000000037141174402453000244720ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoRadioSettings : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoRadioSettings(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } qDebug() << "FIXME: radio settings interface is not supported by AT modems, and consequently, phonesim"; QCOMPARE(m->isValid(), true); } void testOfonoRadioSettings() { QSignalSpy preference(m, SIGNAL(technologyPreferenceChanged(QString))); QSignalSpy setPreferenceFailed(m, SIGNAL(setTechnologyPreferenceFailed())); qDebug() << "technologyPreference():" << m->technologyPreference(); } void cleanupTestCase() { } private: OfonoRadioSettings *m; }; QTEST_MAIN(TestOfonoRadioSettings) #include "test_ofonoradiosettings.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonoradiosettings.pro000066400000000000000000000001231174402453000244770ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonoradiosettings.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonosimmanager.cpp000066400000000000000000000216011174402453000237310ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include #include class TestOfonoSimManager : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoSimManager(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoSimManager() { QSignalSpy presence(m, SIGNAL(presenceChanged(bool))); QSignalSpy subscriberIdentity(m, SIGNAL(subscriberIdentityChanged(QString))); QSignalSpy mcc(m, SIGNAL(mobileCountryCodeChanged(QString))); QSignalSpy mnc(m, SIGNAL(mobileNetworkCodeChanged(QString))); QSignalSpy subscriberNumbers(m, SIGNAL(subscriberNumbersChanged(QStringList))); QSignalSpy serviceNumbers(m, SIGNAL(serviceNumbersChanged(OfonoServiceNumbers))); QSignalSpy pinRequired(m, SIGNAL(pinRequiredChanged(QString))); QSignalSpy lockedPins(m, SIGNAL(lockedPinsChanged(QStringList))); QSignalSpy cardIdentifier(m, SIGNAL(cardIdentifierChanged(QString))); QSignalSpy preferredLanguages(m, SIGNAL(preferredLanguagesChanged(QStringList))); QSignalSpy fixedDialing(m, SIGNAL(fixedDialingChanged(bool))); QSignalSpy barredDialing(m, SIGNAL(barredDialingChanged(bool))); QSignalSpy setSubscriberNumbersFailed(m, SIGNAL(setSubscriberNumbersFailed())); QSignalSpy changePin(m, SIGNAL(changePinComplete(bool))); QSignalSpy enterPin(m, SIGNAL(enterPinComplete(bool))); QSignalSpy resetPin(m, SIGNAL(resetPinComplete(bool))); QSignalSpy lockPin(m, SIGNAL(lockPinComplete(bool))); QSignalSpy unlockPin(m, SIGNAL(unlockPinComplete(bool))); QCOMPARE(m->present(), true); QCOMPARE(m->subscriberIdentity(), QString("246813579")); QCOMPARE(m->mobileCountryCode(), QString("246")); QCOMPARE(m->mobileNetworkCode(), QString("81")); QVERIFY(m->subscriberNumbers().count() > 0); QCOMPARE(m->subscriberNumbers()[0], QString("358501234567")); QVERIFY(m->serviceNumbers().count() > 0); QCOMPARE(m->serviceNumbers()[".HELP DESK"], QString("2601")); QCOMPARE(m->pinRequired(), QString("none")); QCOMPARE(m->lockedPins().count(), 0); QCOMPARE(m->cardIdentifier(), QString("8949222074451242066")); QVERIFY(m->preferredLanguages().count() > 0); QCOMPARE(m->preferredLanguages()[0], QString("de")); QCOMPARE(m->pinRetries().count(), 0); QCOMPARE(m->fixedDialing(), false); QCOMPARE(m->barredDialing(), false); QStringList numbers = m->subscriberNumbers(); QStringList newNumbers; newNumbers << "1234567"; m->setSubscriberNumbers(newNumbers); QTest::qWait(1000); QCOMPARE(subscriberNumbers.count(), 1); QStringList newNumbersSignal = subscriberNumbers.takeFirst().at(0).toStringList(); QCOMPARE(newNumbersSignal.count(), 1); QCOMPARE(newNumbersSignal, newNumbers); newNumbers.clear(); newNumbers << ""; m->setSubscriberNumbers(newNumbers); QTest::qWait(1000); QCOMPARE(setSubscriberNumbersFailed.count(), 1); setSubscriberNumbersFailed.takeFirst(); m->setSubscriberNumbers(numbers); QTest::qWait(1000); QCOMPARE(subscriberNumbers.count(), 1); newNumbersSignal = subscriberNumbers.takeFirst().at(0).toStringList(); QCOMPARE(newNumbersSignal.count(), 1); QCOMPARE(newNumbersSignal, numbers); //SIM hotswap is not testable with phonesim, so we simulate a modem reset m->modem()->setOnline(false); QTest::qWait(5000); m->modem()->setPowered(false); QTest::qWait(5000); m->modem()->setPowered(true); QTest::qWait(5000); m->modem()->setOnline(true); QTest::qWait(5000); QCOMPARE(presence.count(), 0); QCOMPARE(subscriberIdentity.count(), 1); QCOMPARE(subscriberIdentity.takeFirst().at(0).toString(), QString("246813579")); QCOMPARE(mcc.count(), 1); QCOMPARE(mcc.takeFirst().at(0).toString(), QString("246")); QCOMPARE(mnc.count(), 1); QCOMPARE(mnc.takeFirst().at(0).toString(), QString("81")); QCOMPARE(subscriberNumbers.count(), 1); numbers = subscriberNumbers.takeFirst().at(0).toStringList(); QCOMPARE(numbers.count(), 1); QCOMPARE(numbers[0], QString("358501234567")); QCOMPARE(serviceNumbers.count(), 1); OfonoServiceNumbers serviceNumbersMap = serviceNumbers.takeFirst().at(0).value(); QVERIFY(serviceNumbersMap.count() > 0); QCOMPARE(serviceNumbersMap[".HELP DESK"], QString("2601")); QCOMPARE(pinRequired.count(), 0); QCOMPARE(lockedPins.count(), 0); QCOMPARE(cardIdentifier.count(), 1); QCOMPARE(cardIdentifier.takeFirst().at(0).toString(), QString("8949222074451242066")); QCOMPARE(preferredLanguages.count(), 1); QStringList languages = preferredLanguages.takeFirst().at(0).toStringList(); QVERIFY(languages.count() > 0); QCOMPARE(languages[0], QString("de")); QCOMPARE(fixedDialing.count(), 0); QCOMPARE(barredDialing.count(), 0); } void testOfonoSimManagerPin() { QSignalSpy presence(m, SIGNAL(presenceChanged(bool))); QSignalSpy subscriberIdentity(m, SIGNAL(subscriberIdentityChanged(QString))); QSignalSpy mcc(m, SIGNAL(mobileCountryCodeChanged(QString))); QSignalSpy mnc(m, SIGNAL(mobileNetworkCodeChanged(QString))); QSignalSpy subscriberNumbers(m, SIGNAL(subscriberNumbersChanged(QStringList))); QSignalSpy serviceNumbers(m, SIGNAL(serviceNumbersChanged(OfonoServiceNumbers))); QSignalSpy pinRequired(m, SIGNAL(pinRequiredChanged(QString))); QSignalSpy lockedPins(m, SIGNAL(lockedPinsChanged(QStringList))); QSignalSpy cardIdentifier(m, SIGNAL(cardIdentifierChanged(QString))); QSignalSpy preferredLanguages(m, SIGNAL(preferredLanguagesChanged(QStringList))); QSignalSpy pinRetries(m, SIGNAL(pinRetriesChanged(OfonoPinRetries))); QSignalSpy changePin(m, SIGNAL(changePinComplete(bool))); QSignalSpy enterPin(m, SIGNAL(enterPinComplete(bool))); QSignalSpy resetPin(m, SIGNAL(resetPinComplete(bool))); QSignalSpy lockPin(m, SIGNAL(lockPinComplete(bool))); QSignalSpy unlockPin(m, SIGNAL(unlockPinComplete(bool))); m->lockPin("pin", "2468"); QTest::qWait(1000); m->changePin("pin", "2468", "1234"); QTest::qWait(1000); m->changePin("pin", "1234", "2468"); QTest::qWait(1000); // entering and resetting PIN is not possible with phonesim's default config m->enterPin("pin", "2468"); QTest::qWait(1000); m->resetPin("puk", "13243546", "2468"); QTest::qWait(1000); m->unlockPin("pin", "2468"); QTest::qWait(1000); QCOMPARE(lockedPins.count(), 2); QCOMPARE(lockedPins.takeFirst().at(0).toStringList().count(), 1); QCOMPARE(lockedPins.takeFirst().at(0).toStringList().count(), 0); QCOMPARE(lockPin.count(), 1); QCOMPARE(lockPin.takeFirst().at(0).toBool(), true); QCOMPARE(unlockPin.count(), 1); QCOMPARE(unlockPin.takeFirst().at(0).toBool(), true); QCOMPARE(changePin.count(), 2); QCOMPARE(changePin.takeFirst().at(0).toBool(), true); QCOMPARE(changePin.takeFirst().at(0).toBool(), true); QCOMPARE(enterPin.count(), 1); QCOMPARE(enterPin.takeFirst().at(0).toBool(), false); QCOMPARE(resetPin.count(), 1); QCOMPARE(resetPin.takeFirst().at(0).toBool(), false); // entering PIN is not possible with phonesim's default config QCOMPARE(pinRetries.count(), 0); } void testOfonoSimManagerIcon() { QSignalSpy getIcon(m, SIGNAL(getIconComplete(bool, QByteArray))); m->getIcon(0); QTest::qWait(1000); m->getIcon(1); QTest::qWait(1000); QCOMPARE(getIcon.count(), 2); QCOMPARE(getIcon.takeFirst().at(0).toBool(), false); QVariantList list = getIcon.takeFirst(); QCOMPARE(list.at(0).toBool(), true); QVERIFY(list.at(1).toByteArray().length() > 0); } void cleanupTestCase() { } private: OfonoSimManager *m; }; QTEST_MAIN(TestOfonoSimManager) #include "test_ofonosimmanager.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonosimmanager.pro000066400000000000000000000001201174402453000237400ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonosimmanager.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonosupplementaryservices.cpp000066400000000000000000000133551174402453000262710ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoSupplementaryServices : public QObject { Q_OBJECT public slots: private slots: void initTestCase() { m = new OfonoSupplementaryServices(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoSupplementaryServices() { QSignalSpy notification(m, SIGNAL(notificationReceived(QString))); QSignalSpy request(m, SIGNAL(requestReceived(QString))); QSignalSpy state(m, SIGNAL(stateChanged(QString))); QSignalSpy initiateUSSD(m, SIGNAL(initiateUSSDComplete(QString))); QSignalSpy barring(m, SIGNAL(barringComplete(QString, QString, QVariantMap))); QSignalSpy forwarding(m, SIGNAL(forwardingComplete(QString, QString, QVariantMap))); QSignalSpy waiting(m, SIGNAL(waitingComplete(QString, QVariantMap))); QSignalSpy callingLinePresentation(m, SIGNAL(callingLinePresentationComplete(QString, QString))); QSignalSpy connectedLinePresentation(m, SIGNAL(connectedLinePresentationComplete(QString, QString))); QSignalSpy callingLineRestriction(m, SIGNAL(callingLineRestrictionComplete(QString, QString))); QSignalSpy connectedLineRestriction(m, SIGNAL(connectedLineRestrictionComplete(QString, QString))); QSignalSpy initiateFailed(m, SIGNAL(initiateFailed())); QSignalSpy respond(m, SIGNAL(respondComplete(bool, QString))); QSignalSpy cancel(m, SIGNAL(cancelComplete(bool))); QCOMPARE(m->state(), QString("idle")); m->initiate("*225#"); QTest::qWait(1000); QCOMPARE(state.count(), 2); QCOMPARE(state.takeFirst().at(0).toString(), QString("active")); QCOMPARE(state.takeFirst().at(0).toString(), QString("idle")); QCOMPARE(initiateUSSD.count(), 1); QCOMPARE(initiateUSSD.takeFirst().at(0).toString(), QString("Thank you, your request is being processed. A message will be sent to your phone.")); m->cancel(); QTest::qWait(1000); QCOMPARE(cancel.count(), 1); QCOMPARE(cancel.takeFirst().at(0).toBool(), false); m->respond("*225#"); QTest::qWait(1000); QCOMPARE(respond.count(), 1); QCOMPARE(respond.takeFirst().at(0).toBool(), false); m->initiate("*226#"); QTest::qWait(1000); QCOMPARE(state.count(), 2); QCOMPARE(state.takeFirst().at(0).toString(), QString("active")); QCOMPARE(state.takeFirst().at(0).toString(), QString("idle")); QCOMPARE(initiateFailed.count(), 1); initiateFailed.takeFirst(); m->initiate("*#331#"); QTest::qWait(1000); QCOMPARE(barring.count(), 1); QVariantList list = barring.takeFirst(); QCOMPARE(list.at(0).toString(), QString("interrogation")); QCOMPARE(list.at(1).toString(), QString("InternationalOutgoing")); QVariantMap map = list.at(2).toMap(); QCOMPARE(map.count(), 3); QCOMPARE(map["DataInternationalOutgoing"].toString(), QString("disabled")); m->initiate("*#002**11#"); QTest::qWait(1000); QCOMPARE(forwarding.count(), 1); list = forwarding.takeFirst(); QCOMPARE(list.at(0).toString(), QString("interrogation")); QCOMPARE(list.at(1).toString(), QString("All")); map = list.at(2).toMap(); QCOMPARE(map.count(), 5); QCOMPARE(map["VoiceNoReplyTimeout"].toUInt(), uint(20)); m->initiate("*#43#"); QTest::qWait(5000); QCOMPARE(waiting.count(), 1); list = waiting.takeFirst(); QCOMPARE(list.at(0).toString(), QString("interrogation")); map = list.at(1).toMap(); QCOMPARE(map.count(), 5); QCOMPARE(map["DataAsyncCallWaiting"].toString(), QString("disabled")); m->initiate("*#31#"); QTest::qWait(1000); QCOMPARE(callingLineRestriction.count(), 1); list = callingLineRestriction.takeFirst(); QCOMPARE(list.at(0).toString(), QString("interrogation")); QCOMPARE(list.at(1).toString(), QString("disabled")); m->initiate("*#30#"); QTest::qWait(1000); QCOMPARE(callingLinePresentation.count(), 1); list = callingLinePresentation.takeFirst(); QCOMPARE(list.at(0).toString(), QString("interrogation")); QCOMPARE(list.at(1).toString(), QString("enabled")); m->initiate("*#76#"); QTest::qWait(1000); QCOMPARE(connectedLinePresentation.count(), 1); list = connectedLinePresentation.takeFirst(); QCOMPARE(list.at(0).toString(), QString("interrogation")); QCOMPARE(list.at(1).toString(), QString("enabled")); m->initiate("*#77#"); QTest::qWait(1000); QCOMPARE(connectedLineRestriction.count(), 1); list = connectedLineRestriction.takeFirst(); QCOMPARE(list.at(0).toString(), QString("interrogation")); QCOMPARE(list.at(1).toString(), QString("enabled")); } void cleanupTestCase() { } private: OfonoSupplementaryServices *m; }; QTEST_MAIN(TestOfonoSupplementaryServices) #include "test_ofonosupplementaryservices.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonosupplementaryservices.pro000066400000000000000000000001331174402453000262750ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonosupplementaryservices.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonovoicecall.cpp000066400000000000000000000163731174402453000235610ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include #include class TestOfonoVoiceCall : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoVoiceCallManager(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoVoiceCall() { QSignalSpy dialreg(m,SIGNAL(dialComplete(bool))); QSignalSpy dspy(m, SIGNAL(callAdded(QString))); // Dial and hangup m->dial("123",""); QTest::qWait(1000); QCOMPARE(dialreg.count(), 1); QCOMPARE(dialreg.takeFirst().at(0).toBool(),true); QCOMPARE(dspy.count(), 1); QString callid = dspy.takeFirst().at(0).toString(); OfonoVoiceCall* call = new OfonoVoiceCall(callid); QSignalSpy state(call, SIGNAL(stateChanged(const QString))); QSignalSpy discreason(call,SIGNAL(disconnectReason(const QString))); QSignalSpy hspy(call, SIGNAL(hangupComplete(bool))); QSignalSpy li (call, SIGNAL(lineIdentificationChanged(QString))); QSignalSpy name (call, SIGNAL(nameChanged(QString))); QSignalSpy info (call, SIGNAL(informationChanged(QString))); QSignalSpy mp (call, SIGNAL(multipartyChanged(bool))); QSignalSpy em (call, SIGNAL(emergencyChanged(bool))); QSignalSpy st (call, SIGNAL(startTimeChanged(QString))); QSignalSpy ic (call, SIGNAL(iconChanged(quint8))); qDebug() << "Please find a call in 'Dialing' state in phonesim window and press 'Active' button"; QTest::qWait(15000); QVERIFY(state.count()>0); QVERIFY(st.count()>0); QVERIFY(ic.count()==0); QVERIFY(em.count()==0); QVERIFY(mp.count()==0); QVERIFY(info.count()==0); QVERIFY(name.count()==0); QVERIFY(li.count()==0); QCOMPARE(call->state(),QString("active")); QCOMPARE(call->lineIdentification(),QString("123")); QCOMPARE(call->emergency(),false); QCOMPARE(call->multiparty(),false); QCOMPARE(call->name(),QString("")); QCOMPARE(call->information(),QString("")); call->hangup(); QTest::qWait(5000); QCOMPARE(hspy.count(), 1); QCOMPARE(hspy.takeFirst().at(0).toBool(),true); QCOMPARE(discreason.count(), 1); QCOMPARE(discreason.takeFirst().at(0).toString(), QString("local")); delete call; } void testOfonoVoiceCallStep2() { //Dial failure, incoming, answer and local hangup QSignalSpy callsignal(m, SIGNAL(callAdded(const QString))); m->dial("199",""); QTest::qWait(8000); QCOMPARE(callsignal.count(),1); QString callid = callsignal.takeFirst().at(0).toString(); OfonoVoiceCall* call = new OfonoVoiceCall(callid); QSignalSpy state(call, SIGNAL(stateChanged(const QString))); QSignalSpy time(call,SIGNAL(startTimeChanged(const QString))); QSignalSpy discreason(call,SIGNAL(disconnectReason(const QString))); QSignalSpy hspy(call, SIGNAL(hangupComplete(bool))); QSignalSpy aspy(call, SIGNAL(answerComplete(bool))); QSignalSpy li (call, SIGNAL(lineIdentificationChanged(QString))); QSignalSpy name (call, SIGNAL(nameChanged(QString))); QSignalSpy info (call, SIGNAL(informationChanged(QString))); QSignalSpy mp (call, SIGNAL(multipartyChanged(bool))); QSignalSpy em (call, SIGNAL(emergencyChanged(bool))); QSignalSpy ic (call, SIGNAL(iconChanged(quint8))); QTest::qWait(8000); QCOMPARE(call->state(),QString("incoming")); call->answer(); QTest::qWait(10000); QVERIFY(state.count()>0); QCOMPARE(call->lineIdentification(),QString("1234567")); //PhoneSim specific value QVERIFY(time.count()>0); QCOMPARE(aspy.count(), 1); QCOMPARE(aspy.takeFirst().at(0).toBool(),true); QVERIFY(ic.count()==0); QVERIFY(em.count()==0); QVERIFY(mp.count()==0); QVERIFY(info.count()==0); QVERIFY(name.count()==0); QVERIFY(li.count()==0); call->hangup(); QTest::qWait(5000); QCOMPARE(hspy.count(), 1); QCOMPARE(hspy.takeFirst().at(0).toBool(), true); QCOMPARE(discreason.count(), 1); QCOMPARE(discreason.takeFirst().at(0).toString(), QString("local")); delete call; } void testOfonoVoiceCallStep3() { //Dial failed, incoming, no answer and state change to disconnect QSignalSpy callsignal(m, SIGNAL(callAdded(const QString))); m->dial("177",""); QTest::qWait(3000); QCOMPARE(callsignal.count(),1); QString callid = callsignal.takeFirst().at(0).toString(); OfonoVoiceCall* call = new OfonoVoiceCall(callid); QSignalSpy state(call, SIGNAL(stateChanged(const QString))); QSignalSpy discreason(call,SIGNAL(disconnectReason(const QString))); QTest::qWait(1000); QCOMPARE(call->state(),QString("incoming")); QTest::qWait(8000); QVERIFY(state.count()>0); QCOMPARE(discreason.count(), 1); QCOMPARE(discreason.takeFirst().at(0).toString(), QString("remote")); delete call; } void testOfonoVoiceCallStep4() { //Deflect QSignalSpy callsignal(m, SIGNAL(callAdded(const QString))); m->dial("199",""); QTest::qWait(8000); QCOMPARE(callsignal.count(),1); QString callid = callsignal.takeFirst().at(0).toString(); OfonoVoiceCall* call = new OfonoVoiceCall(callid); QSignalSpy dfspy(call, SIGNAL(deflectComplete(bool))); QTest::qWait(8000); QCOMPARE(call->state(),QString("incoming")); QCOMPARE(call->lineIdentification(),QString("1234567")); //PhoneSim specific value call->deflect("2345"); QTest::qWait(8000); QCOMPARE(dfspy.count(), 1); QCOMPARE(dfspy.takeFirst().at(0).toBool(), true); QTest::qWait(10000); delete call; } void cleanupTestCase() { } private: OfonoVoiceCallManager *m; }; QTEST_MAIN(TestOfonoVoiceCall) #include "test_ofonovoicecall.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonovoicecall.pro000066400000000000000000000000711174402453000235630ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonovoicecall.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonovoicecallmanager.cpp000066400000000000000000000077551174402453000251200ustar00rootroot00000000000000/* * This file is part of ofono-qt * * Copyright (C) 2010-2011 Nokia Corporation and/or its subsidiary(-ies). * * Contact: Alexander Kanavin * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation. * * 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 #include class TestOfonoVoiceCallManager : public QObject { Q_OBJECT private slots: void initTestCase() { m = new OfonoVoiceCallManager(OfonoModem::ManualSelect, "/phonesim", this); QCOMPARE(m->modem()->isValid(), true); if (!m->modem()->powered()) { m->modem()->setPowered(true); QTest::qWait(5000); } if (!m->modem()->online()) { m->modem()->setOnline(true); QTest::qWait(5000); } QCOMPARE(m->isValid(), true); } void testOfonoVoiceCallManager() { QVERIFY(m->emergencyNumbers().count() > 0); QSignalSpy emergencyNumbers(m, SIGNAL(emergencyNumbersChanged(QStringList))); QSignalSpy dialreg(m,SIGNAL(dialComplete(bool))); QSignalSpy dspy(m, SIGNAL(callAdded(QString))); QSignalSpy hupreg(m,SIGNAL(hangupAllComplete(bool))); QSignalSpy tonereg(m,SIGNAL(sendTonesComplete(bool))); QSignalSpy hspy(m, SIGNAL(callRemoved(QString))); m->modem()->setPowered(false); QTest::qWait(5000); m->modem()->setPowered(true); QTest::qWait(5000); m->modem()->setOnline(true); QTest::qWait(5000); QCOMPARE(emergencyNumbers.count(), 1); QVERIFY(emergencyNumbers.takeFirst().at(0).toStringList().count() > 0); //Dial testing m->dial("123",""); qDebug() << "Please find a call in 'Dialing' state in phonesim window and press 'Active' button"; QTest::qWait(15000); QCOMPARE(dialreg.count(), 1); QCOMPARE(dialreg.takeFirst().at(0).toBool(),true); QCOMPARE(dspy.count(), 1); //Tones testing QTest::qWait(5000); m->sendTones("1234"); QTest::qWait(5000); QCOMPARE(tonereg.count(), 1); QCOMPARE(tonereg.takeFirst().at(0).toBool(),true); QTest::qWait(5000); QStringList calls = m->getCalls(); QVERIFY(calls.size()>0); //hangup testing m->hangupAll(); QTest::qWait(5000); QCOMPARE(hupreg.count(), 1); QCOMPARE(hupreg.takeFirst().at(0).toBool(),true); QCOMPARE(hspy.count(), 1); } void testoFonoVoiceCallManagerStep2() { // test dial failure and hangup of incoming alerting call QSignalSpy dialreg(m,SIGNAL(dialComplete(bool))); QSignalSpy hupreg(m,SIGNAL(hangupAllComplete(bool))); QSignalSpy dspy(m, SIGNAL(callAdded(QString))); QSignalSpy hspy(m, SIGNAL(callRemoved(QString))); m->dial("199",""); QTest::qWait(5000); QCOMPARE(dialreg.count(), 1); QCOMPARE(dialreg.takeFirst().at(0).toBool(),false); QTest::qWait(10000); QCOMPARE(dspy.count(), 1); //hangup the alerting call m->hangupAll(); QTest::qWait(5000); QCOMPARE(hupreg.count(), 1); QCOMPARE(hupreg.takeFirst().at(0).toBool(),true); QTest::qWait(10000); QCOMPARE(hspy.count(), 1); } void cleanupTestCase() { } private: OfonoVoiceCallManager *m; }; QTEST_MAIN(TestOfonoVoiceCallManager) #include "test_ofonovoicecallmanager.moc" ofono-qt-1.5+git20120419+bcf0c04/tests/test_ofonovoicecallmanager.pro000066400000000000000000000001261174402453000251170ustar00rootroot00000000000000include(testcase.pri) SOURCES += test_ofonovoicecallmanager.cpp ofono-qt-1.5+git20120419+bcf0c04/tests/testcase.pri000066400000000000000000000002571174402453000213350ustar00rootroot00000000000000CONFIG += testcase QT = core testlib dbus INCLUDEPATH += ../lib ../ LIBS += -L ../lib -lofono-qt target.path = $$[QT_INSTALL_PREFIX]/lib/libofono-qt/tests INSTALLS += target ofono-qt-1.5+git20120419+bcf0c04/tests/tests.pro000066400000000000000000000015361174402453000206730ustar00rootroot00000000000000TEMPLATE = subdirs SUBDIRS += test_ofonointerface.pro SUBDIRS += test_ofonomodemmanager.pro SUBDIRS += test_ofonomodem.pro SUBDIRS += test_ofonomodeminterface.pro SUBDIRS += test_ofonophonebook.pro SUBDIRS += test_ofonomessagewaiting.pro SUBDIRS += test_ofonomessagemanager.pro SUBDIRS += test_ofonoradiosettings.pro SUBDIRS += test_ofonosimmanager.pro SUBDIRS += test_ofonocallbarring.pro SUBDIRS += test_ofonocallforwarding.pro SUBDIRS += test_ofonocallmeter.pro SUBDIRS += test_ofonocallsettings.pro SUBDIRS += test_ofononetworkoperator.pro SUBDIRS += test_ofononetworkregistration.pro SUBDIRS += test_ofonosupplementaryservices.pro SUBDIRS += test_ofonovoicecallmanager.pro SUBDIRS += test_ofonovoicecall.pro SUBDIRS += test_ofonocallvolume.pro SUBDIRS += test_ofonoconnman.pro SUBDIRS += test_ofonoconnmancontext.pro SUBDIRS += test_ofonomultipartycall.pro ofono-qt-1.5+git20120419+bcf0c04/version.pri000066400000000000000000000000161174402453000200360ustar00rootroot00000000000000VERSION = 1.5