From 507524b97ef3bedb42f6c15ec93eedff8ee4b150 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)> Date: Wed, 26 Nov 2003 02:12:18 +0000 Subject: New repository initialized by cvs2svn. --- src/rtfformatting.h | 190 ---------------------------------------------------- 1 file changed, 190 deletions(-) delete mode 100644 src/rtfformatting.h (limited to 'src/rtfformatting.h') diff --git a/src/rtfformatting.h b/src/rtfformatting.h deleted file mode 100644 index aa5ac58..0000000 --- a/src/rtfformatting.h +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2004, Nate Nielsen - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * * Redistributions of source code must retain the above - * copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the - * above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * * The names of contributors to this software may not be - * used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH - * DAMAGE. - * - * - * CONTRIBUTORS - * Nate Nielsen - * - */ - -#ifndef __RTFFORMATTING_H__ -#define __RTFFORMATTING_H__ - -/* - * RtfFormatting - * - * For keeping track of all the various transient formatting options - * within a given Rtf group. Any supported text options (not block) - * should be added here. - */ -class RtfFormatting -{ -public: - RtfFormatting() - { - resetText(); - resetPara(); - } - - RtfFormatting(const RtfFormatting& format) - { - copy(format); - } - - bool textEquals(const RtfFormatting& format) const - { - return m_bold == format.m_bold && - m_italic == format.m_italic && - m_strike == format.m_italic && - m_hidden == format.m_hidden && - m_underline == format.m_underline && - m_color == format.m_color && - m_suscript == format.m_suscript && - m_font == format.m_font && - m_fsize == format.m_fsize; - } - - bool paraEquals(RtfFormatting& format) const - { - return m_style == format.m_style && - m_list == format.m_list && - m_inTbl == format.m_inTbl; - } - - void copy(const RtfFormatting& format) - { - m_bold = format.m_bold; - m_italic = format.m_italic; - m_strike = format.m_italic; - m_hidden = format.m_hidden; - m_underline = format.m_underline; - m_color = format.m_color; - m_suscript = format.m_suscript; - m_font = format.m_font; - m_fsize = format.m_fsize; - - m_style = format.m_style; - m_list = format.m_list; - m_inTbl = format.m_inTbl; - } - - void resetText() - { - m_bold = m_italic = m_strike = - m_underline = m_hidden = false; - m_color = -1; - m_suscript = 0; - m_fsize = -1; - m_font = -1; - } - - void resetPara() - { - m_style = m_list = -1; - m_inTbl = false; - } - - bool textIsBold() const - { return m_bold; } - bool textIsItalic() const - { return m_italic; } - bool textIsStrike() const - { return m_strike; } - bool textIsUnderline() const - { return m_underline; } - bool textIsHidden() const - { return m_hidden; } - int textColor() const - { return m_color; } - int textSuScript() const - { return m_suscript; } - int textFont() const - { return m_font; } - int textFontSize() const - { return m_fsize; } - int paraStyle() const - { return m_style; } - int paraList() const - { return m_list; } - bool paraInTable() const - { return m_inTbl; } - - void textSetBold(bool bold) - { m_bold = bold; } - void textSetItalic(bool italic) - { m_italic = italic; } - void textSetStrike(bool strike) - { m_strike = strike; } - void textSetUnderline(bool underline) - { m_underline = underline; } - void textSetHidden(bool hidden) - { m_hidden = hidden; } - void textSetColor(int color) - { m_color = color; } - void textSetSuScript(int suscript) - { m_suscript = suscript; } - void textSetFont(int font) - { m_font = font; } - void textSetFontSize(int fsize) - { m_fsize = fsize == 24 ? -1 : fsize; } // default font size is always 24 - void paraSetStyle(int style) - { m_style = style; } - void paraSetList(int list) - { m_list = list; } - void paraSetTable(bool inTable) - { m_inTbl = inTable; } - - enum - { - SUPERSCRIPT = 1, - SUBSCRIPT - }; - -protected: - bool m_bold; - bool m_italic; - bool m_strike; - bool m_underline; - bool m_hidden; - int m_suscript; - int m_color; - int m_font; - int m_fsize; - - int m_style; - int m_list; - bool m_inTbl; - - // TODO: Character styles -}; - -#endif // __RTFFORMATTING_H__ -- cgit v1.2.3