1 /*****************************************************************************
2  *
3  * Copyright (c) 2008-2010, CoreCodec, Inc.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  *     * Redistributions of source code must retain the above copyright
9  *       notice, this list of conditions and the following disclaimer.
10  *     * Redistributions in binary form must reproduce the above copyright
11  *       notice, this list of conditions and the following disclaimer in the
12  *       documentation and/or other materials provided with the distribution.
13  *     * Neither the name of CoreCodec, Inc. nor the
14  *       names of its contributors may be used to endorse or promote products
15  *       derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY CoreCodec, Inc. ``AS IS'' AND ANY
18  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL CoreCodec, Inc. BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  ****************************************************************************/
29 
30 #ifndef NODE_SYMBIAN__H
31 #define NODE_SYMBIAN__H
32 
33 /* the symbian headers are not compatible with C */
34 #if defined(__cplusplus)
35 
36 #undef T
37 #undef NULL
38 
39 #include <e32std.h>
40 #include <e32hal.h>
41 #include <f32file.h>
42 #include <flogger.h>
43 #include <hal.h>
44 #include <utf.h>
45 #include <eikfutil.h>
46 #include <mdaaudiooutputstream.h>
47 #include <mda\common\audio.h>
48 
49 #ifdef SYMBIAN90
50 #include <CommDB.h>
51 #endif
52 
53 #include <eikenv.h>
54 #include <eikappui.h>
55 #include <eikapp.h>
56 #include <eikdoc.h>
57 #include <eikmenup.h>
58 #include <eikon.hrh>
59 #include <eikmenub.h>
60 #include <eikedwin.h>
61 #include <eiktbar.h>
62 
63 #if !defined(SERIES90)
64 #include <eikspane.h>
65 #endif
66 
67 #if defined(SERIES60)
68 #include <aknapp.h>
69 #include <aknenv.h>
70 #include <eikdoc.h>
71 #include <stdio.h>
72 #include <aknnotewrappers.h>
73 #include <aknindicatorcontainer.h>
74 
75 #define CAppUi CAknAppUi
76 #define CDocument CEikDocument
77 typedef CAknApplication CApplication;
78 
79 #elif defined(SERIES80) || defined(SERIES90)
80 #include <eikenv.h>
81 #include <eikappui.h>
82 #include <eikapp.h>
83 #include <eikdoc.h>
84 #include <eikbtgpc.h>
85 
86 #define CAppUi CEikAppUi
87 #define CDocument CEikDocument
88 typedef CEikApplication CApplication;
89 
90 #elif defined(UIQ)
91 #include <qikappui.h>
92 #include <qikapplication.h>
93 #include <qikdocument.h>
94 #if defined(SYMBIAN90)
95 #include <QikViewBase.h>
96 #include <QikCommand.h>
97 #endif
98 
99 #define CAppUi CQikAppUi
100 #define CDocument CQikDocument
101 typedef CQikApplication CApplication;
102 
103 #else
104 #error Unknown Symbian SDK
105 #endif
106 
107 #ifdef UNICODE
108 #define T(a) L ## a
109 #else
110 #define T(a) a
111 #endif
112 
113 #ifndef SYMBIAN90
FromInt64(const TInt64 & i)114 static INLINE int64_t FromInt64(const TInt64& i)
115 {
116 	return i.Low() | ((int64_t)i.High() << 32);
117 }
ToInt64(int64_t i)118 static INLINE TInt64 ToInt64(int64_t i)
119 {
120     return TInt64((int32_t)(i>>32),(uint32_t)i);
121 }
122 #else
123 #define FromInt64(a) (a)
124 #define ToInt64(a) (a)
125 #endif
126 
127 #endif /* __cplusplus */
128 
129 #endif /* NODE_SYMBIAN__H */
130