diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-07-11 09:57:30 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-07-11 09:57:30 +0000 |
commit | 7da0ebe121b5b07dfd3f020b23e9622628f12a82 (patch) | |
tree | e0a8e02ee11a1447f62f178c4df8445a801034fd /fpicker/source/aqua/CFStringUtilities.hxx | |
parent | 3f9354c601a9962ab85f35288d460bf4e65df0b3 (diff) |
INTEGRATION: CWS aquafilepicker01 (1.1.2); FILE ADDED
2007/06/16 11:39:12 pjanik 1.1.2.7: #i74798#: Add license header.
2007/06/15 21:25:25 fheckl 1.1.2.6: cleanup changes
2007/05/09 06:12:05 fheckl 1.1.2.5: some cleanup and last changes
2007/05/02 22:24:57 fheckl 1.1.2.4: reverting FilterHelper's native format back to OUString
fixing bug with wrong default popu selection at "Insert picture" dialog
2007/04/28 14:03:52 fheckl 1.1.2.3: Several debug logging changes
2007/04/13 18:25:58 fheckl 1.1.2.2: Adding new files and general update
2007/02/20 23:57:39 fheckl 1.1.2.1: Next phase of aqua file picker after some refactoring
Diffstat (limited to 'fpicker/source/aqua/CFStringUtilities.hxx')
-rw-r--r-- | fpicker/source/aqua/CFStringUtilities.hxx | 150 |
1 files changed, 150 insertions, 0 deletions
diff --git a/fpicker/source/aqua/CFStringUtilities.hxx b/fpicker/source/aqua/CFStringUtilities.hxx new file mode 100644 index 000000000000..9fda807bf6b0 --- /dev/null +++ b/fpicker/source/aqua/CFStringUtilities.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: CFStringUtilities.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: ihi $ $Date: 2007-07-11 10:57:30 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef _CFSTRINGUTILITIES_HXX_ +#define _CFSTRINGUTILITIES_HXX_ + +#include <premac.h> +#include <Carbon/Carbon.h> +#include <postmac.h> + +#include <rtl/ustring.hxx> +#include <sal/types.h> + +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif + +enum InfoType { + FULLPATH, + FILENAME, + PATHWITHOUTLASTCOMPONENT +}; + +rtl::OUString CFStringToOUString(const CFStringRef sOrig); +rtl::OUString FSRefToOUString(FSRef fsRef, InfoType info = FULLPATH); +CFStringRef CFStringCreateWithOUString(const rtl::OUString& aString); + +//debug utils +#define PARAMFILLER "\n " + +inline void DBG_PRINT_ENTRY() { + OSL_TRACE(">>> %s", __func__); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname) { + OSL_TRACE(">>> %s::%s", classname, methodname); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const char* value1) { + OSL_TRACE(">>> %s::%s%s%s = %s", classname, methodname, PARAMFILLER, param1, value1); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const rtl::OUString& value1) { + OSL_TRACE(">>> %s::%s%s%s = %s", classname, methodname, PARAMFILLER, param1, OUStringToOString(value1, RTL_TEXTENCODING_UTF8).getStr()); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const CFStringRef value1) { + OSL_TRACE(">>> %s::%s%s%s =", classname, methodname, PARAMFILLER, param1); +#if OSL_DEBUG_LEVEL > 1 + CFShow(value1); +#endif +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const int value1) { + OSL_TRACE(">>> %s::%s%s%s = %d", classname, methodname, PARAMFILLER, param1, value1); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const char* value1, const char* param2, const int value2) { + OSL_TRACE(">>> %s::%s%s%s = %s%s%s = %d", classname, methodname, PARAMFILLER, param1, value1, PARAMFILLER, param2, value2); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const char* value1, const char* param2, const char* value2) { + OSL_TRACE(">>> %s::%s%s%s = %s%s%s = %s", classname, methodname, PARAMFILLER, param1, value1, PARAMFILLER, param2, value2); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const int value1, const char* param2, const int value2) { + OSL_TRACE(">>> %s::%s%s%s = %d%s%s = %d", classname, methodname, PARAMFILLER, param1, value1, PARAMFILLER, param2, value2); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const int value1, const char* param2, const char* value2) { + OSL_TRACE(">>> %s::%s%s%s = %d%s%s = %s", classname, methodname, PARAMFILLER, param1, value1, PARAMFILLER, param2, value2); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const int value1, const char* param2, const CFStringRef value2) { + OSL_TRACE(">>> %s::%s%s%s = %d%s%s =", classname, methodname, PARAMFILLER, param1, value1, PARAMFILLER, param2, value2); +#if OSL_DEBUG_LEVEL > 1 + CFShow(value2); +#endif +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const rtl::OUString& value1, const char* param2, const rtl::OUString& value2) { + OSL_TRACE(">>> %s::%s%s%s = %s%s%s = %s", classname, methodname, PARAMFILLER, param1, OUStringToOString(value1, RTL_TEXTENCODING_UTF8).getStr(), PARAMFILLER, param2, OUStringToOString(value2, RTL_TEXTENCODING_UTF8).getStr()); +} + +inline void DBG_PRINT_ENTRY(const char * classname, const char * methodname, const char* param1, const rtl::OUString& value1, const char* param2, const int value2) { + OSL_TRACE(">>> %s::%s%s%s = %s%s%s = %d", classname, methodname, PARAMFILLER, param1, OUStringToOString(value1, RTL_TEXTENCODING_UTF8).getStr(), PARAMFILLER, param2, value2); +} + +//exit method debugs + +inline void DBG_PRINT_EXIT() { + OSL_TRACE("<<< %s", __func__); +} + +inline void DBG_PRINT_EXIT(const char * classname, const char * methodname) { + OSL_TRACE("<<< %s::%s", classname, methodname); +} + +inline void DBG_PRINT_EXIT(const char * classname, const char * methodname, const char* retVal) { + OSL_TRACE("<<< %s::%s%sreturnValue = %s", classname, methodname, PARAMFILLER, retVal); +} + +inline void DBG_PRINT_EXIT(const char * classname, const char * methodname, int retVal) { + OSL_TRACE("<<< %s::%s%sreturnValue = %d", classname, methodname, PARAMFILLER, retVal); +} + +inline void DBG_PRINT_EXIT(const char * classname, const char * methodname, const CFStringRef retVal) { + OSL_TRACE("<<< %s::%s%sreturnValue = ", classname, methodname, PARAMFILLER); +#if OSL_DEBUG_LEVEL > 1 + CFShow(retVal); +#endif +} + +inline void DBG_PRINT_EXIT(const char * classname, const char * methodname, const rtl::OUString& retVal) { + OSL_TRACE("<<< %s::%s%sreturnValue = %s", classname, methodname, PARAMFILLER, OUStringToOString(retVal, RTL_TEXTENCODING_UTF8).getStr()); +} + +#endif //_CFSTRINGUTILITIES_HXX_ |