Files
libreoffice/include/svtools/stdmenu.hxx

154 lines
5.3 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patch contributed by: Jurgen Schmidt remove onlineregistration with dependencies http://svn.apache.org/viewvc?view=revision&revision=1240245 imported patch package_eventlistener.patch http://svn.apache.org/viewvc?view=revision&revision=1172103 Patch contributed by Pedro Giffuni Accept Google Chrome OS fonts as equivalent to MS fonts. http://svn.apache.org/viewvc?view=revision&revision=1233155 http://svn.apache.org/viewvc?view=revision&revision=1233408 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 Patches contributed by Mathias Bauer (and others) gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 cws mba34issues01: #i114600#: remove forbidden characters from list of unencoded characters http://svn.apache.org/viewvc?view=revision&revision=1172370 Patches contributed by Oliver Rainer-Wittman some clean up in JPEGReader due to memory constraints http://svn.apache.org/viewvc?view=revision&revision=1299729 119114 - method <UpdateDialog::addSpecificError(..)> - create entry with correct type http://svn.apache.org/viewvc?view=revision&revision=1305265 Patches contributed by Ariel Constenla-Haile i118707 - make toolbar control's popup window grab focus http://svn.apache.org/viewvc?view=revision&revision=1225846 Patches contributed by Herbert Duerr #i118662# remove usage of BerkeleyDB in desktop module http://svn.apache.org/viewvc?view=revision&revision=1213171 minor cleanups in dp_persmap.* http://svn.apache.org/viewvc?view=revision&revision=1215064 flush early to prevent problem with extension manager not cleaning up its objects http://svn.apache.org/viewvc?view=revision&revision=1228147 i118726 do not flush *pmap file while reading it http://svn.apache.org/viewvc?view=revision&revision=1230614 #i119048# migrate BDB extension entries using a simple heuristic http://svn.apache.org/viewvc?view=revision&revision=1300972 #i119048# handle edge cases when importing BDB hash files http://svn.apache.org/viewvc?view=revision&revision=1301428 #i119113# fix of-by-one when importing BDB files http://svn.apache.org/viewvc?view=revision&revision=1305420 restore our encryption settings, icon themes, and dictionaries. removed wrapper hacks, kill obsolete bundled extension blob / pre-registration handling, remove duplicated quickstart code. remove OS/2 conditionals.
2012-11-15 17:28:16 +00:00
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 16:07:07 +00:00
#ifndef INCLUDED_SVTOOLS_STDMENU_HXX
#define INCLUDED_SVTOOLS_STDMENU_HXX
2000-09-18 16:07:07 +00:00
#include <svtools/svtdllapi.h>
2000-09-18 16:07:07 +00:00
#include <tools/link.hxx>
#include <vcl/menu.hxx>
class FontList;
namespace vcl {
class FontInfo;
}
2000-09-18 16:07:07 +00:00
/*************************************************************************
Description
2000-09-18 16:07:07 +00:00
============
class FontNameMenu
Description
2000-09-18 16:07:07 +00:00
Allows the selection of fonts. The menu is filled with the FontNames by
the method Fill(). Fill() automatically sorts the FontNames (incl. all
umlauts and language-dependent). Using SetCurName()/GetCurName(), the
current FontName can be set/requested. If SetCurName() is called with
an empty string, no entry is displayed as the current one.
Before the Select call, the selected name is automatically set as the
current one and would be displayed as the current name on the next call.
Because of this, the current FontName should be set using SetCurName()
if necessary before calling PopupMenu::Execute().
2000-09-18 16:07:07 +00:00
As the Ids and the internal structure of the menu are not known, a
Select handler must be set in order to notice the selection of a name.
2000-09-18 16:07:07 +00:00
No further items can be inserted into that menu.
2000-09-18 16:07:07 +00:00
Later on, the menu shall display the same bitmaps as the FontNameBox.
On many systems, where menues don't scroll automatically, an A-Z menu
might be interposed. As a menu has always needed long when many Fonts
are installed, this menu should only be generated once.
2000-09-18 16:07:07 +00:00
References
2000-09-18 16:07:07 +00:00
2011-12-21 01:42:15 +01:00
FontList; FontSizeMenu; FontNameBox
2000-09-18 16:07:07 +00:00
--------------------------------------------------------------------------
class FontSizeMenu
Description
2000-09-18 16:07:07 +00:00
Allows the selection of font sizes. The FontSizeMenu is filled using
Fill(). The selected font size can be queried using GetCurHeight().
Using SetCurHeight()/GetCurHeight(), the current font size can be set/
requested. If SetCurHeight() is called with 0, no entry is displayed
as the current one.
Before the Select call, the selected size is automatically set as the
current one and would be displayed as the current size on the next call.
Because of this, the current font size should be set using SetCurHeight()
if necessary before calling PopupMenu::Execute(). As the font sizes
depend on the selected Font, the Menu should be re-filled with the
sizes of the font using Fill() after a change to the font name.
2000-09-18 16:07:07 +00:00
As the Ids and the internal structure of the menu are not known, a
Select handler must be set in order to notice the selection of a size.
2000-09-18 16:07:07 +00:00
All sizes are given in 1/10 points.
2000-09-18 16:07:07 +00:00
No further items can be inserted into that menu.
2000-09-18 16:07:07 +00:00
Later on, the menu shall display the sizes in respect to the system.
For example, Mac could possibly show an outline of the fonts that are
available as bitmaps.
2000-09-18 16:07:07 +00:00
References
2000-09-18 16:07:07 +00:00
2011-12-21 01:42:15 +01:00
FontList; FontNameMenu; FontSizeBox
2000-09-18 16:07:07 +00:00
*************************************************************************/
class SVT_DLLPUBLIC FontNameMenu : public PopupMenu
2000-09-18 16:07:07 +00:00
{
private:
OUString maCurName;
2000-09-18 16:07:07 +00:00
Link maSelectHdl;
Link maHighlightHdl;
public:
FontNameMenu();
virtual ~FontNameMenu();
virtual void Select() SAL_OVERRIDE;
virtual void Highlight() SAL_OVERRIDE;
2000-09-18 16:07:07 +00:00
void Fill( const FontList* pList );
void SetCurName( const OUString& rName );
const OUString& GetCurName() const { return maCurName; }
2000-09-18 16:07:07 +00:00
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
const Link& GetSelectHdl() const { return maSelectHdl; }
void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
const Link& GetHighlightHdl() const { return maHighlightHdl; }
};
class SVT_DLLPUBLIC FontSizeMenu : public PopupMenu
2000-09-18 16:07:07 +00:00
{
private:
long* mpHeightAry;
long mnCurHeight;
Link maSelectHdl;
Link maHighlightHdl;
public:
FontSizeMenu();
virtual ~FontSizeMenu();
2000-09-18 16:07:07 +00:00
virtual void Select() SAL_OVERRIDE;
virtual void Highlight() SAL_OVERRIDE;
2000-09-18 16:07:07 +00:00
void Fill( const vcl::FontInfo& rInfo, const FontList* pList );
2000-09-18 16:07:07 +00:00
void SetCurHeight( long nHeight );
long GetCurHeight() const { return mnCurHeight; }
void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
const Link& GetSelectHdl() const { return maSelectHdl; }
void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
const Link& GetHighlightHdl() const { return maHighlightHdl; }
};
#endif // INCLUDED_SVTOOLS_STDMENU_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */