Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / embedserv / source / embed / guid.cxx
blobb7520cd515525c34b8d7eab61dbdd0f52420c471
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifdef _MSC_VER
20 #pragma warning(disable : 4917 4555)
21 #endif
23 #include "common.h"
24 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
25 #include <com/sun/star/container/XNameAccess.hpp>
27 ::rtl::OUString getStorageTypeFromGUID_Impl( GUID* guid )
29 if ( *guid == OID_WriterTextServer )
30 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarWriterDocument.6" ) );
32 if ( *guid == OID_WriterOASISTextServer )
33 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.WriterDocument.1" ) );
35 if ( *guid == OID_CalcServer )
36 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarCalcDocument.6" ) );
38 if ( *guid == OID_CalcOASISServer )
39 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.CalcDocument.1" ) );
41 if ( *guid == OID_DrawingServer )
42 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarDrawDocument.6" ) );
44 if ( *guid == OID_DrawingOASISServer )
45 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.DrawDocument.1" ) );
47 if ( *guid == OID_PresentationServer )
48 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarImpressDocument.6" ) );
50 if ( *guid == OID_PresentationOASISServer )
51 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.ImpressDocument.1" ) );
53 if ( *guid == OID_MathServer )
54 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "soffice.StarMathDocument.6" ) );
56 if ( *guid == OID_MathOASISServer )
57 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "LibreOffice.MathDocument.1" ) );
59 return ::rtl::OUString();
62 ::rtl::OUString getServiceNameFromGUID_Impl( GUID* guid )
64 if ( *guid == OID_WriterTextServer )
65 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.TextDocument" ) );
67 if ( *guid == OID_WriterOASISTextServer )
68 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Writer.TextDocument" ) );
70 if ( *guid == OID_CalcServer )
71 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Calc.SpreadsheetDocument" ) );
73 if ( *guid == OID_CalcOASISServer )
74 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Calc.SpreadsheetDocument" ) );
76 if ( *guid == OID_DrawingServer )
77 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.DrawingDocument" ) );
79 if ( *guid == OID_DrawingOASISServer )
80 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.DrawingDocument" ) );
82 if ( *guid == OID_PresentationServer )
83 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.PresentationDocument" ) );
85 if ( *guid == OID_PresentationOASISServer )
86 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Draw.PresentationDocument" ) );
88 if ( *guid == OID_MathServer )
89 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Math.FormulaDocument" ) );
91 if ( *guid == OID_MathOASISServer )
92 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.Math.FormulaDocument" ) );
94 return ::rtl::OUString();
97 ::rtl::OUString getFilterNameFromGUID_Impl( GUID* guid )
99 if ( *guid == OID_WriterTextServer )
100 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Writer)" ) );
102 if ( *guid == OID_WriterOASISTextServer )
103 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "writer8" ) );
105 if ( *guid == OID_CalcServer )
106 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Calc)" ) );
108 if ( *guid == OID_CalcOASISServer )
109 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "calc8" ) );
111 if ( *guid == OID_DrawingServer )
112 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Draw)" ) );
114 if ( *guid == OID_DrawingOASISServer )
115 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "draw8" ) );
117 if ( *guid == OID_PresentationServer )
118 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Impress)" ) );
120 if ( *guid == OID_PresentationOASISServer )
121 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "impress8" ) );
123 if ( *guid == OID_MathServer )
124 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "StarOffice XML (Math)" ) );
126 if ( *guid == OID_MathOASISServer )
127 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "math8" ) );
129 return ::rtl::OUString();
132 ::rtl::OUString getTestFileURLFromGUID_Impl( GUID* guid )
134 if ( *guid == OID_WriterTextServer )
135 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxw" ) );
137 if ( *guid == OID_WriterOASISTextServer )
138 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odt" ) );
140 if ( *guid == OID_CalcServer )
141 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxc" ) );
143 if ( *guid == OID_CalcOASISServer )
144 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.ods" ) );
146 if ( *guid == OID_DrawingServer )
147 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxd" ) );
149 if ( *guid == OID_DrawingOASISServer )
150 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odg" ) );
152 if ( *guid == OID_PresentationServer )
153 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxi" ) );
155 if ( *guid == OID_PresentationOASISServer )
156 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odp" ) );
158 if ( *guid == OID_MathServer )
159 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.sxm" ) );
161 if ( *guid == OID_MathOASISServer )
162 return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "file:///d:/OLE_TEST/test.odf" ) );
164 return ::rtl::OUString();
167 // Fix strange warnings about some
168 // ATL::CAxHostWindow::QueryInterface|AddRef|Releae functions.
169 // warning C4505: 'xxx' : unreferenced local function has been removed
170 #if defined(_MSC_VER)
171 #pragma warning(disable: 4505)
172 #endif
174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */