Source init for master branch.
authorCuong Le <metacuong@gmail.com>
Tue, 23 Aug 2011 12:07:08 +0000 (19:07 +0700)
committerCuong Le <metacuong@gmail.com>
Tue, 23 Aug 2011 12:07:08 +0000 (19:07 +0700)
87 files changed:
Licence.txt [new file with mode: 0644]
LichViet.desktop [new file with mode: 0644]
LichViet.png [new file with mode: 0644]
LichViet.pro [new file with mode: 0644]
LichViet.pro.user [new file with mode: 0644]
LichViet.svg [new file with mode: 0644]
Makefile [new file with mode: 0644]
lichviet.qrc [new file with mode: 0644]
lunarcalendar.cpp [new file with mode: 0644]
lunarcalendar.h [new file with mode: 0644]
main.cpp [new file with mode: 0644]
qml/DatePicker/Licence.txt [new file with mode: 0644]
qml/DatePicker/component/Button.qml [new file with mode: 0644]
qml/DatePicker/component/DateReel.qml [new file with mode: 0644]
qml/DatePicker/component/Reel.qml [new file with mode: 0644]
qml/DatePicker/component/gfx/button.png [new file with mode: 0644]
qml/DatePicker/component/gfx/button_pressed.png [new file with mode: 0644]
qml/LichViet/About.qml [new file with mode: 0644]
qml/LichViet/AmDateTimeDialog.qml [new file with mode: 0644]
qml/LichViet/Button.qml [new file with mode: 0644]
qml/LichViet/DateTimeDialog.qml [new file with mode: 0644]
qml/LichViet/FullMonth.qml [new file with mode: 0644]
qml/LichViet/MenuScreen.qml [new file with mode: 0644]
qml/LichViet/MultiTitleBar.qml [new file with mode: 0644]
qml/LichViet/NoFeatureDialog.qml [new file with mode: 0644]
qml/LichViet/OptionsScreen.qml [new file with mode: 0644]
qml/LichViet/Settings.js [new file with mode: 0644]
qml/LichViet/Switch.qml [new file with mode: 0644]
qml/LichViet/Themes.js [new file with mode: 0644]
qml/LichViet/TitleBar.qml [new file with mode: 0644]
qml/LichViet/ToolBar.qml [new file with mode: 0644]
qml/LichViet/ToolBarSingle.qml [new file with mode: 0644]
qml/LichViet/TopBar.qml [new file with mode: 0644]
qml/LichViet/XemNgayTotXauHoangDao.qml [new file with mode: 0644]
qml/LichViet/amlich-aa98.js [new file with mode: 0644]
qml/LichViet/amlich-hnd.js [new file with mode: 0644]
qml/LichViet/img/background.jpg [new file with mode: 0644]
qml/LichViet/img/button_active.png [new file with mode: 0644]
qml/LichViet/img/gloss.png [new file with mode: 0644]
qml/LichViet/img/lineedit.png [new file with mode: 0644]
qml/LichViet/img/lineedit.sci [new file with mode: 0644]
qml/LichViet/img/loading.png [new file with mode: 0644]
qml/LichViet/img/quit-back.png [new file with mode: 0644]
qml/LichViet/img/quit.png [new file with mode: 0644]
qml/LichViet/img/quit_pressed.png [new file with mode: 0644]
qml/LichViet/img/stripes.png [new file with mode: 0644]
qml/LichViet/img/switch_off.png [new file with mode: 0644]
qml/LichViet/img/switch_on.png [new file with mode: 0644]
qml/LichViet/img/titlebar.png [new file with mode: 0644]
qml/LichViet/img/titlebar.sci [new file with mode: 0644]
qml/LichViet/img/toolbutton-back.png [new file with mode: 0644]
qml/LichViet/img/toolbutton.png [new file with mode: 0644]
qml/LichViet/img/toolbutton.sci [new file with mode: 0644]
qml/LichViet/img/toolbutton_pressed.png [new file with mode: 0644]
qml/LichViet/img/toolbutton_pressed.sci [new file with mode: 0644]
qml/LichViet/img/topbar.jpg [new file with mode: 0644]
qml/LichViet/main.qml [new file with mode: 0644]
qml/LichViet/xemngaytotxau.js [new file with mode: 0644]
qmlapplicationviewer/qmlapplicationviewer.cpp [new file with mode: 0644]
qmlapplicationviewer/qmlapplicationviewer.h [new file with mode: 0644]
qmlapplicationviewer/qmlapplicationviewer.pri [new file with mode: 0644]
qtc_packaging/debian_fremantle/README [new file with mode: 0644]
qtc_packaging/debian_fremantle/changelog [new file with mode: 0644]
qtc_packaging/debian_fremantle/compat [new file with mode: 0644]
qtc_packaging/debian_fremantle/control [new file with mode: 0644]
qtc_packaging/debian_fremantle/copyright [new file with mode: 0644]
qtc_packaging/debian_fremantle/rules [new file with mode: 0644]
themes/default/background.jpg [new file with mode: 0644]
themes/default/default.qml [new file with mode: 0644]
themes/default/dp_button.png [new file with mode: 0644]
themes/default/dp_button_active.png [new file with mode: 0644]
themes/default/dp_button_pressed.png [new file with mode: 0644]
themes/default/gloss.png [new file with mode: 0644]
themes/default/lineedit.png [new file with mode: 0644]
themes/default/lineedit.sci [new file with mode: 0644]
themes/default/quit.png [new file with mode: 0644]
themes/default/quit_pressed.png [new file with mode: 0644]
themes/default/stripes.png [new file with mode: 0644]
themes/default/switch_off.png [new file with mode: 0644]
themes/default/switch_on.png [new file with mode: 0644]
themes/default/titlebar.png [new file with mode: 0644]
themes/default/titlebar.sci [new file with mode: 0644]
themes/default/toolbutton-back.png [new file with mode: 0644]
themes/default/toolbutton.png [new file with mode: 0644]
themes/default/toolbutton.sci [new file with mode: 0644]
themes/default/toolbutton_pressed.png [new file with mode: 0644]
themes/default/toolbutton_pressed.sci [new file with mode: 0644]

