diff options
author | George Hazan <george.hazan@gmail.com> | 2012-06-01 21:37:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-06-01 21:37:18 +0000 |
commit | 57c87234383026f1f57a3044f0d934fc13ea9d0e (patch) | |
tree | a296589c5e16dff5540923582207007552476f61 /plugins | |
parent | 5e52c4592330b5971a107da1bafd115fafb38f54 (diff) |
- RecentContacts added;
- _A2T & _T2A classes moved to m_utils.h
git-svn-id: http://svn.miranda-ng.org/main/trunk@255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
19 files changed, 1720 insertions, 73 deletions
diff --git a/plugins/RecentContacts/Docs/RecentContacts-Changelog.txt b/plugins/RecentContacts/Docs/RecentContacts-Changelog.txt new file mode 100644 index 0000000000..251aeec301 --- /dev/null +++ b/plugins/RecentContacts/Docs/RecentContacts-Changelog.txt @@ -0,0 +1,39 @@ +v0.0.2.0 (10.04.2009)
+ + Options page (Contact List > Recent Contacts)
+ + some clean-up.
+
+v0.0.1.4 (03.04.2009)
+ + add ability to hide offline contacts from list (via DBEditor (RecentContacts/HideOfflineContacts))
+
+v0.0.1.3 (02.04.2009)
+ + add item to toggle ignore state to contact menu.
+
+v0.0.1.2 (02.04.2009)
+ + add ability to ignore contacts (via DBEditor (Contact/RecentContacts/Ignore))
+ + fix opening of MUC
+
+v0.0.1.1 (01.04.2009)
+ + add ability to restrict number shown contacts (via DBEditor (RecentContacts/MaxShownContacts))
+
+v0.0.1.0 (31.03.2009)
+ + add UID and support for miranda 0.8
+ + add icolib support
+ + add updater support
+ + add hotkeys support (Miranda 0.8+)
+
+==============================================================================
+==============================================================================
+
+
+v0.0.0.3 (2005-05-22)
+ * fixed bug: green icon of this plugin is appear on other miranda dialog boxes.
+
+v0.0.0.2 (2005-05-21)
+ + now last unread incoming or outgoing message is taken in account. This allow to build Recent Contacts list for message modules that do not support Message API and also for contacts that have been used before installing this plugin.
+
+v0.0.0.1 (2005-05-04)
+ * fixed: sometimes contacts shown as '(Unknown Contact)'
+ * last used time now is not updated on close message window. Now only on open message window.
+
+v0.0.0.0 (2005-04-22)
+ + Initial Release
diff --git a/plugins/RecentContacts/Docs/RecentContacts-License.txt b/plugins/RecentContacts/Docs/RecentContacts-License.txt new file mode 100644 index 0000000000..7f1161073d --- /dev/null +++ b/plugins/RecentContacts/Docs/RecentContacts-License.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ 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 2 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, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/plugins/RecentContacts/Docs/RecentContacts-Readme.txt b/plugins/RecentContacts/Docs/RecentContacts-Readme.txt new file mode 100644 index 0000000000..5d74df9644 --- /dev/null +++ b/plugins/RecentContacts/Docs/RecentContacts-Readme.txt @@ -0,0 +1,73 @@ +Recent Contacts v0.0.2.0
+(c) 2005 ValeraVi, 2009 Kildor
+web: http://kildor.miranda.im
+email: kostia@ngs.ru
+Jabber: kildor@jabber.ru
+
+Overview
+--------
+ Adds a menu item in main menu, which open the window with list of last
+used contacts names, sorted in order from most recent to least.
+
+
+Homepage & Forum
+----------------
+
+
+Information
+-----------
+
+ It`s possible to change max count of shown contacts by changing setting
+ RecentContacts\MaxShownContacts (BYTE, default is 0)
+
+ 0 means "Show all contacts".
+
+
+ In the database it is possible to change format of date and time,
+by changing setting (add it, because it is not exist by default):
+
+ RecentContacts\DateTimeFormat (STRING, default is "(%Y-%m-%d %H:%M) ")
+
+ The format argument consists of one or more codes; the formatting codes
+are preceded by a percent sign (%). Characters that do not begin with % are
+copied unchanged to strDest. The formatting codes are listed below:
+%a Abbreviated weekday name
+%A Full weekday name
+%b Abbreviated month name
+%B Full month name
+%c Date and time representation appropriate for locale
+%d Day of month as decimal number (01 – 31)
+%H Hour in 24-hour format (00 – 23)
+%I Hour in 12-hour format (01 – 12)
+%j Day of year as decimal number (001 – 366)
+%m Month as decimal number (01 – 12)
+%M Minute as decimal number (00 – 59)
+%p Current locale's A.M./P.M. indicator for 12-hour clock
+%S Second as decimal number (00 – 59)
+%U Week of year as decimal number, with Sunday as first day of week (00 – 53)
+%w Weekday as decimal number (0 – 6; Sunday is 0)
+%W Week of year as decimal number, with Monday as first day of week (00 – 53)
+%x Date representation for current locale
+%X Time representation for current locale
+%y Year without century, as decimal number (00 – 99)
+%Y Year with century, as decimal number
+%z, %Z Either the time-zone name or time zone abbreviation, depending on registry settings; no characters if time zone is unknown
+%% Percent sign
+ The # flag may prefix any formatting code. In that case, the meaning of
+the format code is changed as follows.
+--------------------------------------------+----------------------------------------------
+Format code | Meaning
+--------------------------------------------+----------------------------------------------
+%#a, %#A, %#b, %#B, %#p, %#X, %#z, %#Z, %#% | # flag is ignored.
+--------------------------------------------+----------------------------------------------
+%#c | Long date and time representation,
+ | appropriate for current locale. For example:
+ | "Tuesday, March 14, 1995, 12:41:29".
+--------------------------------------------+----------------------------------------------
+%#x | Long date representation, appropriate to
+ | current locale. For example:
+ | "Tuesday, March 14, 1995".
+--------------------------------------------|----------------------------------------------
+%#d, %#H, %#I, %#j, %#m, %#M, %#S, %#U, | Remove leading zeros (if any).
+ %#w, %#W, %#y, %#Y |
+--------------------------------------------+----------------------------------------------
diff --git a/plugins/RecentContacts/Docs/RecentContacts-Translation.txt b/plugins/RecentContacts/Docs/RecentContacts-Translation.txt new file mode 100644 index 0000000000..5898be865d --- /dev/null +++ b/plugins/RecentContacts/Docs/RecentContacts-Translation.txt @@ -0,0 +1,3 @@ +;[Recent Contacts]
+;[Contact]
+;[Main icon]
diff --git a/plugins/RecentContacts/Docs/RecentContacts.txt b/plugins/RecentContacts/Docs/RecentContacts.txt new file mode 100644 index 0000000000..6b5b851024 --- /dev/null +++ b/plugins/RecentContacts/Docs/RecentContacts.txt @@ -0,0 +1 @@ +RecentContacts 0.0.2.0
\ No newline at end of file diff --git a/plugins/RecentContacts/RecentContacts.bmp b/plugins/RecentContacts/RecentContacts.bmp Binary files differnew file mode 100644 index 0000000000..070d7a5124 --- /dev/null +++ b/plugins/RecentContacts/RecentContacts.bmp diff --git a/plugins/RecentContacts/RecentContacts.cpp b/plugins/RecentContacts/RecentContacts.cpp new file mode 100644 index 0000000000..0eda98536f --- /dev/null +++ b/plugins/RecentContacts/RecentContacts.cpp @@ -0,0 +1,684 @@ +
+#include "RecentContacts.h"
+
+extern int onOptInitialise(WPARAM wParam, LPARAM lParam);
+
+using namespace std;
+static const basic_string <char>::size_type npos = -1;
+
+char *szProto;
+HINSTANCE hInst = NULL;
+PLUGINLINK *pluginLink = NULL;
+int hLangpack = 0;
+
+MM_INTERFACE mmi;
+LIST_INTERFACE li;
+
+HANDLE hMenu = NULL;
+HANDLE hPrebuildMenu = NULL;
+HANDLE hSystemModulesLoaded = NULL;
+HANDLE hTopToolbarLoaded = NULL;
+HANDLE hTopToolbarButtonShowList = NULL;
+HANDLE hMsgWndEvent = NULL;
+HANDLE hWindowList = NULL;
+HANDLE hMenuItemRemove = NULL;
+HANDLE hOptInitialise = NULL;
+HANDLE hContactSetting = NULL;
+
+LIST<void> ServiceList(10,0), HookList(10,0);
+
+BOOL IsMessageAPI = FALSE;
+
+LastUCOptions LastUCOpt = {0};
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ hInst = hinstDLL;
+ return TRUE;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+PLUGININFOEX pluginInfo =
+{
+ sizeof(PLUGININFOEX),
+ "Recent Contacts",
+ PLUGIN_MAKE_VERSION(0,0,2,0),
+ "Adds a menu item in main menu, which open the window with list of last used contacts names,"
+ " sorted in order from most recent to least.",
+ "ValeraVi, Kildor",
+ "kostia@ngs.ru",
+ "© 2005 ValeraVi, © 2009 Kildor",
+ "http://kildor.miranda.im",
+ UNICODE_AWARE,
+ 0, //doesn't replace anything built-in
+ { 0x0e5f3b9d, 0xebcd, 0x44d7, {0x93, 0x74, 0xd8, 0xe5, 0xd8, 0x8d, 0xf4, 0xe3}}
+ /* 0e5f3b9d-ebcd-44d7-9374-d8e5d88df4e3 */
+};
+
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static const MUUID interfaces[] = {MIID_RECENTCONTACTS, MIID_LAST};
+
+extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void LoadDBSettings()
+{
+ ZeroMemory(&LastUCOpt, sizeof(LastUCOpt));
+ LastUCOpt.MaxShownContacts = (INT)DBGetContactSettingByte( NULL, dbLastUC_ModuleName, dbLastUC_MaxShownContacts, 0 );
+ LastUCOpt.HideOffline = DBGetContactSettingByte( NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, 0 );
+
+ DBVARIANT dbv;
+ dbv.type = DBVT_ASCIIZ;
+ dbv.pszVal = NULL;
+ if ( db_get(NULL, dbLastUC_ModuleName, dbLastUC_DateTimeFormat, &dbv) == 0 && dbv.pszVal[0]!=0 ) {
+ LastUCOpt.DateTimeFormat = dbv.pszVal;
+ DBFreeVariant(&dbv);
+ }
+ else LastUCOpt.DateTimeFormat = "(%Y-%m-%d %H:%M) ";
+}
+
+void ShowListMainDlgProc_AdjustListPos(HWND hDlg, LASTUC_DLG_DATA *DlgDat)
+{
+ HWND hList = GetDlgItem(hDlg, IDC_CONTACTS_LIST);
+ if (hList == NULL)
+ return;
+
+ RECT rc;
+ SIZE cur;
+ GetWindowRect(hDlg, &rc);
+ cur.cx = rc.right - rc.left;
+ cur.cy = rc.bottom - rc.top;
+ rc.left = DlgDat->ListUCRect.left;
+ rc.top = DlgDat->ListUCRect.top;
+ rc.right = DlgDat->ListUCRect.right + cur.cx - DlgDat->WindowMinSize.cx;
+ rc.bottom = DlgDat->ListUCRect.bottom + cur.cy - DlgDat->WindowMinSize.cy;
+ MoveWindow(hList, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, TRUE);
+
+ LVCOLUMN lvc = { 0 };
+ lvc.mask = LVCF_WIDTH;
+ lvc.cx = rc.right - rc.left - GetSystemMetrics(SM_CYHSCROLL) - 4;
+ if (lvc.cx < 10)
+ lvc.cx = 10;
+ ListView_SetColumn(hList, 0, &lvc);
+}
+
+BOOL ShowListMainDlgProc_OpenContact(HWND hList, int item)
+{
+ if (item != -1) {
+ LVITEM lvi;
+ ZeroMemory(&lvi, sizeof(lvi));
+ lvi.mask = LVIF_PARAM;
+ lvi.lParam = NULL;
+ lvi.iItem = item;
+ lvi.iSubItem = 0;
+ ListView_GetItem(hList, &lvi);
+ if (lvi.lParam != NULL) {
+ CallService(MS_CLIST_CONTACTDOUBLECLICKED, (WPARAM)lvi.lParam, NULL);
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+BOOL ShowListMainDlgProc_OpenContactMenu(HWND hDlg, HWND hList, int item, LASTUC_DLG_DATA *DlgDat)
+{
+ if (item != -1) {
+ LVITEM lvi;
+ ZeroMemory(&lvi, sizeof(lvi));
+ lvi.mask = LVIF_PARAM;
+ lvi.lParam = NULL;
+ lvi.iItem = item;
+ lvi.iSubItem = 0;
+ ListView_GetItem(hList, &lvi);
+ if (lvi.lParam != NULL) {
+ HMENU hCMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)lvi.lParam, NULL);
+ if (hCMenu != NULL) {
+ POINT p;
+ GetCursorPos(&p);
+ DlgDat->hContact = (HANDLE) lvi.lParam;
+ BOOL ret = TrackPopupMenu(hCMenu, 0, p.x, p.y, 0, hDlg, NULL);
+ DestroyMenu(hCMenu);
+ if (ret)
+ return TRUE;
+ DlgDat->hContact = NULL;
+ }
+ }
+ }
+ return FALSE;
+}
+
+void wSetData(char **Data, const char *Value)
+{
+ if (Value[0] != 0) {
+ char *newData = (char*)mir_alloc(strlen(Value)+3);
+ strcpy(newData, Value);
+ *Data = newData;
+ }
+ else *Data = "";
+}
+
+void wfree(char **Data)
+{
+ if (*Data && strlen(*Data) > 0) mir_free(*Data);
+ *Data = NULL;
+}
+
+HWND hwndContactTree = NULL;
+
+BOOL WINAPI ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ LASTUC_DLG_DATA *DlgDat;
+
+ DlgDat = (LASTUC_DLG_DATA *)GetWindowLong(hDlg, GWL_USERDATA);
+ HWND hList = GetDlgItem(hDlg, IDC_CONTACTS_LIST);
+ if (hList == NULL)
+ return FALSE;
+
+ switch( msg ) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hDlg);
+ {
+ DlgDat = new LASTUC_DLG_DATA;
+ ZeroMemory(DlgDat, sizeof(LASTUC_DLG_DATA));
+ DlgDat->Contacts = (cmultimap*)lParam;
+
+ RECT rc;
+ GetWindowRect(hDlg, &rc);
+ DlgDat->WindowMinSize.cx = rc.right - rc.left;
+ DlgDat->WindowMinSize.cy = rc.bottom - rc.top;
+ GetWindowRect(hList, &DlgDat->ListUCRect);
+
+ POINT p;
+ p.x = DlgDat->ListUCRect.left;
+ p.y = DlgDat->ListUCRect.top;
+ ScreenToClient(hDlg, &p);
+ DlgDat->ListUCRect.left = p.x;
+ DlgDat->ListUCRect.top = p.y;
+ p.x = DlgDat->ListUCRect.right;
+ p.y = DlgDat->ListUCRect.bottom;
+ ScreenToClient(hDlg, &p);
+ DlgDat->ListUCRect.right = p.x;
+ DlgDat->ListUCRect.bottom = p.y;
+ SetWindowLong(hDlg, GWL_USERDATA, (LONG)DlgDat);
+
+ //set listview styles
+ ListView_SetExtendedListViewStyleEx(hList,
+ LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_LABELTIP
+ | LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT, -1);
+
+ // add header columns to listview
+ LVCOLUMN lvc;
+ ZeroMemory(&lvc, sizeof(lvc));
+ lvc.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
+ lvc.fmt = LVCFMT_LEFT;
+ lvc.iSubItem = 0;
+ lvc.pszText = TranslateT("Contact");
+ lvc.cx = 10;
+ ListView_InsertColumn(hList, 0, &lvc);
+
+ // add conacts to listview
+ HIMAGELIST hImgList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ if (hImgList != NULL)
+ ListView_SetImageList(hList, hImgList, LVSIL_SMALL);
+
+ LVITEM lvi = { 0 };
+ lvi.mask = LVIF_TEXT | LVIF_PARAM | LVIF_IMAGE;
+
+ int i=0;
+ cmultimap::iterator curContact;
+ std::tstring str;
+ char strtim[256 + 16];
+
+ string strtimformat;
+ DBVARIANT dbv;
+ dbv.type = DBVT_ASCIIZ;
+ dbv.pszVal = NULL;
+ if (db_get(NULL, dbLastUC_ModuleName, dbLastUC_DateTimeFormat, &dbv) == 0) {
+ strtimformat = dbv.pszVal;
+ DBFreeVariant(&dbv);
+ }
+ else strtimformat = dbLastUC_DateTimeFormatDefault;
+
+ for(curContact = DlgDat->Contacts->begin(); curContact != DlgDat->Contacts->end(); curContact++) {
+ if (curContact->second != NULL && db_byte_get(curContact->second, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ) {
+ TCHAR *cname = ( TCHAR* )CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)curContact->second, GCDNF_TCHAR);
+ if ( cname == NULL )
+ continue;
+
+ if (LastUCOpt.HideOffline == 1) {
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)curContact->second, 0);
+ if (szProto != NULL && DBGetContactSettingWord((HANDLE)curContact->second, szProto, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ continue;
+ }
+
+ lvi.iItem = i;
+ lvi.iSubItem = 0;
+ lvi.lParam = (LPARAM)curContact->second;
+
+ strftime(strtim, 256, strtimformat.c_str(), _localtime64(&curContact->first));
+ strtim[255] = 0;
+ str = _A2T(strtim);
+ str += cname;
+ lvi.pszText = (LPTSTR)str.c_str();
+ lvi.iImage = CallService(MS_CLIST_GETCONTACTICON, (WPARAM)curContact->second, 0);
+ ListView_InsertItem(hList, &lvi);
+ i++;
+
+ }
+ if (LastUCOpt.MaxShownContacts > 0 && i >= LastUCOpt.MaxShownContacts)
+ break;
+ }
+
+ SAVEWINDOWPOS pos;
+ pos.hContact = NULL;
+ pos.hwnd = hDlg;
+ pos.szModule = dbLastUC_ModuleName;
+ pos.szNamePrefix = dbLastUC_WindowPosPrefix;
+ CallService(MS_UTILS_RESTOREWINDOWPOSITION, 0, (LPARAM)(SAVEWINDOWPOS*)&pos);
+ SendMessage(hDlg, WM_SIZE, 0, 0);
+ WindowList_Add(hWindowList, hDlg, NULL);
+ return TRUE;
+ }
+
+ case WM_ACTIVATE:
+ if (LOWORD(wParam) == WA_INACTIVE)
+ SendMessage(hDlg, WM_CLOSE, 0, 0);
+ break;
+
+ case WM_NOTIFY:
+ {
+ LPNMHDR lpNmhdr;
+ lpNmhdr = (LPNMHDR)lParam;
+ if (lpNmhdr->hwndFrom == hList) {
+ if (lpNmhdr->code == NM_CLICK || lpNmhdr->code == NM_RCLICK) {
+ RECT r;
+ POINT p;
+ GetCursorPos(&p);
+ GetWindowRect(hList, &r);
+ if (PtInRect(&r, p)) {
+ LVHITTESTINFO lvh;
+ ZeroMemory(&lvh, sizeof(lvh));
+ lvh.pt = p;
+ ScreenToClient(hList, &lvh.pt);
+ ListView_HitTest(hList, &lvh);
+ if ((lvh.flags & (LVHT_ONITEMICON | LVHT_ONITEMLABEL | LVHT_ONITEMSTATEICON)) && lvh.iItem != -1) {
+ if (lpNmhdr->code == NM_CLICK) {
+ if (ShowListMainDlgProc_OpenContact(hList, lvh.iItem))
+ SendMessage(hDlg, WM_CLOSE, 0, 0);
+ }
+ else ShowListMainDlgProc_OpenContactMenu(hDlg, hList, lvh.iItem, DlgDat);
+ }
+ }
+ }
+ else if (lpNmhdr->code == NM_RETURN) {
+ if (ShowListMainDlgProc_OpenContact(hList, ListView_GetNextItem(hList, -1, LVIS_SELECTED)))
+ SendMessage(hDlg, WM_CLOSE, 0, 0);
+ }
+ }
+ break;
+ }
+
+ case WM_MEASUREITEM:
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
+
+ case WM_DRAWITEM:
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
+
+ case WM_COMMAND:
+ if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_CONTACTMENU), (LPARAM)DlgDat->hContact))
+ break;
+
+ switch(wParam) {
+ case IDOK:
+ ShowListMainDlgProc_OpenContact(hList, ListView_GetNextItem(hList, -1, LVIS_SELECTED));
+ case IDCANCEL:
+ SendMessage(hDlg, WM_CLOSE, 0, 0);
+ break;
+ }
+ break;
+
+ case WM_GETMINMAXINFO:
+ {
+ MINMAXINFO *mmi = (MINMAXINFO *) lParam;
+ mmi->ptMinTrackSize.x = 100;
+ mmi->ptMinTrackSize.y = 150;
+ return 0;
+ }
+
+ case WM_SIZE:
+ ShowListMainDlgProc_AdjustListPos(hDlg, DlgDat);
+ break;
+
+ case WM_CLOSE:
+ DestroyWindow(hDlg);
+ break;
+
+ case WM_DESTROY:
+ {
+ // Save current window position.
+ SAVEWINDOWPOS pos;
+ pos.hContact = NULL;
+ pos.hwnd = hDlg;
+ pos.szModule = dbLastUC_ModuleName;
+ pos.szNamePrefix = dbLastUC_WindowPosPrefix;
+ CallService(MS_UTILS_SAVEWINDOWPOSITION, 0, (LPARAM)(SAVEWINDOWPOS*)&pos);
+ delete DlgDat->Contacts;
+ delete DlgDat;
+ // Remove entry from Window list
+ WindowList_Remove(hWindowList, hDlg);
+ break;
+ }
+ }
+ return FALSE;
+}
+
+int OnMenuCommandShowList(WPARAM wParam, LPARAM lParam)
+{
+ cmultimap *contacts = new cmultimap;
+
+ __time64_t curTime;
+ //DWORD t;
+ DBEVENTINFO dbe;
+ ZeroMemory(&dbe, sizeof(dbe));
+ dbe.cbSize = sizeof(dbe);
+ BYTE buf[1];
+ dbe.pBlob = buf;
+ HANDLE curEvent;
+ HANDLE curContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ for(; curContact != NULL; curContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)curContact, 0))
+ {
+// if (IsMessageAPI)
+ {
+ curTime = ((__time64_t)db_dword_get(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, -1)) |
+ (((__time64_t)db_dword_get(curContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeHi, -1)) << 32);
+ //use TabSRMM last used time. ! NOT used, because bug: TabSRMM reset last used time to time when miranda started at miranda start!
+ //t = ((DWORD)db_dword_get(curContact, "Tab_SRMsg", "isRecent", -1));
+ //if (t != -1)
+ //{
+ // if (curTime == -1 || (__time64_t)t > curTime)
+ // curTime = (__time64_t)t;
+ //}
+ }
+// else
+ {
+ curEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)curContact, 0);
+ if (curEvent != NULL)
+ {
+ for( ; curEvent != NULL; curEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)curEvent, 0))
+ {
+ dbe.cbBlob = 1;
+ if (CallService(MS_DB_EVENT_GET, (WPARAM)curEvent, (LPARAM)&dbe) != 0)
+ {
+ curEvent = NULL;
+ break;
+ }
+ if ((dbe.flags & (DBEF_READ | DBEF_SENT)) && dbe.eventType < 2000)
+ break;
+ }
+ if (curEvent != NULL)
+ if (curTime == -1 || (__time64_t)dbe.timestamp > curTime)
+ curTime = (__time64_t)dbe.timestamp;
+ }
+ }
+ if (curTime != -1)
+ contacts->insert(cpair(curTime, curContact));
+ }
+
+ HWND hWndMain;
+ if ((hWndMain = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_LASTUC_DIALOG), NULL, ShowListMainDlgProc, (LPARAM)contacts)) == NULL)
+ return -1;
+
+ ShowWindow(hWndMain, SW_SHOW);
+
+ if (hTopToolbarButtonShowList != NULL)
+ CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTopToolbarButtonShowList, TTBST_RELEASED);
+ return 0;
+}
+
+static int OnContactSettingChanged( WPARAM wParam, LPARAM lParam )
+{
+ HANDLE hContact = ( HANDLE )wParam;
+ DBCONTACTWRITESETTING* pdbcws = ( DBCONTACTWRITESETTING* )lParam;
+
+ if ( hContact == NULL )
+ if ( !stricmp( pdbcws->szModule, dbLastUC_ModuleName))
+ LoadDBSettings();
+
+ return 0;
+}
+
+int Create_TopToolbarShowList(WPARAM wParam, LPARAM lParam)
+{
+ if (ServiceExists(MS_TTB_ADDBUTTON)) {
+ TTBButton ttbb = { 0 };
+ ttbb.cbSize = sizeof(ttbb);
+ ttbb.hbBitmapUp =
+ ttbb.hbBitmapDown = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_CMD_SHOWLASTUSED));
+ ttbb.pszServiceUp =
+ ttbb.pszServiceDown = msLastUC_ShowList;
+ ttbb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP|TTBBF_DRAWBORDER;
+ ttbb.name = Translate(msLastUC_ShowListName);
+
+ hTopToolbarButtonShowList = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttbb, 0);
+ if ((int)hTopToolbarButtonShowList == -1)
+ hTopToolbarButtonShowList = NULL;
+ }
+
+ return 0;
+}
+
+int Create_MenuitemShowList(void)
+{
+ CLISTMENUITEM mi = { 0 };
+ mi.cbSize = sizeof(mi);
+ mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, ( LPARAM )"recent_main" );
+ mi.pszName = msLastUC_ShowListName;
+ mi.pszService = msLastUC_ShowList;
+ CallService(MS_CLIST_ADDMAINMENUITEM, 0, (LPARAM)&mi);
+
+ ZeroMemory( &mi, sizeof( mi ));
+ mi.cbSize = sizeof( mi );
+ mi.position = 0xFFFFF;
+ mi.hIcon = ( HICON )CallService( MS_SKIN2_GETICON, 0, ( LPARAM )"recent_main" );
+ mi.ptszName = _T("Toggle Ignore");
+ mi.pszService = V_RECENTCONTACTS_TOGGLE_IGNORE;
+ hMenuItemRemove = (HANDLE)CallService( MS_CLIST_ADDCONTACTMENUITEM,0, ( LPARAM )&mi );
+
+ return 0;
+}
+
+BOOL SaveLastUsedTimeStamp(HANDLE hContact)
+{
+ __time64_t ct = _time64(NULL);
+ db_dword_set(hContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeLo, (DWORD)ct);
+ db_dword_set(hContact, dbLastUC_ModuleName, dbLastUC_LastUsedTimeHi, (DWORD)(ct >> 32));
+ return TRUE;
+}
+
+int OnMsgEvent(WPARAM wParam, LPARAM lParam)
+{
+ MessageWindowEventData *ed = (MessageWindowEventData *)lParam;
+ if (ed->hContact == NULL)
+ return 0;
+
+ if (ed->uType == MSG_WINDOW_EVT_OPEN)
+ SaveLastUsedTimeStamp(ed->hContact);
+ else if (ed->uType == MSG_WINDOW_EVT_CUSTOM) {
+ struct TABSRMM_SessionInfo *si = (struct TABSRMM_SessionInfo*) ed->local;
+ if (si != NULL)
+ if (si->evtCode == tabMSG_WINDOW_EVT_CUSTOM_BEFORESEND)
+ SaveLastUsedTimeStamp(ed->hContact);
+ }
+ return 0;
+}
+
+static void iconsInit(void)
+{
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInst, szFile, SIZEOF(szFile));
+
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_PATH_UNICODE;
+ sid.pszSection = Translate(msLastUC_ShowListName);
+ sid.ptszDefaultFile = szFile;
+
+ sid.pszDescription = LPGEN("Main icon");
+ sid.pszName = "recent_main";
+ sid.iDefaultIndex = -IDI_SHOWRECENT;
+ CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+}
+
+static int OnPrebuildContactMenu (WPARAM wParam, LPARAM lParam)
+{
+ CLISTMENUITEM clmi = { 0 };
+ clmi.cbSize = sizeof( clmi );
+ clmi.flags = CMIM_NAME | CMIF_TCHAR;
+
+ if ( DBGetContactSettingByte((HANDLE)wParam, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0)
+ clmi.ptszName = TranslateT("Ignore Contact");
+ else
+ clmi.ptszName = TranslateT("Show Contact");
+
+ CallService( MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenuItemRemove, (LPARAM)&clmi );
+ return 0;
+}
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ iconsInit();
+ Create_MenuitemShowList();
+ IsMessageAPI = (CallService(MS_MSG_GETWINDOWAPI, 0, 0) != CALLSERVICE_NOTFOUND);
+ //maxShownContacts = ;
+ LoadDBSettings();
+
+ if ( ServiceExists(MS_UPDATE_REGISTER)) {
+ char szVersion[16];
+
+ Update update = {0};
+ update.cbSize = sizeof(Update);
+ update.szComponentName = pluginInfo.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion);
+ update.cpbVersion = strlen((char *)update.pbVersion);
+
+ update.szUpdateURL = UPDATER_AUTOREGISTER;
+
+ // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
+ // before the version that we use to locate it on the page
+ // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
+ // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
+ update.szBetaUpdateURL = "http://kildor.miranda.im/miranda/recentcontacts.zip";
+ update.szBetaVersionURL = "http://kildor.miranda.im/miranda/recentcontacts.txt";
+ update.szBetaChangelogURL = "http://kildor.miranda.im/miranda/recentcontacts_changes.txt";
+ update.pbBetaVersionPrefix = (BYTE *)"RecentContacts ";
+ update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix);
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+ }
+
+ /*
+ if (ServiceExists(MS_FONT_REGISTERT)) {
+ FontIDT fid={0};
+
+ fid.cbSize=sizeof(fid);
+ fid.group = _T("Console");
+ fid.name,TranslateT = "Text";
+ fid.dbSettingsGroup = "Console";
+ fid.prefix = "ConsoleFont";
+
+ fid.backgroundGroup = _T("Console");
+ fid.backgroundName = _T("Background");
+
+ fid.flags = FIDF_DEFAULTVALID;
+
+ fid.deffontsettings.charset = DEFAULT_CHARSET;
+ fid.deffontsettings.colour = RGB(0, 0, 0);
+ fid.deffontsettings.size = 10;
+ fid.deffontsettings.style = 0;
+ _tcsncpy(fid.deffontsettings.szFace, _T("Tahoma"), LF_FACESIZE);
+
+ CallService(MS_FONT_REGISTERT,(WPARAM)&fid,0);
+
+ hHooks[i++] = HookEvent(ME_FONT_RELOAD,OnFontChange);
+ }
+ */
+
+ if (ServiceExists(MS_HOTKEY_REGISTER)) {
+ // hotkeys
+ HOTKEYDESC hotkey = {0};
+ hotkey.cbSize = sizeof(hotkey);
+ hotkey.pszName = msLastUC_ShowList;
+ hotkey.pszDescription = LPGEN("Show Recent Contacts");
+ hotkey.pszSection = "Contacts";
+ hotkey.pszService = msLastUC_ShowList;
+ hotkey.DefHotKey = MAKEWORD('R', HOTKEYF_CONTROL | HOTKEYF_SHIFT);
+ CallService(MS_HOTKEY_REGISTER, 0, (LPARAM)&hotkey);
+ }
+
+ return 0;
+}
+
+int ToggleIgnore (WPARAM wParam, LPARAM lParam)
+{
+ if (wParam != NULL) {
+ HANDLE hContact = ( HANDLE )wParam;
+ int state = DBGetContactSettingByte(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, 0) == 0 ? 1 : 0 ;
+ DBWriteContactSettingByte(hContact, dbLastUC_ModuleName, dbLastUC_IgnoreContact, state);
+ return state;
+ }
+
+ return -1;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+ mir_getLP( &pluginInfo );
+ mir_getMMI( &mmi );
+ mir_getLI( &li );
+
+ CoInitialize(NULL);
+ hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+
+ ServiceList.insert( CreateServiceFunction(msLastUC_ShowList, OnMenuCommandShowList));
+ ServiceList.insert( CreateServiceFunction(V_RECENTCONTACTS_TOGGLE_IGNORE, ToggleIgnore));
+
+ HookList.insert( HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded));
+ HookList.insert( HookEvent(ME_CLIST_PREBUILDCONTACTMENU, OnPrebuildContactMenu ));
+ HookList.insert( HookEvent(ME_TTB_MODULELOADED, Create_TopToolbarShowList));
+ HookList.insert( HookEvent(ME_MSG_WINDOWEVENT, OnMsgEvent));
+ HookList.insert( HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged ));
+ HookList.insert( HookEvent(ME_OPT_INITIALISE, onOptInitialise));
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+extern "C" __declspec(dllexport) int Unload(void)
+{
+ int i;
+
+ for (i=0; i < ServiceList.getCount(); ++i)
+ DestroyServiceFunction( ServiceList[i] );
+
+ for (i=0; i < HookList.getCount(); ++i)
+ UnhookEvent( HookList[i] );
+
+ CoUninitialize();
+ return 0;
+}
diff --git a/plugins/RecentContacts/RecentContacts.h b/plugins/RecentContacts/RecentContacts.h new file mode 100644 index 0000000000..76adb2fdd8 --- /dev/null +++ b/plugins/RecentContacts/RecentContacts.h @@ -0,0 +1,93 @@ +
+#pragma once
+
+#define _CRT_SECURE_NO_WARNINGS
+#define _CRT_NONSTDC_NO_DEPRECATE
+#define MIRANDA_VER 0x0A00
+
+#include <windows.h>
+#include <commctrl.h>
+#include <string>
+#include <map>
+#include "resource.h"
+#include <time.h>
+
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_contacts.h>
+#include <m_langpack.h>
+#include <m_database.h>
+#include <m_system.h>
+#include <m_system_cpp.h>
+#include <m_message.h>
+#include <m_utils.h>
+#include <m_updater.h>
+#include <m_icolib.h>
+#include <m_hotkeys.h>
+#include <m_protosvc.h>
+#include <m_options.h>
+#include <win2k.h>
+
+#include <m_toptoolbar.h>
+
+/* dc90285a-9985-4b7a-baad-e70ae1dfc1d9 */
+#define MIID_RECENTCONTACTS { 0xdc90285a, 0x9985, 0x4b7a, {0xba, 0xad, 0xe7, 0x0a, 0xe1, 0xdf, 0xc1, 0xd9}}
+
+#define V_RECENTCONTACTS_TOGGLE_IGNORE "RecentContacts/ToggleIgnore"
+
+using namespace std;
+
+void wSetData(char **Data, const char *Value);
+void wfree(char **Data);
+
+static char msLastUC_ShowListName[] = "Recent Contacts";
+
+static char dbLastUC_ModuleName[] = "RecentContacts";
+static char dbLastUC_LastUsedTimeLo[] = "LastUsedTimeLo";
+static char dbLastUC_LastUsedTimeHi[] = "LastUsedTimeHi";
+static char dbLastUC_WindowPosPrefix[] = "Window";
+static char dbLastUC_DateTimeFormat[] = "DateTimeFormat";
+static char dbLastUC_DateTimeFormatDefault[] = "(%Y-%m-%d %H:%M) ";
+static char dbLastUC_MaxShownContacts[] = "MaxShownContacts";
+static char dbLastUC_IgnoreContact[] = "Ignore";
+static char dbLastUC_HideOfflineContacts[] = "HideOfflineContacts";
+
+static char msLastUC_ShowList[] = "RecentContacts/ShowList";
+static char msLastUC_IgnoreOff[] = "RecentContacts/SetIgnoreOff";
+static char msLastUC_IgnoreOn[] = "RecentContacts/SetIgnoreOn";
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
+typedef struct _LastUCOptions
+{
+ int MaxShownContacts;
+ int HideOffline;
+ string DateTimeFormat;
+}
+ LastUCOptions;
+
+extern LastUCOptions LastUCOpt;
+//#include "m_tabsrmm.h"
+// custom tabSRMM events
+#define tabMSG_WINDOW_EVT_CUSTOM_BEFORESEND 1
+struct TABSRMM_SessionInfo {
+ unsigned int cbSize;
+ unsigned int evtCode;
+ HWND hwnd; // handle of the message dialog (tab)
+ HWND hwndContainer; // handle of the parent container
+ HWND hwndInput; // handle of the input area (rich edit)
+ /*struct MessageWindowData*/ void *dat; // the session info
+ /*struct ContainerWindowData*/ void *pContainer;
+};
+
+
+typedef std::multimap <__time64_t, HANDLE, std::greater<__time64_t> > cmultimap;
+typedef std::pair <__time64_t, HANDLE> cpair;
+
+typedef struct LASTUC_DLG_DATA
+{
+ cmultimap *Contacts;
+ SIZE WindowMinSize;
+ RECT ListUCRect;
+ HANDLE hContact;
+} LASTUC_DLG_DATA;
\ No newline at end of file diff --git a/plugins/RecentContacts/RecentContacts.ico b/plugins/RecentContacts/RecentContacts.ico Binary files differnew file mode 100644 index 0000000000..765c18bb73 --- /dev/null +++ b/plugins/RecentContacts/RecentContacts.ico diff --git a/plugins/RecentContacts/RecentContacts.sln b/plugins/RecentContacts/RecentContacts.sln new file mode 100644 index 0000000000..43bb0bc71c --- /dev/null +++ b/plugins/RecentContacts/RecentContacts.sln @@ -0,0 +1,17 @@ +Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RecentContacts", "RecentContacts.vcxproj", "{07137F45-8B5F-4561-BEC8-B883E9123785}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {07137F45-8B5F-4561-BEC8-B883E9123785}.Debug|Win32.ActiveCfg = Debug|Win32
+ {07137F45-8B5F-4561-BEC8-B883E9123785}.Release|Win32.ActiveCfg = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/plugins/RecentContacts/RecentContacts.vcxproj b/plugins/RecentContacts/RecentContacts.vcxproj new file mode 100644 index 0000000000..232b7a0cb4 --- /dev/null +++ b/plugins/RecentContacts/RecentContacts.vcxproj @@ -0,0 +1,159 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{07137F45-8B5F-4561-BEC8-B883E9123785}</ProjectGuid>
+ <RootNamespace>V_RecentContacts</RootNamespace>
+ <SccProjectName />
+ <SccLocalPath />
+ <ProjectName>RecentContacts</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>Unicode</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Plugins\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\Obj\$(ProjectName)\</IntDir>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>Full</Optimization>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;V_RECENTCONTACTS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <BrowseInformation>true</BrowseInformation>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <CompileAs>Default</CompileAs>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <PrecompiledHeaderFile>RecentContacts.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <Link>
+ <AdditionalOptions>/RELEASE %(AdditionalOptions)</AdditionalOptions>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <BaseAddress>
+ </BaseAddress>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ </Link>
+ <Midl>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Release/V_RecentContacts.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ <AdditionalIncludeDirectories>..\..\include\msapi</AdditionalIncludeDirectories>
+ </ResourceCompile>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;V_RECENTCONTACTS_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <PrecompiledHeader>Use</PrecompiledHeader>
+ <WarningLevel>Level3</WarningLevel>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>Default</CompileAs>
+ <PrecompiledHeaderFile>RecentContacts.h</PrecompiledHeaderFile>
+ </ClCompile>
+ <Link>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <TargetMachine>MachineX86</TargetMachine>
+ </Link>
+ <Midl>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ <TypeLibraryName>.\Debug/V_RecentContacts.tlb</TypeLibraryName>
+ <HeaderFileName>
+ </HeaderFileName>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x0809</Culture>
+ </ResourceCompile>
+ <Bscmake>
+ <OutputFile>$(IntDir)$(TargetName).bsc</OutputFile>
+ </Bscmake>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="options.cpp" />
+ <ClCompile Include="RecentContacts.cpp">
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
+ <BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
+ <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MinSpace</Optimization>
+ <BrowseInformation Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</BrowseInformation>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="resource.h" />
+ <ClInclude Include="RecentContacts.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="RecentContacts.bmp" />
+ <None Include="RecentContacts.ico" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/RecentContacts/RecentContacts.vcxproj.filters b/plugins/RecentContacts/RecentContacts.vcxproj.filters new file mode 100644 index 0000000000..9af855e77a --- /dev/null +++ b/plugins/RecentContacts/RecentContacts.vcxproj.filters @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{a8e5f8af-fab4-45bb-be3e-7dcb02fd0b6f}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{2359b09a-bdf6-467a-996f-8c02cd5d8438}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{d5d389fb-98d8-4510-932a-9154b08ddf7a}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="options.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="RecentContacts.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="RecentContacts.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="resource.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="RecentContacts.bmp">
+ <Filter>Resource Files</Filter>
+ </None>
+ <None Include="RecentContacts.ico">
+ <Filter>Resource Files</Filter>
+ </None>
+ </ItemGroup>
+</Project>
\ No newline at end of file diff --git a/plugins/RecentContacts/options.cpp b/plugins/RecentContacts/options.cpp new file mode 100644 index 0000000000..ad2b6e5359 --- /dev/null +++ b/plugins/RecentContacts/options.cpp @@ -0,0 +1,74 @@ +#include "RecentContacts.h"
+#include "resource.h"
+
+extern HINSTANCE hInst;
+void LoadDBSettings();
+
+BOOL CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ char str[32];
+
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, (LastUCOpt.HideOffline ? BST_CHECKED : BST_UNCHECKED));
+
+ mir_snprintf(str, SIZEOF(str), "%d", LastUCOpt.MaxShownContacts);
+ SetDlgItemTextA(hwndDlg, IDC_SHOWNCONTACTS, str);
+
+ mir_snprintf(str, SIZEOF(str), "%s", LastUCOpt.DateTimeFormat.c_str());
+ SetDlgItemTextA(hwndDlg, IDC_DATETIME, str);
+
+ SetWindowLong(hwndDlg,GWL_USERDATA,lParam);
+ return TRUE;
+
+ case WM_COMMAND:
+ switch(HIWORD(wParam)) {
+ case EN_CHANGE:
+ case BN_CLICKED:
+ case CBN_EDITCHANGE:
+ case CBN_SELCHANGE:
+ SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
+ }
+ break;
+
+ case WM_NOTIFY:
+ {
+ LPNMHDR phdr = (LPNMHDR)(lParam);
+ if (phdr->idFrom == 0 && phdr->code == PSN_APPLY) {
+ BOOL bSuccess = FALSE;
+
+ LastUCOpt.HideOffline = (BOOL)IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE);
+ DBWriteContactSettingByte(NULL, dbLastUC_ModuleName, dbLastUC_HideOfflineContacts, (BYTE)LastUCOpt.HideOffline);
+
+ GetDlgItemTextA(hwndDlg, IDC_SHOWNCONTACTS, str, SIZEOF(str));
+ LastUCOpt.MaxShownContacts= atoi(str);
+ DBWriteContactSettingByte(0,dbLastUC_ModuleName, dbLastUC_MaxShownContacts, LastUCOpt.MaxShownContacts);
+
+ GetDlgItemTextA(hwndDlg, IDC_DATETIME, str, SIZEOF(str));
+ DBWriteContactSettingString(0,dbLastUC_ModuleName, dbLastUC_DateTimeFormat, str );
+
+ LoadDBSettings();
+ return TRUE;
+ }
+ break;
+ }
+ }
+ return FALSE;
+}
+
+int onOptInitialise(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.cbSize = sizeof(odp);
+ odp.position = 0;
+ odp.hInstance = hInst;
+ odp.pszGroup = "Contact List";
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_LASTUC_OPT);
+ odp.pszTitle = Translate(msLastUC_ShowListName);
+ odp.pfnDlgProc = DlgProcOptions;
+ odp.flags = ODPF_BOLDGROUPS;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) &odp);
+
+ return 0;
+}
diff --git a/plugins/RecentContacts/resource.h b/plugins/RecentContacts/resource.h new file mode 100644 index 0000000000..93dc6a4a6f --- /dev/null +++ b/plugins/RecentContacts/resource.h @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDD_LASTUC_OPT 9
+#define IDI_FOLDER 101
+#define IDB_FOLDER 102
+#define IDI_CMD_BROWSE 103
+#define IDI_SHOWRECENT 103
+#define IDB_CMD_SHOWLASTUSED 104
+#define IDD_LASTUC_DIALOG 105
+#define IDC_LIST1 1000
+#define IDC_CONTACTS_LIST 1000
+#define IDC_SHOWNCONTACTS 1002
+#define IDC_HIDEOFFLINE 1004
+#define IDC_DATETIME 1005
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 106
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1006
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/plugins/RecentContacts/resource.rc b/plugins/RecentContacts/resource.rc new file mode 100644 index 0000000000..7656a189e4 --- /dev/null +++ b/plugins/RecentContacts/resource.rc @@ -0,0 +1,164 @@ +// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_CMD_SHOWLASTUSED BITMAP "RecentContacts.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_LASTUC_DIALOG DIALOGEX 0, 0, 150, 200
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU |
+ WS_THICKFRAME
+EXSTYLE WS_EX_TOOLWINDOW
+CAPTION "Recent Contacts"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_CONTACTS_LIST,"SysListView32",LVS_REPORT |
+ LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_SHAREIMAGELISTS |
+ LVS_ALIGNLEFT | LVS_NOCOLUMNHEADER | WS_BORDER |
+ WS_TABSTOP,0,0,150,200
+END
+
+#endif // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// German (Germany) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU)
+#ifdef _WIN32
+LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // German (Germany) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_LASTUC_OPT DIALOGEX 0, 0, 314, 240
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+BEGIN
+ GROUPBOX "Plugin settings",IDC_STATIC,7,7,300,226
+ EDITTEXT IDC_SHOWNCONTACTS,161,27,28,12,ES_AUTOHSCROLL
+ CONTROL "Number shown contacts:\n (0 to show all)",IDC_STATIC,
+ "Static",SS_LEFTNOWORDWRAP | WS_GROUP,24,27,121,17
+ LTEXT "Format of date and time\n(Look to readme for placeholders help)",
+ IDC_STATIC,24,50,133,22
+ EDITTEXT IDC_DATETIME,161,50,96,12,ES_AUTOHSCROLL
+ CONTROL "Hide offline contacts",IDC_HIDEOFFLINE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,161,75,84,8
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_SHOWRECENT ICON "RecentContacts.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_LASTUC_OPT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 307
+ VERTGUIDE, 24
+ VERTGUIDE, 161
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 233
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/Svc_vi/common.h b/plugins/Svc_vi/common.h index 0d2b22a711..c87ff4c726 100644 --- a/plugins/Svc_vi/common.h +++ b/plugins/Svc_vi/common.h @@ -94,37 +94,4 @@ extern BOOL verbose; const MUUID UUID_NULL = {0x00000000, 0x0000, 0x0000, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }};
-///////////////////////////////////////////////////////////////////////
-class _A2T
-{
- TCHAR* buf;
-
-public:
- _A2T( const char* s ) : buf( mir_a2t( s )) {}
- _A2T( const char* s, int cp ) : buf( mir_a2t_cp( s, cp )) {}
- ~_A2T() { mir_free(buf); }
-
- __forceinline operator TCHAR*() const
- { return buf;
- }
-};
-
-#define OLD_MIRANDAPLUGININFO_SUPPORT PLUGININFO oldPluginInfo = { \
- sizeof(PLUGININFO), \
- pluginInfo.shortName, \
- pluginInfo.version, \
- pluginInfo.description, \
- pluginInfo.author, \
- pluginInfo.authorEmail, \
- pluginInfo.copyright, \
- pluginInfo.homepage, \
- pluginInfo.flags, \
- pluginInfo.replacesDefaultModule \
-}; \
-\
-extern "C" __declspec(dllexport) PLUGININFO *MirandaPluginInfo(DWORD mirandaVersion) \
-{ \
- return &oldPluginInfo; \
-}
-
#endif
\ No newline at end of file diff --git a/plugins/Svc_vi/main.cpp b/plugins/Svc_vi/main.cpp index b376278c41..f6a9c7bd99 100644 --- a/plugins/Svc_vi/main.cpp +++ b/plugins/Svc_vi/main.cpp @@ -66,8 +66,6 @@ PLUGININFOEX pluginInfo={ {0x2f174488, 0x489c, 0x4fe1, {0x94, 0x0d, 0x59, 0x6c, 0xf0, 0xf3, 0x5e, 0x65}} //{2f174488-489c-4fe1-940d-596cf0f35e65}
};
-OLD_MIRANDAPLUGININFO_SUPPORT;
-
static const MUUID interfaces[] = {MIID_VERSIONINFO, MIID_SERVICEMODE, MIID_LAST};
extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
diff --git a/plugins/UserInfoEx/mir_string.h b/plugins/UserInfoEx/mir_string.h index ca8d90d2d0..558e86e508 100644 --- a/plugins/UserInfoEx/mir_string.h +++ b/plugins/UserInfoEx/mir_string.h @@ -31,28 +31,6 @@ Last change by : $Author: ing.u.horn $ #ifndef _MIR_STRING_H_INCLUDED_
#define _MIR_STRING_H_INCLUDED_
-class _A2T
-{
- public:
- _A2T(const char* s) :
- buf(mir_a2t(s))
- {}
-
- _A2T(const char* s, int cp) :
- buf(mir_a2t_cp(s, cp))
- {}
-
- ~_A2T()
- { mir_free(buf);
- }
-
- __inline operator TCHAR*() const
- { return buf;
- }
-
- private: TCHAR* buf;
-};
-
#define mir_wcsdup mir_wstrdup
#ifdef _UNICODE
diff --git a/plugins/YAMN/yamn.h b/plugins/YAMN/yamn.h index 7d82d83b82..3a7a7f86f0 100644 --- a/plugins/YAMN/yamn.h +++ b/plugins/YAMN/yamn.h @@ -283,20 +283,4 @@ extern int YAMN_STATUS; extern PYAMN_VARIABLES pYAMNVar;
extern HYAMNPROTOPLUGIN POP3Plugin;
-///////////////////////////////////////////////////////////////////////
-
-class _A2T
-{
- TCHAR* buf;
-
-public:
- _A2T( const char* s ) : buf( mir_a2t( s )) {}
- _A2T( const char* s, int cp ) : buf( mir_a2t_cp( s, cp )) {}
- ~_A2T() { mir_free(buf); }
-
- __forceinline operator TCHAR*() const
- { return buf;
- }
-};
-
#endif
|