From e9ae80694875f869892f13f4fcaf1170a00dea41 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- quanta/components/csseditor/shorthandformer.h | 117 ++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 quanta/components/csseditor/shorthandformer.h (limited to 'quanta/components/csseditor/shorthandformer.h') diff --git a/quanta/components/csseditor/shorthandformer.h b/quanta/components/csseditor/shorthandformer.h new file mode 100644 index 00000000..f5b0f291 --- /dev/null +++ b/quanta/components/csseditor/shorthandformer.h @@ -0,0 +1,117 @@ +/*************************************************************************** + * Copyright (C) 2003 by Gulmini Luciano * + * gulmini.luciano@student.unife.it * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * + ***************************************************************************/ +#ifndef SHORTHANDFORMER_H +#define SHORTHANDFORMER_H + +/** +@author Gulmini Luciano +*/ +#include +class QString; +class QStringList; + +class ShorthandFormer{ +public: + ShorthandFormer(){} + ShorthandFormer( QMap m ); + ~ShorthandFormer(){} + QString compress(); + QMap expand(const QString& propertyName, const QString& propertyValue); + static QStringList SHFormList(); + +private: + QMap m_properties; + QString cue_after, + cue_before, + pause_before, + pause_after, + background_color, + background_image, + background_repeat, + background_attachment, + background_position, + border_top_style, + border_top_color, + border_top_width, + border_left_style, + border_left_color, + border_left_width, + border_right_style, + border_right_color, + border_right_width, + border_bottom_style, + border_bottom_color, + border_bottom_width, + outline_style, + outline_color, + outline_width, + list_style_type, + list_style_image, + list_style_position, + font_style, + font_variant, + font_weight, + font_size, + line_height, + font_family, + margin_top, + margin_bottom, + margin_left, + margin_right, + padding_top, + padding_bottom, + padding_left, + padding_right; + +private: + QString compressCueProp(); + QString compressPauseProp(); + QString compressPaddingProp(); + QString compressMarginProp(); + QString compressFontProp(); + QString compressBackgroundProp(); + QString compressOutlineProp(); + QString compressListStyleProp(); + QString compressBorderStyleProp(); + QString compressBorderWidthProp(); + QString compressBorderColorProp(); + QString compressBorderProp(); + + QString compressImplementation( const QString& prop, const QString& t, const QString& b, const QString& r, const QString& l, const QString& defValue); + QString compressImplementation2( const QString& prop, const QString& after, const QString& before, const QString& defValue); + QString compressImplementation3( const QString& prop, const QString& p1, const QString& p2, const QString& p3); + + QMap expandCueProp(const QStringList& l); + QMap expandPauseProp(const QStringList& l); + QMap expandBackgroundProp(const QStringList& l); + QMap expandFontProp(const QStringList& l); + QMap expandOutlineProp(const QStringList& l); + QMap expandListstyleProp(const QStringList& l); + QMap expandBoxSide(const QString& subPropName, const QStringList& l); + QMap expandBorderProp(const QStringList& l); + QMap expandBox(const QString& subPropName, const QStringList& l); + QMap expandPaddingProp(const QStringList& l); + QMap expandMarginProp(const QStringList& l); + + QMap expandImplementation(const QString& propertyName, const QStringList& l); + QMap expandImplementation2(const QString& propertyName, const QStringList& l); + }; + +#endif -- cgit v1.2.1