diff --git a/Licence.txt b/Licence.txt
new file mode 100644 (file)
index 0000000..4f3d3e8
--- /dev/null
@@ -0,0 +1,278 @@
+        GNU GENERAL PUBLIC LICENSE\r
+           Version 2, June 1991\r
+\r
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.\r
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
+ Everyone is permitted to copy and distribute verbatim copies\r
+ of this license document, but changing it is not allowed.\r
+\r
+          Preamble\r
+\r
+  The licenses for most software are designed to take away your\r
+freedom to share and change it.  By contrast, the GNU General Public\r
+License is intended to guarantee your freedom to share and change free\r
+software--to make sure the software is free for all its users.  This\r
+General Public License applies to most of the Free Software\r
+Foundation's software and to any other program whose authors commit to\r
+using it.  (Some other Free Software Foundation software is covered by\r
+the GNU Lesser General Public License instead.)  You can apply it to\r
+your programs, too.\r
+\r
+  When we speak of free software, we are referring to freedom, not\r
+price.  Our General Public Licenses are designed to make sure that you\r
+have the freedom to distribute copies of free software (and charge for\r
+this service if you wish), that you receive source code or can get it\r
+if you want it, that you can change the software or use pieces of it\r
+in new free programs; and that you know you can do these things.\r
+\r
+  To protect your rights, we need to make restrictions that forbid\r
+anyone to deny you these rights or to ask you to surrender the rights.\r
+These restrictions translate to certain responsibilities for you if you\r
+distribute copies of the software, or if you modify it.\r
+\r
+  For example, if you distribute copies of such a program, whether\r
+gratis or for a fee, you must give the recipients all the rights that\r
+you have.  You must make sure that they, too, receive or can get the\r
+source code.  And you must show them these terms so they know their\r
+rights.\r
+\r
+  We protect your rights with two steps: (1) copyright the software, and\r
+(2) offer you this license which gives you legal permission to copy,\r
+distribute and/or modify the software.\r
+\r
+  Also, for each author's protection and ours, we want to make certain\r
+that everyone understands that there is no warranty for this free\r
+software.  If the software is modified by someone else and passed on, we\r
+want its recipients to know that what they have is not the original, so\r
+that any problems introduced by others will not reflect on the original\r
+authors' reputations.\r
+\r
+  Finally, any free program is threatened constantly by software\r
+patents.  We wish to avoid the danger that redistributors of a free\r
+program will individually obtain patent licenses, in effect making the\r
+program proprietary.  To prevent this, we have made it clear that any\r
+patent must be licensed for everyone's free use or not licensed at all.\r
+\r
+  The precise terms and conditions for copying, distribution and\r
+modification follow.\r
+\r
+        GNU GENERAL PUBLIC LICENSE\r
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\r
+\r
+  0. This License applies to any program or other work which contains\r
+a notice placed by the copyright holder saying it may be distributed\r
+under the terms of this General Public License.  The "Program", below,\r
+refers to any such program or work, and a "work based on the Program"\r
+means either the Program or any derivative work under copyright law:\r
+that is to say, a work containing the Program or a portion of it,\r
+either verbatim or with modifications and/or translated into another\r
+language.  (Hereinafter, translation is included without limitation in\r
+the term "modification".)  Each licensee is addressed as "you".\r
+\r
+Activities other than copying, distribution and modification are not\r
+covered by this License; they are outside its scope.  The act of\r
+running the Program is not restricted, and the output from the Program\r
+is covered only if its contents constitute a work based on the\r
+Program (independent of having been made by running the Program).\r
+Whether that is true depends on what the Program does.\r
+\r
+  1. You may copy and distribute verbatim copies of the Program's\r
+source code as you receive it, in any medium, provided that you\r
+conspicuously and appropriately publish on each copy an appropriate\r
+copyright notice and disclaimer of warranty; keep intact all the\r
+notices that refer to this License and to the absence of any warranty;\r
+and give any other recipients of the Program a copy of this License\r
+along with the Program.\r
+\r
+You may charge a fee for the physical act of transferring a copy, and\r
+you may at your option offer warranty protection in exchange for a fee.\r
+\r
+  2. You may modify your copy or copies of the Program or any portion\r
+of it, thus forming a work based on the Program, and copy and\r
+distribute such modifications or work under the terms of Section 1\r
+above, provided that you also meet all of these conditions:\r
+\r
+    a) You must cause the modified files to carry prominent notices\r
+    stating that you changed the files and the date of any change.\r
+\r
+    b) You must cause any work that you distribute or publish, that in\r
+    whole or in part contains or is derived from the Program or any\r
+    part thereof, to be licensed as a whole at no charge to all third\r
+    parties under the terms of this License.\r
+\r
+    c) If the modified program normally reads commands interactively\r
+    when run, you must cause it, when started running for such\r
+    interactive use in the most ordinary way, to print or display an\r
+    announcement including an appropriate copyright notice and a\r
+    notice that there is no warranty (or else, saying that you provide\r
+    a warranty) and that users may redistribute the program under\r
+    these conditions, and telling the user how to view a copy of this\r
+    License.  (Exception: if the Program itself is interactive but\r
+    does not normally print such an announcement, your work based on\r
+    the Program is not required to print an announcement.)\r
+\r
+These requirements apply to the modified work as a whole.  If\r
+identifiable sections of that work are not derived from the Program,\r
+and can be reasonably considered independent and separate works in\r
+themselves, then this License, and its terms, do not apply to those\r
+sections when you distribute them as separate works.  But when you\r
+distribute the same sections as part of a whole which is a work based\r
+on the Program, the distribution of the whole must be on the terms of\r
+this License, whose permissions for other licensees extend to the\r
+entire whole, and thus to each and every part regardless of who wrote it.\r
+\r
+Thus, it is not the intent of this section to claim rights or contest\r
+your rights to work written entirely by you; rather, the intent is to\r
+exercise the right to control the distribution of derivative or\r
+collective works based on the Program.\r
+\r
+In addition, mere aggregation of another work not based on the Program\r
+with the Program (or with a work based on the Program) on a volume of\r
+a storage or distribution medium does not bring the other work under\r
+the scope of this License.\r
+\r
+  3. You may copy and distribute the Program (or a work based on it,\r
+under Section 2) in object code or executable form under the terms of\r
+Sections 1 and 2 above provided that you also do one of the following:\r
+\r
+    a) Accompany it with the complete corresponding machine-readable\r
+    source code, which must be distributed under the terms of Sections\r
+    1 and 2 above on a medium customarily used for software interchange; or,\r
+\r
+    b) Accompany it with a written offer, valid for at least three\r
+    years, to give any third party, for a charge no more than your\r
+    cost of physically performing source distribution, a complete\r
+    machine-readable copy of the corresponding source code, to be\r
+    distributed under the terms of Sections 1 and 2 above on a medium\r
+    customarily used for software interchange; or,\r
+\r
+    c) Accompany it with the information you received as to the offer\r
+    to distribute corresponding source code.  (This alternative is\r
+    allowed only for noncommercial distribution and only if you\r
+    received the program in object code or executable form with such\r
+    an offer, in accord with Subsection b above.)\r
+\r
+The source code for a work means the preferred form of the work for\r
+making modifications to it.  For an executable work, complete source\r
+code means all the source code for all modules it contains, plus any\r
+associated interface definition files, plus the scripts used to\r
+control compilation and installation of the executable.  However, as a\r
+special exception, the source code distributed need not include\r
+anything that is normally distributed (in either source or binary\r
+form) with the major components (compiler, kernel, and so on) of the\r
+operating system on which the executable runs, unless that component\r
+itself accompanies the executable.\r
+\r
+If distribution of executable or object code is made by offering\r
+access to copy from a designated place, then offering equivalent\r
+access to copy the source code from the same place counts as\r
+distribution of the source code, even though third parties are not\r
+compelled to copy the source along with the object code.\r
+\r
+  4. You may not copy, modify, sublicense, or distribute the Program\r
+except as expressly provided under this License.  Any attempt\r
+otherwise to copy, modify, sublicense or distribute the Program is\r
+void, and will automatically terminate your rights under this License.\r
+However, parties who have received copies, or rights, from you under\r
+this License will not have their licenses terminated so long as such\r
+parties remain in full compliance.\r
+\r
+  5. You are not required to accept this License, since you have not\r
+signed it.  However, nothing else grants you permission to modify or\r
+distribute the Program or its derivative works.  These actions are\r
+prohibited by law if you do not accept this License.  Therefore, by\r
+modifying or distributing the Program (or any work based on the\r
+Program), you indicate your acceptance of this License to do so, and\r
+all its terms and conditions for copying, distributing or modifying\r
+the Program or works based on it.\r
+\r
+  6. Each time you redistribute the Program (or any work based on the\r
+Program), the recipient automatically receives a license from the\r
+original licensor to copy, distribute or modify the Program subject to\r
+these terms and conditions.  You may not impose any further\r
+restrictions on the recipients' exercise of the rights granted herein.\r
+You are not responsible for enforcing compliance by third parties to\r
+this License.\r
+\r
+  7. If, as a consequence of a court judgment or allegation of patent\r
+infringement or for any other reason (not limited to patent issues),\r
+conditions are imposed on you (whether by court order, agreement or\r
+otherwise) that contradict the conditions of this License, they do not\r
+excuse you from the conditions of this License.  If you cannot\r
+distribute so as to satisfy simultaneously your obligations under this\r
+License and any other pertinent obligations, then as a consequence you\r
+may not distribute the Program at all.  For example, if a patent\r
+license would not permit royalty-free redistribution of the Program by\r
+all those who receive copies directly or indirectly through you, then\r
+the only way you could satisfy both it and this License would be to\r
+refrain entirely from distribution of the Program.\r
+\r
+If any portion of this section is held invalid or unenforceable under\r
+any particular circumstance, the balance of the section is intended to\r
+apply and the section as a whole is intended to apply in other\r
+circumstances.\r
+\r
+It is not the purpose of this section to induce you to infringe any\r
+patents or other property right claims or to contest validity of any\r
+such claims; this section has the sole purpose of protecting the\r
+integrity of the free software distribution system, which is\r
+implemented by public license practices.  Many people have made\r
+generous contributions to the wide range of software distributed\r
+through that system in reliance on consistent application of that\r
+system; it is up to the author/donor to decide if he or she is willing\r
+to distribute software through any other system and a licensee cannot\r
+impose that choice.\r
+\r
+This section is intended to make thoroughly clear what is believed to\r
+be a consequence of the rest of this License.\r
+\r
+  8. If the distribution and/or use of the Program is restricted in\r
+certain countries either by patents or by copyrighted interfaces, the\r
+original copyright holder who places the Program under this License\r
+may add an explicit geographical distribution limitation excluding\r
+those countries, so that distribution is permitted only in or among\r
+countries not thus excluded.  In such case, this License incorporates\r
+the limitation as if written in the body of this License.\r
+\r
+  9. The Free Software Foundation may publish revised and/or new versions\r
+of the General Public License from time to time.  Such new versions will\r
+be similar in spirit to the present version, but may differ in detail to\r
+address new problems or concerns.\r
+\r
+Each version is given a distinguishing version number.  If the Program\r
+specifies a version number of this License which applies to it and "any\r
+later version", you have the option of following the terms and conditions\r
+either of that version or of any later version published by the Free\r
+Software Foundation.  If the Program does not specify a version number of\r
+this License, you may choose any version ever published by the Free Software\r
+Foundation.\r
+\r
+  10. If you wish to incorporate parts of the Program into other free\r
+programs whose distribution conditions are different, write to the author\r
+to ask for permission.  For software which is copyrighted by the Free\r
+Software Foundation, write to the Free Software Foundation; we sometimes\r
+make exceptions for this.  Our decision will be guided by the two goals\r
+of preserving the free status of all derivatives of our free software and\r
+of promoting the sharing and reuse of software generally.\r
+\r
+          NO WARRANTY\r
+\r
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\r
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN\r
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\r
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\r
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS\r
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE\r
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\r
+REPAIR OR CORRECTION.\r
+\r
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\r
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\r
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\r
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\r
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\r
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\r
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\r
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGES.\r
diff --git a/LichViet.desktop b/LichViet.desktop
new file mode 100644 (file)
index 0000000..5e7a48d
--- /dev/null
@@ -0,0 +1,11 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Type=Application
+Terminal=false
+Name=LichViet
+Exec=/opt/usr/bin/LichViet
+Icon=LichViet
+X-Window-Icon=
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
diff --git a/LichViet.png b/LichViet.png
new file mode 100644 (file)
index 0000000..9c47d9c
Binary files /dev/null and b/LichViet.png differ
diff --git a/LichViet.pro b/LichViet.pro
new file mode 100644 (file)
index 0000000..406941b
--- /dev/null
@@ -0,0 +1,70 @@
+VERSION = 1.0.1
+DEFINES += APP_VERSION=\\\"$$VERSION\\\"
+# Add more folders to ship with the application, here
+#folder_01.source = qml/LichViet
+#folder_01.target = qml
+#DEPLOYMENTFOLDERS = folder_01
+themes.source = themes
+themes.target = /
+DEPLOYMENTFOLDERS = themes
+
+# Additional import path used to resolve QML modules in Creator's code model
+QML_IMPORT_PATH =
+
+symbian:TARGET.UID3 = 0xE3016781
+
+# Allow network access on Symbian
+symbian:TARGET.CAPABILITY += NetworkServices
+
+# Define QMLJSDEBUGGER to allow debugging of QML in debug builds
+# (This might significantly increase build time)
+# DEFINES += QMLJSDEBUGGER
+
+# If your application uses the Qt Mobility libraries, uncomment
+# the following lines and add the respective components to the 
+# MOBILITY variable. 
+# CONFIG += mobility
+# MOBILITY +=
+
+# The .cpp file which was generated for your project. Feel free to hack it.
+SOURCES += main.cpp \
+    lunarcalendar.cpp
+
+# Please do not modify the following two lines. Required for deployment.
+include(qmlapplicationviewer/qmlapplicationviewer.pri)
+qtcAddDeployment()
+
+RESOURCES += \
+    lichviet.qrc
+
+HEADERS += \
+    lunarcalendar.h
+
+OTHER_FILES += \
+    debian/changelog \
+    debian/compat \
+    debian/control \
+    debian/copyright \
+    debian/README \
+    debian/rules \
+    qml/LichViet/FullMonth.qml \
+    qml/LichViet/Settings.js \
+    qml/LichViet/Themes.js \
+    qml/LichViet/XemNgayTotXauHoangDao.qml \
+    qml/LichViet/TopBar.qml \
+    qml/LichViet/ToolBarSingle.qml \
+    qml/LichViet/ToolBar.qml \
+    qml/LichViet/TitleBar.qml \
+    qml/LichViet/Switch.qml \
+    qml/LichViet/OptionsScreen.qml \
+    qml/LichViet/NoFeatureDialog.qml \
+    qml/LichViet/MultiTitleBar.qml \
+    qml/LichViet/MenuScreen.qml \
+    qml/LichViet/main.qml \
+    qml/LichViet/DateTimeDialog.qml \
+    qml/LichViet/Button.qml \
+    qml/LichViet/amlich-hnd.js \
+    qml/LichViet/About.qml \
+    qml/LichViet/amlich-aa98.js \
+    qml/LichViet/AmDateTimeDialog.qml \
+    qml/LichViet/xemngaytotxau.js
diff --git a/LichViet.pro.user b/LichViet.pro.user
new file mode 100644 (file)
index 0000000..e8171f3
--- /dev/null
@@ -0,0 +1,325 @@
+<!DOCTYPE QtCreatorProject>
+<qtcreator>
+ <data>
+  <variable>ProjectExplorer.Project.ActiveTarget</variable>
+  <value type="int">1</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.EditorSettings</variable>
+  <valuemap type="QVariantMap">
+   <value key="EditorConfiguration.Codec" type="QByteArray">Default</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.0</variable>
+  <valuemap type="QVariantMap">
+   <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Desktop</value>
+   <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Desktop</value>
+   <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.DesktopTarget</value>
+   <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
+   <value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
+   <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+   <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+      <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+      <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+     </valuemap>
+     <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+       <value type="QString">clean</value>
+      </valuelist>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+    <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+    <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Release</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/cuongle/Garage/LichViet-build-desktop</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">5</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+   </valuemap>
+   <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+      <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+      <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+     </valuemap>
+     <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+       <value type="QString">clean</value>
+      </valuelist>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+    <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+    <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Debug</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/cuongle/Garage/LichViet-build-desktop</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">5</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">0</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
+   <valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">0</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">No deployment</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
+   <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">LichViet</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase" type="int">2</value>
+    <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments" type="QVariantList"/>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.ProFile" type="QString">LichViet.pro</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix" type="bool">false</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal" type="bool">false</value>
+    <valuelist key="Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UserSetWorkingDirectory" type="bool">false</value>
+    <value key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory" type="QString"></value>
+    <value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
+    <value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
+    <value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Target.1</variable>
+  <valuemap type="QVariantMap">
+   <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Maemo</value>
+   <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString">Maemo</value>
+   <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Target.MaemoDeviceTarget</value>
+   <value key="ProjectExplorer.Target.ActiveBuildConfiguration" type="int">0</value>
+   <value key="ProjectExplorer.Target.ActiveDeployConfiguration" type="int">0</value>
+   <value key="ProjectExplorer.Target.ActiveRunConfiguration" type="int">0</value>
+   <valuemap key="ProjectExplorer.Target.BuildConfiguration.0" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+      <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+      <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+     </valuemap>
+     <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+       <value type="QString">clean</value>
+      </valuelist>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+    <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+    <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Release</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">0</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/cuongle/Garage/LichViet-build-maemo</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">4</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+   </valuemap>
+   <valuemap key="ProjectExplorer.Target.BuildConfiguration.1" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">qmake</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">QtProjectManager.QMakeBuildStep</value>
+      <valuelist key="QtProjectManager.QMakeBuildStep.QMakeArguments" type="QVariantList"/>
+      <value key="QtProjectManager.QMakeBuildStep.QMakeForced" type="bool">false</value>
+     </valuemap>
+     <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">false</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList"/>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Build</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Build</value>
+    </valuemap>
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.1" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Make</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MakeStep</value>
+      <value key="Qt4ProjectManager.MakeStep.Clean" type="bool">true</value>
+      <valuelist key="Qt4ProjectManager.MakeStep.MakeArguments" type="QVariantList">
+       <value type="QString">clean</value>
+      </valuelist>
+      <value key="Qt4ProjectManager.MakeStep.MakeCommand" type="QString"></value>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">1</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Clean</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Clean</value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">2</value>
+    <value key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment" type="bool">false</value>
+    <valuelist key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Debug</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.Qt4BuildConfiguration</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration" type="int">2</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory" type="QString">/home/cuongle/Garage/LichViet-build-maemo</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId" type="int">4</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.ToolChain" type="int">9</value>
+    <value key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild" type="bool">true</value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.BuildConfigurationCount" type="int">2</value>
+   <valuemap key="ProjectExplorer.Target.DeployConfiguration.0" type="QVariantMap">
+    <valuemap key="ProjectExplorer.BuildConfiguration.BuildStepList.0" type="QVariantMap">
+     <valuemap key="ProjectExplorer.BuildStepList.Step.0" type="QVariantMap">
+      <value key="Packaging Enabled" type="bool">true</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Packaging for Maemo</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoPackageCreationStep</value>
+     </valuemap>
+     <valuemap key="ProjectExplorer.BuildStepList.Step.1" type="QVariantMap">
+      <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy to Maemo device</value>
+      <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+      <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoDeployStep</value>
+      <value key="Qt4ProjectManager.MaemoRunConfiguration.DeployToSysroot" type="bool">true</value>
+      <value key="Qt4ProjectManager.MaemoRunConfiguration.DeviceId" type="qulonglong">1</value>
+      <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedFiles" type="QVariantList"/>
+      <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedHosts" type="QVariantList"/>
+      <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedRemotePaths" type="QVariantList"/>
+      <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.LastDeployedTimes" type="QVariantList"/>
+     </valuemap>
+     <value key="ProjectExplorer.BuildStepList.StepsCount" type="int">2</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy</value>
+     <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+     <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.BuildSteps.Deploy</value>
+    </valuemap>
+    <value key="ProjectExplorer.BuildConfiguration.BuildStepListCount" type="int">1</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">Deploy to Maemo device</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">ProjectExplorer.DefaultDeployConfiguration</value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.DeployConfigurationCount" type="int">1</value>
+   <valuemap key="ProjectExplorer.Target.RunConfiguration.0" type="QVariantMap">
+    <value key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName" type="QString">LichViet</value>
+    <value key="ProjectExplorer.ProjectConfiguration.DisplayName" type="QString"></value>
+    <value key="ProjectExplorer.ProjectConfiguration.Id" type="QString">Qt4ProjectManager.MaemoRunConfiguration</value>
+    <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.Arguments" type="QVariantList"/>
+    <value key="Qt4ProjectManager.MaemoRunConfiguration.BaseEnvironmentBase" type="int">1</value>
+    <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.ExportedLocalDirs" type="QVariantList"/>
+    <value key="Qt4ProjectManager.MaemoRunConfiguration.ProFile" type="QString">LichViet.pro</value>
+    <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.RemoteMountPoints" type="QVariantList"/>
+    <value key="Qt4ProjectManager.MaemoRunConfiguration.UseRemoteGdb" type="bool">false</value>
+    <valuelist key="Qt4ProjectManager.MaemoRunConfiguration.UserEnvironmentChanges" type="QVariantList"/>
+    <value key="RunConfiguration.QmlDebugServerPort" type="uint">3768</value>
+    <value key="RunConfiguration.UseCppDebugger" type="bool">true</value>
+    <value key="RunConfiguration.UseQmlDebugger" type="bool">false</value>
+   </valuemap>
+   <value key="ProjectExplorer.Target.RunConfigurationCount" type="int">1</value>
+  </valuemap>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.TargetCount</variable>
+  <value type="int">2</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.EnvironmentId</variable>
+  <value type="QString">{9e6be66c-4b64-4eb7-93c5-6d4eea5685ea}</value>
+ </data>
+ <data>
+  <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+  <value type="int">8</value>
+ </data>
+</qtcreator>
diff --git a/LichViet.svg b/LichViet.svg
new file mode 100644 (file)
index 0000000..566acfa
--- /dev/null
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   height="44px"
+   version="1.1"
+   viewBox="0 0 44 44"
+   width="44px"
+   x="0px"
+   y="0px"
+   id="svg2"
+   inkscape:version="0.47 r22583"
+   sodipodi:docname="qt.svg">
+  <metadata
+     id="metadata18">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs16">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 22 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="44 : 22 : 1"
+       inkscape:persp3d-origin="22 : 14.666667 : 1"
+       id="perspective2836" />
+  </defs>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1920"
+     inkscape:window-height="1020"
+     id="namedview14"
+     showgrid="false"
+     inkscape:zoom="21.454545"
+     inkscape:cx="49.412871"
+     inkscape:cy="21.894358"
+     inkscape:window-x="-4"
+     inkscape:window-y="-4"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="g3" />
+  <g
+     transform="matrix(0.18308778,0,0,0.18308778,6.6100946,3.2385199)"
+     id="g3">
+    <path
+       d="M 43.09,0.3586 C 40.94,0.0036 38.84,-0.0824 36.81,0.0776 31.968136,0.39505671 27.122677,0.73638425 22.28,1.0696 9.62,2.0816 0,12.4996 0,26.8896 l 0,169.7 14.19,13.2 28.87,-209.42 0.03,-0.011 z"
+       style="fill:#006225"
+       id="path5"
+       sodipodi:nodetypes="cccccccc" />
+    <path
+       d="m 174.4,160 c 0,12.5 -7.75,24.07 -17.57,25.77 L 14.23,209.73 V 25.93 C 14.23,9.21 27.57,-2.27 43.12,0.3 l 131.3,21.52 v 138.2 z"
+       style="fill:#80c342"
+       id="path7" />
+    <path
+       d="m 154.9,80.96 -12.96,-0.598 0,0.278 6.945,0.32 6.016,0 z"
+       style="fill:#006225"
+       id="path11" />
+    <path
+       d="m 144.6,135.6 c 0.66,0.328 1.43,0.476 2.351,0.476 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 h -6.015 c -1.821,0.832 -3.532,1.457 -5.176,1.848 z"
+       style="fill:#006225"
+       id="path13" />
+    <path
+       id="path17"
+       style="fill:#ffffff"
+       d="m 91.15,132.4 c 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -4.34,0 -7.68,2.535 -10.01,7.625 -2.52,5.543 -3.793,17.04 -3.793,34.44 0,16.82 1.238,28.75 3.734,35.75 2.356,6.672 5.879,9.976 10.5,9.976 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 m 17.98,3.75 c -4.117,9.707 -10.39,16.06 -18.99,19 0.867,4.449 2.176,7.441 3.922,9.019 1.351,1.211 3.433,1.821 6.222,1.821 0.805,0 1.668,-0.055 2.59,-0.157 v 13.12 l -5.961,0.782 c -1.758,0.23 -3.426,0.343 -5.004,0.343 -5.218,0 -9.445,-1.265 -12.62,-3.824 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 1.629,0 3.309,0.102 5.043,0.305 11.95,1.375 20.62,7.016 26.26,16.79 5.535,9.562 8.254,23.27 8.254,41.26 0,16.48 -2,29.45 -6.043,39.02 z M 130.4,45.91 l 11.52,1.238 0,20.21 12.96,0.914 0,12.68 -12.96,-0.598 0,46.33 c 0,4.032 0.445,6.625 1.34,7.789 0.8,1.067 2.046,1.594 3.71,1.594 0.161,0 0.329,-0.004 0.497,-0.016 2.55,-0.148 5.32,-0.933 8.343,-2.308 v 11.65 c -5.136,2.258 -10.18,3.598 -15.12,4.02 -0.718,0.055 -1.41,0.086 -2.078,0.086 -4.48,0 -7.906,-1.301 -10.25,-3.934 -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.535 L 118.046,79.25 V 65.66 l 7.586,0.547 4.773,-20.3 z" />
+    <path
+       d="m 100.3,166 c 0.809,0 1.672,-0.055 2.59,-0.157 H 98.054 C 98.73,165.949 99.507,166 100.3,166 z"
+       style="fill:#006225"
+       id="path19" />
+    <path
+       id="path21"
+       style="fill:#006225"
+       d="m 84.85,63.98 c 2.336,5.997 3.484,16.92 3.484,32.81 0,17.7 -1.16,29.57 -3.512,35.62 -1.894,4.879 -4.527,7.902 -7.863,9.07 0.965,0.368 1.992,0.551 3.078,0.551 0.207,0 0.41,-0.008 0.621,-0.019 4.633,-0.293 8.121,-3.496 10.49,-9.602 2.351,-6.051 3.511,-17.91 3.511,-35.62 0,-15.89 -1.148,-26.82 -3.484,-32.81 -2.336,-6.027 -5.832,-9.281 -10.52,-9.691 -0.359,-0.031 -0.714,-0.051 -1.058,-0.051 -1.09,0 -2.117,0.16 -3.082,0.481 h -0.004 c 3.601,1.121 6.379,4.215 8.336,9.261 z m -2.344,114.3 c -0.113,-0.05 -0.227,-0.105 -0.336,-0.16 -0.012,-0.004 -0.023,-0.012 -0.035,-0.015 -0.102,-0.051 -0.207,-0.106 -0.309,-0.157 -0.019,-0.011 -0.039,-0.019 -0.058,-0.031 -0.09,-0.051 -0.184,-0.098 -0.278,-0.148 -0.027,-0.016 -0.054,-0.036 -0.086,-0.051 -0.082,-0.043 -0.164,-0.09 -0.242,-0.137 -0.039,-0.023 -0.078,-0.047 -0.113,-0.07 -0.07,-0.039 -0.145,-0.082 -0.215,-0.125 -0.047,-0.031 -0.094,-0.059 -0.14,-0.09 -0.059,-0.039 -0.118,-0.074 -0.176,-0.113 -0.059,-0.039 -0.114,-0.075 -0.168,-0.114 -0.051,-0.031 -0.102,-0.066 -0.149,-0.097 -0.066,-0.047 -0.132,-0.094 -0.195,-0.137 -0.039,-0.027 -0.078,-0.055 -0.113,-0.082 -0.078,-0.055 -0.153,-0.113 -0.231,-0.172 -0.023,-0.016 -0.05,-0.035 -0.078,-0.055 -0.098,-0.078 -0.199,-0.156 -0.297,-0.234 -4.207,-3.379 -7.308,-9.894 -9.297,-19.54 -9.136,-1.945 -16.26,-7.754 -21.19,-17.5 -5.004,-9.902 -7.551,-24.39 -7.551,-43.34 0,-20.43 3.484,-35.51 10.34,-45.07 5.789,-8.07 13.86,-12.04 24.02,-12.04 h -6.351 c -10.15,0.008 -18.22,3.977 -24,12.04 -6.855,9.563 -10.34,24.64 -10.34,45.07 0,18.95 2.547,33.44 7.551,43.34 4.934,9.75 12.05,15.56 21.19,17.5 1.989,9.641 5.09,16.16 9.297,19.54 3.176,2.559 7.403,3.824 12.62,3.824 0.098,0 0.199,0 0.297,-0.004 h 5.539 c -3.406,-0.05 -6.383,-0.66 -8.906,-1.828 L 82.498,178.28 z M 128.4,145.6 c -2.73,-3.051 -4.09,-7.949 -4.09,-14.67 V 79.57 l -6.226,-0.285 v -13.59 h -6.016 v 3.035 c 0.871,3.273 1.555,6.82 2.063,10.64 l 4.164,0.192 v 51.36 c 0,6.723 1.367,11.62 4.09,14.67 2.343,2.633 5.765,3.934 10.25,3.934 h 6.015 c -4.48,0 -7.906,-1.301 -10.25,-3.934 z m 2.043,-99.66 -6.016,0 -4.668,19.88 5.911,0.422 4.773,-20.3 z" />
+  </g>
+</svg>
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..d533cd3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,276 @@
+#############################################################################
+# Makefile for building: LichViet
+# Generated by qmake (2.01a) (Qt 4.6.2) on: Mon Aug 8 14:03:43 2011
+# Project:  LichViet.pro
+# Template: app
+# Command: /usr/bin/qmake -unix -o Makefile LichViet.pro
+#############################################################################
+
+####### Compiler, tools and options
+
+CC            = gcc
+CXX           = g++
+DEFINES       = -DAPP_VERSION=\"1.0.1\" -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB
+CFLAGS        = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
+CXXFLAGS      = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES)
+INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtDeclarative -I/usr/include/qt4 -Iqmlapplicationviewer -I.
+LINK          = g++
+LFLAGS        = -Wl,-O1
+LIBS          = $(SUBLIBS)  -L/usr/lib -lQtDeclarative -lQtGui -lQtCore -lpthread 
+AR            = ar cqs
+RANLIB        = 
+QMAKE         = /usr/bin/qmake
+TAR           = tar -cf
+COMPRESS      = gzip -9f
+COPY          = cp -f
+SED           = sed
+COPY_FILE     = $(COPY)
+COPY_DIR      = $(COPY) -r
+STRIP         = strip
+INSTALL_FILE  = install -m 644 -p
+INSTALL_DIR   = $(COPY_DIR)
+INSTALL_PROGRAM = install -m 755 -p
+DEL_FILE      = rm -f
+SYMLINK       = ln -f -s
+DEL_DIR       = rmdir
+MOVE          = mv -f
+CHK_DIR_EXISTS= test -d
+MKDIR         = mkdir -p
+
+####### Output directory
+
+OBJECTS_DIR   = ./
+
+####### Files
+
+SOURCES       = main.cpp \
+               lunarcalendar.cpp \
+               qmlapplicationviewer/qmlapplicationviewer.cpp moc_qmlapplicationviewer.cpp \
+               moc_lunarcalendar.cpp \
+               qrc_lichviet.cpp
+OBJECTS       = main.o \
+               lunarcalendar.o \
+               qmlapplicationviewer.o \
+               moc_qmlapplicationviewer.o \
+               moc_lunarcalendar.o \
+               qrc_lichviet.o
+DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
+               /usr/share/qt4/mkspecs/common/unix.conf \
+               /usr/share/qt4/mkspecs/common/linux.conf \
+               /usr/share/qt4/mkspecs/qconfig.pri \
+               /usr/share/qt4/mkspecs/features/qt_functions.prf \
+               /usr/share/qt4/mkspecs/features/qt_config.prf \
+               /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+               /usr/share/qt4/mkspecs/features/default_pre.prf \
+               qmlapplicationviewer/qmlapplicationviewer.pri \
+               /usr/share/qt4/mkspecs/features/release.prf \
+               /usr/share/qt4/mkspecs/features/default_post.prf \
+               /usr/share/qt4/mkspecs/features/warn_on.prf \
+               /usr/share/qt4/mkspecs/features/qt.prf \
+               /usr/share/qt4/mkspecs/features/unix/thread.prf \
+               /usr/share/qt4/mkspecs/features/moc.prf \
+               /usr/share/qt4/mkspecs/features/resources.prf \
+               /usr/share/qt4/mkspecs/features/uic.prf \
+               /usr/share/qt4/mkspecs/features/yacc.prf \
+               /usr/share/qt4/mkspecs/features/lex.prf \
+               /usr/share/qt4/mkspecs/features/include_source_dir.prf \
+               LichViet.pro
+QMAKE_TARGET  = LichViet
+DESTDIR       = 
+TARGET        = LichViet
+
+first: all
+####### Implicit rules
+
+.SUFFIXES: .o .c .cpp .cc .cxx .C
+
+.cpp.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cc.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.cxx.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.C.o:
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<"
+
+.c.o:
+       $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<"
+
+####### Build rules
+
+all: Makefile $(TARGET)
+
+$(TARGET):  $(OBJECTS)  
+       $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
+
+Makefile: LichViet.pro  /usr/share/qt4/mkspecs/linux-g++/qmake.conf /usr/share/qt4/mkspecs/common/g++.conf \
+               /usr/share/qt4/mkspecs/common/unix.conf \
+               /usr/share/qt4/mkspecs/common/linux.conf \
+               /usr/share/qt4/mkspecs/qconfig.pri \
+               /usr/share/qt4/mkspecs/features/qt_functions.prf \
+               /usr/share/qt4/mkspecs/features/qt_config.prf \
+               /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
+               /usr/share/qt4/mkspecs/features/default_pre.prf \
+               qmlapplicationviewer/qmlapplicationviewer.pri \
+               /usr/share/qt4/mkspecs/features/release.prf \
+               /usr/share/qt4/mkspecs/features/default_post.prf \
+               /usr/share/qt4/mkspecs/features/warn_on.prf \
+               /usr/share/qt4/mkspecs/features/qt.prf \
+               /usr/share/qt4/mkspecs/features/unix/thread.prf \
+               /usr/share/qt4/mkspecs/features/moc.prf \
+               /usr/share/qt4/mkspecs/features/resources.prf \
+               /usr/share/qt4/mkspecs/features/uic.prf \
+               /usr/share/qt4/mkspecs/features/yacc.prf \
+               /usr/share/qt4/mkspecs/features/lex.prf \
+               /usr/share/qt4/mkspecs/features/include_source_dir.prf
+       $(QMAKE) -unix -o Makefile LichViet.pro
+/usr/share/qt4/mkspecs/common/g++.conf:
+/usr/share/qt4/mkspecs/common/unix.conf:
+/usr/share/qt4/mkspecs/common/linux.conf:
+/usr/share/qt4/mkspecs/qconfig.pri:
+/usr/share/qt4/mkspecs/features/qt_functions.prf:
+/usr/share/qt4/mkspecs/features/qt_config.prf:
+/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
+/usr/share/qt4/mkspecs/features/default_pre.prf:
+qmlapplicationviewer/qmlapplicationviewer.pri:
+/usr/share/qt4/mkspecs/features/release.prf:
+/usr/share/qt4/mkspecs/features/default_post.prf:
+/usr/share/qt4/mkspecs/features/warn_on.prf:
+/usr/share/qt4/mkspecs/features/qt.prf:
+/usr/share/qt4/mkspecs/features/unix/thread.prf:
+/usr/share/qt4/mkspecs/features/moc.prf:
+/usr/share/qt4/mkspecs/features/resources.prf:
+/usr/share/qt4/mkspecs/features/uic.prf:
+/usr/share/qt4/mkspecs/features/yacc.prf:
+/usr/share/qt4/mkspecs/features/lex.prf:
+/usr/share/qt4/mkspecs/features/include_source_dir.prf:
+qmake:  FORCE
+       @$(QMAKE) -unix -o Makefile LichViet.pro
+
+dist: 
+       @$(CHK_DIR_EXISTS) .tmp/LichViet1.0.1 || $(MKDIR) .tmp/LichViet1.0.1 
+       $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/LichViet1.0.1/ && $(COPY_FILE) --parents qmlapplicationviewer/qmlapplicationviewer.h lunarcalendar.h .tmp/LichViet1.0.1/ && $(COPY_FILE) --parents lichviet.qrc .tmp/LichViet1.0.1/ && $(COPY_FILE) --parents main.cpp lunarcalendar.cpp qmlapplicationviewer/qmlapplicationviewer.cpp .tmp/LichViet1.0.1/ && (cd `dirname .tmp/LichViet1.0.1` && $(TAR) LichViet1.0.1.tar LichViet1.0.1 && $(COMPRESS) LichViet1.0.1.tar) && $(MOVE) `dirname .tmp/LichViet1.0.1`/LichViet1.0.1.tar.gz . && $(DEL_FILE) -r .tmp/LichViet1.0.1
+
+
+clean:compiler_clean 
+       -$(DEL_FILE) $(OBJECTS)
+       -$(DEL_FILE) *~ core *.core
+
+
+####### Sub-libraries
+
+distclean: clean
+       -$(DEL_FILE) $(TARGET) 
+       -$(DEL_FILE) Makefile
+
+
+first: $(first) copydeploymentfolders
+
+copydeploymentfolders:
+       @echo Copying application data... && $(MKDIR) "/home/cle/Nokia/LichViet//" && $(COPY_DIR) "/home/cle/Nokia/LichViet/themes" "/home/cle/Nokia/LichViet//"
+
+mocclean: compiler_moc_header_clean compiler_moc_source_clean
+
+mocables: compiler_moc_header_make_all compiler_moc_source_make_all
+
+compiler_moc_header_make_all: moc_qmlapplicationviewer.cpp moc_lunarcalendar.cpp
+compiler_moc_header_clean:
+       -$(DEL_FILE) moc_qmlapplicationviewer.cpp moc_lunarcalendar.cpp
+moc_qmlapplicationviewer.cpp: qmlapplicationviewer/qmlapplicationviewer.h
+       /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) qmlapplicationviewer/qmlapplicationviewer.h -o moc_qmlapplicationviewer.cpp
+
+moc_lunarcalendar.cpp: lunarcalendar.h
+       /usr/bin/moc-qt4 $(DEFINES) $(INCPATH) lunarcalendar.h -o moc_lunarcalendar.cpp
+
+compiler_rcc_make_all: qrc_lichviet.cpp
+compiler_rcc_clean:
+       -$(DEL_FILE) qrc_lichviet.cpp
+qrc_lichviet.cpp: lichviet.qrc
+       /usr/bin/rcc -name lichviet lichviet.qrc -o qrc_lichviet.cpp
+
+compiler_image_collection_make_all: qmake_image_collection.cpp
+compiler_image_collection_clean:
+       -$(DEL_FILE) qmake_image_collection.cpp
+compiler_moc_source_make_all:
+compiler_moc_source_clean:
+compiler_uic_make_all:
+compiler_uic_clean:
+compiler_yacc_decl_make_all:
+compiler_yacc_decl_clean:
+compiler_yacc_impl_make_all:
+compiler_yacc_impl_clean:
+compiler_lex_make_all:
+compiler_lex_clean:
+compiler_clean: compiler_moc_header_clean compiler_rcc_clean 
+
+####### Compile
+
+main.o: main.cpp lunarcalendar.h
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp
+
+lunarcalendar.o: lunarcalendar.cpp lunarcalendar.h
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o lunarcalendar.o lunarcalendar.cpp
+
+qmlapplicationviewer.o: qmlapplicationviewer/qmlapplicationviewer.cpp qmlapplicationviewer/qmlapplicationviewer.h
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qmlapplicationviewer.o qmlapplicationviewer/qmlapplicationviewer.cpp
+
+moc_qmlapplicationviewer.o: moc_qmlapplicationviewer.cpp 
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_qmlapplicationviewer.o moc_qmlapplicationviewer.cpp
+
+moc_lunarcalendar.o: moc_lunarcalendar.cpp 
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_lunarcalendar.o moc_lunarcalendar.cpp
+
+qrc_lichviet.o: qrc_lichviet.cpp 
+       $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_lichviet.o qrc_lichviet.cpp
+
+####### Install
+
+install_itemthemes: first FORCE
+       @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/share/LichViet// || $(MKDIR) $(INSTALL_ROOT)/usr/local/share/LichViet// 
+       -$(INSTALL_DIR) /home/cle/Nokia/LichViet/themes $(INSTALL_ROOT)/usr/local/share/LichViet//
+
+
+uninstall_itemthemes:  FORCE
+       -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/local/share/LichViet//themes
+       -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/share/LichViet// 
+
+
+install_desktopfile: first FORCE
+       @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/applications/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/applications/ 
+       -$(INSTALL_FILE) /home/cle/Nokia/LichViet/LichViet.desktop $(INSTALL_ROOT)/usr/share/applications/
+
+
+uninstall_desktopfile:  FORCE
+       -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/applications/LichViet.desktop
+       -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/applications/ 
+
+
+install_icon: first FORCE
+       @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ || $(MKDIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ 
+       -$(INSTALL_FILE) /home/cle/Nokia/LichViet/LichViet.png $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/
+
+
+uninstall_icon:  FORCE
+       -$(DEL_FILE) -r $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/LichViet.png
+       -$(DEL_DIR) $(INSTALL_ROOT)/usr/share/icons/hicolor/64x64/apps/ 
+
+
+install_target: first FORCE
+       @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/usr/local/bin/ || $(MKDIR) $(INSTALL_ROOT)/usr/local/bin/ 
+       -$(INSTALL_PROGRAM) "$(QMAKE_TARGET)" "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
+       -$(STRIP) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
+
+uninstall_target:  FORCE
+       -$(DEL_FILE) "$(INSTALL_ROOT)/usr/local/bin/$(QMAKE_TARGET)"
+       -$(DEL_DIR) $(INSTALL_ROOT)/usr/local/bin/ 
+
+
+install:  install_itemthemes install_desktopfile install_icon install_target  FORCE
+
+uninstall: uninstall_itemthemes uninstall_desktopfile uninstall_icon uninstall_target   FORCE
+
+FORCE:
+
diff --git a/lichviet.qrc b/lichviet.qrc
new file mode 100644 (file)
index 0000000..36718f2
--- /dev/null
@@ -0,0 +1,34 @@
+ <!DOCTYPE RCC>
+ <RCC version="1.0">
+
+<qresource prefix="">
+    <file>qml/LichViet/main.qml</file>
+    <file>qml/LichViet/About.qml</file>
+    <file>qml/LichViet/FullMonth.qml</file>
+    <file>qml/LichViet/MenuScreen.qml</file>
+    <file>qml/LichViet/OptionsScreen.qml</file>
+    <file>qml/LichViet/MultiTitleBar.qml</file>
+    <file>qml/LichViet/ToolBar.qml</file>
+    <file>qml/LichViet/Switch.qml</file>
+    <file>qml/LichViet/Button.qml</file>
+    <file>qml/LichViet/TitleBar.qml</file>
+    <file>qml/LichViet/ToolBarSingle.qml</file>
+    <file>qml/LichViet/XemNgayTotXauHoangDao.qml</file>
+    <file>qml/LichViet/DateTimeDialog.qml</file>
+        <file>qml/LichViet/AmDateTimeDialog.qml</file>s
+    <file>qml/LichViet/NoFeatureDialog.qml</file>
+
+    <file>qml/DatePicker/component/Button.qml</file>
+    <file>qml/DatePicker/component/DateReel.qml</file>
+    <file>qml/DatePicker/component/Reel.qml</file>
+
+    <file>LichViet.png</file>
+
+    <file>qml/LichViet/amlich-hnd.js</file>
+        <file>qml/LichViet/amlich-aa98.js</file>
+    <file>qml/LichViet/Settings.js</file>
+    <file>qml/LichViet/Themes.js</file>
+        <file>qml/LichViet/xemngaytotxau.js</file>
+</qresource>
+
+ </RCC>
diff --git a/lunarcalendar.cpp b/lunarcalendar.cpp
new file mode 100644 (file)
index 0000000..39c4cfd
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+
+#include <QDateTime>
+#include "lunarcalendar.h"
+
+LunarCalendar::LunarCalendar(QObject *parent) :
+    QObject(parent)
+{
+    this->curDayA =  QDateTime::currentDateTime().toString("d").toUInt();
+    this->curMonthA = QDateTime::currentDateTime().toString("M").toUInt();
+    this->curYearA = QDateTime::currentDateTime().toString("yyyy").toUInt();
+}
+
+/*
+  Calendar
+  */
+QString LunarCalendar::nextDay(){
+    int value = this->curDayA+1;
+    int days = calDays(this->curMonthA,this->curYearA);
+    if (value>days){
+        value = 1;
+        this->curMonthA++;
+        if (this->curMonthA > 12){
+            this->curMonthA = 1;
+            this->curYearA++;
+        }
+    }
+    this->curDayA=value;
+    return QString::number(value);
+}
+
+QString LunarCalendar::prevDay(){
+    int value = this->curDayA-1;
+    if(!value){
+        this->curMonthA--;
+        if (!this->curMonthA){
+            this->curMonthA = 12;
+            this->curYearA--;
+        }
+        value = calDays( this->curMonthA,this->curYearA);
+    }
+     this->curDayA=value;
+    return QString::number(value);
+}
+
+int LunarCalendar::curDay(){
+    return this->curDayA;
+}
+
+int LunarCalendar::curMonth(){
+    return this->curMonthA;
+}
+
+int LunarCalendar::curYear(){
+    return this->curYearA;
+}
+
+int LunarCalendar::curHour(){
+    return QDateTime::currentDateTime().toString("H").toUInt();
+}
+
+int LunarCalendar::curMinute(){
+    return QDateTime::currentDateTime().toString("m").toUInt();
+}
+
+void LunarCalendar::reset(int D, int M, int Y){
+ this->curDayA = D;
+    this->curMonthA = M;
+    this->curYearA = Y;
+}
+
+
+int LunarCalendar::calDays(int Month, int Year){
+    if (Month == 4 || Month == 6 || Month == 9 || Month == 11)
+        return 30;
+    else
+    if (Month == 2) {
+        bool isLeapYear = (Year % 4 == 0 && Year % 100 != 0) || (Year % 400 == 0);
+        if (isLeapYear == 0)
+            return 28;
+        else
+            return 29;
+    }
+    else
+    return 31;
+}
+
diff --git a/lunarcalendar.h b/lunarcalendar.h
new file mode 100644 (file)
index 0000000..957ad05
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+
+#ifndef LUNARCALENDAR_H
+#define LUNARCALENDAR_H
+
+#include <QObject>
+
+class LunarCalendar : public QObject
+{
+    Q_OBJECT
+
+    int curDayA;
+    int curMonthA;
+    int curYearA;
+
+    int jdn();
+
+public:
+    explicit LunarCalendar(QObject *parent = 0);
+
+     Q_INVOKABLE QString nextDay();
+     Q_INVOKABLE QString prevDay();
+
+     Q_INVOKABLE int curDay();
+     Q_INVOKABLE int curMonth();
+     Q_INVOKABLE int curYear();
+
+    Q_INVOKABLE int curHour();
+        Q_INVOKABLE int curMinute();
+
+        Q_INVOKABLE void reset(int,int,int);
+
+       Q_INVOKABLE int calDays(int, int);
+
+
+signals:
+
+public slots:
+
+};
+
+#endif // LUNARCALENDAR_H
diff --git a/main.cpp b/main.cpp
new file mode 100644 (file)
index 0000000..4e3c667
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,63 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+
+#include <QtGui/QApplication>
+#include <QtGui/QDesktopWidget>
+#include <QtDeclarative/QDeclarativeContext>
+
+#include "qmlapplicationviewer.h"
+#include "lunarcalendar.h"
+
+#ifdef Q_WS_MAEMO_5
+#include <QtOpenGL/QGLWidget>
+#endif
+
+int main(int argc, char *argv[])
+{
+    QApplication app(argc, argv);
+    QmlApplicationViewer viewer;
+
+     app.setApplicationVersion(APP_VERSION);
+
+    LunarCalendar lc;
+
+    viewer.rootContext()->setContextProperty("ROOT", &viewer);
+    viewer.rootContext()->setContextProperty("LC", &lc);
+
+    viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
+    //viewer.setMainQmlFile(QLatin1String("qml/LichViet/main.qml"));
+    viewer.setSource(QUrl("qrc:/qml/LichViet/main.qml"));
+
+    viewer.setWindowTitle(QString::fromUtf8("Lịch Việt"));
+
+#ifdef Q_WS_MAEMO_5
+    QGLFormat fmt = QGLFormat::defaultFormat();
+    fmt.setDoubleBuffer(true);
+
+    QGLWidget *glWidget = new QGLWidget(fmt);
+    viewer.setViewport(glWidget);
+#endif
+
+#if defined(Q_WS_MAEMO_5) || defined(Q_OS_SYMBIAN)
+            viewer.showFullScreen();
+#else
+            viewer.show();
+ #endif
+
+    return app.exec();
+}
diff --git a/qml/DatePicker/Licence.txt b/qml/DatePicker/Licence.txt
new file mode 100644 (file)
index 0000000..dfd977f
--- /dev/null
@@ -0,0 +1,32 @@
+Copyright © 2011 Nokia Corporation. All rights reserved. Nokia and Nokia \r
+Connecting People are registered trademarks of Nokia Corporation. Oracle and \r
+Java are registered trademarks of Oracle and/or its affiliates. Other product \r
+and company names mentioned herein may be trademarks or trade names of their \r
+respective owners.\r
+\r
+\r
+Subject to the conditions below, you may, without charge:\r
+\r
+·  Use, copy, modify and/or merge copies of this software and \r
+   associated documentation files (the \93Software\94)\r
+\r
+·  Publish, distribute, sub-licence and/or sell new software \r
+   derived from or incorporating the Software.\r
+\r
+\r
+\r
+This file, unmodified, shall be included with all copies or substantial portions \r
+of the Software that are distributed in source code form.\r
+\r
+The Software cannot constitute the primary value of any new software derived \r
+from or incorporating the Software.\r
+\r
+Any person dealing with the Software shall not misrepresent the source of the \r
+Software.\r
+\r
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR \r
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS \r
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR \r
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER \r
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN \r
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
diff --git a/qml/DatePicker/component/Button.qml b/qml/DatePicker/component/Button.qml
new file mode 100644 (file)
index 0000000..eb58bbb
--- /dev/null
@@ -0,0 +1,94 @@
+import QtQuick 1.0\r
+\r
+Item {\r
+    id: container\r
+\r
+    property string buttonName: "NOT SET"\r
+    property string target: "NOT SET"\r
+    property string text: "NOT SET"\r
+\r
+    property string fontName: "Helvetica"\r
+    property int fontSize: 14\r
+    property color fontColor: "black"\r
+\r
+    property bool active: false\r
+\r
+    property string bgImage: theme_manager.theme.datepicker.button\r
+    property string bgImagePressed: theme_manager.theme.datepicker.button_pressed\r
+    property string bgImageActive: theme_manager.theme.datepicker.button_active\r
+\r
+    // These Component properties can be used to modify the Button's LaF\r
+    // from the calling component. They have to define a BorderImage component.\r
+    property Component bg: defaultBackground\r
+    property Component bgPressed: defaultPressedBackground\r
+    property Component bgActive: defaultActiveBackground\r
+\r
+    signal clicked(string target, string button)\r
+\r
+    width: 140\r
+    height: 60\r
+    opacity: enabled ? 1.0 : 0.5    \r
+\r
+    Loader {\r
+        id: background\r
+        sourceComponent: container.bg\r
+        anchors.fill: parent\r
+    }\r
+\r
+    Component {\r
+        id: defaultBackground\r
+        BorderImage {\r
+            border { top: 8; bottom: 8; left: 8; right: 8 }\r
+            source: bgImage\r
+        }\r
+    }\r
+    Component {\r
+        id: defaultPressedBackground\r
+        BorderImage {\r
+            border { top: 8; bottom: 8; left: 8; right: 8 }\r
+            source: bgImagePressed\r
+        }\r
+    }\r
+\r
+    Component {\r
+        id: defaultActiveBackground\r
+        BorderImage {\r
+            border { top: 8; bottom: 8; left: 8; right: 8 }\r
+            source: bgImageActive\r
+        }\r
+    }\r
+\r
+    Text {\r
+        id: buttonLabel\r
+        text: parent.text\r
+        wrapMode: Text.WordWrap\r
+\r
+        anchors {\r
+            horizontalCenter: parent.horizontalCenter\r
+            verticalCenter: parent.verticalCenter\r
+        }\r
+        font {\r
+            family: container.fontName\r
+            pointSize: container.fontSize\r
+        }\r
+        color: container.fontColor\r
+    }\r
+\r
+    MouseArea {\r
+        id: mouseArea\r
+        anchors.fill: parent\r
+\r
+    }\r
+\r
+    states: [\r
+        State {\r
+            name: 'pressed'; when: mouseArea.pressed\r
+            PropertyChanges { target: background; sourceComponent: container.bgPressed }\r
+        },\r
+        State {\r
+            name: 'active'; when: container.active\r
+            PropertyChanges { target: background; sourceComponent: container.defaultActiveBackground; }\r
+        }\r
+    ]\r
+\r
+}\r
diff --git a/qml/DatePicker/component/DateReel.qml b/qml/DatePicker/component/DateReel.qml
new file mode 100644 (file)
index 0000000..8ae694b
--- /dev/null
@@ -0,0 +1,225 @@
+import QtQuick 1.0
+
+Item {
+    id: container
+
+    // Year item dimensions
+    property int yearWidth: (width-2*spacing)*0.4
+    property int yearHeight: height
+    // Month item dimensions
+    property int monthWidth: (width-2*spacing)*0.3
+    property int monthHeight: height
+    // Day item dimensions
+    property int dayWidth: (width-2*spacing)*0.3
+    property int dayHeight: height
+    // Font properties
+    property string fontName: 'Helvetica'
+    property int fontSize: 22
+    property color fontColor: "#666666"
+    // Spacing between items
+    property int spacing: 8
+
+    property Component itemBackground: Component {
+        BorderImage {
+            border { top: 8; bottom: 8; left: 8; right: 8 }
+            source:  theme_manager.theme.datepicker.button
+        }
+    }
+    property Component itemBackgroundPressed: Component {
+        BorderImage {
+            border { top: 8; bottom: 8; left: 8; right: 8 }
+            source: theme_manager.theme.datepicker.button_pressed
+        }
+    }
+
+    width: 240
+    height:  90
+
+    Component.onCompleted: {
+    }
+
+    Component {
+        id: dayDelegate
+        Button {
+            width: container.dayWidth
+            height: container.dayHeight
+            text: number
+            fontColor: container.fontColor
+            fontName: container.fontName
+            fontSize: container.fontSize
+            bg: itemBackground
+            bgPressed: itemBackgroundPressed
+             opacity: (index+1 < days.start || index+1 > days.end) ? 0.5 : 1.0
+        }
+    }
+
+    Component {
+        id: monthDelegate
+        Button {
+            width: container.monthWidth
+            height: container.monthHeight
+            text: number
+            fontColor: container.fontColor
+            fontName: container.fontName
+            fontSize: container.fontSize
+            bg: itemBackground
+            bgPressed: itemBackgroundPressed
+
+        }
+    }
+
+    Component {
+        id: yearDelegate
+        Button {
+            width: container.yearWidth
+            height: container.yearHeight
+            text: number
+            fontColor: container.fontColor
+            fontName: container.fontName
+            fontSize: container.fontSize
+            bg: itemBackground
+            bgPressed: itemBackgroundPressed
+        }
+    }
+
+
+    Row {
+        id: reels
+        spacing: container.spacing
+
+        Reel {
+            id: day
+            width: container.dayWidth
+            height: container.dayHeight
+            model: days
+            delegate:  dayDelegate
+            autoClose: false
+
+            function mouseoff(){
+                if (day.index+1 < days.start) day.index = days.start-1;
+                else if (day.index+1 > days.end ) day.index = days.end-1;
+
+
+                datePicker.mDay = day.index + 1;
+                datePicker.mMonth = month.index + 1;
+                datePicker.mYear = year.index + 1900;
+            }
+        }
+
+        Reel {
+            id: month
+            width: container.monthWidth
+            height: container.monthHeight
+            model: months
+            delegate: monthDelegate
+            autoClose: false
+
+            function mouseoff(){
+                days.reset()
+                datePicker.mDay = day.index + 1;
+                datePicker.mMonth = month.index + 1;
+                datePicker.mYear = year.index + 1900;
+            }
+        }
+
+        Reel {
+            id: year
+            width: container.yearWidth
+            height: container.yearHeight
+            model: years
+            delegate: yearDelegate
+            autoClose: false
+
+            function mouseoff(){
+                 days.reset()
+                datePicker.mDay = day.index + 1;
+                datePicker.mMonth = month.index + 1;
+                datePicker.mYear = year.index + 1900;
+            }
+        }
+
+    }
+
+
+    ListModel {
+        id: days
+
+        property int start: 1
+        property int end: 31
+
+        Component.onCompleted: {
+            appends()
+            day.index = screen.curDay - 1
+            end = LC.calDays(month.index+1,year.index+1900);
+        }
+
+        function reset(){
+            var howmanydays =  LC.calDays(month.index+1,year.index+1900);
+            end = howmanydays;
+
+            if (day.index+1 < days.start) day.index = days.start-1;
+            else if (day.index+1 > days.end ) day.index = days.end-1;
+        }
+
+        function appends(){
+            for(var j=1;j<=31;j++){
+                if (j<=9)
+                   append({number:"0"+j})
+                else
+                   append({number:j})
+            }
+        }
+
+        function change(){
+           day.index = screen.curDay-1;
+        }
+    }
+
+    ListModel{
+        id: months
+        Component.onCompleted: {
+            for(var j=1;j<=12;j++){
+                if (j<=9)
+                   append({number:"0"+j})
+                else
+                   append({number:j})
+            }
+            month.index = screen.curMonth - 1
+        }
+
+        function change(){
+             month.index = screen.curMonth - 1;
+        }
+    }
+
+    ListModel{
+        id: years
+        Component.onCompleted: {
+            for(var i=1900;i<2099;i++){
+                append({number:i})
+            }
+            year.index = screen.curYear - 1900
+        }
+
+        function change(){
+              year.index = screen.curYear - 1900
+        }
+    }
+
+    function day_reset(){
+         datePicker.mDay = screen.curDay
+        days.change()
+    }
+
+    function month_reset(){
+                 datePicker.mMonth = screen.curMonth
+        months.change()
+    }
+
+    function year_reset(){
+        datePicker.mYear = screen.curYear
+        years.change()
+    }
+
+
+}
diff --git a/qml/DatePicker/component/Reel.qml b/qml/DatePicker/component/Reel.qml
new file mode 100644 (file)
index 0000000..dc5b3a1
--- /dev/null
@@ -0,0 +1,66 @@
+import QtQuick 1.0
+
+Rectangle {
+    id: reel    
+
+    property alias interactive: path.interactive
+    property int index: 0
+    property bool moving: false
+    property ListModel model    
+    property Component delegate
+    property int itemsShown: 4
+    property bool autoClose: true
+    property alias closingDelay: clippingTimer.interval
+    property int closingTimeout: 800
+
+    function open() { focus = true; clip = false }
+    function close() { clip = true }
+    function toggle() { clip ? open() : close() }
+    function shiftZ(obj, delta) {
+        if (typeof obj.z != 'undefined') obj.z += delta
+        if (obj.parent) shiftZ(obj.parent, delta) // Set z recursively to parent
+    }
+
+    width: 100
+    height: 100
+    color: "transparent"
+    clip: true
+    // Close reel when the focus is lost
+    onFocusChanged: if (!focus) close()
+    // Bring to front if not clipped
+    onClipChanged:  { clip ? shiftZ(reel, -500) : shiftZ(reel, 500) }
+
+    onIndexChanged: path.currentIndex = reel.index
+
+    PathView {
+        id: path
+        width: parent.width
+        height: (pathItemCount-1)*parent.height
+        pathItemCount: parent.itemsShown+1
+        clip: true
+        anchors.centerIn: parent
+        model: parent.model
+        delegate: reel.delegate
+
+        preferredHighlightBegin: 0.5
+        preferredHighlightEnd: 0.5
+        highlightRangeMode: PathView.StrictlyEnforceRange
+        focus: false
+
+        path: Path {
+            startX: path.x+path.width/2; startY: 1-reel.height/2
+            PathLine {x: path.x+path.width/2; y: path.height+reel.height/2-1}
+        }
+        onMovementStarted: {}
+        onMovementEnded: {
+            reel.index = path.currentIndex;
+            parent.mouseoff()
+        }
+
+        Timer {
+            id: clippingTimer
+            repeat: false; interval: reel.closingTimeout;
+            triggeredOnStart: false; onTriggered: reel.close()
+        }        
+    }
+}
diff --git a/qml/DatePicker/component/gfx/button.png b/qml/DatePicker/component/gfx/button.png
new file mode 100644 (file)
index 0000000..fcdc4ff
Binary files /dev/null and b/qml/DatePicker/component/gfx/button.png differ
diff --git a/qml/DatePicker/component/gfx/button_pressed.png b/qml/DatePicker/component/gfx/button_pressed.png
new file mode 100644 (file)
index 0000000..162b194
Binary files /dev/null and b/qml/DatePicker/component/gfx/button_pressed.png differ
diff --git a/qml/LichViet/About.qml b/qml/LichViet/About.qml
new file mode 100644 (file)
index 0000000..efd3e6d
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+
+Item{
+    id: item1
+    Rectangle {
+        id: rectangle1
+        anchors.fill: parent; anchors.bottomMargin: 0
+        visible: true
+        opacity:0.8
+
+    Image {
+        id: image1
+        x: 0
+        y: 43
+        width: 100
+        height: 100
+        anchors.horizontalCenterOffset: 0
+        anchors.horizontalCenter: parent.horizontalCenter
+        source: "qrc:/LichViet.png"
+
+        Text {
+            id: text3
+            x: 10
+            y: 261
+            width: 80
+            height: 20
+            text: "Chương trình có tham khảo thuật toán tính <br>Âm Lịch của tác giả Hồ Ngọc Đức.<br><a href='http://www.informatik.uni-leipzig.de/~duc/amlich/'>http://www.informatik.uni-leipzig.de/~duc/amlich/</a>"
+            anchors.horizontalCenterOffset: 0
+            anchors.horizontalCenter: parent.horizontalCenter
+            verticalAlignment: Text.AlignVCenter
+            horizontalAlignment: Text.AlignHCenter
+            font.pixelSize: 16
+        }
+    }
+
+    Text {
+        id: text1
+        x: 11
+        y: 171
+        width: 80
+        height: 20
+        text: "Lịch Âm Việt Nam <br> OS: Maemo 5"
+        anchors.horizontalCenterOffset: 1
+        font.bold: true
+        anchors.horizontalCenter: parent.horizontalCenter
+        horizontalAlignment: Text.AlignHCenter
+        verticalAlignment: Text.AlignVCenter
+        font.pixelSize: 26
+    }
+
+    Text {
+        id: text2
+        x: 10
+        y: 234
+        width: 80
+        height: 20
+        text: "Phiên bản : 1.0.1 (build 401.23.08.2011)<br>\
+Phát triển bởi : <a href='mailto:metacuong@gmail.com'>metacuong@gmail.com</a>"
+anchors.horizontalCenterOffset: 0
+wrapMode: Text.NoWrap
+        verticalAlignment: Text.AlignVCenter
+        horizontalAlignment: Text.AlignHCenter
+        anchors.horizontalCenter: parent.horizontalCenter
+        font.pixelSize: 24
+    }
+
+
+}
+
+    ToolBarSingle { id: toolBar; height: 50;
+        y: screen.height-78
+        width: parent.width;
+        button1Label: "Quay Về"
+        onButton1Clicked:
+        {
+            screen.state="mainscreen"
+        }
+    }
+
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+    ]
+}
diff --git a/qml/LichViet/AmDateTimeDialog.qml b/qml/LichViet/AmDateTimeDialog.qml
new file mode 100644 (file)
index 0000000..70fa1f4
--- /dev/null
@@ -0,0 +1,532 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+import "amlich-hnd.js" as AmLich
+import "amlich-aa98.js" as AmLich98
+
+Item{
+    id: amdatetime
+    state: "switch_me"
+    BorderImage { anchors.centerIn: parent;source: "./img/titlebar.sci"; width: 344+2; height: 234+14; y: +7  }
+    Rectangle {
+        id: rectangle1
+        x: 0
+        y: -16
+        anchors.centerIn: parent
+        width:460
+        height: 234
+        color: "#19262b"
+        radius: 8
+        border.color: "#b57e8f"
+        visible: true
+        opacity:0.9
+
+        Button {
+            id: button2
+            x: 313
+            anchors.right: parent.right; anchors.rightMargin: 8; y: 185; width: 140; height: 40
+            text: "OK"
+            onClicked: {
+                 var lday = lunarday_pathview.currentIndex+1;
+                 var lmonth=lunarmonth_pathview.currentIndex+1;
+                 var lyear=lunaryear_pathview.currentIndex+1900;
+
+                var lnhuan=0;
+
+                var thangnhuan = -1;
+
+                for (var l=0;l<12;l++)
+                    if (lunarmonth_model.get(l).nhuan){
+                        thangnhuan = l;
+                    }
+
+                 if(lunarmonth_model.get(lunarmonth_pathview.currentIndex).nhuan){
+                     lnhuan=1;
+                     lmonth=lmonth-1;
+                 }
+
+                 if (thangnhuan!=-1 && lunarmonth_pathview.currentIndex> thangnhuan)
+                     lmonth-=1;
+
+                var finalSolarDay = AmLich98.convertLunar2Solar(lday,lmonth,lyear,lnhuan,7)
+
+                 LC.reset(finalSolarDay[0],finalSolarDay[1],finalSolarDay[2])
+                 screen.calculateLunar( finalSolarDay[0], finalSolarDay[1], finalSolarDay[2])
+                 screen.state="mainscreen"
+                 screen.refresh()
+
+                 maindatemodel.reset()
+                 txtDATEpv.currentIndex =  finalSolarDay[0]-1;
+
+            }
+        }
+
+        Button {
+            id: button3
+            x: 413
+            y: 6
+            width: 39
+            height: 40
+            text: "X"
+            anchors.rightMargin: 56
+            onClicked: {screen.state="mainscreen"}
+        }
+
+        Rectangle {
+            id: rectangle2
+            x: 23
+            y: 89
+            width: 415
+            height: 56
+            radius: 9
+            gradient: Gradient {
+                GradientStop {
+                    position: 0
+                    color: "#ffffff"
+                }
+
+                GradientStop {
+                    position: 0.1
+                    color: "#7c6969"
+                }
+            }
+            border.color: "#b57e8f"
+
+            Rectangle {
+                id:lmk
+                x: 207
+                y: -39
+                width: 198; height: 129
+                gradient: Gradient {
+                    GradientStop {
+                        position: 0.89
+                        color: "#148ebe"
+                    }
+
+                    GradientStop {
+                        position: 0.01
+                        color: "#19262b"
+                    }
+
+                    GradientStop {
+                        position: 0.13
+                        color: "#6eb3d5"
+                    }
+
+                    GradientStop {
+                        position: 1
+                        color: "#19262b"
+                    }
+                }
+            }
+
+            /**LUNAR YEAR**/
+            Rectangle {
+                id:lunaryear_rec
+                state: "switch_to_year"
+                x: 217
+                y: -39
+                width: 178; height: 129
+                color:"transparent"
+
+                property int index: 0
+                onIndexChanged: lunaryear_pathview.currentIndex = lunaryear_rec.index
+
+                Component {
+                    id: lunaryear_delegate
+                    Column {
+                        id: wrapper
+                        Text {
+                            id: nameText
+                            text: name
+                            font.pointSize: 16
+                            width: lunaryear_rec.width
+                            color: PathView.isCurrentItem ? "#FFFFFF" : "grey"
+                            verticalAlignment:Text.AlignLeft
+                            font.bold: true
+                        }
+                    }
+                }
+
+                PathView {
+                    id:lunaryear_pathview
+                    anchors.fill: parent
+                    model: lunaryear_model
+                    delegate: lunaryear_delegate
+                     pathItemCount: 3
+                     clip: true
+                     preferredHighlightBegin: 0.5
+                     preferredHighlightEnd: 0.5
+                     highlightRangeMode: PathView.StrictlyEnforceRange
+                     focus: true
+                     path: Path {
+                         startX: 90
+                         startY: 0
+                         PathLine {x: 90; y: lunaryear_rec.height}
+                     }
+
+                     onMovementEnded: {
+                         //console.log(lunaryear_pathview.currentIndex)
+                         AmLich.getYearInfo(lunaryear_pathview.currentIndex+1900);
+                         lunarmonth_model.change(lunaryear_pathview.currentIndex+1900, lunarmonth_pathview.currentIndex+1);
+                     }
+                }
+                MouseArea {
+                    id:lunaryear_mousearea
+                    anchors.fill: parent
+                    onClicked: {
+                        amdatetime.state="switch_to_year"
+                    }
+                }
+            }
+
+            ListModel {
+                id:lunaryear_model
+                Component.onCompleted: {
+                    init()
+                 }
+
+                function init(){
+                    for(var i=1900;i<2099;i++){
+                        var lunarYear = AmLich.getYearCanChi(i)
+                        append({name:i+" ("+lunarYear+")"})
+                    }
+                }
+
+                function change(YYYY){
+                    lunaryear_pathview.currentIndex = YYYY - 1900
+                }
+            }
+            /***/
+
+            /**LUNAR DAY*/
+                Rectangle{
+                    state:"switch_to_day"
+                    id:lunarday_rec
+                    x: -20
+                    y: -39
+                    width: 80; height: 129
+                    color:"transparent"
+
+                    property int index: 0
+                    onIndexChanged: lunarday_pathview.currentIndex = lunarday_rec.index
+
+                    Component {
+                        id: lunarday_delegate
+                        Column {
+                            id: wrapper
+
+                            Text {
+                                id: nameText
+                                text: name
+                                font.pointSize: 18
+                                width: lunarday_rec.width
+                                color: PathView.isCurrentItem ? "#FFFFFF" : "grey"
+                                verticalAlignment:Text.AlignVCenter
+                                font.bold: true
+                            }
+
+                        }
+                    }
+
+                    PathView {
+                        id:lunarday_pathview
+                        anchors.fill: parent
+                        model: lunarday_model
+                        delegate: lunarday_delegate
+                         pathItemCount: 1
+                         clip: true
+                         preferredHighlightBegin: 0.5
+                         preferredHighlightEnd: 0.5
+                         highlightRangeMode: PathView.StrictlyEnforceRange
+                         focus: true
+                         path: Path {
+                             startX: 90
+                             startY: 0
+                             PathLine {x: 90; y: lunarday_rec.height}
+                         }
+                    }
+
+                    MouseArea {
+                        id:lunarday_mousearea
+                        anchors.fill: parent
+                        onClicked: {
+                            amdatetime.state="switch_to_day"
+                        }
+                    }
+
+                }
+
+                ListModel {
+                    id:lunarday_model
+                    Component.onCompleted: {
+                        for(var i=1;i<=30;i++)
+                            append({name:i})
+                    }
+
+                    function change(MM,DD){
+
+                        while(lunarday_model.count>0){
+                            lunarday_model.remove(lunarday_model.count-1)
+                        }
+
+
+                        var daystotal = AmLich.RMM[MM-1];
+
+                        if(lunarmonth_model.get(MM-1).nhuan){
+
+                                for (var i=1;i<=AmLich.LML;i++)
+                                     lunarday_model.append({name:i})
+
+                        }else{
+                                    for (var i=1;i<=daystotal;i++)
+                                         lunarday_model.append({name:i})
+
+                        }
+
+                        /*if(lunarmonth_model.get(MM-1).nhuan){
+                            if(AmLich.LML > lunarday_model.count){
+                                for (var i=lunarday_model.count+1;i<=AmLich.LML;i++)
+                                     lunarday_model.append({name:i})
+                            }else
+                                if(AmLich.LML< lunarday_model.count){
+                                while(lunarday_model.count>AmLich.LML){
+                                     lunarday_model.remove(lunarday_model.count-1);
+                                }
+                           }
+
+                        }else{
+                                if(daystotal > lunarday_model.count){
+                                    for (var i=lunarday_model.count+1;i<=daystotal;i++)
+                                         lunarday_model.append({name:i})
+                                }else
+                                    if(daystotal < lunarday_model.count){
+                                    while(lunarday_model.count>daystotal){
+                                         lunarday_model.remove(lunarday_model.count-1);
+                                    }
+                               }
+                        }*/
+
+                        /*
+                        var nhuansetru = 30 - AmLich.LML;
+
+                        if(lunarmonth_model.get(MM-1).nhuan && lunarday_model.count==30){
+                            var j=0;
+                            while(j<nhuansetru){
+                                lunarday_model.remove(lunarday_model.count-1);
+                                j++;
+                            }
+                        }
+                        else if(lunarday_model.count<30){
+                            for (var i=lunarday_model.count+1;i<=30;i++)
+                            lunarday_model.append({name:i})
+                        }*/
+
+                        lunarday_rec.index = DD-1;
+                        lunarday_pathview.currentIndex= DD-1;
+
+                    }
+                }
+
+            /***/
+
+
+                /**LUNAR MONTH*/
+                    Rectangle{
+                        state:"switch_to_month"
+                        id:lunarmonth_rec
+                        x: 60
+                        y: -39
+                        width: 150; height: 129
+                        color:"transparent"
+
+                        property int index: 0
+                        onIndexChanged: lunarmonth_pathview.currentIndex = lunarmonth_rec.index
+
+                        Component {
+                            id: lunarmonth_delegate
+                            Column {
+                                id: wrapper
+
+                                Text {
+                                    id: nameText
+                                    text: name
+                                    font.pointSize: 16
+                                    width: lunarmonth_rec.width
+                                    color: PathView.isCurrentItem ? "#FFFFFF" : "grey"
+                                    verticalAlignment:Text.AlignVCenter
+                                    font.bold: true
+                                }
+
+                            }
+                        }
+
+                        PathView {
+                            id:lunarmonth_pathview
+                            anchors.fill: parent
+                            model: lunarmonth_model
+                            delegate: lunarmonth_delegate
+                             pathItemCount: 1
+                             clip: true
+                             preferredHighlightBegin: 0.5
+                             preferredHighlightEnd: 0.5
+                             highlightRangeMode: PathView.StrictlyEnforceRange
+                             focus: true
+                             path: Path {
+                                 startX: 90
+                                 startY: 0
+                                 PathLine {x: 90; y: lunarmonth_rec.height}
+                             }
+                             onMovementEnded: {
+                                 //console.log(lunaryear_pathview.currentIndex)
+                                // console.log(AmLich.LML)
+
+                                lunarday_model.change(lunarmonth_pathview.currentIndex+1,lunarday_pathview.currentIndex+1);
+                             }
+                        }
+
+                        MouseArea {
+                            id:lunarmonth_mousearea
+                            anchors.fill: parent
+                            onClicked: {
+                                amdatetime.state="switch_to_month"
+                            }
+                        }
+
+                    }
+
+                    ListModel {
+                        id:lunarmonth_model
+
+                        Component.onCompleted: {
+
+                        }
+
+                        function change(YYYY, MM){
+                            while(lunarmonth_model.count>0){
+                                lunarmonth_model.remove(lunarmonth_model.count-1)
+                            }
+                            readd(YYYY, MM)
+
+                           lunarday_model.change(lunarmonth_pathview.currentIndex+1,lunarday_pathview.currentIndex+1);
+                        }
+
+                        function readd(YYYY, MM){
+                            var yTest = YYYY;
+                            var preFix = "Tháng ";
+                            var a=AmLich.leapMonth(yTest)
+                            var t=0;
+                            if(a){ // nam nhuan
+                                 for(var i=0;i<=12;i++){
+                                    var l=AmLich.getYearInfo(yTest)[i].month
+                                     if (t==l)
+                                         lunarmonth_model.append({name:preFix+l+" (N)", nhuan:true})
+                                     else
+                                         lunarmonth_model.append({name:preFix+l, nhuan:false})
+                                     t=l
+                                 }
+
+                            }else
+                                {
+                                for(var i=1;i<=12;i++)
+                                    lunarmonth_model.append({name:preFix+i, nhuan:false})
+                            }
+
+                            lunarmonth_rec.index = MM -1;
+                            lunarmonth_pathview.currentIndex = MM-1;
+
+                        }
+                    }
+
+                /***/
+        }
+
+    }
+
+    Component.onCompleted: {
+
+    }
+
+    states: [
+        State {
+            name: "switch_to_day";
+            PropertyChanges { target:lmk;x:10;width:60;}
+            PropertyChanges { target:lunaryear_pathview;pathItemCount:1;}
+                                    PropertyChanges { target:lunarmonth_pathview;pathItemCount:1;}
+            PropertyChanges { target:lunarday_pathview;pathItemCount:3;}
+            PropertyChanges { target:lunarday_mousearea;visible:false;}
+            PropertyChanges { target:lunaryear_mousearea;visible:true;}
+            PropertyChanges { target:lunarmonth_mousearea;visible:true;}
+        },
+        State {
+            name: "switch_to_year";
+            PropertyChanges { target:lmk;x:207;width:198;}
+            PropertyChanges { target:lunarday_pathview;pathItemCount:1;}
+                                    PropertyChanges { target:lunarmonth_pathview;pathItemCount:1;}
+            PropertyChanges { target:lunaryear_pathview;pathItemCount:3;}
+            PropertyChanges { target:lunarday_mousearea;visible:true;}
+            PropertyChanges { target:lunaryear_mousearea;visible:false;}
+                        PropertyChanges { target:lunarmonth_mousearea;visible:true;}
+        },
+        State {
+            name: "switch_to_month";
+            PropertyChanges { target:lmk;x:60;width:150;}
+            PropertyChanges { target:lunarday_pathview;pathItemCount:1;}
+            PropertyChanges { target:lunaryear_pathview;pathItemCount:1;}
+                        PropertyChanges { target:lunarmonth_pathview;pathItemCount:3;}
+            PropertyChanges { target:lunarday_mousearea;visible:true;}
+            PropertyChanges { target:lunaryear_mousearea;visible:true;}
+                        PropertyChanges { target:lunarmonth_mousearea;visible:false;}
+        }
+    ]
+
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 100; easing.type: Easing.InOutBack } }
+    ]
+
+    function reset(){
+        var acs = AmLich.getYearInfo(screen.curYear)
+        var a=AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear)
+                var finalmonth=a.month;
+        if (a.leap)
+            finalmonth+=1;
+        else{
+        var aaa=AmLich.leapMonth(screen.curYear)
+        var t=-1;
+
+        if (aaa){
+           for (var i=0;i<=12;i++){
+               var l=acs[i].month
+                if (t==l && a.leap==0){
+                    if (a.month>i){
+                    finalmonth = finalmonth+1;
+                    break;
+                    }
+                }
+                t=l
+            }
+
+        }
+        }
+
+        lunaryear_model.change(a.year)
+        lunarmonth_model.change(a.year, finalmonth)
+        lunarday_model.change(finalmonth,a.day)
+
+    }
+}
diff --git a/qml/LichViet/Button.qml b/qml/LichViet/Button.qml
new file mode 100644 (file)
index 0000000..5f9f4da
--- /dev/null
@@ -0,0 +1,51 @@
+
+import QtQuick 1.0
+
+Item {
+    id: container
+
+    signal clicked
+
+    property string text
+    property bool keyUsing: false
+
+    BorderImage {
+        id: buttonImage
+        source:  theme_manager.theme.toolbar.button_sci
+        width: container.width; height: container.height
+    }
+    BorderImage {
+        id: pressed
+        opacity: 0
+        source: theme_manager.theme.toolbar.button_pressed_sci
+        width: container.width; height: container.height
+    }
+    MouseArea {
+        id: mouseRegion
+        anchors.fill: buttonImage
+        onClicked: { container.clicked(); }
+    }
+    Text {
+        id: btnText
+        color: if(container.keyUsing){"#D0D0D0";} else {"#FFFFFF";}
+        anchors.centerIn: buttonImage; font.bold: true
+        text: container.text; style: Text.Raised; styleColor: "black"
+        font.pixelSize: 24
+        font.family: "Tahoma"
+    }
+    states: [
+        State {
+            name: "Pressed"
+            when: mouseRegion.pressed == true
+            PropertyChanges { target: pressed; opacity: 1 }
+        },
+        State {
+            name: "Focused"
+            when: container.activeFocus == true
+            PropertyChanges { target: btnText; color: "#FFFFFF" }
+        }
+    ]
+    transitions: Transition {
+        ColorAnimation { target: btnText; }
+    }
+}
diff --git a/qml/LichViet/DateTimeDialog.qml b/qml/LichViet/DateTimeDialog.qml
new file mode 100644 (file)
index 0000000..556af62
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+import "../DatePicker/component" as Comp
+
+Item{
+    id: item1
+    BorderImage { anchors.centerIn: parent;source: "./img/titlebar.sci"; width: 344+2; height: 234+14; y: +7  }
+    Rectangle {
+        id: rectangle1
+        x: 0
+        y: -16
+        anchors.centerIn: parent
+        width:344
+        height: 234
+        color: "#19262b"
+        radius: 8
+        border.color: "#b57e8f"
+        visible: true
+        opacity:0.9
+
+
+
+        Column {
+            id: datePicker
+            width: 260
+            property int mDay: screen.curDay
+            property int mMonth: screen.curMonth
+            property int mYear: screen.curYear
+            anchors.centerIn: parent
+
+            Comp.DateReel {
+                id: dateReel
+                width: parent.width
+            }}
+
+
+        Button {
+            id: button2
+            x: 102
+            anchors.right: parent.right; anchors.rightMargin: 102; y: 185; width: 140; height: 40
+            text: "OK"
+            visible: true
+            onClicked: {
+
+                LC.reset(datePicker.mDay,datePicker.mMonth,datePicker.mYear)
+                screen.calculateLunar(datePicker.mDay,datePicker.mMonth,datePicker.mYear)
+                screen.state="mainscreen"
+                screen.refresh()
+                maindatemodel.reset()
+                txtDATEpv.currentIndex = datePicker.mDay-1;
+                }
+        }
+
+        Button {
+            id: button3
+            x: 298
+            y: 6
+            width: 39
+            height: 40
+            text: "X"
+            anchors.rightMargin: 56
+            onClicked: {screen.state="mainscreen";screen.refresh();}
+        }
+    }
+
+    function reset(){
+        dateReel.day_reset()
+                dateReel.month_reset()
+                dateReel.year_reset()
+    }
+
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+    ]
+}
diff --git a/qml/LichViet/FullMonth.qml b/qml/LichViet/FullMonth.qml
new file mode 100644 (file)
index 0000000..117aaee
--- /dev/null
@@ -0,0 +1,306 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+import "../DatePicker/component" as Comp
+import "amlich-hnd.js" as AmLich
+
+Item{
+    id: item1
+
+    Rectangle{
+        id: fullmonthREC
+        anchors.fill: parent; anchors.bottomMargin: 0
+        visible: true
+        opacity:0.9
+
+            Component {
+                id: contactDelegate
+                Item {
+                    width: grid.cellWidth; height: {
+                        if (header)
+                            return grid.cellHeight - 15;
+                        else return grid.cellHeight;
+                    }
+                    Rectangle {
+                        anchors.fill: parent;anchors.rightMargin: 2;anchors.topMargin: 2;
+                        Text { color: {
+                                if (header)
+                                  return  "#000000";
+                                else
+                                    return "#007070"
+                            }
+
+                            text: name; anchors.horizontalCenter: parent.horizontalCenter
+                            font.pixelSize: 21;font.bold: true;font.family: "Tahoma"
+                            anchors.topMargin: 0;
+                        }
+
+                        color: {
+                            if (header)
+                                return "#FAFAFF";
+                            else{
+                                if (inmonth){
+                                    if (day==initcurDay && month==initcurMonth && year==initcurYear)
+                                        return "#00EBEB";
+                                    else
+                                      return "lightsteelblue";
+                                }
+                                else
+                                    return "#AAAAAA";
+                            }
+                        }
+                         radius: 4
+                         MouseArea{
+                             id:fullmonthMouse
+                             anchors.fill: parent
+
+                             onClicked: {
+                               if (index >= 7){
+                                   LC.reset(day,month,year)
+                                   screen.calculateLunar(day,month,year)
+                                   screen.state="mainscreen"
+                                   screen.refresh()
+                                   maindatemodel.reset()
+                                   txtDATEpv.currentIndex = day-1;
+                               }
+                             }
+
+onPressed:{
+    if (index >= 7)
+        parent.color="#F0F0F0"
+}
+
+onReleased:{
+      if (index >= 7){
+          if (inmonth){
+              if (day==initcurDay && month==initcurMonth && year==initcurYear)
+                  parent.color="#00EBEB";
+              else
+                  parent.color="lightsteelblue";
+          }else
+              parent.color="#AAAAAA";
+      }
+}
+
+onCanceled:{
+    if (index >= 7){
+        if (inmonth)
+        {if (day==initcurDay && month==initcurMonth && year==initcurYear) parent.color="#00EBEB"; else parent.color="lightsteelblue";}
+        else
+         parent.color="#AAAAAA";
+    }
+
+}
+
+                         }
+                    }
+                }
+            }
+
+            GridView {
+                id: grid
+                x: -335
+                y: 41
+                width: {
+                    800
+                }
+
+                height: {
+                    480
+                }
+
+                anchors.horizontalCenterOffset: 15
+                anchors.bottomMargin: -52
+                anchors.topMargin: 42
+                anchors.horizontalCenter: parent.horizontalCenter
+                anchors.bottom: parent.bottom
+                anchors.top: parent.top
+                cellWidth: 110; cellHeight: 50
+                //Dung : 64 | Nam :110
+                model:lmodel
+                delegate: contactDelegate
+                focus: false
+            }
+
+            ListModel {
+                id:lmodel
+
+                Component.onCompleted: {
+                    reset()
+                }
+
+                function reset(){
+                    for(var i=0;i<42;i++){
+                        append({header:false,name:"",inmonths:false,day:0,month:0,year:0})
+                    }
+                }
+
+                ListElement {
+                                        header:true;inmonth:false;day:0;month:0;year:0
+                    name: "CN"
+                }
+
+                ListElement {
+                    header:true;inmonth:false;day:0;month:0;year:0
+                    name: "Hai"
+                }
+
+                ListElement {
+                    header:true;inmonth:false;day:0;month:0;year:0
+                    name: "Ba"
+                }
+                ListElement {
+                                        header:true;inmonth:false;day:0;month:0;year:0
+                    name: "Tư"
+                }
+                ListElement {
+                                        header:true;inmonth:false;day:0;month:0;year:0
+                    name: "Năm"
+                }
+                ListElement {
+                                        header:true;inmonth:false;day:0;month:0;year:0
+                    name: "Sáu"
+                }
+                ListElement {
+                                        header:true;inmonth:false;day:0;month:0;year:0
+                    name: "Bảy"
+                }
+            }
+
+            Component.onCompleted: {
+            }
+
+    }
+
+    ToolBarSingle { id: toolBar; height: 50;
+        y: screen.height-78
+        width: parent.width;
+        button1Label: "Quay Về"
+        onButton1Clicked:
+        {
+            screen.state="mainscreen"
+        }
+    }
+
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+    ]
+
+    states: [
+        State {
+            name: "xemtheothang"
+            PropertyChanges {
+                target: grid
+                width : screen.width
+                height: screen.height
+                cellWidth: {
+                    if (screen.width>=800)
+                         return 110;
+                    else
+                        return 64;
+                }
+            }
+        }
+    ]
+
+    function get_prevmonth(startfrom){
+        var cMonth=screen.curMonth;
+        var cYear=screen.curYear;
+        var pmonth = [];
+        if (cMonth == 1){
+            cMonth = 12
+            cYear--;
+        }else
+            cMonth--;
+         var daysofthemonthyear = LC.calDays(cMonth,cYear);
+        for (var i=daysofthemonthyear;i>daysofthemonthyear-startfrom;i--){
+            var lunarcl = AmLich.getLunarDate(i,cMonth,cYear)
+            pmonth.push({duong:i, am:lunarcl.day, month:cMonth, year:cYear})
+        }
+        return pmonth.reverse()
+    }
+
+    function get_nextmonth(startfrom){
+        var cMonth=screen.curMonth;
+        var cYear=screen.curYear;
+         var pmonth = [];
+        if (cMonth==12){
+            cMonth = 1;
+            cYear++;
+        }else
+            cMonth++;
+
+        for (var i=1;i<=startfrom;i++){
+          var lunarcl = AmLich.getLunarDate(i,cMonth,cYear)
+            pmonth.push({duong:i, am:lunarcl.day, month:cMonth, year:cYear});
+        }
+           return pmonth.reverse();
+    }
+
+    function reset(){
+        var firstdayofthemonthyear = AmLich.getLunarDate(1,screen.curMonth,screen.curYear).jd;
+        var startfrom = (firstdayofthemonthyear+1)%7;
+        var daysofthemonthyear = LC.calDays(screen.curMonth,screen.curYear);
+        var j=1;
+
+        var totalslot = 42;
+
+        var nextmonth = get_nextmonth(totalslot - (startfrom+daysofthemonthyear))
+        var prevmonth = get_prevmonth(startfrom)
+
+        var dayclick, monthclick, yearclick;
+        console.log(lmodel.count)
+
+        while(lmodel.count>7){
+            lmodel.remove(lmodel.count-1);
+        }
+
+        for (var i=7;i<49;i++){
+            var realnumber = i - 7;
+            if (realnumber >= startfrom && j<= daysofthemonthyear){
+            var lunarcl = AmLich.getLunarDate(j,screen.curMonth,screen.curYear)
+            if (lunarcl.day==1){
+                var lunarclmonth = "/"+lunarcl.month
+            }else{
+                var lunarclmonth = ""
+            }
+
+            var datas = j+"<br><span style='font-size:18px;float:right;color:#700070;'>&nbsp;&nbsp;"+lunarcl.day+lunarclmonth+"</span>";
+            dayclick = j;
+            monthclick = screen.curMonth;
+            yearclick = screen.curYear;
+            var inmonths = true;
+                j++;
+            }else{
+                if (realnumber<startfrom){
+                    var datas1= prevmonth[realnumber];
+                }else
+                {
+                    var datas1=nextmonth[(totalslot-realnumber)-1];
+                }
+                dayclick = datas1.duong;
+                monthclick = datas1.month;
+                yearclick = datas1.year;
+                var datas = "<span style='color:grey;font-weight:normal;'>"+datas1.duong+"</span><br><span style='font-size:18px;float:right;color:#CCFFFF;'>&nbsp;&nbsp;"+datas1.am+"</span>";
+                var inmonths=false;
+            }
+
+            lmodel.append({header:false,name:datas,inmonth:inmonths,day:dayclick,month:monthclick,year:yearclick})
+        }
+    }
+}
diff --git a/qml/LichViet/MenuScreen.qml b/qml/LichViet/MenuScreen.qml
new file mode 100644 (file)
index 0000000..f511302
--- /dev/null
@@ -0,0 +1,104 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+
+Item{
+    Rectangle {
+        id: rectangle1
+        anchors.fill: parent; anchors.bottomMargin: 0
+        visible: true
+        opacity:0.9
+
+        Component {
+                id: listDelegate
+                Rectangle {
+                    height:65
+                Button {
+                    id: button1
+                     y: 3; width: parent.parent.width; height: 60
+                    onClicked: {
+                        getText(idm)
+                    }
+
+                    focus:true
+                    text: name
+                }
+                }
+            }
+
+        ListModel {
+                 id: listModel
+
+                 ListElement {
+                     idm:1;name: "Hôm Nay";
+                 }
+                 ListElement {
+                    idm:2; name: "Tới Ngày Âm";
+                 }
+                 ListElement {
+                     idm:3;name: "Tới Ngày Dương";
+                 }
+                 ListElement {
+                    idm:4; name: "Xem Ngày Tốt/Xấu, Hoàng Đạo ...";
+                 }
+                 ListElement {
+                    idm:5; name: "Xem Theo Tháng";
+                 }
+                 ListElement {
+                    idm:6; name: "Giới Thiệu";
+                 }
+         }
+
+        ListView {
+              id: listView
+              anchors.fill: parent;anchors.topMargin: 35;anchors.leftMargin: 5;anchors.rightMargin: 5;
+              model: listModel
+              delegate: listDelegate
+              focus: true
+        }
+
+    }
+
+    ToolBarSingle { id: toolBar; height: 50;
+        y: screen.height-78
+        width: parent.width;
+        button1Label: "Quay Về"
+        onButton1Clicked:
+        {
+            screen.state="mainscreen"
+        }
+    }
+
+    function getText(id) {
+        switch(id){
+        case 1:screen.reset();break;
+        case 2: screen.state="amdatetimedialog";break;
+        case 3: screen.state="datetimedialog";break;
+        case 4: screen.state="xemngaytotxauhoangdao";break;
+        case 5: screen.state="xemtheothang";break;
+        case 6: screen.state="aboutdialog";break;
+        default:
+            screen.state="nofeaturedialog"
+        }
+
+    }
+
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+    ]
+}
diff --git a/qml/LichViet/MultiTitleBar.qml b/qml/LichViet/MultiTitleBar.qml
new file mode 100644 (file)
index 0000000..a484ba4
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+
+Item {
+    TitleBar { id: titleBar; width: parent.width; height: 60;
+        y: -80
+        untaggedString: ""
+        taggedString: ""
+    }
+    states: [
+        State {
+            name: "search"; when: screen.state!="search"
+            PropertyChanges { target: titleBar; y: 0 }
+        }
+    ]
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y"; duration: 500; easing.type: Easing.InOutQuad } }
+    ]
+}
diff --git a/qml/LichViet/NoFeatureDialog.qml b/qml/LichViet/NoFeatureDialog.qml
new file mode 100644 (file)
index 0000000..6f03f16
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+
+Item{
+    id: item1
+    BorderImage { anchors.centerIn: parent;source: "./img/titlebar.sci"; width: 344+2; height: 234+14; y: +7  }
+    Rectangle {
+        id: rectangle1
+        x: 0
+        y: -16
+        anchors.centerIn: parent
+        width:344
+        height: 234
+        radius: 4
+        gradient: Gradient {
+            GradientStop {
+                position: 0
+                color: "#ffffff"
+            }
+
+            GradientStop {
+                position: 0.97
+                color: "#ffffff"
+            }
+
+            GradientStop {
+                position: 0.04
+                color: "#aca4c6"
+            }
+        }
+        border.color: "#f3e3e8"
+        visible: true
+        opacity:0.9
+
+        Button {
+            id: button2
+            x: 102
+            anchors.right: parent.right; anchors.rightMargin: 102; y: 185; width: 140; height: 40
+            text: "OK"
+            onClicked: {screen.state="mainscreen"}
+        }
+
+        Button {
+            id: button3
+            x: 298
+            y: 6
+            width: 39
+            height: 40
+            text: "X"
+            anchors.rightMargin: 56
+            onClicked: {screen.state="mainscreen"}
+        }
+
+        Text {
+            id: text1
+            x: 132
+            y: 100
+            width: 80
+            height: 20
+            color: "#12347e"
+            text: "Chức năng này hiện chưa có !"
+            font.strikeout: false
+            horizontalAlignment: Text.AlignHCenter
+            font.pixelSize: 22
+
+        }
+    }
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+    ]
+}
diff --git a/qml/LichViet/OptionsScreen.qml b/qml/LichViet/OptionsScreen.qml
new file mode 100644 (file)
index 0000000..f8a571a
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+import "Settings.js" as Settings
+
+Item{
+
+    Rectangle {
+        id: rectangle1
+        anchors.fill: parent; anchors.bottomMargin: 0
+        visible: true
+        opacity:0.9
+
+        Component {
+                id: listDelegate
+                 Rectangle {
+                     height:60
+                     Text {
+                         id: text1
+                         text:name
+                         font.pixelSize: 21
+                         font.family: "Nokia Sans"
+                         x:20
+                         anchors.verticalCenter: parent.verticalCenter
+
+                     }
+                        Switch {
+                            id: switch_me
+                            x:rectangle1.width-220
+                            onSwitched:{
+                                listModel.setProperty(index, "selected", switchedOn);
+                            }
+                            switchedOn: {
+                               selected
+                            }
+
+                            anchors.verticalCenter: parent.verticalCenter
+                        }
+                 }
+            }
+
+        ListModel {
+                 id: listModel
+                 Component.onCompleted: {
+                     Settings.restore(listModel);
+                     var cdx = Settings.chedoxoay();
+                     ROOT.initScreenOrientation(cdx);
+                 }
+         }
+
+        ListView {
+              id: listView
+              anchors.fill: parent;anchors.topMargin: 45;anchors.leftMargin: 0;
+              model: listModel
+              delegate: listDelegate
+              focus: true
+        }
+
+    }
+
+    ToolBar { id: toolBar; height: 50;
+        y: screen.height-78
+        width: parent.width;
+        button1Label: "Đồng Ý"
+        button2Label: "Hủy Bỏ"
+        onButton1Clicked:
+        {
+            Settings.save(listModel)
+            screen.state="mainscreen"
+
+            var cdx = Settings.chedoxoay();
+            ROOT.initScreenOrientation(cdx);
+        }
+        onButton2Clicked: {
+            Settings.restore(listModel)
+            screen.state="mainscreen"
+        }
+    }
+
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+    ]
+}
diff --git a/qml/LichViet/Settings.js b/qml/LichViet/Settings.js
new file mode 100644 (file)
index 0000000..0477324
--- /dev/null
@@ -0,0 +1,140 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+.pragma library
+
+var optsGlobal = [];
+
+function get_db(){
+    return openDatabaseSync("LichVietDB", "1.0", "LichVietDB SQL", 5000);
+}
+
+function delete_old_db(){
+    var db = get_db();
+    db.transaction( function(tx) { try {
+                           tx.executeSql('DROP TABLE Settings;');
+                       } catch(error) {} }
+                   );
+}
+
+function init_default(){
+    return [
+                {idm:1,name:"Chế Độ Xoay",selected:true},
+                {idm:2,name:"Lịch Hệ Thống",selected:false},
+                {idm:3,name:"Nhấn 2 Lần Liên Tiếp<br>Tới Ngày Dương",selected:true},
+                {idm:4,name:"Nhấn Giữ<br>Xem Ngày Tốt/Xấu ...",selected:true}
+            ];
+}
+
+function restore(objmodel){
+    var db = get_db();
+    objmodel.clear();
+
+    optsGlobal = [];
+
+    function readEntry(json) {
+        var parsed = JSON.parse(json);
+        optsGlobal.push(parsed);
+        objmodel.append(parsed);
+    }
+
+    db.transaction( function(tx) {
+                       try {
+                           var rs = tx.executeSql('SELECT * FROM Settings');
+                           for (var i = 0; i < rs.rows.length; i++) {
+                               readEntry(rs.rows.item(i).json)
+                           }
+                       } catch (error) {
+                           init(objmodel);
+                       }
+                   } );
+}
+
+function store(lopt){
+    var db = get_db();
+    db.transaction( function(tx) {
+                       try{tx.executeSql('DROP TABLE Settings;');}catch(e){};
+                              tx.executeSql('CREATE TABLE IF NOT EXISTS Settings(id INT, json TEXT)');
+                   });
+    for (var i=0;i<lopt.length;i++){
+        db.transaction( function(tx) {
+                           tx.executeSql('INSERT INTO Settings VALUES(?, ?)', [i+1, lopt[i]]);
+                       });
+    }
+}
+
+function save(obj){
+    var lopts = [];
+    optsGlobal = [];
+    for (var i=0; i < obj.count; i++) {
+        var newopt = "{";
+        var firstpartopt = obj.get(i);
+
+        for (var elem in firstpartopt) {
+             if (!elem.match("^attributes")) {
+                 newopt += "\""+elem+"\": \"" + firstpartopt[elem] + "\",";
+             }
+        }
+        if (firstpartopt.attributes){
+             newopt += "\"attributes\":[";
+              for (var j=0; j < firstpartopt.attributes.count; j++) {
+                    if (j > 0) newopt += ",";
+                    var attr = firstpartopt.attributes.get(j);
+                     newopt += JSON.stringify(attr);
+              }
+              newopt += "]";
+        }else{
+            newopt = newopt.slice(0, -1);
+        }
+         newopt += "}";
+        lopts.push(newopt);
+        optsGlobal.push( JSON.parse(newopt));
+    }
+    store(lopts);
+}
+
+function init(obj){
+    var listopts = init_default();
+    optsGlobal = [];
+    for(var i=0;i< listopts.length;i++){
+        obj.append(listopts[i]);
+        optsGlobal.push(listopts[i]);
+    }
+}
+
+function pressandhold(){
+    return get_opt(4);
+}
+
+function doubleclicked(){
+    return get_opt(3);
+}
+
+function chedoxoay(){
+    console.log(optsGlobal)
+    return get_opt(1);
+}
+
+function get_opt(idm){
+    for(var i=0;i<optsGlobal.length;i++){
+        if (optsGlobal[i].idm == idm){
+                if(optsGlobal[i].selected == "true" || optsGlobal[i].selected == true)
+                    return 1;
+        }
+    }
+   return 0;
+}
diff --git a/qml/LichViet/Switch.qml b/qml/LichViet/Switch.qml
new file mode 100644 (file)
index 0000000..4e6ab7c
--- /dev/null
@@ -0,0 +1,82 @@
+/*\r
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>\r
+\r
+This program is free software: you can redistribute it and/or modify\r
+it under the terms of the GNU General Public License as published by\r
+the Free Software Foundation, either version 3 of the License, or\r
+(at your option) any later version.\r
+\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+GNU General Public License for more details.\r
+\r
+You should have received a copy of the GNU General Public License\r
+along with this program.  If not, see <http://www.gnu.org/licenses/>\r
+*/\r
+\r
+import QtQuick 1.0\r
+\r
+Item {\r
+    id: container\r
+\r
+    // Font properties\r
+    property string fontName: "Nokia Sans"\r
+    property int fontSize: 18\r
+    property color fontColor: "black"\r
+    // Images for switch states\r
+    property string imageOn: theme_manager.theme.switch_on\r
+    property string imageOff:theme_manager.theme.switch_off\r
+    // Property indicating current state\r
+    property bool switchedOn: true\r
+    // Labels for the states\r
+    property alias textOn: textOn.text\r
+    property alias textOff: textOff.text\r
+    // Spacing between labels and switch\r
+    property alias spacing: row.spacing\r
+\r
+    // Signal that gets fired when switch state has been toggled\r
+    signal switched(bool position)\r
+\r
+    width: row.width\r
+    height: 44\r
+\r
+    Row {\r
+        id: row\r
+        spacing: 8\r
+        Text {\r
+            id: textOn\r
+            text: "Bật"\r
+            height: container.height\r
+            color: container.fontColor\r
+            font {\r
+                family: container.fontName\r
+                pointSize: container.fontSize\r
+            }\r
+            verticalAlignment: Text.AlignVCenter\r
+        }\r
+        Image {\r
+            id: toggleSwitch\r
+            height: container.height\r
+            width: 2.22 * height\r
+            source: switchedOn ? imageOn : imageOff\r
+            fillMode: Image.PreserveAspectFit\r
+            smooth: true\r
+        }\r
+        Text {\r
+            id: textOff\r
+            height: container.height\r
+            text: "Tắt"\r
+            color: container.fontColor\r
+            font {\r
+                family: container.fontName\r
+                pointSize: container.fontSize\r
+            }\r
+            verticalAlignment: Text.AlignVCenter\r
+        }\r
+    }\r
+    MouseArea {\r
+        anchors.fill: row\r
+        onClicked: { switchedOn = !switchedOn; switched(switchedOn) }\r
+    }\r
+}\r
diff --git a/qml/LichViet/Themes.js b/qml/LichViet/Themes.js
new file mode 100644 (file)
index 0000000..80d73de
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+.pragma library
+
+var root_dir = "/opt/usr/share/LichViet/";
+
+function default_theme(){
+    return "file:"+root_dir+"themes/default/default.qml";
+}
diff --git a/qml/LichViet/TitleBar.qml b/qml/LichViet/TitleBar.qml
new file mode 100644 (file)
index 0000000..651cf69
--- /dev/null
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+    id: titleBar
+    property string untaggedString: " "
+    property string taggedString: " "
+
+    BorderImage { source: theme_manager.theme.titlebar.sci; width: parent.width; height: parent.height + 14; y: -7 }
+
+    Item {
+        id: container
+        width: (parent.width * 2) - 55 ; height: parent.height
+
+        function accept() {
+            titleBar.state = ""
+            background.state = ""
+            rssModel.tags = editor.text
+        }
+
+
+        Image {
+            id: quitButton
+            x: screen.width - 50
+            anchors.verticalCenter: parent.verticalCenter
+            source:  theme_manager.theme.titlebar.button
+            MouseArea {
+                anchors.fill: parent
+                onPressed:{
+                    parent.source= theme_manager.theme.titlebar.button_pressed
+                }
+                onReleased:{
+                     parent.source=theme_manager.theme.titlebar.button
+                }
+
+                onClicked: Qt.quit()
+            }
+        }
+
+        Text {
+            id: categoryText
+            x:10
+            anchors {
+                verticalCenter: parent.verticalCenter
+            }
+            elide: Text.ElideLeft
+            text: "Lịch Âm"
+            font.bold: true; color: "White"; style: Text.Raised; styleColor: "Black"
+            font.pixelSize: 24
+            font.family: "Tahoma"
+        }
+    }
+
+    states: State {
+        name: "Tags"
+        PropertyChanges { target: container; x: -tagButton.x + 5 }
+        PropertyChanges { target: editor; focus: true }
+    }
+
+    /*transitions: Transition {
+        NumberAnimation { properties: "x"; easing.type: Easing.InOutQuad }
+    }*/
+}
diff --git a/qml/LichViet/ToolBar.qml b/qml/LichViet/ToolBar.qml
new file mode 100644 (file)
index 0000000..cfa4f61
--- /dev/null
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights.  These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 1.0
+
+Item {
+    id: toolbar
+
+    property alias button1Label: button1.text
+    property alias button2Label: button2.text
+    signal button1Clicked
+    signal button2Clicked
+    focus:true
+    BorderImage { source:  theme_manager.theme.titlebar.sci; width: parent.width; height: parent.height + 14; y: -7 }
+    Button {
+        id: button1
+        anchors.left: parent.left; anchors.leftMargin: 5; y: 3; width: 140; height: 40
+        onClicked: toolbar.button1Clicked()
+        focus:true
+    }
+    Button {
+        id: button2
+        anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 40
+        onClicked: toolbar.button2Clicked()
+    }
+}
diff --git a/qml/LichViet/ToolBarSingle.qml b/qml/LichViet/ToolBarSingle.qml
new file mode 100644 (file)
index 0000000..bba117e
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+
+Item {
+    id: toolbarsingle
+
+    property alias button1Label: button1.text
+    signal button1Clicked
+    focus:true
+    BorderImage { source:  theme_manager.theme.titlebar.sci; width: parent.width; height: parent.height + 14; y: -7 }
+    Button {
+        id: button1
+       anchors.right: parent.right; anchors.rightMargin: 5; y: 3; width: 140; height: 40
+        onClicked: toolbarsingle.button1Clicked()
+        focus:true
+    }
+}
diff --git a/qml/LichViet/TopBar.qml b/qml/LichViet/TopBar.qml
new file mode 100644 (file)
index 0000000..82a6d84
--- /dev/null
@@ -0,0 +1,16 @@
+import QtQuick 1.0
+
+Rectangle{
+    width:parent.width
+    height: 50
+    border.width:1
+    border.color: "white"
+
+    Image {
+        id: topbar_container_image
+        source: "./img/topbar.jpg"
+        width:parent.width
+        height:50
+    }
+
+}
diff --git a/qml/LichViet/XemNgayTotXauHoangDao.qml b/qml/LichViet/XemNgayTotXauHoangDao.qml
new file mode 100644 (file)
index 0000000..512680b
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+
+import "amlich-hnd.js" as AmLich
+import "xemngaytotxau.js" as NTX
+
+Item{
+    Rectangle {
+        id: rectangle1
+        x: 0
+        y: -5
+        anchors.rightMargin: 0
+        anchors.leftMargin: 0
+        anchors.topMargin:30
+        anchors.fill: parent; anchors.bottomMargin: 16
+        visible: true
+        opacity:0.9
+
+        Component {
+            id: listDelegate
+            Item {
+                height: lheight+5
+                Rectangle {
+                                 width:rectangle1.width-20;
+                                 y:10;
+                                 x:10
+                                 height:lheight
+                                 color: "#ffffff"
+                                 radius: 8
+                                 border.color: "#b57e8f"
+                Column {
+                    Text { x:5;y:50;text:name;color:"blue";    font.pixelSize: 20
+                        font.family: "Tahoma" }
+                    Text { x:5;y:50;text:getHD(idm) ;    font.pixelSize: 20
+                        font.family: "Tahoma"}
+                    }                anchors.bottomMargin: -10
+                }
+            }
+        }
+
+
+
+
+        ListModel {
+                 id: listModel
+
+                 ListElement {
+                     lheight:55;idm:0;name: "";
+                 }
+                 ListElement {
+                     lheight:30;idm:-1;name: "";
+                 }
+                 ListElement {
+                     lheight:85;idm:1;name: "<b>Giờ Hoàng Đạo</b>";
+                 }
+                 ListElement {
+                     lheight:55;idm:2;name: "<b>Tiết Khí</b>";
+                 }
+                ListElement {
+                     lheight:55;idm:3;name: "<b>Nhị Thập Bát Tú</b>";
+                 }
+                ListElement {
+                     lheight:80;idm:6;name: "<b>Các sao tốt</b>";
+                 }
+            /*    ListElement {
+                     lheight:80;idm:7;name: "<b>Các sao xấu</b>";
+                 }
+                ListElement {
+                     lheight:120;idm:5;name: "<b>Ngày Tốt/Xấu</b>";
+                 }*/
+         }
+
+
+
+        ListView {
+              id: listView
+              anchors.fill: parent;anchors.topMargin: 0;anchors.leftMargin: 0; anchors.bottomMargin: 16
+              model: listModel
+              delegate: listDelegate
+              focus: true
+        }
+
+    }
+
+    ToolBarSingle { id: toolBar; height: 50;
+        y: screen.height-78
+        width: parent.width;
+        button1Label: "Quay Về"
+        onButton1Clicked:
+        {
+            screen.state="mainscreen"
+        }
+    }
+
+    function getHD(idm){
+        NTX.test();
+        switch(idm){
+        case 0 : return AmLich.getTHU(screen.jd)+",ngày <b>"+screen.curDay+"</b> tháng <b>"+screen.curMonth+"</b> năm <b>"+screen.curYear+"</b><br>Ngày <b>"+screen.lunarDay+"</b> tháng <b>"+screen.lunarMonth+"</b> năm <b>"+screen.lunarYear+"</b> (<b>"+screen.lunarYearInt+"</b>)";break;
+        case 1 : return screen.lunarGioHoangDao;break;
+        case 2 : return screen.lunarTietKhi();break;
+        case 3 : return NTX.sao(screen.curYear,AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).jd - AmLich.getLunarDate(1,1,screen.curYear).jd);break;
+        case 5 :  return NTX.luangiai(screen.curDay);break;
+        case -1: return NTX.truc(screen.lunarMonth, screen.lunarDayCanChi, screen.lunarMonthCanChi);break;//"Là ngày: <b>Thiên Lao Hắc Đạo</b> Trực: <b>Định</b>"
+        case 6: return NTX.cacsaotot(screen.lunarMonth, screen.lunarDayCanChi);break;
+        case 7: return NTX.cacsaoxau(screen.lunarMonth, screen.lunarDayCanChi);break;
+        }
+    }
+
+    transitions: [
+        Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+    ]
+}
diff --git a/qml/LichViet/amlich-aa98.js b/qml/LichViet/amlich-aa98.js
new file mode 100644 (file)
index 0000000..0f417bc
--- /dev/null
@@ -0,0 +1,211 @@
+var PI = Math.PI;
+
+/* Discard the fractional part of a number, e.g., INT(3.2) = 3 */
+function INT(d) {
+        return Math.floor(d);
+}
+
+/* Compute the (integral) Julian day number of day dd/mm/yyyy, i.e., the number
+ * of days between 1/1/4713 BC (Julian calendar) and dd/mm/yyyy.
+ * Formula from http://www.tondering.dk/claus/calendar.html
+ */
+function jdFromDate(dd, mm, yy) {
+        var a, y, m, jd;
+        a = INT((14 - mm) / 12);
+        y = yy+4800-a;
+        m = mm+12*a-3;
+        jd = dd + INT((153*m+2)/5) + 365*y + INT(y/4) - INT(y/100) + INT(y/400) - 32045;
+        if (jd < 2299161) {
+                jd = dd + INT((153*m+2)/5) + 365*y + INT(y/4) - 32083;
+        }
+        return jd;
+}
+
+/* Convert a Julian day number to day/month/year. Parameter jd is an integer */
+function jdToDate(jd) {
+        var a, b, c, d, e, m, day, month, year;
+        if (jd > 2299160) { // After 5/10/1582, Gregorian calendar
+                a = jd + 32044;
+                b = INT((4*a+3)/146097);
+                c = a - INT((b*146097)/4);
+        } else {
+                b = 0;
+                c = jd + 32082;
+        }
+        d = INT((4*c+3)/1461);
+        e = c - INT((1461*d)/4);
+        m = INT((5*e+2)/153);
+        day = e - INT((153*m+2)/5) + 1;
+        month = m + 3 - 12*INT(m/10);
+        year = b*100 + d - 4800 + INT(m/10);
+        return new Array(day, month, year);
+}
+
+/* Compute the time of the k-th new moon after the new moon of 1/1/1900 13:52 UCT
+ * (measured as the number of days since 1/1/4713 BC noon UCT, e.g., 2451545.125 is 1/1/2000 15:00 UTC).
+ * Returns a floating number, e.g., 2415079.9758617813 for k=2 or 2414961.935157746 for k=-2
+ * Algorithm from: "Astronomical Algorithms" by Jean Meeus, 1998
+ */
+function NewMoon(k) {
+        var T, T2, T3, dr, Jd1, M, Mpr, F, C1, deltat, JdNew;
+        T = k/1236.85; // Time in Julian centuries from 1900 January 0.5
+        T2 = T * T;
+        T3 = T2 * T;
+        dr = PI/180;
+        Jd1 = 2415020.75933 + 29.53058868*k + 0.0001178*T2 - 0.000000155*T3;
+        Jd1 = Jd1 + 0.00033*Math.sin((166.56 + 132.87*T - 0.009173*T2)*dr); // Mean new moon
+        M = 359.2242 + 29.10535608*k - 0.0000333*T2 - 0.00000347*T3; // Sun's mean anomaly
+        Mpr = 306.0253 + 385.81691806*k + 0.0107306*T2 + 0.00001236*T3; // Moon's mean anomaly
+        F = 21.2964 + 390.67050646*k - 0.0016528*T2 - 0.00000239*T3; // Moon's argument of latitude
+        C1=(0.1734 - 0.000393*T)*Math.sin(M*dr) + 0.0021*Math.sin(2*dr*M);
+        C1 = C1 - 0.4068*Math.sin(Mpr*dr) + 0.0161*Math.sin(dr*2*Mpr);
+        C1 = C1 - 0.0004*Math.sin(dr*3*Mpr);
+        C1 = C1 + 0.0104*Math.sin(dr*2*F) - 0.0051*Math.sin(dr*(M+Mpr));
+        C1 = C1 - 0.0074*Math.sin(dr*(M-Mpr)) + 0.0004*Math.sin(dr*(2*F+M));
+        C1 = C1 - 0.0004*Math.sin(dr*(2*F-M)) - 0.0006*Math.sin(dr*(2*F+Mpr));
+        C1 = C1 + 0.0010*Math.sin(dr*(2*F-Mpr)) + 0.0005*Math.sin(dr*(2*Mpr+M));
+        if (T < -11) {
+                deltat= 0.001 + 0.000839*T + 0.0002261*T2 - 0.00000845*T3 - 0.000000081*T*T3;
+        } else {
+                deltat= -0.000278 + 0.000265*T + 0.000262*T2;
+        };
+        JdNew = Jd1 + C1 - deltat;
+        return JdNew;
+}
+
+/* Compute the longitude of the sun at any time.
+ * Parameter: floating number jdn, the number of days since 1/1/4713 BC noon
+ * Algorithm from: "Astronomical Algorithms" by Jean Meeus, 1998
+ */
+function SunLongitude(jdn) {
+        var T, T2, dr, M, L0, DL, L;
+        T = (jdn - 2451545.0 ) / 36525; // Time in Julian centuries from 2000-01-01 12:00:00 GMT
+        T2 = T*T;
+        dr = PI/180; // degree to radian
+        M = 357.52910 + 35999.05030*T - 0.0001559*T2 - 0.00000048*T*T2; // mean anomaly, degree
+        L0 = 280.46645 + 36000.76983*T + 0.0003032*T2; // mean longitude, degree
+        DL = (1.914600 - 0.004817*T - 0.000014*T2)*Math.sin(dr*M);
+        DL = DL + (0.019993 - 0.000101*T)*Math.sin(dr*2*M) + 0.000290*Math.sin(dr*3*M);
+        L = L0 + DL; // true longitude, degree
+        L = L*dr;
+        L = L - PI*2*(INT(L/(PI*2))); // Normalize to (0, 2*PI)
+        return L;
+}
+
+/* Compute sun position at midnight of the day with the given Julian day number.
+ * The time zone if the time difference between local time and UTC: 7.0 for UTC+7:00.
+ * The function returns a number between 0 and 11.
+ * From the day after March equinox and the 1st major term after March equinox, 0 is returned.
+ * After that, return 1, 2, 3 ...
+ */
+function getSunLongitude(dayNumber, timeZone) {
+        return INT(SunLongitude(dayNumber - 0.5 - timeZone/24)/PI*6);
+}
+
+/* Compute the day of the k-th new moon in the given time zone.
+ * The time zone if the time difference between local time and UTC: 7.0 for UTC+7:00
+ */
+function getNewMoonDay(k, timeZone) {
+        return INT(NewMoon(k) + 0.5 + timeZone/24);
+}
+
+/* Find the day that starts the luner month 11 of the given year for the given time zone */
+function getLunarMonth11(yy, timeZone) {
+        var k, off, nm, sunLong;
+        //off = jdFromDate(31, 12, yy) - 2415021.076998695;
+        off = jdFromDate(31, 12, yy) - 2415021;
+        k = INT(off / 29.530588853);
+        nm = getNewMoonDay(k, timeZone);
+        sunLong = getSunLongitude(nm, timeZone); // sun longitude at local midnight
+        if (sunLong >= 9) {
+                nm = getNewMoonDay(k-1, timeZone);
+        }
+        return nm;
+}
+
+/* Find the index of the leap month after the month starting on the day a11. */
+function getLeapMonthOffset(a11, timeZone) {
+        var k, last, arc, i;
+        k = INT((a11 - 2415021.076998695) / 29.530588853 + 0.5);
+        last = 0;
+        i = 1; // We start with the month following lunar month 11
+        arc = getSunLongitude(getNewMoonDay(k+i, timeZone), timeZone);
+        do {
+                last = arc;
+                i++;
+                arc = getSunLongitude(getNewMoonDay(k+i, timeZone), timeZone);
+        } while (arc != last && i < 14);
+        return i-1;
+}
+
+/* Comvert solar date dd/mm/yyyy to the corresponding lunar date */
+function convertSolar2Lunar(dd, mm, yy, timeZone) {
+        var k, dayNumber, monthStart, a11, b11, lunarDay, lunarMonth, lunarYear, lunarLeap;
+        dayNumber = jdFromDate(dd, mm, yy);
+        k = INT((dayNumber - 2415021.076998695) / 29.530588853);
+        monthStart = getNewMoonDay(k+1, timeZone);
+        if (monthStart > dayNumber) {
+                monthStart = getNewMoonDay(k, timeZone);
+        }
+        //alert(dayNumber+" -> "+monthStart);
+        a11 = getLunarMonth11(yy, timeZone);
+        b11 = a11;
+        if (a11 >= monthStart) {
+                lunarYear = yy;
+                a11 = getLunarMonth11(yy-1, timeZone);
+        } else {
+                lunarYear = yy+1;
+                b11 = getLunarMonth11(yy+1, timeZone);
+        }
+        lunarDay = dayNumber-monthStart+1;
+        var diff = INT((monthStart - a11)/29);
+        lunarLeap = 0;
+        lunarMonth = diff+11;
+        if (b11 - a11 > 365) {
+                var leapMonthDiff = getLeapMonthOffset(a11, timeZone);
+                if (diff >= leapMonthDiff) {
+                        lunarMonth = diff + 10;
+                        if (diff == leapMonthDiff) {
+                                lunarLeap = 1;
+                        }
+                }
+        }
+        if (lunarMonth > 12) {
+                lunarMonth = lunarMonth - 12;
+        }
+        if (lunarMonth >= 11 && diff < 4) {
+                lunarYear -= 1;
+        }
+        return new Array(lunarDay, lunarMonth, lunarYear, lunarLeap);
+}
+
+/* Convert a lunar date to the corresponding solar date */
+function convertLunar2Solar(lunarDay, lunarMonth, lunarYear, lunarLeap, timeZone) {
+        var k, a11, b11, off, leapOff, leapMonth, monthStart;
+        if (lunarMonth < 11) {
+                a11 = getLunarMonth11(lunarYear-1, timeZone);
+                b11 = getLunarMonth11(lunarYear, timeZone);
+        } else {
+                a11 = getLunarMonth11(lunarYear, timeZone);
+                b11 = getLunarMonth11(lunarYear+1, timeZone);
+        }
+        k = INT(0.5 + (a11 - 2415021.076998695) / 29.530588853);
+        off = lunarMonth - 11;
+        if (off < 0) {
+                off += 12;
+        }
+        if (b11 - a11 > 365) {
+                leapOff = getLeapMonthOffset(a11, timeZone);
+                leapMonth = leapOff - 2;
+                if (leapMonth < 0) {
+                        leapMonth += 12;
+                }
+                if (lunarLeap != 0 && lunarMonth != leapMonth) {
+                        return new Array(0, 0, 0);
+                } else if (lunarLeap != 0 || off >= leapOff) {
+                        off += 1;
+                }
+        }
+        monthStart = getNewMoonDay(k+off, timeZone);
+        return jdToDate(monthStart+lunarDay-1);
+}
diff --git a/qml/LichViet/amlich-hnd.js b/qml/LichViet/amlich-hnd.js
new file mode 100644 (file)
index 0000000..05966dd
--- /dev/null
@@ -0,0 +1,411 @@
+\r
+\r
+var ABOUT = "\u00C2m l\u1ECBch Vi\u1EC7t Nam - Version 0.8"+"\n\u00A9 2004 H\u1ED3 Ng\u1ECDc \u0110\u1EE9c [http://come.to/duc]";\r
+var TK19 = new Array(\r
+       0x30baa3, 0x56ab50, 0x422ba0, 0x2cab61, 0x52a370, 0x3c51e8, 0x60d160, 0x4ae4b0, 0x376926, 0x58daa0,\r
+       0x445b50, 0x3116d2, 0x562ae0, 0x3ea2e0, 0x28e2d2, 0x4ec950, 0x38d556, 0x5cb520, 0x46b690, 0x325da4,\r
+       0x5855d0, 0x4225d0, 0x2ca5b3, 0x52a2b0, 0x3da8b7, 0x60a950, 0x4ab4a0, 0x35b2a5, 0x5aad50, 0x4455b0,\r
+       0x302b74, 0x562570, 0x4052f9, 0x6452b0, 0x4e6950, 0x386d56, 0x5e5aa0, 0x46ab50, 0x3256d4, 0x584ae0,\r
+       0x42a570, 0x2d4553, 0x50d2a0, 0x3be8a7, 0x60d550, 0x4a5aa0, 0x34ada5, 0x5a95d0, 0x464ae0, 0x2eaab4,\r
+       0x54a4d0, 0x3ed2b8, 0x64b290, 0x4cb550, 0x385757, 0x5e2da0, 0x4895d0, 0x324d75, 0x5849b0, 0x42a4b0,\r
+       0x2da4b3, 0x506a90, 0x3aad98, 0x606b50, 0x4c2b60, 0x359365, 0x5a9370, 0x464970, 0x306964, 0x52e4a0,\r
+       0x3cea6a, 0x62da90, 0x4e5ad0, 0x392ad6, 0x5e2ae0, 0x4892e0, 0x32cad5, 0x56c950, 0x40d4a0, 0x2bd4a3,\r
+       0x50b690, 0x3a57a7, 0x6055b0, 0x4c25d0, 0x3695b5, 0x5a92b0, 0x44a950, 0x2ed954, 0x54b4a0, 0x3cb550,\r
+       0x286b52, 0x4e55b0, 0x3a2776, 0x5e2570, 0x4852b0, 0x32aaa5, 0x56e950, 0x406aa0, 0x2abaa3, 0x50ab50\r
+); /* Years 2000-2099 */\r
+\r
+var TK20 = new Array(\r
+       0x3c4bd8, 0x624ae0, 0x4ca570, 0x3854d5, 0x5cd260, 0x44d950, 0x315554, 0x5656a0, 0x409ad0, 0x2a55d2,\r
+       0x504ae0, 0x3aa5b6, 0x60a4d0, 0x48d250, 0x33d255, 0x58b540, 0x42d6a0, 0x2cada2, 0x5295b0, 0x3f4977,\r
+       0x644970, 0x4ca4b0, 0x36b4b5, 0x5c6a50, 0x466d50, 0x312b54, 0x562b60, 0x409570, 0x2c52f2, 0x504970,\r
+       0x3a6566, 0x5ed4a0, 0x48ea50, 0x336a95, 0x585ad0, 0x442b60, 0x2f86e3, 0x5292e0, 0x3dc8d7, 0x62c950,\r
+       0x4cd4a0, 0x35d8a6, 0x5ab550, 0x4656a0, 0x31a5b4, 0x5625d0, 0x4092d0, 0x2ad2b2, 0x50a950, 0x38b557,\r
+       0x5e6ca0, 0x48b550, 0x355355, 0x584da0, 0x42a5b0, 0x2f4573, 0x5452b0, 0x3ca9a8, 0x60e950, 0x4c6aa0,\r
+       0x36aea6, 0x5aab50, 0x464b60, 0x30aae4, 0x56a570, 0x405260, 0x28f263, 0x4ed940, 0x38db47, 0x5cd6a0,\r
+       0x4896d0, 0x344dd5, 0x5a4ad0, 0x42a4d0, 0x2cd4b4, 0x52b250, 0x3cd558, 0x60b540, 0x4ab5a0, 0x3755a6,\r
+       0x5c95b0, 0x4649b0, 0x30a974, 0x56a4b0, 0x40aa50, 0x29aa52, 0x4e6d20, 0x39ad47, 0x5eab60, 0x489370,\r
+       0x344af5, 0x5a4970, 0x4464b0, 0x2c74a3, 0x50ea50, 0x3d6a58, 0x6256a0, 0x4aaad0, 0x3696d5, 0x5c92e0\r
+); /* Years 1900-1999 */\r
+\r
+var TK21 = new Array(\r
+       0x46c960, 0x2ed954, 0x54d4a0, 0x3eda50, 0x2a7552, 0x4e56a0, 0x38a7a7, 0x5ea5d0, 0x4a92b0, 0x32aab5,\r
+       0x58a950, 0x42b4a0, 0x2cbaa4, 0x50ad50, 0x3c55d9, 0x624ba0, 0x4ca5b0, 0x375176, 0x5c5270, 0x466930,\r
+       0x307934, 0x546aa0, 0x3ead50, 0x2a5b52, 0x504b60, 0x38a6e6, 0x5ea4e0, 0x48d260, 0x32ea65, 0x56d520,\r
+       0x40daa0, 0x2d56a3, 0x5256d0, 0x3c4afb, 0x6249d0, 0x4ca4d0, 0x37d0b6, 0x5ab250, 0x44b520, 0x2edd25,\r
+       0x54b5a0, 0x3e55d0, 0x2a55b2, 0x5049b0, 0x3aa577, 0x5ea4b0, 0x48aa50, 0x33b255, 0x586d20, 0x40ad60,\r
+       0x2d4b63, 0x525370, 0x3e49e8, 0x60c970, 0x4c54b0, 0x3768a6, 0x5ada50, 0x445aa0, 0x2fa6a4, 0x54aad0,\r
+       0x4052e0, 0x28d2e3, 0x4ec950, 0x38d557, 0x5ed4a0, 0x46d950, 0x325d55, 0x5856a0, 0x42a6d0, 0x2c55d4,\r
+       0x5252b0, 0x3ca9b8, 0x62a930, 0x4ab490, 0x34b6a6, 0x5aad50, 0x4655a0, 0x2eab64, 0x54a570, 0x4052b0,\r
+       0x2ab173, 0x4e6930, 0x386b37, 0x5e6aa0, 0x48ad50, 0x332ad5, 0x582b60, 0x42a570, 0x2e52e4, 0x50d160,\r
+       0x3ae958, 0x60d520, 0x4ada90, 0x355aa6, 0x5a56d0, 0x462ae0, 0x30a9d4, 0x54a2d0, 0x3ed150, 0x28e952\r
+); /* Years 2000-2099 */\r
+\r
+var TK22 = new Array(\r
+               0x4eb520, 0x38d727, 0x5eada0, 0x4a55b0, 0x362db5, 0x5a45b0, 0x44a2b0, 0x2eb2b4, 0x54a950, 0x3cb559,\r
+               0x626b20, 0x4cad50, 0x385766, 0x5c5370, 0x484570, 0x326574, 0x5852b0, 0x406950, 0x2a7953, 0x505aa0,\r
+               0x3baaa7, 0x5ea6d0, 0x4a4ae0, 0x35a2e5, 0x5aa550, 0x42d2a0, 0x2de2a4, 0x52d550, 0x3e5abb, 0x6256a0,\r
+               0x4c96d0, 0x3949b6, 0x5e4ab0, 0x46a8d0, 0x30d4b5, 0x56b290, 0x40b550, 0x2a6d52, 0x504da0, 0x3b9567,\r
+               0x609570, 0x4a49b0, 0x34a975, 0x5a64b0, 0x446a90, 0x2cba94, 0x526b50, 0x3e2b60, 0x28ab61, 0x4c9570,\r
+               0x384ae6, 0x5cd160, 0x46e4a0, 0x2eed25, 0x54da90, 0x405b50, 0x2c36d3, 0x502ae0, 0x3a93d7, 0x6092d0,\r
+               0x4ac950, 0x32d556, 0x58b4a0, 0x42b690, 0x2e5d94, 0x5255b0, 0x3e25fa, 0x6425b0, 0x4e92b0, 0x36aab6,\r
+               0x5c6950, 0x4674a0, 0x31b2a5, 0x54ad50, 0x4055a0, 0x2aab73, 0x522570, 0x3a5377, 0x6052b0, 0x4a6950,\r
+               0x346d56, 0x585aa0, 0x42ab50, 0x2e56d4, 0x544ae0, 0x3ca570, 0x2864d2, 0x4cd260, 0x36eaa6, 0x5ad550,\r
+               0x465aa0, 0x30ada5, 0x5695d0, 0x404ad0, 0x2aa9b3, 0x50a4d0, 0x3ad2b7, 0x5eb250, 0x48b540, 0x33d556\r
+); /* Years 2100-2199 */\r
+\r
+var CAN = new Array("Gi\341p", "\u1EA4t", "B\355nh", "\u0110inh", "M\u1EADu", "K\u1EF7", "Canh", "T\342n", "Nh\342m", "Qu\375");\r
+var CHI = new Array("T\375", "S\u1EEDu", "D\u1EA7n", "Mão", "Th\354n", "T\u1EF5", "Ng\u1ECD", "M\371i", "Th\342n", "D\u1EADu", "Tu\u1EA5t", "H\u1EE3i");\r
+var TUAN = new Array("Ch\u1EE7 Nh\u1EADt", "Th\u1EE9 Hai", "Th\u1EE9 Ba", "Th\u1EE9 T\u01B0", "Th\u1EE9 N\u0103m", "Th\u1EE9 S\341u", "Th\u1EE9 B\u1EA3y");\r
+var GIO_HD = new Array("110100101100", "001101001011", "110011010010", "101100110100", "001011001101", "010010110011");\r
+var TIETKHI = new Array("Xu\u00E2n ph\u00E2n", "Thanh minh", "C\u1ED1c v\u0169", "L\u1EADp h\u1EA1", "Ti\u1EC3u m\u00E3n", "Mang ch\u1EE7ng",\r
+       "H\u1EA1 ch\u00ED", "Ti\u1EC3u th\u1EED", "\u0110\u1EA1i th\u1EED", "L\u1EADp thu", "X\u1EED th\u1EED", "B\u1EA1ch l\u1ED9",\r
+       "Thu ph\u00E2n", "H\u00E0n l\u1ED9", "S\u01B0\u01A1ng gi\u00E1ng", "L\u1EADp \u0111\u00F4ng", "Ti\u1EC3u tuy\u1EBFt", "\u0110\u1EA1i tuy\u1EBFt",\r
+       "\u0110\u00F4ng ch\u00ED", "Ti\u1EC3u h\u00E0n", "\u0110\u1EA1i h\u00E0n", "L\u1EADp xu\u00E2n", "V\u0169 Th\u1EE7y", "Kinh tr\u1EADp"\r
+);\r
+\r
+var LML,RMM;\r
+\r
+/* Create lunar date object, stores (lunar) date, month, year, leap month indicator, and Julian date number */\r
+function LunarDate(dd, mm, yy, leap, jd) {\r
+       this.day = dd;\r
+       this.month = mm;\r
+       this.year = yy;\r
+       this.leap = leap;\r
+       this.jd = jd;\r
+}\r
+\r
+var PI = Math.PI;\r
+\r
+/* Discard the fractional part of a number, e.g., INT(3.2) = 3 */\r
+function INT(d) {\r
+       return Math.floor(d);\r
+}\r
+\r
+function jdn(dd, mm, yy) {\r
+       var a = INT((14 - mm) / 12);\r
+       var y = yy+4800-a;\r
+       var m = mm+12*a-3;\r
+       var jd = dd + INT((153*m+2)/5) + 365*y + INT(y/4) - INT(y/100) + INT(y/400) - 32045;\r
+       return jd;\r
+       //return 367*yy - INT(7*(yy+INT((mm+9)/12))/4) - INT(3*(INT((yy+(mm-9)/7)/100)+1)/4) + INT(275*mm/9)+dd+1721029;\r
+}\r
+\r
+function jdn2date(jd) {\r
+       var Z, A, alpha, B, C, D, E, dd, mm, yyyy, F;\r
+       Z = jd;\r
+       if (Z < 2299161) {\r
+         A = Z;\r
+       } else {\r
+         alpha = INT((Z-1867216.25)/36524.25);\r
+         A = Z + 1 + alpha - INT(alpha/4);\r
+       }\r
+       B = A + 1524;\r
+       C = INT( (B-122.1)/365.25);\r
+       D = INT( 365.25*C );\r
+       E = INT( (B-D)/30.6001 );\r
+       dd = INT(B - D - INT(30.6001*E));\r
+       if (E < 14) {\r
+         mm = E - 1;\r
+       } else {\r
+         mm = E - 13;\r
+       }\r
+       if (mm < 3) {\r
+         yyyy = C - 4715;\r
+       } else {\r
+         yyyy = C - 4716;\r
+       }\r
+       return new Array(dd, mm, yyyy);\r
+}\r
+\r
+function decodeLunarYear(yy, k) {\r
+       var monthLengths, regularMonths, offsetOfTet, leapMonth, leapMonthLength, solarNY, currentJD, j, mm;\r
+       var ly = new Array();\r
+       monthLengths = new Array(29, 30);\r
+        var regularMonths = new Array(12);\r
+       offsetOfTet = k >> 17;\r
+        leapMonth = k & 0xf;\r
+       leapMonthLength = monthLengths[k >> 16 & 0x1];\r
+       solarNY = jdn(1, 1, yy);\r
+       currentJD = solarNY+offsetOfTet;\r
+       j = k >> 4;\r
+        for(var i = 0; i < 12; i++) {\r
+               regularMonths[12 - i - 1] = monthLengths[j & 0x1];\r
+               j >>= 1;\r
+       }\r
+       if (leapMonth == 0) {\r
+               for(mm = 1; mm <= 12; mm++) {\r
+                       ly.push(new LunarDate(1, mm, yy, 0, currentJD));\r
+                       currentJD += regularMonths[mm-1];\r
+               }\r
+       } else {\r
+               for(mm = 1; mm <= leapMonth; mm++) {\r
+                       ly.push(new LunarDate(1, mm, yy, 0, currentJD));\r
+                       currentJD += regularMonths[mm-1];\r
+               }\r
+               ly.push(new LunarDate(1, leapMonth, yy, 1, currentJD));\r
+               currentJD += leapMonthLength;\r
+               for(mm = leapMonth+1; mm <= 12; mm++) {\r
+                       ly.push(new LunarDate(1, mm, yy, 0, currentJD));\r
+                       currentJD += regularMonths[mm-1];\r
+               }\r
+       }\r
+\r
+       LML = leapMonthLength;\r
+       RMM = regularMonths;\r
+       return ly;\r
+}\r
+\r
+function leapMonth(yyyy){\r
+    var yearCode = getYearCode(yyyy);\r
+    return yearCode & 0xf;\r
+}\r
+\r
+function monthLength(yyyy){\r
+    var yearCode = getYearCode(yyyy);\r
+    return yearCode >> 16 & 0x1;\r
+}\r
+\r
+function getYearCode(yyyy){\r
+    var yearCode;\r
+    if (yyyy < 1900) {\r
+            yearCode = TK19[yyyy - 1800];\r
+    } else if (yyyy < 2000) {\r
+            yearCode = TK20[yyyy - 1900];\r
+    } else if (yyyy < 2100) {\r
+            yearCode = TK21[yyyy - 2000];\r
+    } else {\r
+            yearCode = TK22[yyyy - 2100];\r
+    }\r
+    return yearCode;\r
+}\r
+\r
+function getYearInfo(yyyy) {\r
+       var yearCode;\r
+       if (yyyy < 1900) {\r
+               yearCode = TK19[yyyy - 1800];\r
+       } else if (yyyy < 2000) {\r
+               yearCode = TK20[yyyy - 1900];\r
+       } else if (yyyy < 2100) {\r
+               yearCode = TK21[yyyy - 2000];\r
+       } else {\r
+               yearCode = TK22[yyyy - 2100];\r
+       }\r
+       return decodeLunarYear(yyyy, yearCode);\r
+}\r
+\r
+var FIRST_DAY = jdn(25, 1, 1800); // Tet am lich 1800\r
+var LAST_DAY = jdn(31, 12, 2199);\r
+\r
+function findLunarDate(jd, ly) {\r
+       if (jd > LAST_DAY || jd < FIRST_DAY || ly[0].jd > jd) {\r
+               return new LunarDate(0, 0, 0, 0, jd);\r
+       }\r
+       var i = ly.length-1;\r
+       while (jd < ly[i].jd) {\r
+               i--;\r
+       }\r
+       var off = jd - ly[i].jd;\r
+        var ret = new LunarDate(ly[i].day+off, ly[i].month, ly[i].year, ly[i].leap, jd);\r
+       return ret;\r
+}\r
+\r
+function getLunarDate(dd, mm, yyyy) {\r
+       var ly, jd;\r
+       if (yyyy < 1800 || 2199 < yyyy) {\r
+               //return new LunarDate(0, 0, 0, 0, 0);\r
+       }\r
+       ly = getYearInfo(yyyy);\r
+       jd = jdn(dd, mm, yyyy);\r
+       if (jd < ly[0].jd) {\r
+               ly = getYearInfo(yyyy - 1);\r
+       }\r
+       return findLunarDate(jd, ly);\r
+}\r
+\r
+/* Compute the longitude of the sun at any time.\r
+ * Parameter: floating number jdn, the number of days since 1/1/4713 BC noon\r
+ * Algorithm from: "Astronomical Algorithms" by Jean Meeus, 1998\r
+ */\r
+function SunLongitude(jdn) {\r
+       var T, T2, dr, M, L0, DL, lambda, theta, omega;\r
+       T = (jdn - 2451545.0 ) / 36525; // Time in Julian centuries from 2000-01-01 12:00:00 GMT\r
+       T2 = T*T;\r
+       dr = PI/180; // degree to radian\r
+       M = 357.52910 + 35999.05030*T - 0.0001559*T2 - 0.00000048*T*T2; // mean anomaly, degree\r
+       L0 = 280.46645 + 36000.76983*T + 0.0003032*T2; // mean longitude, degree\r
+       DL = (1.914600 - 0.004817*T - 0.000014*T2)*Math.sin(dr*M);\r
+       DL = DL + (0.019993 - 0.000101*T)*Math.sin(dr*2*M) + 0.000290*Math.sin(dr*3*M);\r
+    theta = L0 + DL; // true longitude, degree\r
+    // obtain apparent longitude by correcting for nutation and aberration\r
+    omega = 125.04 - 1934.136 * T;\r
+    lambda = theta - 0.00569 - 0.00478 * Math.sin(omega * dr);\r
+    // Convert to radians\r
+    lambda = lambda*dr;\r
+       lambda = lambda - PI*2*(INT(lambda/(PI*2))); // Normalize to (0, 2*PI)\r
+    return lambda;\r
+}\r
+\r
+/* Compute the sun segment at start (00:00) of the day with the given integral Julian day number.\r
+ * The time zone if the time difference between local time and UTC: 7.0 for UTC+7:00.\r
+ * The function returns a number between 0 and 23.\r
+ * From the day after March equinox and the 1st major term after March equinox, 0 is returned.\r
+ * After that, return 1, 2, 3 ...\r
+ */\r
+function getSunLongitude(dayNumber, timeZone) {\r
+       return INT(SunLongitude(dayNumber - 0.5 - timeZone/24.0) / PI * 12);\r
+}\r
+\r
+var today = new Date();\r
+//var currentLunarYear = getYearInfo(today.getFullYear());\r
+var currentLunarDate = getLunarDate(today.getDate(), today.getMonth()+1, today.getFullYear());\r
+var currentMonth = today.getMonth()+1;\r
+var currentYear = today.getFullYear();\r
+\r
+function parseQuery(q) {\r
+       var ret = new Array();\r
+       if (q.length < 2) return ret;\r
+       var s = q.substring(1, q.length);\r
+       var arr = s.split("&");\r
+       var i, j;\r
+       for (i = 0; i < arr.length; i++) {\r
+               var a = arr[i].split("=");\r
+               for (j = 0; j < a.length; j++) {\r
+                       ret.push(a[j]);\r
+               }\r
+       }\r
+       return ret;\r
+}\r
+\r
+function getSelectedMonth() {\r
+       var query = window.location.search;\r
+       var arr = parseQuery(query);\r
+       var idx;\r
+       for (idx = 0; idx < arr.length; idx++) {\r
+               if (arr[idx] == "mm") {\r
+                       currentMonth = parseInt(arr[idx+1]);\r
+               } else if (arr[idx] == "yy") {\r
+                       currentYear = parseInt(arr[idx+1]);\r
+               }\r
+       }\r
+}\r
+\r
+function getMonth(mm, yy) {\r
+       var ly1, ly2, tet1, jd1, jd2, mm1, yy1, result, i;\r
+       if (mm < 12) {\r
+               mm1 = mm + 1;\r
+               yy1 = yy;\r
+       } else {\r
+               mm1 = 1;\r
+               yy1 = yy + 1;\r
+       }\r
+       jd1 = jdn(1, mm, yy);\r
+       jd2 = jdn(1, mm1, yy1);\r
+       ly1 = getYearInfo(yy);\r
+       //alert('1/'+mm+'/'+yy+' = '+jd1+'; 1/'+mm1+'/'+yy1+' = '+jd2);\r
+       tet1 = ly1[0].jd;\r
+       result = new Array();\r
+       if (tet1 <= jd1) { /* tet(yy) = tet1 < jd1 < jd2 <= 1.1.(yy+1) < tet(yy+1) */\r
+               for (i = jd1; i < jd2; i++) {\r
+                       result.push(findLunarDate(i, ly1));\r
+               }\r
+       } else if (jd1 < tet1 && jd2 < tet1) { /* tet(yy-1) < jd1 < jd2 < tet1 = tet(yy) */\r
+               ly1 = getYearInfo(yy - 1);\r
+               for (i = jd1; i < jd2; i++) {\r
+                       result.push(findLunarDate(i, ly1));\r
+               }\r
+       } else if (jd1 < tet1 && tet1 <= jd2) { /* tet(yy-1) < jd1 < tet1 <= jd2 < tet(yy+1) */\r
+               ly2 = getYearInfo(yy - 1);\r
+               for (i = jd1; i < tet1; i++) {\r
+                       result.push(findLunarDate(i, ly2));\r
+               }\r
+               for (i = tet1; i < jd2; i++) {\r
+                       result.push(findLunarDate(i, ly1));\r
+               }\r
+       }\r
+       return result;\r
+}\r
+\r
+function getDayName(lunarDate) {\r
+       if (lunarDate.day == 0) {\r
+               return "";\r
+       }\r
+       var cc = getCanChi(lunarDate);\r
+       var s = "Ng\u00E0y " + cc[0] +", th\341ng "+cc[1] + ", n\u0103m " + cc[2];\r
+       return s;\r
+}\r
+\r
+function getYearCanChi(year) {\r
+       return CAN[(year+6) % 10] + " " + CHI[(year+8) % 12];\r
+}\r
+\r
+/*\r
+ * Can cua gio Chinh Ty (00:00) cua ngay voi JDN nay\r
+ */\r
+function getCanHour0(jdn) {\r
+       return CAN[(jdn-1)*2 % 10];\r
+}\r
+\r
+function getCanChi(lunar) {\r
+       var dayName, monthName, yearName;\r
+       dayName = CAN[(lunar.jd + 9) % 10] + " " + CHI[(lunar.jd+1)%12];\r
+       monthName = CAN[(lunar.year*12+lunar.month+3) % 10] + " " + CHI[(lunar.month+1)%12];\r
+       if (lunar.leap == 1) {\r
+                monthName += " (N)";\r
+       }\r
+       yearName = getYearCanChi(lunar.year);\r
+       return new Array(dayName, monthName, yearName);\r
+}\r
+\r
+function getDayString(lunar, solarDay, solarMonth, solarYear) {\r
+       var s;\r
+        var dayOfWeek = TUAN[(lunar.jd + 1) % 7];\r
+       s = dayOfWeek + " " + solarDay + "/" + solarMonth + "/" + solarYear;\r
+       s += " -+- ";\r
+       s = s + "Ng\u00E0y " + lunar.day+" th\341ng "+lunar.month;\r
+       if (lunar.leap == 1) {\r
+               s = s + " nhu\u1EADn";\r
+       }\r
+       return s;\r
+}\r
+\r
+function getTodayString() {\r
+       var s = getDayString(currentLunarDate, today.getDate(), today.getMonth()+1, today.getFullYear());\r
+       s += " n\u0103m " + getYearCanChi(currentLunarDate.year);\r
+       return s;\r
+}\r
+\r
+function getCurrentTime() {\r
+       today = new Date();\r
+       var Std = today.getHours();\r
+       var Min = today.getMinutes();\r
+       var Sec = today.getSeconds();\r
+       var s1  = ((Std < 10) ? "0" + Std : Std);\r
+       var s2  = ((Min < 10) ? "0" + Min : Min);\r
+       //var s3  = ((Sec < 10) ? "0" + Sec : Sec);\r
+       //return s1 + ":" + s2 + ":" + s3;\r
+       return s1 + ":" + s2;\r
+}\r
+\r
+function getGioHoangDao(jd) {\r
+       var chiOfDay = (jd+1) % 12;\r
+       var gioHD = GIO_HD[chiOfDay % 6]; // same values for Ty' (1) and Ngo. (6), for Suu and Mui etc.\r
+       var ret = "";\r
+       var count = 0;\r
+       for (var i = 0; i < 12; i++) {\r
+               if (gioHD.charAt(i) == '1') {\r
+                       ret += CHI[i];\r
+                        ret += ' ('+(i*2+23)%24+'h-'+(i*2+1)%24+'h)';\r
+                       if (count++ < 5) ret += ', ';\r
+                        if (count == 3) ret += '<br>';\r
+               }\r
+       }\r
+       return ret;\r
+}\r
+\r
+function getTHU(jd){\r
+    return TUAN[(jd+1)%7];\r
+}\r
+\r
+function getTHUINT(jd){\r
+    return (jd+1)%7;\r
+}\r
diff --git a/qml/LichViet/img/background.jpg b/qml/LichViet/img/background.jpg
new file mode 100644 (file)
index 0000000..c61f523
Binary files /dev/null and b/qml/LichViet/img/background.jpg differ
diff --git a/qml/LichViet/img/button_active.png b/qml/LichViet/img/button_active.png
new file mode 100644 (file)
index 0000000..604d829
Binary files /dev/null and b/qml/LichViet/img/button_active.png differ
diff --git a/qml/LichViet/img/gloss.png b/qml/LichViet/img/gloss.png
new file mode 100644 (file)
index 0000000..5d370cd
Binary files /dev/null and b/qml/LichViet/img/gloss.png differ
diff --git a/qml/LichViet/img/lineedit.png b/qml/LichViet/img/lineedit.png
new file mode 100644 (file)
index 0000000..2cc38dc
Binary files /dev/null and b/qml/LichViet/img/lineedit.png differ
diff --git a/qml/LichViet/img/lineedit.sci b/qml/LichViet/img/lineedit.sci
new file mode 100644 (file)
index 0000000..054bff7
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 10
+border.bottom: 10
+border.right: 10
+source: lineedit.png
diff --git a/qml/LichViet/img/loading.png b/qml/LichViet/img/loading.png
new file mode 100644 (file)
index 0000000..47a1589
Binary files /dev/null and b/qml/LichViet/img/loading.png differ
diff --git a/qml/LichViet/img/quit-back.png b/qml/LichViet/img/quit-back.png
new file mode 100644 (file)
index 0000000..5bda1b6
Binary files /dev/null and b/qml/LichViet/img/quit-back.png differ
diff --git a/qml/LichViet/img/quit.png b/qml/LichViet/img/quit.png
new file mode 100644 (file)
index 0000000..69dc1b8
Binary files /dev/null and b/qml/LichViet/img/quit.png differ
diff --git a/qml/LichViet/img/quit_pressed.png b/qml/LichViet/img/quit_pressed.png
new file mode 100644 (file)
index 0000000..972ece5
Binary files /dev/null and b/qml/LichViet/img/quit_pressed.png differ
diff --git a/qml/LichViet/img/stripes.png b/qml/LichViet/img/stripes.png
new file mode 100644 (file)
index 0000000..9f36727
Binary files /dev/null and b/qml/LichViet/img/stripes.png differ
diff --git a/qml/LichViet/img/switch_off.png b/qml/LichViet/img/switch_off.png
new file mode 100644 (file)
index 0000000..3a9098c
Binary files /dev/null and b/qml/LichViet/img/switch_off.png differ
diff --git a/qml/LichViet/img/switch_on.png b/qml/LichViet/img/switch_on.png
new file mode 100644 (file)
index 0000000..666d052
Binary files /dev/null and b/qml/LichViet/img/switch_on.png differ
diff --git a/qml/LichViet/img/titlebar.png b/qml/LichViet/img/titlebar.png
new file mode 100644 (file)
index 0000000..51c9008
Binary files /dev/null and b/qml/LichViet/img/titlebar.png differ
diff --git a/qml/LichViet/img/titlebar.sci b/qml/LichViet/img/titlebar.sci
new file mode 100644 (file)
index 0000000..0418d94
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 12
+border.bottom: 12
+border.right: 10
+source: titlebar.png
diff --git a/qml/LichViet/img/toolbutton-back.png b/qml/LichViet/img/toolbutton-back.png
new file mode 100644 (file)
index 0000000..1131001
Binary files /dev/null and b/qml/LichViet/img/toolbutton-back.png differ
diff --git a/qml/LichViet/img/toolbutton.png b/qml/LichViet/img/toolbutton.png
new file mode 100644 (file)
index 0000000..9ecc83b
Binary files /dev/null and b/qml/LichViet/img/toolbutton.png differ
diff --git a/qml/LichViet/img/toolbutton.sci b/qml/LichViet/img/toolbutton.sci
new file mode 100644 (file)
index 0000000..9e4f965
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 15
+border.top: 4
+border.bottom: 4
+border.right: 15
+source: toolbutton.png
diff --git a/qml/LichViet/img/toolbutton_pressed.png b/qml/LichViet/img/toolbutton_pressed.png
new file mode 100644 (file)
index 0000000..4d2969f
Binary files /dev/null and b/qml/LichViet/img/toolbutton_pressed.png differ
diff --git a/qml/LichViet/img/toolbutton_pressed.sci b/qml/LichViet/img/toolbutton_pressed.sci
new file mode 100644 (file)
index 0000000..95a4502
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 15
+border.top: 4
+border.bottom: 4
+border.right: 15
+source: toolbutton_pressed.png
diff --git a/qml/LichViet/img/topbar.jpg b/qml/LichViet/img/topbar.jpg
new file mode 100644 (file)
index 0000000..186f0b0
Binary files /dev/null and b/qml/LichViet/img/topbar.jpg differ
diff --git a/qml/LichViet/main.qml b/qml/LichViet/main.qml
new file mode 100644 (file)
index 0000000..99ca088
--- /dev/null
@@ -0,0 +1,445 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+import QtQuick 1.0
+import "amlich-hnd.js" as AmLich
+import "amlich-aa98.js" as AmLich98
+
+import "Settings.js" as Settings
+import "Themes.js" as Themes
+
+Item {
+     id: screen
+     width: 800
+     height: 480
+
+     property int curDay: LC.curDay()
+     property int curMonth: LC.curMonth()
+     property int curYear: LC.curYear()
+
+     property int initcurDay: LC.curDay()
+     property int initcurMonth: LC.curMonth()
+     property int initcurYear:LC.curYear()
+
+     property int lunarDay: AmLich.getLunarDate(curDay,curMonth,curYear).day
+     property int lunarMonth: AmLich.getLunarDate(curDay,curMonth,curYear).month
+     property string lunarYear: AmLich.getCanChi(AmLich.getLunarDate(curDay,curMonth,curYear))[2]
+
+     property int lunarYearInt : AmLich.getLunarDate(curDay,curMonth,curYear).year
+     property int jd : AmLich.getLunarDate(curDay,curMonth,curYear).jd
+     property string lunarGioHoangDao : AmLich.getGioHoangDao(jd)
+
+     property string lunarDayCanChi : AmLich.getCanChi(AmLich.getLunarDate(curDay,curMonth,curYear))[0]
+     property string lunarMonthCanChi : AmLich.getCanChi(AmLich.getLunarDate(curDay,curMonth,curYear))[1]
+
+     //property string lunarCanHour : AmLich.getCanHour0(LC.curHour())
+
+     state:"mainscreen"
+
+     Loader {
+         id: theme_manager
+         property alias theme: theme_manager.item
+         source: Themes.default_theme()
+     }
+
+     Rectangle {
+         id: background
+         anchors.fill: parent
+         color: "#343434"
+
+         state:"jumptodate"
+         Image {
+             source: theme_manager.theme.background_image; fillMode: Image.Tile; anchors.fill: parent; opacity: 0.3
+         }
+
+
+         MouseArea {
+             id:mouseareaMM
+             property int  xfrom: 0
+             property int  yfrom: 0
+
+             property int fixed: 40
+             property int rise: 0
+
+             anchors.fill: parent
+
+             onPressAndHold:{
+                 if (Settings.pressandhold()==1){
+                    screen.state="xemngaytotxauhoangdao"
+                 }
+             }
+
+             onDoubleClicked:{
+
+                 if (Settings.doubleclicked()==1){
+                     screen.state="datetimedialog"
+                 }
+             }
+
+ /*            onPressed: {
+                 xfrom=mouseX;
+                 yfrom=mouseY;
+             }
+
+             onReleased : {
+                 rise = mouseX - xfrom
+                 if (rise > fixed || rise <  -fixed){
+                 if (mouseX < xfrom){
+                     calculateLunar(LC.nextDay(), LC.curMonth(), LC.curYear())
+                 }else{
+                      calculateLunar(LC.prevDay(), LC.curMonth(), LC.curYear())
+                 }
+                 }
+
+             }*/
+         }
+
+         Text {
+             id: txtDMY
+             x: 140
+             y: 77
+             width: 80
+             height: 20
+             color: "#29d999"
+             text: "Tháng "+screen.curMonth+" Năm "+screen.curYear
+             anchors.horizontalCenter: parent.horizontalCenter
+             font.bold: true
+             font.family: "Tahoma"
+             smooth: true
+             horizontalAlignment: Text.AlignHCenter
+             font.pixelSize: 28
+         }
+
+         /*
+         Text {
+             id: txtDAY
+             x: 151
+             y: 126
+             width: 80
+             height: 20
+             color: "#f0f0f5"
+             text: screen.curDay
+             horizontalAlignment: Text.AlignHCenter
+             anchors.horizontalCenter: parent.horizontalCenter
+             opacity: 0.6
+             font.bold: true
+             font.pixelSize: 80
+         }
+*/
+
+         //------------------------------------------------
+
+                  Rectangle {
+                      id:reelx
+                              width: 300
+                              height: 100
+                                           y: 126
+                                           anchors.horizontalCenter: parent.horizontalCenter
+                                           property int index: 0
+         onIndexChanged: txtDATEpv.currentIndex = reelx.index
+         color: "transparent"
+                      Component {
+                          id: delegate
+                          Column {
+                              id: wrapper
+                              Text {
+                                  id: nameText
+                                  text: name
+                                  font.bold: true
+                                  font.pixelSize: wrapper.PathView.isCurrentItem ? 80 : 40
+                                  color: wrapper.PathView.isCurrentItem ? "#FFFFFF" : "grey"
+                              }
+                          }
+                      }
+
+                      PathView {
+                          id:txtDATEpv
+                          anchors.fill: parent
+                          model: maindatemodel
+                          delegate: delegate
+                          pathItemCount: 3
+                          clip: true
+                          preferredHighlightBegin: 0.5
+                          preferredHighlightEnd: 0.5
+                          highlightRangeMode: PathView.StrictlyEnforceRange
+                          focus: true
+                          path: Path {
+                              startX: 0
+                              startY: 50
+                              PathLine {x: reelx.width; y: 50}
+                          }
+                          onMovementEnded: {
+                              calculateLunar(txtDATEpv.currentIndex+1, LC.curMonth(), LC.curYear())
+                          }
+                      }
+                  }
+                  ListModel {
+                      id:maindatemodel
+
+                      function reset(){
+                          while(maindatemodel.count>0){
+                              try{maindatemodel.remove(maindatemodel.count-1)}catch(e){}
+                          }
+
+                          for(var i=1;i<=LC.calDays(screen.curMonth,screen.curYear);i++)
+                              append({name:i})
+                          reelx.index = screen.curDay -1
+                      }
+                  }
+
+         //-------------------------------------------------
+                  Component.onCompleted: {
+                     maindatemodel.reset()
+                  }
+
+         Text {
+             id: txtTHU
+             x: 151
+             y: 240
+             width: 80
+             height: 20
+             color: "#f0f0f5"
+             text: AmLich.getTHU(screen.jd)
+             horizontalAlignment: Text.AlignHCenter
+             anchors.horizontalCenter: parent.horizontalCenter
+             opacity: 0.6
+             font.bold: true
+             font.pixelSize: 30
+         }
+
+         Text {
+
+             id: txtDAYAmLich
+             x: 151
+             y: 300
+             width: 80
+             height: 20
+             color: "#f0f0f5"
+             text: "Ngày <span style='color:#C0C0C0;'>"+screen.lunarDay+" ("+screen.lunarDayCanChi+")</span><br>Tháng <span style='color:#C0C0C0;'>"+screen.lunarMonth+" ("+screen.lunarMonthCanChi+")</span><br>Năm <span style='color:#C0C0C0;'>"+screen.lunarYearInt+" ("+screen.lunarYear+")</span>"
+             horizontalAlignment: Text.AlignHCenter
+             anchors.horizontalCenter: parent.horizontalCenter
+             opacity: 0.6
+             font.bold: true
+             font.pixelSize: 28
+         }
+
+
+         MenuScreen{
+             id: menuScreen
+             state:"menuscreen"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+         OptionsScreen{
+             id: optionsScreen
+             state:"optionsscreen"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+         XemNgayTotXauHoangDao{
+             id: xntxhdScreen
+             state:"xemngaytotxauhoangdao"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+         DateTimeDialog{
+             id: datetimeDialog
+             state:"datetimedialog"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+         AmDateTimeDialog{
+             id: amdatetimeDialog
+             state:"amdatetimedialog"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+         FullMonth{
+             id: fullmonthDialog
+             state:"xemtheothang"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+         NoFeatureDialog{
+             id: nofeatureDialog
+             state:"nofeaturedialog"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+
+         About{
+             id: aboutDialog
+             state:"aboutdialog"
+             anchors.verticalCenter: parent.verticalCenter
+             width: parent.width; height: parent.height-60;
+             x: -(screen.width * 1.5)
+         }
+
+
+         MultiTitleBar { id: titleBar; width: parent.width }
+         ToolBar { id: toolBar; height: 50;
+             y: screen.height - 48
+             width: parent.width; opacity: 0.9
+             button1Label: "Menu"
+             button2Label: "Lựa Chọn"
+             onButton1Clicked:
+             {
+                 screen.state="menuscreen"
+             }
+             onButton2Clicked: {
+                 screen.state="optionsscreen"
+             }
+         }
+     }
+
+     states: [
+         State {
+             name: "menuscreen";
+             PropertyChanges { target: menuScreen; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+                          PropertyChanges { target: mouseareaMM;enabled:false }
+
+         },
+         State {
+             name: "optionsscreen";
+             PropertyChanges { target: optionsScreen; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+                          PropertyChanges { target: mouseareaMM;enabled:false }
+
+         },
+         State {
+             name: "xemngaytotxauhoangdao";
+             PropertyChanges { target: xntxhdScreen; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+             PropertyChanges { target: mouseareaMM;enabled:false }
+
+         },
+         State {
+             name: "datetimedialog";
+             PropertyChanges { target: datetimeDialog; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+             PropertyChanges { target: mouseareaMM;enabled:false }
+                                                                 PropertyChanges { target: reelx;enabled:false }
+             StateChangeScript {
+                 script:{
+                     datetimeDialog.reset()
+                 }
+                }
+         },
+         State {
+             name: "amdatetimedialog";
+             PropertyChanges { target: amdatetimeDialog; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+             PropertyChanges { target: mouseareaMM;enabled:false }
+                                                                 PropertyChanges { target: reelx;enabled:false }
+             StateChangeScript {
+                 script:{
+                     amdatetimeDialog.reset()
+                 }
+                }
+         },
+         State {
+             name: "nofeaturedialog";
+             PropertyChanges { target: nofeatureDialog; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+             PropertyChanges { target: mouseareaMM;enabled:false }
+                                                                 PropertyChanges { target: reelx;enabled:false }
+         },
+         State {
+             name: "aboutdialog";
+             PropertyChanges { target: aboutDialog; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+             PropertyChanges { target: mouseareaMM;enabled:false }
+         },
+         State {
+             name: "xemtheothang";
+             PropertyChanges { target: fullmonthDialog; x: 0; focus:true}
+             PropertyChanges { target: toolBar; y: screen.height }
+             PropertyChanges { target: toolBar }
+             StateChangeScript {
+                 script:{
+                     fullmonthDialog.reset()
+                 }
+                }
+             PropertyChanges { target: mouseareaMM;enabled:false }
+         }
+     ]
+
+     transitions: [
+         Transition { NumberAnimation { properties: "x,y,opacity"; duration: 500; easing.type: Easing.InOutBack } }
+     ]
+
+
+     function lunarTietKhi(){
+         return AmLich.TIETKHI[AmLich.getSunLongitude(screen.jd+1,7.0)];
+     }
+
+
+     function calculateLunar(D,M,Y){
+         screen.curDay =D
+         screen.curMonth = M
+         screen.curYear = Y
+         screen.lunarDay = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).day
+         screen.lunarMonth = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).month
+         screen.lunarYearInt = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).year
+         screen.lunarYear = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[2]//AmLich.getYearCanChi(screen.curYear)
+         screen.jd = AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear).jd
+         screen.lunarGioHoangDao = AmLich.getGioHoangDao(screen.jd)
+
+         screen.lunarDayCanChi = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[0]
+         screen.lunarMonthCanChi = AmLich.getCanChi(AmLich.getLunarDate(screen.curDay,screen.curMonth,screen.curYear))[1]
+
+         //console.log(screen.curDay+" "+screen.curMonth+" "+screen.curYear)
+         //console.log( AmLich.getCanChi(AmLich.getLunarDate(30,1,2007)))
+     }
+
+     function reset(){
+         calculateLunar(initcurDay, initcurMonth, initcurYear)
+         LC.reset(initcurDay, initcurMonth, initcurYear)
+         screen.state="mainscreen"
+         maindatemodel.reset()
+         txtDATEpv.currentIndex = initcurDay-1;
+     }
+
+     function refresh(){
+     }
+
+     Component.onCompleted: {
+
+     }
+}
diff --git a/qml/LichViet/xemngaytotxau.js b/qml/LichViet/xemngaytotxau.js
new file mode 100644 (file)
index 0000000..0a9b54b
--- /dev/null
@@ -0,0 +1,1153 @@
+/*
+Copyright (C) 2011  by Cuong Le <metacuong@gmail.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program 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 General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>
+*/
+
+.pragma library
+
+/*
+Phương Nam   1.Giác         2.Cang  3.Đe           4.Phòng        5.Tâm  6.Vĩ           7.Cơ
+Phương Đông        8.Đẩu        9.Ngưu         10.Nữ         11.Hư  12.Nguy         13.Thất       14.Bích
+Phương Bắc         15.Khuê        16.Lâu         17.Vị         18.Mão         19.Tất        20.Chuỷ       21.Sâm
+Phương Tây  22.Tinh         23.Quỷ        24.Liễu       25.Tinh         26.Trương     27.Lực        28.Chẩn
+Ngày tuần lễ      Thứ Năm      Thứ sáu      Thứ bảy     Chủ nhật    Thứ hai       Thứ ba        Thứ tư
+Thống thuộc
+sao theo hệ
+mặt trời             Mộc         Kim              Thổ           Thái dươn  Thái âm         Hoả           Thuỷ
+  */
+var TUAN_SAO = new Array("Giác", "Cáng", "Đê", "Phòng", "Tâm", "Vĩ", "Cơ", "Đẩu", "Ngưu","Nữ","Hư","Nguy","Thất",
+                         "Bích","Khuê","Lâu","Vị","Mão","Tất","Chủy","Sâm","Tinh","Quỷ","Liễu","Tinh","Trương","Lực","Chẩn");
+var SAO_CON_VAT = new Array("Giao Long","Rồng","Lạc","Thỏ","Hồ","Hổ","Báo","Giải","Trâu","Dơi","Chuột","Én","Lợn",
+                            "Du","Lang","Chó","Trĩ","Gà","Chim","Khỉ","Vượn","Hươu Bướu","Dê","Hoẵng","Ngựa","Hươu","Rắn","Giun");
+var SAO_THUOC = new Array("Mộc","Kim","Thổ","Thái Dương","Thái Âm","Hoả","Thuỷ","Mộc","Kim","Thổ",
+                          "Thái Dương","Thái Âm","Hoả","Thuỷ","Mộc","Kim","Thổ","Thái Dương","Thái Âm","Hoả","Thuỷ",
+                          "Mộc","Kim","Thổ","Thái Dương","Thái Âm","Hoả","Thuỷ")
+
+function sao(curYear, totalDays) {
+
+    var t=5;//1900
+
+    if (curYear > 1900){
+        for (var j=1901;j<=curYear;j++){
+            if (j % 4 == 0)
+                    t+=2;
+            else
+                    t+=1
+        }
+    }
+
+    while (t>28){
+        t-=28;
+    }
+    var k = t+totalDays;
+    while (k>28){
+        k-=28;
+    }
+
+    return "Sao: <b>"+TUAN_SAO[k-1]+"</b> Thuộc: <b>"+SAO_THUOC[k-1]+"</b> Con vật: <b>"+SAO_CON_VAT[k-1]+"</b>"
+}
+
+var TRUC = new Array("Kiến", "Trừ","Mãn","Bình","Định","Chấp","Phá","Nguy","Thành","Thu","Khai","Bế");
+
+var glTruc = -1;
+
+var TRUC_TOT_XAU = new Array(
+        "Tốt với xuất hành, giá thú.<br>Nhưng xấu với động thổ (vì trùng với Thổ phủ)",
+        "Tốt nói chung",
+        "Tốt với tế tự, cầu tài, cầu phú, xấu với các việc khác (vì trùng sao xấu)",
+        "Tốt với mọi việc",
+        "Tốt với cầu tài, ký hợp đồng, yến tiệc xấu với tố tụng, tranh chấp, chữa bệnh (vì có Đại hao, Quan phù)",
+        "Tốt với khởi công xây dựng, xấu với xuất hành, di chuyển, khai trương",
+        "Xấu với mọi việc, riêng chữa bệnh, dỡ nhà củ, phá bỏ đồ củ là tốt",
+         "Mọi việc đều xấu",
+        "Tốt với xuất hành, giá thú, khai trương. Xấu với kiện cáo, tranh chấp",
+        "Thu hoạch tốt, kỵ khởi công, xuất hành, an táng",
+        "Tốt mọi việc, trừ động thổ, an táng",
+        "Xấu mọi việc, trừ đắp đê, lấp hố rãnh"
+        );
+
+var TRUC_THANG = new Array(
+        new Array([3, 0],[4, 1],[5, 2],[6, 3],[7, 4],[8, 5],[9, 6],[10, 7],[11, 8],[12, 9],[1, 10],[2, 11]),//1
+        new Array([4, 0],[5, 1],[6, 2],[7, 3],[8, 4],[9, 5],[10, 6],[11, 7],[12, 8],[1, 9],[2, 10],[3, 11]),//2
+        new Array([5, 0],[6, 1],[7, 2],[8, 3],[9, 4],[10, 5],[11, 6],[12, 7],[1, 8],[2, 9],[3, 10],[4, 11]),//3
+        new Array([6, 0],[7, 1],[8, 2],[9, 3],[10, 4],[11, 5],[12, 6],[1, 7],[2, 8],[3, 9],[4, 10],[5, 11]),//4
+        new Array([7, 0],[8, 1],[9, 2],[10, 3],[11, 4],[12, 5],[1, 6],[2, 7],[3, 8],[4, 9],[5, 10],[6, 11]),//5
+        new Array([8, 0],[9, 1],[10, 2],[11, 3],[12, 4],[1, 5],[2, 6],[3, 7],[4, 8],[5, 9],[6, 10],[7, 11]),//6
+        new Array([9, 0],[10, 1],[11, 2],[12, 3],[1, 4],[2, 5],[3, 6],[4, 7],[5, 8],[6, 9],[7, 10],[8, 11]),//7
+        new Array([10, 0],[11, 1],[12, 2],[1, 3],[2, 4],[3, 5],[4, 6],[5, 7],[6, 8],[7, 9],[8, 10],[9, 11]),//8
+        new Array([11, 0],[12, 1],[1, 2],[2, 3],[3, 4],[4, 5],[5, 6],[6, 7],[7, 8],[8, 9],[9, 10],[10, 11]),//9
+        new Array([12, 0],[1, 1],[2, 2],[3, 3],[4, 4],[5, 5],[6, 6],[7, 7],[8, 8],[9, 9],[10, 10],[11, 11]),//10
+        new Array([1, 0],[2, 1],[3, 2],[4, 3],[5, 4],[6, 5],[7, 6],[8, 7],[9, 8],[10, 9],[11, 10],[12, 11]),//11
+        new Array([2, 0],[3, 1],[4, 2],[5, 3],[6, 4],[7, 5],[8, 6],[9, 7],[10, 8],[11, 9],[12, 10],[1, 11])//12
+        )
+
+var HD = new Array(
+        "Thanh Long Hoàng đạo",
+        "Minh Đường Hoàng đạo",
+        "Thiên Hình Hắc đạo",
+        "Chu Tước Hắc đạo",
+        "Kim Quỹ Hoàng đạo",
+        "Bảo Quang(Kim Đường) Hoàng đạo",
+        "Bạch Hổ Hắc đạo",
+        "Ngọc Đường Hoàng đạo",
+        "Thiên Lao Hắc đạo",
+        "Nguyên Vũ Hắc đạo",
+        "Tư Mệnh Hoàng đạo",
+        "Câu Trận Hắc đạo"
+        )
+
+var HD_MATRIX = new Array(
+        new Array([9, 0],[10, 1],[11, 2],[12, 3],[1, 4],[2, 5],[3, 6],[4, 7],[5, 8],[6, 9],[7, 10],[8, 11]),//1 Ty
+        new Array([11, 0],[12, 1],[1, 2],[2, 3],[3, 4],[4, 5],[5, 6],[6, 7],[7, 8],[8, 9],[9, 10],[10, 11]),//2 Suu
+        new Array([1, 0],[2, 1],[3, 2],[4, 3],[5, 4],[6, 5],[7, 6],[8, 7],[9, 8],[10, 9],[11, 10],[12, 11]),//3 Dan
+        new Array([3, 0],[4, 1],[5, 2],[6, 3],[7, 4],[8, 5],[9, 6],[10, 7],[11, 8],[12, 9],[1, 10],[2, 11]),//4 Mao
+        new Array([5, 0],[6, 1],[7, 2],[8, 3],[9, 4],[10, 5],[11, 6],[12, 7],[1, 8],[2, 9],[3, 10],[4, 11]),//5 Thin
+        new Array([7, 0],[8, 1],[9, 2],[10, 3],[11, 4],[12, 5],[1, 6],[2, 7],[3, 8],[4, 9],[5, 10],[6, 11]),//6 Ty
+        new Array([9, 0],[10, 1],[11, 2],[12, 3],[1, 4],[2, 5],[3, 6],[4, 7],[5, 8],[6, 9],[7, 10],[8, 11]),//7 Ngo
+        new Array([11, 0],[12, 1],[1, 2],[2, 3],[3, 4],[4, 5],[5, 6],[6, 7],[7, 8],[8, 9],[9, 10],[10, 11]),//8 Mui
+        new Array([1, 0],[2, 1],[3, 2],[4, 3],[5, 4],[6, 5],[7, 6],[8, 7],[9, 8],[10, 9],[11, 10],[12, 11]),//9 Than
+        new Array([3, 0],[4, 1],[5, 2],[6, 3],[7, 4],[8, 5],[9, 6],[10, 7],[11, 8],[12, 9],[1, 10],[2, 11]),//10 Dau
+        new Array([5, 0],[6, 1],[7, 2],[8, 3],[9, 4],[10, 5],[11, 6],[12, 7],[1, 8],[2, 9],[3, 10],[4, 11]),//11 Tuat
+        new Array([7, 0],[8, 1],[9, 2],[10, 3],[11, 4],[12, 5],[1, 6],[2, 7],[3, 8],[4, 9],[5, 10],[6, 11])//12 Hoi
+
+
+        )
+
+
+function truc(lunarMonth, lunarDayCanChi, lunarMonthCanChi){
+    var CHI = lunarDayCanChi.split(" ")[1];
+    var MCHI = lunarMonthCanChi.split(" ")[1];
+
+    var chi_so_gia;
+
+    switch(CHI){
+    case "Tý": chi_so_gia=1; break;
+    case "Sửu":  chi_so_gia=2; break;
+    case "Dần": chi_so_gia=3; break;
+    case "Mão":  chi_so_gia=4; break;
+    case "Thìn": chi_so_gia=5; break;
+    case "Tỵ": chi_so_gia=6; break;
+    case "Ngọ":  chi_so_gia=7; break;
+    case "Mùi":  chi_so_gia=8; break;
+    case "Thân":  chi_so_gia=9; break;
+    case "Dậu":  chi_so_gia=10; break;
+    case "Tuất":  chi_so_gia=11; break;
+    case "Hợi":  chi_so_gia=12; break;
+    }
+
+    var getTrucofMonth = TRUC_THANG[lunarMonth-1];
+    var txtTruc="";
+
+    for (var i=0;i<12;i++)
+        if (getTrucofMonth[i][0]==chi_so_gia){
+            txtTruc = TRUC[getTrucofMonth[i][1]];
+            glTruc = getTrucofMonth[i][1];
+            break;
+        }
+
+   var chi_so_giaM;
+
+    switch(MCHI){
+    case "Tý": chi_so_giaM=1; break;
+    case "Sửu":  chi_so_giaM=2; break;
+    case "Dần": chi_so_giaM=3; break;
+    case "Mão":  chi_so_giaM=4; break;
+    case "Thìn": chi_so_giaM=5; break;
+    case "Tỵ": chi_so_giaM=6; break;
+    case "Ngọ":  chi_so_giaM=7; break;
+    case "Mùi":  chi_so_giaM=8; break;
+    case "Thân":  chi_so_giaM=9; break;
+    case "Dậu":  chi_so_giaM=10; break;
+    case "Tuất":  chi_so_giaM=11; break;
+    case "Hợi":  chi_so_giaM=12; break;
+    }
+
+    var txtLangay = "";
+
+   for(i=0;i<12;i++)
+       if (HD_MATRIX[chi_so_giaM-1][i][0] == chi_so_gia){
+           txtLangay=HD[HD_MATRIX[chi_so_giaM-1][i][1]];
+           break;
+       }
+
+    return "Là ngày: <b>"+txtLangay+"</b>, Trực: <b>"+txtTruc+"</b>";
+}
+
+
+function luangiai(curDay){
+    /*if (glTruc != -1){
+        return TRUC_TOT_XAU[glTruc];
+    }*/
+    return "Tốt đối với:<br>Hơi tốt:<br>Hạn chế làm:<br>Không nên:<br>";
+}
+
+var SAO_TOT_TEN = new Array(
+        "Thiên đức",
+        "Thiên đức hợp",
+        "Nguyệt Đức",
+        "Nguyệt đức hợp",
+        "Thiên hỷ",
+        "Thiên phú",
+        "Thiên Quý",
+        "Thiên Xá",
+        "Sinh khí",
+        "Thiên Phúc",
+        "Thiên thành",
+        "Thiên Quan",
+        "Thiên Mã",
+        "Thiên tài",
+        "Địa tài",
+        "Nguyệt Tài",
+        "Nguyệt Ân",
+        "Nguyệt Không",
+        "Minh tinh",
+        "Thánh tâm",
+        "Ngũ phú",
+        "Lộc khố",
+        "Phúc Sinh",
+        "Cát Khánh",
+        "Âm Đức",
+        "U Vi tinh",
+        "Mãn đức tinh",
+        "Kính Tâm",
+        "Tuế hợp",
+        "Nguyệt giải",
+        "Quan nhật",
+        "Hoạt điệu",
+        "Giải thần",
+        "Phổ hộ",
+        "Ích Hậu",
+        "Tục Thế",
+        "Yếu yên",
+        "Dịch Mã",
+        "Tam Hợp",
+        "Lục Hợp",
+       "Mẫu Thương",
+        "Phúc hậu",
+        "Đại Hồng Sa",
+        "Dân nhật, thời đức",
+        "Hoàng Ân",
+        "Thanh Long",
+        "Minh đường",
+        "Kim đường",
+        "Ngọc đường"
+            );
+
+var SAO_TOT_MATRIX = new Array(
+                                new Array(
+            "Đinh",
+            "Nhâm",
+            "Bính",
+            "Tân",
+            "Tuất",
+            "Thìn",
+            "Giáp Ất",
+            "Mậu Dần",
+            "Tý",
+            "Kỷ",
+            "Mùi",
+            "Tuất",
+            "Ngọ",
+            "Thìn",
+            "Tỵ",
+            "Ngọ",
+            "Bính",
+            "Nhâm",
+            "Thân",
+            "Hợi",
+            "Hợi",
+            "Thìn",
+            "Dậu",
+            "Dậu",
+            "Dậu",
+            "Hợi",
+            "Dần",
+            "Mùi",
+            "Sửu",
+            "Thân",
+            " -",
+            "Tỵ",
+            "Thân",
+            "Thân",
+            "Tý",
+            "Sửu",
+            "Dần",
+            "Thân",
+            "Ngọ Tuất",
+            "Hợi",
+            "Hợi Tý",
+            "Dần",
+            "Tý Sửu",
+            "Ngọ",
+            "Tuất",
+            "Tý",
+            "Sửu",
+            "Tỵ",
+            "Mùi"
+            ),//1
+                                new Array(
+            "Thân",
+            "Tý",
+            "Giáp",
+            "Kỷ",
+            "Hợi",
+            "Tỵ",
+            "Giáp Ất",
+            "Mậu Dần",
+            "Sửu",
+            "Mậu",
+            "Dậu",
+            "Tý",
+            "Thân",
+            "Ngọ",
+            "Mùi",
+            "Tỵ",
+            "Đinh",
+            "Canh",
+            "Tuất",
+            "Tỵ",
+            "Dần",
+            "Tỵ",
+            "Mão",
+            "Dần",
+            "Mùi",
+            "Thìn",
+            "Mùi",
+            "Sửu",
+            "Tý",
+            "Thân",
+            "Mão",
+            "Tuất",
+            "Thân",
+            "Dần",
+            "Ngọ",
+            "Mùi",
+            "Thân",
+            "Tỵ",
+            "Mùi Hợi",
+            "Tuất",
+            "Hợi Tý",
+            "Dần",
+            "Tý Sửu",
+            "Ngọ",
+            "Sửu",
+            "Dần",
+            "Mão",
+            "Mùi",
+            "Dậu"
+            ),//2
+                                new Array(//3
+            "Nhâm",
+            "Đinh",
+            "Nhâm",
+            "Đinh",
+            "Tý",
+            "Ngọ",
+            "Giáp Ất",
+            "Mậu Dần",
+            "Dần",
+            "-",
+            "Hợi",
+            "Dần",
+            "Tuất",
+            "Thân",
+            "Dậu",
+            "Tỵ",
+            "Canh",
+            "Bính",
+            "Tý",
+            "Tý",
+            "Tỵ",
+            "Ngọ",
+            "Tuất",
+            "Hợi",
+            "Tỵ",
+            "Sửu",
+            "Thìn",
+            "Thân",
+            "Hợi",
+            "Dậu",
+            "-",
+            "Mùi",
+            "Tuất",
+            "Dậu",
+            "Sửu",
+            "Dần",
+            "Mão",
+            "Dần",
+            "Thân Tý",
+            "Dậu",
+            "Hợi Tý",
+            "Dần",
+            "Tý Sửu",
+            "Ngọ",
+            "Dần",
+            "Thìn",
+            "Tỵ",
+            "Dậu",
+            "Hợi"
+                                ),
+                                new Array(
+            "Tân",
+            "Bính",
+            "Canh",
+            "Ất",
+            "Sửu",
+            "Mùi",
+            "Bính Đinh",
+            "Giáp Ngọ",
+            "Mão",
+            "Tân Quý",
+            "Sửu",
+            "Thìn",
+            "Tý",
+            "Tuất",
+            "Hợi",
+            "Mùi",
+            "Kỷ",
+            "Giáp",
+            "Dần",
+            "Ngọ",
+            "Thân",
+            "Mùi",
+            "Thìn",
+            "Thìn",
+            "Mão",
+            "Ngọ",
+            "Dậu",
+            "Dần",
+            "Tuất",
+            "Dậu",
+            " -",
+            "Tý",
+            "Tuất",
+            "Mão",
+            "Mùi",
+            "Thân",
+            "Dậu",
+            "Hợi",
+            "Dậu Sửu",
+            "Thân",
+            "Dần Mão",
+            "Tỵ",
+            "Thìn Tỵ",
+            "Dậu",
+            "Tỵ",
+            "Ngọ",
+            "Mùi",
+            "Hợi",
+            "Sửu"
+            ),//4
+                                new Array(
+            "Hợi",
+            "Dần",
+            "Bính",
+            "Tân",
+            "Dần",
+            "Thân",
+            "Bính Đinh",
+            " -",
+            "Thìn",
+            "Tân Nhâm",
+            "Mão",
+            "Ngọ",
+            "Dần",
+            "Tý",
+            "Sửu",
+            "Dậu",
+            "Mậu",
+            "Nhâm",
+            "Thìn",
+            "Sửu",
+            "Hợi",
+            "Thân",
+            "Hợi",
+            "Sửu",
+            "Sửu",
+            "Mão",
+            "Ngọ",
+            "Dậu",
+            "Dậu",
+            "Tuất",
+            "Ngọ",
+            "Dậu",
+            "Tý",
+            "Tuất",
+            "Dần",
+            "Mão",
+            "Thìn",
+            "Thân",
+            "Tuất Dần",
+            "Mùi",
+            "Dần Mão",
+            "Tỵ",
+            "Thìn Tỵ",
+            "Dậu",
+            "Dậu",
+            "Thân",
+            "Dậu",
+            "Sửu",
+            "Mão"
+            ),//5
+                                new Array(
+            "Giáp",
+            "Kỷ",
+            "Giáp",
+            "Kỷ",
+            "Mão",
+            "Dậu",
+            "Bính Đinh",
+            "Giáp Ngọ",
+            "Tỵ",
+            " ",
+            "Tỵ",
+            "Thân",
+            "Thìn",
+            "Dần",
+            "Mão",
+            "Hợi",
+            "Tân",
+            "Canh",
+            "Ngọ",
+            "Mùi",
+            "Dần",
+            "Dậu",
+            "Tỵ",
+            "Ngọ",
+            "Hợi",
+            "Thân",
+            "Hợi",
+            "Mão",
+            "Thân",
+            "Tuất",
+            " -",
+            "Dần",
+            "Tý",
+            "Thìn",
+            "Thân",
+            "Dậu",
+            "Tuất",
+            "Tỵ",
+            "Hợi Mão",
+            "Ngọ",
+            "Dần Mão",
+            "Tỵ",
+            "Thìn Tỵ",
+            "Dậu",
+            "Mão",
+            "Tuất",
+            "Hợi",
+            "Mão",
+            "Tỵ"
+            ),//6
+                                new Array(//7
+                                          "Quý",
+                                          "Mậu",
+                                          "Nhâm",
+                                          "Đinh",
+                                          "Thìn",
+                                          "Tuất",
+                                          "Canh Tân",
+                                          "Mậu Thân",
+                                          "Ngọ",
+                                          "Ất",
+                                          "Mùi",
+                                          "Tuất",
+                                          "Ngọ",
+                                          "Thìn",
+                                          "Tỵ",
+                                          "Ngọ",
+                                          "Nhâm",
+                                          "Bính",
+                                          "Thân",
+                                          "Dần",
+                                          "Tỵ",
+                                          "Tuất",
+                                          "Tý",
+                                          "Mão",
+                                          "Dậu",
+                                          "Tỵ",
+                                          "Thân",
+                                          "Tuất",
+                                          "Mùi",
+                                          "Hợi",
+                                          " -",
+                                          "Hợi",
+                                          "Dần",
+                                          "Hợi",
+                                          "Mão",
+                                          "Thìn",
+                                          "Tỵ",
+                                          "Dần",
+                                          "Tý Thìn",
+                                          "Tỵ",
+                                          "Thìn Sửu",
+                                          "Thân",
+                                          "Ngọ Mùi",
+                                          "Tý",
+                                          "Tý",
+                                          "Tý",
+                                          "Sửu",
+                                          "Tỵ",
+                                          "Mùi"
+            ),
+                                new Array(
+            "Dần",
+            "Hợi",
+            "Canh",
+            "Ất",
+            "Tỵ",
+            "Hợi",
+            "Canh Tân",
+            "Mậu  Thân",
+            "Mùi",
+            "Giáp",
+            "Dậu",
+            "Tý",
+            "Thân",
+            "Ngọ",
+            "Mùi",
+            "Tỵ",
+            "Quý",
+            "Giáp",
+            "Tuất",
+            "Thân",
+            "Thân",
+            "Hợi",
+            "Ngọ",
+            "Thân",
+            "Mùi",
+            "Tuất",
+            "Sửu",
+            "Thìn",
+            "Ngọ",
+            "Hợi",
+            "Dậu",
+            "Thìn",
+            "Dần",
+            "Tỵ",
+            "Dậu",
+            "Tuất",
+            "Hợi",
+            "Hợi",
+            "Sửu Tỵ",
+            "Thìn",
+            "Thìn Sửu",
+            "Thân",
+            "Ngọ Mùi",
+            "Tý",
+            "Ngọ",
+            "Dần",
+            "Mão",
+            "Mùi",
+            "Dậu"
+            ),//8
+                                new Array(
+            "Bính",
+            "Tân",
+            "Bính",
+            "Tân",
+            "Ngọ",
+            "Tý",
+            "Canh Tân",
+            "Mậu Thân",
+            "Thân",
+            "-",
+            "Hợi",
+            "Dần",
+            "Tuất",
+            "Thân",
+            "Dậu",
+            "Tỵ",
+            "Canh",
+            "Nhâm",
+            "Tý",
+            "Mão",
+            "Hợi",
+            "Tý",
+            "Sửu",
+            "Tỵ",
+            "Tỵ",
+            "Mùi",
+            "Tuất",
+            "Hợi",
+            "Tỵ",
+            "Ngọ",
+            " -",
+            "Sửu",
+            "Thìn",
+            "Tý",
+            "Thìn",
+            "Tỵ",
+            "Ngọ",
+            "Thân",
+            "Dần Ngọ",
+            "Mão",
+            "Thìn Sửu",
+            "Thân",
+            "Ngọ Mùi",
+            "Tý",
+            "Hợi",
+            "Thìn",
+            "Tỵ",
+            "Dậu",
+            "Hợi"
+            ),//9
+                                new Array(
+            "Ất",
+            "Canh",
+            "Giáp",
+            "Kỷ",
+            "Mùi",
+            "Sửu",
+            "Nhâm Quý",
+            "Giáp Tý",
+            "Dậu",
+            "Đinh",
+            "Sửu",
+            "Thìn",
+            "Tý",
+            "Tuất",
+            "Hợi",
+            "Mùi",
+            "Ất",
+            "Canh",
+            "Dần",
+            "Dậu",
+            "Dần",
+            "Sửu",
+            "Mùi",
+            "Tuất",
+            "Mão",
+            "Tý",
+            "Mão",
+            "Tỵ",
+            "Thìn",
+            "Ngọ",
+            "-",
+            "Ngọ",
+            "Thìn",
+            "Ngọ",
+            "Tuất",
+            "Hợi",
+            "Tý",
+            "Tỵ",
+            "Mão Mùi",
+            "Dần",
+            "Thân Dậu",
+            "Hợi",
+            "Thân Tuất",
+            "Mão",
+            "Thìn",
+            "Ngọ",
+            "Mùi",
+            "Hợi",
+            "Sửu"
+            ),//10
+                                new Array(
+            "Tỵ",
+            "Thân",
+            "Nhâm",
+            "Đinh",
+            "Thân",
+            "Dần",
+            "Nhâm Quý",
+            "-",
+            "Tuất",
+            "Bính",
+            "Mão",
+            "Ngọ",
+            "Dần",
+            "Tý",
+            "Sửu",
+            "Dậu",
+            "Giáp",
+            "Bính",
+            "Thìn",
+            "Thìn",
+            "Tỵ",
+            "Dần",
+            "Dần",
+            "Mùi",
+            "Sửu",
+            "Dậu",
+            "Tý",
+            "Tý",
+            "Mão",
+            "Mùi",
+            "Tý",
+            "Mão",
+            "Ngọ",
+            "Sửu",
+            "Tỵ",
+            "Ngọ",
+            "Mùi",
+            "Dần",
+            "Thìn Thân",
+            "Sửu",
+            "Thân Dậu",
+            "Hợi",
+            "Thân Tuất",
+            "Mão",
+            "Thân",
+            "Thân",
+            "Dậu",
+            "Sửu",
+            "Mão"
+            ),//11
+                                new Array(
+            "Canh",
+            "Ất",
+            "Canh",
+            "Ất",
+            "Dậu",
+            "Mão",
+            "Nhâm Quý",
+            "Giáp  Tý",
+            "Hợi",
+            "-",
+            "Tỵ",
+            "Thân",
+            "Thìn",
+            "Dần",
+            "Mão",
+            "Hợi",
+            "Tân",
+            "Giáp",
+            "Ngọ",
+            "Tuất",
+            "Thân",
+            "Mão",
+            "Thân",
+            "Tý",
+            "Hợi",
+            "Dần",
+            "Tỵ",
+            "Ngọ",
+            "Dần",
+            "Mùi",
+            "-",
+            "Thân",
+            "Ngọ",
+            "Mùi",
+            "Hợi",
+            "Tý",
+            "Sửu",
+            "Hợi",
+            "Tỵ Dậu",
+            "Tý",
+            "Thân Dậu",
+            "Hợi",
+            "Thân Tuất",
+            "Mão",
+            "Mùi",
+            "Tuất",
+            "Hợi",
+            "Mão",
+            "Tỵ"
+            )//12
+        );
+
+var SAO_TOT_TINHCHAT = new Array(
+        "Tốt mọi việc",
+        "Tốt mọi việc",
+        "Tốt mọi việc",
+        "Tốt mọi việc, kỵ tố tụng",
+        "Tốt mọi việc, nhất là hôn thú",
+        "Tốt mọi việc, nhất là xây dựng nhà cửa, khai trương và an táng",
+        "Tốt mọi việc",
+        "Tốt cho tế tự, giải oan, trừ được các sao xấu, chỉ kiêng kỵ động thổ. Nếu gặp trực khai thì rất tốt tức là ngày thiên xá gặp sinh khí",
+        "Tốt mọi việc, nhất là làm nhà, sửa nhà, động thổ, trồng cây",
+        "Tốt mọi việc",
+        "Tốt mọi việc",
+        "Tốt mọi việc",
+        "Tốt cho việc xuất hành, giao dịch, cầu tài lộc",
+        "Tốt cho việc cầu tài lộc, khai trương",
+        "Tốt cho việc cầu tài lộc, khai trương",
+        "Tốt cho việc cầu tài lộc, khai trương, xuất hành, di chuyển, giao dịch",
+        "Tốt mọi việc",
+        "Tốt cho việc làm nhà, làm gường",
+        "Tốt mọi việc",
+        "Tốt mọi việc, nhất là cầu phúc, tế tự",
+        "Tốt mọi việc",
+        "Tốt cho việc cầu tài, khai trương, giao dịch",
+        "Tốt mọi việc",
+            "Tốt mọi việc","Tốt mọi việc","Tốt mọi việc","Tốt mọi việc","Tốt đối với tang lễ",
+        "Tốt mọi việc","Tốt mọi việc","Tốt mọi việc",
+        "Tốt, nhưng gặp thụ tử thì xấu","Tốt cho việc tế tự,tố tụng, gải oan (trừ được các sao xấu)",
+        "Tốt mọi việc, làm phúc, giá thú, xuất hành","Tốt mọi việc, nhất là giá thú","Tốt mọi việc, nhất là giá thú",
+        "Tốt mọi việc, nhất là giá thú","Tốt mọi việc, nhất là xuất hành","Tốt mọi việc","Tốt mọi việc","Tốt về cầu tài lộc, khai trương",
+        "Tốt về cầu tài lộc, khai trương","Tốt mọi việc","Tốt mọi việc","Hoàng Đạo - Tốt mọi việc","Hoàng Đạo - Tốt mọi việc",
+        "Hoàng Đạo - Tốt mọi việc","Hoàng Đạo - Tốt mọi việc"
+            );
+
+
+var SAO_XAU_TEN = new Array(
+        "Thiên Cương",
+        "Thiên Lại",
+        "Thiên Ngục Thiên Hoả",
+        "Tiểu Hồng Sa",
+        "Đại Hao",
+        "Tiểu Hao",
+        "Nguyệt phá",
+        "Kiếp sát",
+        "Địa phá",
+        "Thổ phủ",
+        "Thổ ôn",
+        "Thiên ôn",
+        "Thụ tử",
+        "Hoang vu",
+        "Thiên tặc",
+        "Địa Tặc",
+        "Hoả tai",
+        "Nguyệt Hoả Độc Hoả",
+        "Nguyệt Yếm",
+        "Nguyệt Hư",
+        "Hoàng Sa",
+        "Lục Bất thành",
+        "Nhân Cách",
+        "Thần cách",
+        "Phi Ma sát",
+        "Ngũ Quỹ",
+        "Băng tiêu ngoạ hãm",
+        "Hà khôi Cẩu Giảo",
+        "Vãng vong",
+        "Cửu không",
+        "Trùng Tang",
+        "Trùng phục",
+        "Chu tước hắc đạo",
+        "Bạch hổ",
+        "Huyền Vũ",
+        "Câu Trận",
+        "Lôi công",
+        "Cô thần",
+        "Quả tú",
+        "Sát chủ",
+        "Nguyệt Hình",
+        "Tội chỉ",
+        "Nguyệt Kiến",
+        "Thiên địa chính chuyển",
+        "Thiên địa chuyển sát",
+        "Lỗ ban sát",
+        "Phủ đầu dát",
+        "Tam tang",
+        "Ngũ hư",
+        "Tứ thời đại mộ",
+        "Thổ cẩm",
+        "Ly sàng",
+        "Tứ thời cô quả",
+        "Không phòng",
+        "Âm thác",
+        "Dương thác",
+        "Quỷ khốc"
+        );
+
+var SAO_XAU_MATRIX= new Array(
+        new Array(),
+                new Array(),
+                new Array(),
+                new Array(),
+                new Array(),
+                new Array(),
+                new Array(
+            "Hợi",
+            "Mão",
+            "Ngọ",
+            "Tỵ",
+            "Tý",
+            "Hợi",
+            "Dần",
+            "Tỵ",
+            "Tỵ",
+            "Thân",
+            "Tuất",
+            "Dậu",
+            "Sửu",
+            "Hợi Mão Mùi",
+            "Tuất",
+            "Mùi",
+            "Thìn",
+            "Hợi",
+            "Thìn",
+            "Mùi",
+            "Ngọ",
+            "Thân",
+            "Dậu",
+            "Tỵ",
+            "Ngọ",
+            "Sửu",
+            "Hợi",
+            "Tỵ",
+            "Dậu",
+            "Dậu",
+            "Canh",
+            "Giáp",
+            "Mão",
+            "Ngọ",
+            "Dậu",
+            "Hợi",
+            "Tỵ",
+            "Thìn",
+            "Tuất",
+            "Sửu",
+            "Dần",
+            "Dậu",
+            "Dậu",
+            "Đinh Dậu",
+            "Tân Dậu",
+            "Ngọ",
+            "Dậu",
+            "Tuất",
+            "Hợi",
+            "Tân Sửu",
+            "Tỵ",
+            "Tuất",
+            "Mùi",
+            "Dần",
+            "Giáp Thìn",
+            "Canh Thân",
+            "Tuất"
+            ),//7
+                new Array(),
+                new Array(),
+                new Array(),
+                new Array(),
+                new Array()
+        );
+
+function cacsaotot(lunarMonth, lunarDayCanChi){
+    var CHI = lunarDayCanChi.split(" ")[1];
+        var CAN = lunarDayCanChi.split(" ")[0];
+    var chi_so_gia;
+
+    switch(CHI){
+    case "Tý": chi_so_gia=1; break;
+    case "Sửu":  chi_so_gia=2; break;
+    case "Dần": chi_so_gia=3; break;
+    case "Mão":  chi_so_gia=4; break;
+    case "Thìn": chi_so_gia=5; break;
+    case "Tỵ": chi_so_gia=6; break;
+    case "Ngọ":  chi_so_gia=7; break;
+    case "Mùi":  chi_so_gia=8; break;
+    case "Thân":  chi_so_gia=9; break;
+    case "Dậu":  chi_so_gia=10; break;
+    case "Tuất":  chi_so_gia=11; break;
+    case "Hợi":  chi_so_gia=12; break;
+    }
+
+    var can_so_gia;
+
+    switch(CAN){
+    case "Giáp": can_so_gia=1; break;
+    case "Ất":  can_so_gia=2; break;
+    case "Bính": can_so_gia=3; break;
+    case "Đinh":  can_so_gia=4; break;
+    case "Mậu": can_so_gia=5; break;
+    case "Kỷ": can_so_gia=6; break;
+    case "Canh":  can_so_gia=7; break;
+    case "Tân":  can_so_gia=8; break;
+    case "Nhâm":  can_so_gia=9; break;
+    case "Quý":  can_so_gia=10; break;
+    }
+
+    var final_can_so_gia = can_so_gia + 12;
+
+
+    var SAOTOT="";
+    var js=1;
+    var asf=1;
+
+    for (var j=0;j<=48;j++){
+
+        if (lunarDayCanChi == SAO_TOT_MATRIX[lunarMonth-1][j] || SAO_TOT_MATRIX[lunarMonth-1][j].indexOf(CAN) != -1 || SAO_TOT_MATRIX[lunarMonth-1][j].indexOf(CHI) != -1)
+            if (js==1){
+              SAOTOT = SAO_TOT_TEN[j];
+              js++;
+            }else{
+                if (asf%3==0)
+                   var rchar  = "<br>";
+                else
+                    var rchar = ", ";
+              SAOTOT += rchar+SAO_TOT_TEN[j];
+                asf++;
+            }
+    }
+
+    return SAOTOT;
+}
+
+function cacsaoxau(lunarMonth, lunarDayCanChi){
+    var CHI = lunarDayCanChi.split(" ")[1];
+        var CAN = lunarDayCanChi.split(" ")[0];
+    var chi_so_gia;
+
+    switch(CHI){
+    case "Tý": chi_so_gia=1; break;
+    case "Sửu":  chi_so_gia=2; break;
+    case "Dần": chi_so_gia=3; break;
+    case "Mão":  chi_so_gia=4; break;
+    case "Thìn": chi_so_gia=5; break;
+    case "Tỵ": chi_so_gia=6; break;
+    case "Ngọ":  chi_so_gia=7; break;
+    case "Mùi":  chi_so_gia=8; break;
+    case "Thân":  chi_so_gia=9; break;
+    case "Dậu":  chi_so_gia=10; break;
+    case "Tuất":  chi_so_gia=11; break;
+    case "Hợi":  chi_so_gia=12; break;
+    }
+
+    var can_so_gia;
+
+    switch(CAN){
+    case "Giáp": can_so_gia=1; break;
+    case "Ất":  can_so_gia=2; break;
+    case "Bính": can_so_gia=3; break;
+    case "Đinh":  can_so_gia=4; break;
+    case "Mậu": can_so_gia=5; break;
+    case "Kỷ": can_so_gia=6; break;
+    case "Canh":  can_so_gia=7; break;
+    case "Tân":  can_so_gia=8; break;
+    case "Nhâm":  can_so_gia=9; break;
+    case "Quý":  can_so_gia=10; break;
+    }
+
+    var final_can_so_gia = can_so_gia + 12;
+
+
+    var SAOXAU="";
+    var js=1;
+    var asf=1;
+
+    for (var j=0;j<=48;j++){
+
+        if (lunarDayCanChi == SAO_XAU_MATRIX[lunarMonth-1][j] || SAO_XAU_MATRIX[lunarMonth-1][j].indexOf(CAN) != -1 || SAO_XAU_MATRIX[lunarMonth-1][j].indexOf(CHI) != -1)
+            if (js==1){
+              SAOXAU = SAO_XAU_TEN[j];
+              js++;
+            }else{
+                if (asf%3==0)
+                   var rchar  = "<br>";
+                else
+                    var rchar = ", ";
+              SAOXAU += rchar+SAO_XAU_TEN[j];
+                asf++;
+            }
+    }
+
+    return SAOXAU;
+}
+
+function test(){
+}
diff --git a/qmlapplicationviewer/qmlapplicationviewer.cpp b/qmlapplicationviewer/qmlapplicationviewer.cpp
new file mode 100644 (file)
index 0000000..e28f583
--- /dev/null
@@ -0,0 +1,162 @@
+// checksum 0x17fa version 0x3000a
+/*
+  This file was generated by the Qt Quick Application wizard of Qt Creator.
+  QmlApplicationViewer is a convenience class containing mobile device specific
+  code such as screen orientation handling. Also QML paths and debugging are
+  handled here.
+  It is recommended not to modify this file, since newer versions of Qt Creator
+  may offer an updated version of it.
+*/
+
+#include "qmlapplicationviewer.h"
+
+#include <QtCore/QCoreApplication>
+#include <QtCore/QDir>
+#include <QtCore/QFileInfo>
+#include <QtDeclarative/QDeclarativeComponent>
+#include <QtDeclarative/QDeclarativeEngine>
+#include <QtDeclarative/QDeclarativeContext>
+
+#if defined(QMLJSDEBUGGER)
+#include <qt_private/qdeclarativedebughelper_p.h>
+#endif
+
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+#include <jsdebuggeragent.h>
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+#include <qdeclarativeviewobserver.h>
+#endif
+
+#if defined(QMLJSDEBUGGER)
+
+// Enable debugging before any QDeclarativeEngine is created
+struct QmlJsDebuggingEnabler
+{
+    QmlJsDebuggingEnabler()
+    {
+        QDeclarativeDebugHelper::enableDebugging();
+    }
+};
+
+// Execute code in constructor before first QDeclarativeEngine is instantiated
+static QmlJsDebuggingEnabler enableDebuggingHelper;
+
+#endif // QMLJSDEBUGGER
+
+class QmlApplicationViewerPrivate
+{
+    QString mainQmlFile;
+    friend class QmlApplicationViewer;
+    static QString adjustPath(const QString &path);
+};
+
+QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
+{
+#ifdef Q_OS_UNIX
+#ifdef Q_OS_MAC
+    if (!QDir::isAbsolutePath(path))
+        return QCoreApplication::applicationDirPath()
+                + QLatin1String("/../Resources/") + path;
+#else
+    const QString pathInShareDir = QCoreApplication::applicationDirPath()
+        + QLatin1String("/../share/")
+        + QFileInfo(QCoreApplication::applicationFilePath()).fileName()
+        + QLatin1Char('/') + path;
+    if (QFileInfo(pathInShareDir).exists())
+        return pathInShareDir;
+#endif
+#endif
+    return path;
+}
+
+QmlApplicationViewer::QmlApplicationViewer(QWidget *parent) :
+    QDeclarativeView(parent),
+    m_d(new QmlApplicationViewerPrivate)
+{
+    connect(engine(), SIGNAL(quit()), SLOT(close()));
+    setResizeMode(QDeclarativeView::SizeRootObjectToView);
+#if defined(QMLJSDEBUGGER) && !defined(NO_JSDEBUGGER)
+    new QmlJSDebugger::JSDebuggerAgent(engine());
+#endif
+#if defined(QMLJSDEBUGGER) && !defined(NO_QMLOBSERVER)
+    new QmlJSDebugger::QDeclarativeViewObserver(this, parent);
+#endif
+}
+
+QmlApplicationViewer::~QmlApplicationViewer()
+{
+    delete m_d;
+}
+
+void QmlApplicationViewer::setMainQmlFile(const QString &file)
+{
+    m_d->mainQmlFile = QmlApplicationViewerPrivate::adjustPath(file);
+    setSource(QUrl::fromLocalFile(m_d->mainQmlFile));
+}
+
+void QmlApplicationViewer::addImportPath(const QString &path)
+{
+    engine()->addImportPath(QmlApplicationViewerPrivate::adjustPath(path));
+}
+
+void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
+{
+#if defined(Q_OS_SYMBIAN)
+    // If the version of Qt on the device is < 4.7.2, that attribute won't work
+    if (orientation != ScreenOrientationAuto) {
+        const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
+        if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
+            qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
+            return;
+        }
+    }
+#endif // Q_OS_SYMBIAN
+
+    Qt::WidgetAttribute attribute;
+    switch (orientation) {
+#if QT_VERSION < 0x040702
+    // Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
+    case ScreenOrientationLockPortrait:
+        attribute = static_cast<Qt::WidgetAttribute>(128);
+        break;
+    case ScreenOrientationLockLandscape:
+        attribute = static_cast<Qt::WidgetAttribute>(129);
+        break;
+    default:
+    case ScreenOrientationAuto:
+        attribute = static_cast<Qt::WidgetAttribute>(130);
+        break;
+#else // QT_VERSION < 0x040702
+    case ScreenOrientationLockPortrait:
+        attribute = Qt::WA_LockPortraitOrientation;
+        break;
+    case ScreenOrientationLockLandscape:
+        attribute = Qt::WA_LockLandscapeOrientation;
+        break;
+    default:
+    case ScreenOrientationAuto:
+        attribute = Qt::WA_AutoOrientation;
+        break;
+#endif // QT_VERSION < 0x040702
+    };
+    setAttribute(attribute, true);
+}
+
+void QmlApplicationViewer::showExpanded()
+{
+#ifdef Q_OS_SYMBIAN
+    showFullScreen();
+#elif defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6)
+    showMaximized();
+#else
+    show();
+#endif
+}
+
+void QmlApplicationViewer::initScreenOrientation(int OO){
+    if (OO == 1)
+            this->setOrientation(this->ScreenOrientationAuto);
+    else
+        this->setOrientation(this->ScreenOrientationLockLandscape);
+}
diff --git a/qmlapplicationviewer/qmlapplicationviewer.h b/qmlapplicationviewer/qmlapplicationviewer.h
new file mode 100644 (file)
index 0000000..6eaf6b8
--- /dev/null
@@ -0,0 +1,41 @@
+// checksum 0x5a59 version 0x3000a
+/*
+  This file was generated by the Qt Quick Application wizard of Qt Creator.
+  QmlApplicationViewer is a convenience class containing mobile device specific
+  code such as screen orientation handling. Also QML paths and debugging are
+  handled here.
+  It is recommended not to modify this file, since newer versions of Qt Creator
+  may offer an updated version of it.
+*/
+
+#ifndef QMLAPPLICATIONVIEWER_H
+#define QMLAPPLICATIONVIEWER_H
+
+#include <QtDeclarative/QDeclarativeView>
+
+class QmlApplicationViewer : public QDeclarativeView
+{
+    Q_OBJECT
+
+public:
+    enum ScreenOrientation {
+        ScreenOrientationLockPortrait,
+        ScreenOrientationLockLandscape,
+        ScreenOrientationAuto
+    };
+
+    explicit QmlApplicationViewer(QWidget *parent = 0);
+    virtual ~QmlApplicationViewer();
+
+    void setMainQmlFile(const QString &file);
+    void addImportPath(const QString &path);
+    void setOrientation(ScreenOrientation orientation);
+    void showExpanded();
+
+    Q_INVOKABLE void initScreenOrientation(int);
+
+private:
+    class QmlApplicationViewerPrivate *m_d;
+};
+
+#endif // QMLAPPLICATIONVIEWER_H
diff --git a/qmlapplicationviewer/qmlapplicationviewer.pri b/qmlapplicationviewer/qmlapplicationviewer.pri
new file mode 100644 (file)
index 0000000..8d0e801
--- /dev/null
@@ -0,0 +1,167 @@
+# checksum 0x8396 version 0x3000a
+# This file was generated by the Qt Quick Application wizard of Qt Creator.
+# The code below adds the QmlApplicationViewer to the project and handles the
+# activation of QML debugging.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+QT += declarative
+
+SOURCES += $$PWD/qmlapplicationviewer.cpp
+HEADERS += $$PWD/qmlapplicationviewer.h
+INCLUDEPATH += $$PWD
+
+defineTest(minQtVersion) {
+    maj = $$1
+    min = $$2
+    patch = $$3
+    isEqual(QT_MAJOR_VERSION, $$maj) {
+        isEqual(QT_MINOR_VERSION, $$min) {
+            isEqual(QT_PATCH_VERSION, $$patch) {
+                return(true)
+            }
+            greaterThan(QT_PATCH_VERSION, $$patch) {
+                return(true)
+            }
+        }
+        greaterThan(QT_MINOR_VERSION, $$min) {
+            return(true)
+        }
+    }
+    return(false)
+}
+
+contains(DEFINES, QMLJSDEBUGGER) {
+    CONFIG(debug, debug|release) {
+        !minQtVersion(4, 7, 1) {
+            warning()
+            warning("Disabling QML debugging:")
+            warning()
+            warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+            warning("This library requires Qt 4.7.1 or newer.")
+            warning()
+            DEFINES -= QMLJSDEBUGGER
+        } else:isEmpty(QMLJSDEBUGGER_PATH) {
+            warning()
+            warning("Disabling QML debugging:")
+            warning()
+            warning("Debugging QML requires the qmljsdebugger library that ships with Qt Creator.")
+            warning("Please specify its location on the qmake command line, eg")
+            warning("  qmake -r QMLJSDEBUGGER_PATH=$CREATORDIR/share/qtcreator/qmljsdebugger")
+            warning()
+            DEFINES -= QMLJSDEBUGGER
+        } else {
+            include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
+        }
+    } else {
+        DEFINES -= QMLJSDEBUGGER
+    }
+}
+# This file was generated by an application wizard of Qt Creator.
+# The code below handles deployment to Symbian and Maemo, aswell as copying
+# of the application data to shadow build directories on desktop.
+# It is recommended not to modify this file, since newer versions of Qt Creator
+# may offer an updated version of it.
+
+defineTest(qtcAddDeployment) {
+for(deploymentfolder, DEPLOYMENTFOLDERS) {
+    item = item$${deploymentfolder}
+    itemsources = $${item}.sources
+    $$itemsources = $$eval($${deploymentfolder}.source)
+    itempath = $${item}.path
+    $$itempath= $$eval($${deploymentfolder}.target)
+    export($$itemsources)
+    export($$itempath)
+    DEPLOYMENT += $$item
+}
+
+MAINPROFILEPWD = $$PWD
+
+symbian {
+    isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
+    isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
+} else:win32 {
+    copyCommand =
+    for(deploymentfolder, DEPLOYMENTFOLDERS) {
+        source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+        source = $$replace(source, /, \\)
+        sourcePathSegments = $$split(source, \\)
+        target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
+        target = $$replace(target, /, \\)
+        !isEqual(source,$$target) {
+            !isEmpty(copyCommand):copyCommand += &&
+            copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
+        }
+    }
+    !isEmpty(copyCommand) {
+        copyCommand = @echo Copying application data... && $$copyCommand
+        copydeploymentfolders.commands = $$copyCommand
+        first.depends = $(first) copydeploymentfolders
+        export(first.depends)
+        export(copydeploymentfolders.commands)
+        QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+    }
+} else:unix {
+    maemo5 {
+        installPrefix = /opt/usr
+        desktopfile.path = /usr/share/applications/hildon
+    } else {
+        installPrefix = /usr/local
+        desktopfile.path = /usr/share/applications
+        copyCommand =
+        for(deploymentfolder, DEPLOYMENTFOLDERS) {
+            source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
+            source = $$replace(source, \\, /)
+            macx {
+                target = $$OUT_PWD/$${TARGET}.app/Contents/Resources/$$eval($${deploymentfolder}.target)
+            } else {
+                target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
+            }
+            target = $$replace(target, \\, /)
+            sourcePathSegments = $$split(source, /)
+            targetFullPath = $$target/$$last(sourcePathSegments)
+            !isEqual(source,$$targetFullPath) {
+                !isEmpty(copyCommand):copyCommand += &&
+                copyCommand += $(MKDIR) \"$$target\"
+                copyCommand += && $(COPY_DIR) \"$$source\" \"$$target\"
+            }
+        }
+        !isEmpty(copyCommand) {
+            copyCommand = @echo Copying application data... && $$copyCommand
+            copydeploymentfolders.commands = $$copyCommand
+            first.depends = $(first) copydeploymentfolders
+            export(first.depends)
+            export(copydeploymentfolders.commands)
+            QMAKE_EXTRA_TARGETS += first copydeploymentfolders
+        }
+    }
+    for(deploymentfolder, DEPLOYMENTFOLDERS) {
+        item = item$${deploymentfolder}
+        itemfiles = $${item}.files
+        $$itemfiles = $$eval($${deploymentfolder}.source)
+        itempath = $${item}.path
+        $$itempath = $${installPrefix}/share/$${TARGET}/$$eval($${deploymentfolder}.target)
+        export($$itemfiles)
+        export($$itempath)
+        INSTALLS += $$item
+    }
+    icon.files = $${TARGET}.png
+    icon.path = /usr/share/icons/hicolor/64x64/apps
+    desktopfile.files = $${TARGET}.desktop
+    target.path = $${installPrefix}/bin
+    export(icon.files)
+    export(icon.path)
+    export(desktopfile.files)
+    export(desktopfile.path)
+    export(target.path)
+    INSTALLS += desktopfile icon target
+}
+
+export (ICON)
+export (INSTALLS)
+export (DEPLOYMENT)
+export (TARGET.EPOCHEAPSIZE)
+export (TARGET.CAPABILITY)
+export (LIBS)
+export (QMAKE_EXTRA_TARGETS)
+}
diff --git a/qtc_packaging/debian_fremantle/README b/qtc_packaging/debian_fremantle/README
new file mode 100644 (file)
index 0000000..a58b865
--- /dev/null
@@ -0,0 +1,6 @@
+The Debian Package lichviet
+----------------------------
+
+Comments regarding the Package
+
+ -- Cuong Le <metacuong@gmail.com>  Tue, 02 Aug 2011 11:30:37 +0700
diff --git a/qtc_packaging/debian_fremantle/changelog b/qtc_packaging/debian_fremantle/changelog
new file mode 100644 (file)
index 0000000..5e8c52a
--- /dev/null
@@ -0,0 +1,9 @@
+lichviet (1.0.1) unstable-develop; urgency=low
+
+  * Initial Release.
+
+ -- Cuong Le <metacuong@gmail.com>  Tue, 02 Aug 2011 11:30:37 +0700
+
+  * Add new features and know bugs fixed.
+
+ -- Cuong Le <metacuong@gmail.com>  Tue, 04 Aug 2011 20:30:37 +0700
diff --git a/qtc_packaging/debian_fremantle/compat b/qtc_packaging/debian_fremantle/compat
new file mode 100644 (file)
index 0000000..7f8f011
--- /dev/null
@@ -0,0 +1 @@
+7
diff --git a/qtc_packaging/debian_fremantle/control b/qtc_packaging/debian_fremantle/control
new file mode 100644 (file)
index 0000000..72f309a
--- /dev/null
@@ -0,0 +1,12 @@
+Source: lichviet
+Section: user/hidden
+Priority: optional
+Maintainer: Cuong Le <metacuong@gmail.com>
+Build-Depends: debhelper (>= 5), libqt4-dev
+Standards-Version: 3.7.3
+Homepage: http://qml.cuongle.name
+
+Package: lichviet
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, mcsp, qtquickcompat
+Description: Lịch Âm cho cộng đồng Maemo/Meego Diễn Đàn Tinh Tế.
diff --git a/qtc_packaging/debian_fremantle/copyright b/qtc_packaging/debian_fremantle/copyright
new file mode 100644 (file)
index 0000000..c75e32e
--- /dev/null
@@ -0,0 +1,38 @@
+This package was debianized by Cuong Le <metacuong@gmail.com> on
+Tue, 02 Aug 2011 11:30:37 +0700.
+
+It was downloaded from <url://qml.cuongle.name>
+
+Upstream Author(s):
+
+    <metacuong@gmail.com>
+
+Copyright:
+
+    <Copyright (C) 2011 Cuong Le>
+
+License:
+
+    This package is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This package 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 General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2011, Cuong Le <metacuong@gmail.com> and
+is licensed under the GPL, see above.
+
+
+# Please also look if there are files or directories which have a
+# different copyright/license attached and list them here.
diff --git a/qtc_packaging/debian_fremantle/rules b/qtc_packaging/debian_fremantle/rules
new file mode 100644 (file)
index 0000000..f81db3f
--- /dev/null
@@ -0,0 +1,91 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+
+
+
+configure: configure-stamp
+configure-stamp:
+       dh_testdir
+       # Add here commands to configure the package.
+
+       touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp  
+       dh_testdir
+
+       # Add here commands to compile the package.
+       $(MAKE)
+       #docbook-to-man debian/lichviet.sgml > lichviet.1
+
+       touch $@
+
+clean: 
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp configure-stamp
+
+       # Add here commands to clean up after the build process.
+       $(MAKE) clean
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/lichviet.
+       $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/lichviet install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+#      dh_installchangelogs 
+#      dh_installdocs
+#      dh_installexamples
+#      dh_install
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_python
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       # dh_strip
+       dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_makeshlibs
+       dh_installdeb
+       # dh_shlibdeps                      # Uncomment this line for publishing!
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
diff --git a/themes/default/background.jpg b/themes/default/background.jpg
new file mode 100644 (file)
index 0000000..c61f523
Binary files /dev/null and b/themes/default/background.jpg differ
diff --git a/themes/default/default.qml b/themes/default/default.qml
new file mode 100644 (file)
index 0000000..c38a499
--- /dev/null
@@ -0,0 +1,37 @@
+import QtQuick 1.0
+
+Item {
+    id:theme
+    property alias titlebar: titlebar
+    property alias datepicker: datepicker
+    property alias toolbar: toolbar
+
+    property string root_dir : "file:/opt/usr/share/LichViet/themes/default/" 
+    property string background_image: root_dir+"background.jpg"
+
+    property string switch_on: root_dir+"switch_on.png"
+    property string switch_off: root_dir+"switch_off.png"
+
+    Item{
+        id:titlebar
+        property string button: root_dir+"quit.png"
+        property string button_pressed: root_dir+"quit_pressed.png"
+        property string button_active: root_dir+"quit.png"
+        property string sci: root_dir+"titlebar.sci"
+    }
+
+    Item{
+        id:toolbar
+        property string sci: root_dir+"titlebar.sci"
+        property string button_sci: root_dir+"toolbutton.sci"
+        property string button_pressed_sci: root_dir+"toolbutton_pressed.sci"
+        property string button_active_sci: root_dir+"toolbutton.sci"
+    }
+
+    Item{
+        id:datepicker
+        property string button: root_dir+"dp_button.png"
+        property string button_pressed: root_dir+"dp_button_pressed.png"
+        property string button_active: root_dir+"dp_button_active.png"
+    }
+}
diff --git a/themes/default/dp_button.png b/themes/default/dp_button.png
new file mode 100644 (file)
index 0000000..fcdc4ff
Binary files /dev/null and b/themes/default/dp_button.png differ
diff --git a/themes/default/dp_button_active.png b/themes/default/dp_button_active.png
new file mode 100644 (file)
index 0000000..604d829
Binary files /dev/null and b/themes/default/dp_button_active.png differ
diff --git a/themes/default/dp_button_pressed.png b/themes/default/dp_button_pressed.png
new file mode 100644 (file)
index 0000000..162b194
Binary files /dev/null and b/themes/default/dp_button_pressed.png differ
diff --git a/themes/default/gloss.png b/themes/default/gloss.png
new file mode 100644 (file)
index 0000000..5d370cd
Binary files /dev/null and b/themes/default/gloss.png differ
diff --git a/themes/default/lineedit.png b/themes/default/lineedit.png
new file mode 100644 (file)
index 0000000..2cc38dc
Binary files /dev/null and b/themes/default/lineedit.png differ
diff --git a/themes/default/lineedit.sci b/themes/default/lineedit.sci
new file mode 100644 (file)
index 0000000..054bff7
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 10
+border.bottom: 10
+border.right: 10
+source: lineedit.png
diff --git a/themes/default/quit.png b/themes/default/quit.png
new file mode 100644 (file)
index 0000000..69dc1b8
Binary files /dev/null and b/themes/default/quit.png differ
diff --git a/themes/default/quit_pressed.png b/themes/default/quit_pressed.png
new file mode 100644 (file)
index 0000000..972ece5
Binary files /dev/null and b/themes/default/quit_pressed.png differ
diff --git a/themes/default/stripes.png b/themes/default/stripes.png
new file mode 100644 (file)
index 0000000..9f36727
Binary files /dev/null and b/themes/default/stripes.png differ
diff --git a/themes/default/switch_off.png b/themes/default/switch_off.png
new file mode 100644 (file)
index 0000000..3a9098c
Binary files /dev/null and b/themes/default/switch_off.png differ
diff --git a/themes/default/switch_on.png b/themes/default/switch_on.png
new file mode 100644 (file)
index 0000000..666d052
Binary files /dev/null and b/themes/default/switch_on.png differ
diff --git a/themes/default/titlebar.png b/themes/default/titlebar.png
new file mode 100644 (file)
index 0000000..51c9008
Binary files /dev/null and b/themes/default/titlebar.png differ
diff --git a/themes/default/titlebar.sci b/themes/default/titlebar.sci
new file mode 100644 (file)
index 0000000..0418d94
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 10
+border.top: 12
+border.bottom: 12
+border.right: 10
+source: titlebar.png
diff --git a/themes/default/toolbutton-back.png b/themes/default/toolbutton-back.png
new file mode 100644 (file)
index 0000000..1131001
Binary files /dev/null and b/themes/default/toolbutton-back.png differ
diff --git a/themes/default/toolbutton.png b/themes/default/toolbutton.png
new file mode 100644 (file)
index 0000000..9ecc83b
Binary files /dev/null and b/themes/default/toolbutton.png differ
diff --git a/themes/default/toolbutton.sci b/themes/default/toolbutton.sci
new file mode 100644 (file)
index 0000000..9e4f965
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 15
+border.top: 4
+border.bottom: 4
+border.right: 15
+source: toolbutton.png
diff --git a/themes/default/toolbutton_pressed.png b/themes/default/toolbutton_pressed.png
new file mode 100644 (file)
index 0000000..4d2969f
Binary files /dev/null and b/themes/default/toolbutton_pressed.png differ
diff --git a/themes/default/toolbutton_pressed.sci b/themes/default/toolbutton_pressed.sci
new file mode 100644 (file)
index 0000000..95a4502
--- /dev/null
@@ -0,0 +1,5 @@
+border.left: 15
+border.top: 4
+border.bottom: 4
+border.right: 15
+source: toolbutton_pressed.png