summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vogelheim <dvo@openoffice.org>2002-02-19 13:34:55 +0000
committerDaniel Vogelheim <dvo@openoffice.org>2002-02-19 13:34:55 +0000
commit6d8a0f600c88414acb9fa24585918ca6837fb3df (patch)
tree14718e139efa97db6a6ea1854cacd2c6e04bc33e
parent7758069d0c43abf5d51a846cc1c889a55f2d43d3 (diff)
#95586# new SwPortionHandler to allow the accessibility implementation access
to the layout's portion structure
-rw-r--r--sw/source/core/inc/SwPortionHandler.hxx122
1 files changed, 122 insertions, 0 deletions
diff --git a/sw/source/core/inc/SwPortionHandler.hxx b/sw/source/core/inc/SwPortionHandler.hxx
new file mode 100644
index 000000000000..bd7b7549ac77
--- /dev/null
+++ b/sw/source/core/inc/SwPortionHandler.hxx
@@ -0,0 +1,122 @@
+/*************************************************************************
+ *
+ * $RCSfile: SwPortionHandler.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: dvo $ $Date: 2002-02-19 14:34:55 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (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.openoffice.org/license.html.
+*
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _________________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SW_PORTIONHANDLER_HXX
+#define _SW_PORTIONHANDLER_HXX
+
+#include <tools/solar.h>
+class String;
+
+/** The SwPortionHandler interface implements a visitor for the layout
+ * engine's text portions. This can be used to gather information of
+ * the on-screen representation of a single paragraph.
+ *
+ * For each text portion, one of the methods text(...) or special(...)
+ * is called, depending on whether it is a 'normal' run of text, or
+ * any other portion. Additionally, the linebreak() method is called
+ * once at the end of every on-screen line.
+ *
+ * All parameters relate to the 'model string', which is the text string
+ * held by the corresponding SwTxtNode.
+ *
+ * The SwPortionHandler can be used with the
+ * SwTextFrame::VisitPortions(...) method.
+ */
+class SwPortionHandler
+{
+public:
+
+ SwPortionHandler() {} /// (emtpy) constructor
+
+ virtual ~SwPortionHandler() {} /// (empty) destructor
+
+ /** text portion. A run of nLength characters from the model
+ * string, that contains no special characters like embedded
+ * fields, etc. Thus, the on-screen text of this portion
+ * corresponds exactly to the corresponding characters in the
+ * model string.
+ */
+ virtual void Text(
+ USHORT nLength /// length of this portion in the model string
+ ) = 0;
+
+ /** special portion. This method is called for every non-text
+ * portion. The parameters describe the length of the
+ * corresponding characters in the model string (often 0 or 1),
+ * the text which is displayed, and the type of the portion.
+ */
+ virtual void Special(
+ USHORT nLength, /// length of this portion in the model string
+ const String& rText, /// text which is painted on-screen
+ USHORT nType /// type of this portion
+ ) = 0;
+
+ /** line break. This method is called whenever a line break in the
+ * layout occurs.
+ */
+ virtual void LineBreak() = 0;
+
+ /** end of paragraph. This method is to be called when all the
+ * paragraph's portions have been processed.
+ */
+ virtual void Finish() = 0;
+};
+
+#endif