lyx_mirror/src/frontends/Selection.h
Abdelrazak Younes 28ad960255 This commit cleans up everything related to singleton. The other important change is that lyx::dispatch() and lyx::getStatus become _the_ official way to use LyXFunc equivalent methods.
* lyxfunc.h:
  - theLyXFunc(): new function in the global namespace.
  - lyx::dispatch():  new function in the lyx namespace.
  - lyx::getStatus():  new function in the lyx namespace.

* bufferlist.h:
  - theBufferList(): new function in the global namespace.

* Clipboard.h:
  - theClipboard(): new function in the global namespace.

* Selection.h:
  - theSelection(): new function in the global namespace.

* FontLoader.h:
  - theFontLoader(): new function in the global namespace.

* FontMetrics.h:
  - theFontMetrics(LyXFont const &): new function in the global namespace.

* Application.C: implements the functions defined above.

* LyXView.h:
  - getLyXFunc(): deleted.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15298 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-11 17:24:46 +00:00

54 lines
1.2 KiB
C++

// -*- C++ -*-
/**
* \file Selection.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author unknown
* \author John Levon
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef BASE_SELECTION_H
#define BASE_SELECTION_H
#include "support/docstring.h"
namespace lyx {
namespace frontend {
/**
* A Selection class manages the selection.
*/
class Selection
{
public:
virtual ~Selection() {}
/// Tell the window system whether we have a selection.
virtual void haveSelection(bool) = 0;
/**
* Get the X selection contents.
* This is a noop on systems that don't have a selection.
* The format is plain text.
* This should be called when the user presses the middle mouse
* button.
*/
virtual docstring const get() const = 0;
/**
* Fill the X selection.
* Does nothing on systems that don't have a selection.
* This should be called whenever some text is highlighted.
*/
virtual void put(docstring const &) = 0;
};
} // namespace frontend
} // namespace lyx
extern lyx::frontend::Selection & theSelection();
#endif // BASE_SELECTION_H