summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-09-07 14:33:54 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-09-07 14:37:56 +0200
commitfc169270eaeb8156d40740cd088cd8ed958ea99c (patch)
tree368c844394526157226afd4a73dbebb0a9ccfc2f /vcl/inc
parente1276e83e0e914eab8966a189948d2238c82a1b6 (diff)
move the code for adding temporary fonts to a separate class
I'm a bit confused on how this stuff is separated between platforms, so better do it this way. Change-Id: I2dbd9baef587c81ee37b509bde272ef970f5b118
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/vcl/fontmanager.hxx23
-rw-r--r--vcl/inc/vcl/temporaryfonts.hxx54
2 files changed, 54 insertions, 23 deletions
diff --git a/vcl/inc/vcl/fontmanager.hxx b/vcl/inc/vcl/fontmanager.hxx
index b659435523b0..3049be0edf0c 100644
--- a/vcl/inc/vcl/fontmanager.hxx
+++ b/vcl/inc/vcl/fontmanager.hxx
@@ -330,8 +330,6 @@ class VCL_DLLPUBLIC PrintFontManager
rtl::OString getDirectory( int nAtom ) const;
int getDirectoryAtom( const rtl::OString& rDirectory, bool bCreate = false );
- void cleanTemporaryFonts();
-
/* try to initialize fonts from libfontconfig
called from <code>initialize()</code>
@@ -595,27 +593,6 @@ public:
bool Substitute( FontSelectPattern &rPattern, rtl::OUString& rMissingCodes );
int FreeTypeCharIndex( void *pFace, sal_uInt32 aChar );
-
- /**
- Returns an URL for a file where to store contents of a temporary font, or an empty string
- if this font is already known. The file will be cleaned up automatically as appropriate.
- Use activateTemporaryFont() to actually enable usage of the font.
-
- @param fontName name of the font (e.g. 'Times New Roman')
- @param fontStyle font style, "" for regular, "bi" for bold italic, etc.
- @since 3.7
- */
- OUString fileUrlForTemporaryFont( const OUString& fontName, const char* fontStyle );
-
- /**
- Adds the given font to the list of known fonts. The font is used only until application
- exit.
-
- @param fontName name of the font (e.g. 'Times New Roman')
- @param fileUrl URL of the font file
- @since 3.7
- */
- void activateTemporaryFont( const OUString& fontName, const OUString& fileUrl );
};
} // namespace
diff --git a/vcl/inc/vcl/temporaryfonts.hxx b/vcl/inc/vcl/temporaryfonts.hxx
new file mode 100644
index 000000000000..6333b92ca647
--- /dev/null
+++ b/vcl/inc/vcl/temporaryfonts.hxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef VCL_TEMPORARYFONTS_HXX
+#define VCL_TEMPORARYFONTS_HXX
+
+#include <vcl/dllapi.h>
+
+#include <rtl/ustring.hxx>
+
+/**
+ Management of temporary fonts (e.g. embedded in documents).
+
+ This class handles adding of temporary fonts.
+ @since LibreOffice 3.7
+*/
+class VCL_DLLPUBLIC TemporaryFonts
+{
+public:
+ /**
+ Returns an URL for a file where to store contents of a temporary font, or an empty string
+ if this font is already known. The file will be cleaned up automatically as appropriate.
+ Use activateTemporaryFont() to actually enable usage of the font.
+
+ @param fontName name of the font (e.g. 'Times New Roman')
+ @param fontStyle font style, "" for regular, "bi" for bold italic, etc.
+ */
+ static OUString fileUrlForFont( const OUString& fontName, const char* fontStyle );
+
+ /**
+ Adds the given font to the list of known fonts. The font is used only until application
+ exit.
+
+ @param fontName name of the font (e.g. 'Times New Roman')
+ @param fileUrl URL of the font file
+ */
+ static void activateFont( const OUString& fontName, const OUString& fileUrl );
+
+ /**
+ Removes all temporary fonts.
+ @internal
+ */
+ static void clear();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */