searchui/inc/search_global.h
author hgs
Tue, 05 Oct 2010 13:32:14 +0530
changeset 26 367228f82b66
parent 15 df6898e696c6
permissions -rw-r--r--
201039
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  The dll header file.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
hgs
parents:
diff changeset
    19
#ifndef SEARCH_GLOBAL_H
hgs
parents:
diff changeset
    20
#define SEARCH_GLOBAL_H
hgs
parents:
diff changeset
    21
hgs
parents:
diff changeset
    22
#include <qdebug.h>
hgs
parents:
diff changeset
    23
hgs
parents:
diff changeset
    24
#ifdef NFT
hgs
parents:
diff changeset
    25
#ifdef Q_OS_SYMBIAN
hgs
parents:
diff changeset
    26
#include <e32hal.h>
hgs
parents:
diff changeset
    27
#endif
hgs
parents:
diff changeset
    28
#endif
26
hgs
parents: 15
diff changeset
    29
hgs
parents: 15
diff changeset
    30
//settings storage path 
15
hgs
parents: 9
diff changeset
    31
const QString SETTINGS_INI_PATH("C:\\private\\2002c377\\searchsettings.ini");
26
hgs
parents: 15
diff changeset
    32
hgs
parents: 15
diff changeset
    33
hgs
parents: 15
diff changeset
    34
#define SEARCHAIWDECLINDEVICE "SearchDeviceQueryView"
hgs
parents: 15
diff changeset
    35
#define SEARCHAIWDECLONLINE "SearchWebQueryView"
hgs
parents: 15
diff changeset
    36
#define SEARCHAIWDECLMAINVIEW "SearchView"
hgs
parents: 15
diff changeset
    37
hgs
parents: 15
diff changeset
    38
#define SEARCHAIWQUERY "query"
hgs
parents: 15
diff changeset
    39
hgs
parents: 15
diff changeset
    40
#define SEARCHAPPUID "2002C377"
hgs
parents: 15
diff changeset
    41
hgs
parents: 15
diff changeset
    42
#define DEFAULT_SEARCH_FIELD "_aggregate"
hgs
parents: 15
diff changeset
    43
hgs
parents: 15
diff changeset
    44
hgs
parents: 15
diff changeset
    45
#define SUGGESTIONLINKS "links"
hgs
parents: 15
diff changeset
    46
hgs
parents: 15
diff changeset
    47
#define FIRSTLINEFIELD "_hlexcerpt"
hgs
parents: 15
diff changeset
    48
#define MAILBOXFIELD "MailBoxId"
hgs
parents: 15
diff changeset
    49
#define FOLDERFIELD "FolderId"
hgs
parents: 15
diff changeset
    50
#define NAMEFIELD "Name"
hgs
parents: 15
diff changeset
    51
#define EXTENSIONFIELD "Extension"
hgs
parents: 15
diff changeset
    52
#define ISFOLDERFIELD "IsFolder"
hgs
parents: 15
diff changeset
    53
#define MEDIAIDFIELD "MediaId"
hgs
parents: 15
diff changeset
    54
hgs
parents: 15
diff changeset
    55
#define MEDIACATEGORY "media"
hgs
parents: 15
diff changeset
    56
#define AUDIOCATEGORY "audio"
hgs
parents: 15
diff changeset
    57
#define VIDEOCATEGORY "video"
hgs
parents: 15
diff changeset
    58
#define IMAGECATEGORY "image"
hgs
parents: 15
diff changeset
    59
#define EMAILCATEGORY "email"
hgs
parents: 15
diff changeset
    60
#define CONTACTCATEGORY "contact"
hgs
parents: 15
diff changeset
    61
#define CALENDARCATEGORY "calendar"
hgs
parents: 15
diff changeset
    62
#define BOOKMARKCATEGORY "bookmark"
hgs
parents: 15
diff changeset
    63
#define APPLICATIONCATEGORY "applications"
hgs
parents: 15
diff changeset
    64
#define NOTESCATEGORY "notes"
hgs
parents: 15
diff changeset
    65
#define FILECATEGORY "file"
hgs
parents: 15
diff changeset
    66
#define MESSAGECATEGORY "msg"
hgs
parents: 15
diff changeset
    67
#define FILEFOLDERCATEGORY "file folder"
hgs
parents: 15
diff changeset
    68
9
hgs
parents:
diff changeset
    69
//#define OST_TRACE_COMPILER_IN_USE //Uncomment to enable performance measurements.
hgs
parents:
diff changeset
    70
hgs
parents:
diff changeset
    71
#ifdef OST_TRACE_COMPILER_IN_USE
hgs
parents:
diff changeset
    72
#define PERF_APP_LAUNCH_END(str) qDebug() << "Search_App_Launch :"<<str<<"at:"<<QTime::currentTime().second()<<":"<<QTime::currentTime().msec();
hgs
parents:
diff changeset
    73
#else
hgs
parents:
diff changeset
    74
#define PERF_APP_LAUNCH_END(str)
hgs
parents:
diff changeset
    75
#endif 
hgs
parents:
diff changeset
    76
hgs
parents:
diff changeset
    77
#ifndef SEARCH_UNITTESTING
hgs
parents:
diff changeset
    78
    #define SEARCH_CLASS(aClassName)
hgs
parents:
diff changeset
    79
#else
hgs
parents:
diff changeset
    80
    #define SEARCH_CLASS(aClassName) class aClassName;
hgs
parents:
diff changeset
    81
#endif 
hgs
parents:
diff changeset
    82
hgs
parents:
diff changeset
    83
#ifndef SEARCH_UNITTESTING
hgs
parents:
diff changeset
    84
    #define SEARCH_FRIEND_CLASS(aClassName)
hgs
parents:
diff changeset
    85
#else
hgs
parents:
diff changeset
    86
    #define SEARCH_FRIEND_CLASS(aClassName) friend class aClassName;
hgs
parents:
diff changeset
    87
#endif 
hgs
parents:
diff changeset
    88
hgs
parents:
diff changeset
    89
#define SEARCHCATCHDEBUG qDebug("Catched in: %s on line: %d",__FILE__,__LINE__);
hgs
parents:
diff changeset
    90
#define SEARCHDEBUG(a) qDebug("%s in: %s on line: %d", (a),  __FILE__,__LINE__);
hgs
parents:
diff changeset
    91
hgs
parents:
diff changeset
    92
#ifdef NFT
hgs
parents:
diff changeset
    93
    #define SEARCHTEST(aText)                  qDebug() << QString(aText)
hgs
parents:
diff changeset
    94
#ifdef Q_OS_SYMBIAN
hgs
parents:
diff changeset
    95
    inline void SEARCHFreeRam(const QString &aFunction)
hgs
parents:
diff changeset
    96
    {
hgs
parents:
diff changeset
    97
    TMemoryInfoV1Buf meminfo;
hgs
parents:
diff changeset
    98
    UserHal::MemoryInfo(meminfo);
hgs
parents:
diff changeset
    99
    int memSize = meminfo().iTotalRamInBytes >> 10;
hgs
parents:
diff changeset
   100
    int memFree = meminfo().iFreeRamInBytes >> 10;
hgs
parents:
diff changeset
   101
hgs
parents:
diff changeset
   102
    RHeap& ownHeap = User::Heap();
hgs
parents:
diff changeset
   103
    TInt biggestBlock = 0;
hgs
parents:
diff changeset
   104
    int heapFree = ownHeap.Available(biggestBlock) >> 10;
hgs
parents:
diff changeset
   105
    int heapSize = ownHeap.Size() >> 10;
hgs
parents:
diff changeset
   106
    qDebug()<< aFunction << "memFree" << memFree << "kb memSize" << memSize << "kb heapFree" << heapFree << "kb heapSize" << heapSize;
hgs
parents:
diff changeset
   107
    }
hgs
parents:
diff changeset
   108
    
hgs
parents:
diff changeset
   109
    #define SEARCH_FUNC_ENTRY(aFunction)   SEARCHFreeRam(QString(aFunction)+" entry")
hgs
parents:
diff changeset
   110
    #define SEARCH_FUNC_EXIT(aFunction)    SEARCHFreeRam(QString(aFunction)+" exit")
hgs
parents:
diff changeset
   111
#else
hgs
parents:
diff changeset
   112
    #define SEARCH_FUNC_ENTRY(aFunction)   qDebug()<< aFunction << " entry";
hgs
parents:
diff changeset
   113
    #define SEARCH_FUNC_EXIT(aFunction)    qDebug()<< aFunction << " exit";
hgs
parents:
diff changeset
   114
#endif
hgs
parents:
diff changeset
   115
    
hgs
parents:
diff changeset
   116
#else
hgs
parents:
diff changeset
   117
    #define SEARCHTEST(aText)
hgs
parents:
diff changeset
   118
    #define SEARCH_FUNC_ENTRY(aFunction)
hgs
parents:
diff changeset
   119
    #define SEARCH_FUNC_EXIT(aFunction)
hgs
parents:
diff changeset
   120
#endif
hgs
parents:
diff changeset
   121
hgs
parents:
diff changeset
   122
#endif // SEARCH_GLOBAL_H
hgs
parents:
diff changeset
   123