📄 html.h
字号:
*/ QString reference; /* * overrides the document charset as specified by <meta> if set. */ QString overrideCharset; /* * This painter is created at need, for example to draw * a selection or for font metrics stuff. */ QPainter *painter; /* * This is the pointer to the tree of HTMLObjects. */ HTMLClueV *clue; /* * This is the scroll offset. The upper left corner is (0,0). */ int x_offset, y_offset; /* * The amount to auto scroll by. */ int autoScrollDY; /* * The delay to wait before auto scrolling autoScrollDY */ int autoScrollYDelay; /* * Timer for autoscroll stuff */ QTimer autoScrollYTimer; /* * Timer used to schedule paint events */ QTimer updateTimer; /* * This object contains the complete text. This text is referenced * by HTMLText objects for example. So you may not delete * 'ht' until you have delete the complete tree 'clue' is * pointing to. */ HTMLTokenizer *ht; QArray<char *> memPool; int memPoolMax; /* * This is used generally for processing the contents of < ... > * We keep a class global instance of this object to reduce the * number of new/deletes performed. If your function may be * called recursively, or somehow from a function using this * tokenizer, you should construct your own. */ StringTokenizer *stringTok; /* * Selects a new font adding _relative_font_size to fontBase * to get the new size. */ void selectFont( int _relative_font_size ); /* * Selects a new font using current settings */ void selectFont(); /* * Makes the font specified by parameters the actual font */ void selectFont( const char *_fontfamily, int _size, int _weight, bool _italic ); /* * Pops the top font form the stack and makes the new * top font the actual one. If the stack is empty ( should never * happen! ) the default font is pushed on the stack. */ void popFont(); const HTMLFont *currentFont() { return font_stack.top(); } void popColor(); // List of all objects waiting to get a remote file loaded // XXXX QList<HTMLObject> waitingFileList; /* * The font stack. The font on top of the stack is the currently * used font. Poping a font from the stack deletes the font. * So use top() to get the actual font. There must always be at least * one font on the stack. */ QStack<HTMLFont> font_stack; /* * The weight currently selected. This is affected by <b>..</b> * for example. */ int weight; /* * The fonts italic flag. This is affected by <i>..</i> * for example. */ bool italic; /* * The fonts underline flag. This is affected by <u>..</u> * for example. */ bool underline; /* * The fonts underline flag. This is affected by <u>..</u> * for example. */ bool strikeOut; /* * Used for drag and drop. */ bool pressed; int press_x, press_y; /* * When the user presses the mouse over an URL, this URL is stored * here. We might need it if the user just started a drag. */ QString pressedURL; /** * If the user pressed the mouse button over an URL then this is the name * of the target window for this hyper link. Used to implement frames. * * @see #pressedURL */ QString pressedTarget;#ifdef EXEC_EXTENSIONS QString pressedExec;#endif /* * If the user drags a URL out of the widget, by default this pixmap * is used for the dragged icon. The pixmap is loaded in the constructor. */ QPixmap dndDefaultPixmap; /* * Start of selection */ QPoint selectPt1; /* * End of selection */ QPoint selectPt2; /* * is any text currently selected */ bool bIsTextSelected; /* * This is the URL which is visible on the screen. This URL * is needed to complete URLs like <a href="classes.html"> since * for example 'URLSelected' should provide a complete URL. */ KURL actualURL; KURL baseURL; // this will do for now - MRJ // actually we need something like this to implement // <base ...> /* * This sets the baseURL given a URL. It strips of any filename. */ void setBaseURL( const char *_url); /* * from <BASE TARGET="..."> */ QString baseTarget; /* * Current text color is at the top of the stack */ QStack<QColor> colorStack; /* * A color context for the current page so that we can free the colors * when we close the page. */ int colorContext; class HTMLStackElem; typedef void (KHTMLWidget::*blockFunc)(HTMLClueV *_clue, HTMLStackElem *stackElem); class HTMLStackElem { public: HTMLStackElem( int _id, int _level, blockFunc _exitFunc, int _miscData1, int _miscData2, HTMLStackElem * _next ) : id(_id), level(_level), exitFunc(_exitFunc), miscData1(_miscData1), miscData2(_miscData2), next(_next) { } int id; int level; blockFunc exitFunc; int miscData1; int miscData2; HTMLStackElem *next; }; HTMLStackElem *blockStack; void pushBlock( int _id, int _level, blockFunc _exitFunc = 0, int _miscData1 = 0, int _miscData2 = 0); void popBlock( int _id, HTMLClueV *_clue); void freeBlock( void); /* * Code for closing-tag to restore font * miscData1: bool - if true terminate current flow */ void blockEndFont(HTMLClueV *_clue, HTMLStackElem *stackElem); /* * Code for closing-tag to end PRE tag */ void blockEndPre(HTMLClueV *_clue, HTMLStackElem *stackElem); /* * Code for closing-tag to restore font and font-color */ void blockEndColorFont(HTMLClueV *_clue, HTMLStackElem *stackElem); /* * Code for closing-tag to restore indentation * miscData1: int - previous indentation */ void blockEndIndent(HTMLClueV *_clue, HTMLStackElem *stackElem); /* * Code for remove item from listStack and restore indentation * miscData1: int - previous indentation * miscData2: bool - if true insert vspace */ void blockEndList(HTMLClueV *_clue, HTMLStackElem *stackElem); /* code to restore old alignment after <div></div> */ void blockEndDiv( HTMLClueV *_clue, HTMLStackElem *Elem); /* * Timer to parse html in background */ int timerId; /* * begin() has been called, but not end() */ bool writing; /* * Is the widget currently parsing */ bool parsing; /* * Have we parsed <body> yet? */ bool bodyParsed; /* * size of current indenting */ int indent; class HTMLList { public: HTMLList( ListType t, ListNumType nt = Numeric ) { type = t; numType = nt; itemNumber = 1; } ListType type; ListNumType numType; int itemNumber; }; /* * Stack of lists currently active. * The top affects whether a bullet or numbering is used by <li> */ QStack<HTMLList> listStack; enum GlossaryEntry { GlossaryDL, GlossaryDD }; /* * Stack of glossary entries currently active */ QStack<GlossaryEntry> glossaryStack; /* * The current alignment, set by <DIV > or <CENTER> */ HTMLClue::HAlign divAlign; /* * Number of tokens parsed in the current time-slice */ int parseCount; int granularity; /* * Used to avoid inserting multiple vspaces */ bool vspace_inserted; /* * The current flow box to add objects to */ HTMLClue *flow; /* * Array of paser functions, e.g. * <img ... is processed by KHTMLWidget::parseI() - parseFuncArray[8]() * </ul> is processed by KHTMLWidget::parseU() - parseFuncArray[20]() */ static parseFunc parseFuncArray[26]; /* * This list holds strings which are displayed in the view, * but are not actually contained in the HTML source. * e.g. The numbers in an ordered list. */ QStrList tempStrings; /* * This list holds all <a href= urls in the document. */ QStrList parsedURLs; QStrList parsedTargets;#ifdef EXEC_EXTENSIONS QStrList parsedExecs;#endif QPixmap bgPixmap; /* * This is the cusor to use when over a link */ QCursor linkCursor; /* * Current fontbase, colors, etc. */ HTMLSettings *settings; /* * Default settings. */ HTMLSettings *defaultSettings; // should the background be painted? bool bDrawBackground; /* * The URL of the not loaded!! background image * If we are waiting for a background image then this is its URL. * If the image is already loaded or if we don't have one this variable * contains 0. You can write bgPixmapURL.isNull() to test wether we are * waiting for a background pixmap. */ QString bgPixmapURL; // true if the current text is destined for <title> bool inTitle; // List of forms in the page QList<HTMLForm> formList; // Current form HTMLForm *form; // Current select form element HTMLSelect *formSelect; // true if the current text is destined for a <SELECT><OPTION> bool inOption; // Current textarea form element HTMLTextArea *formTextArea; // true if the current text is destined for a <TEXTAREA>...</TEXTAREA> bool inTextArea; // true if the current text is destined for a <PRE>...</PRE> bool inPre; // the text to be put in a form element QString formText; /* * Image maps used in this document */ QList<HTMLMap> mapList; /* * The toplevel frame set if we have frames otherwise 0L. */ HTMLFrameSet *frameSet; /* * Stack of framesets used during parsing. */ QList<HTMLFrameSet> framesetStack; /* * List of all framesets we are currently showing. * This list is not cleared after parsing like @ref #framesetStack. */ QList<HTMLFrameSet> framesetList; /* * List of all frames appearing in this window. They are stored in * source order. JavaScript uses this list to implement its * frames array. */ QList<KHTMLWidget> frameList; /* * @return TRUE if the current document is a framed document. */ bool bIsFrameSet; /* * @return TRUE if the widget is a frame of a frameset. */ bool bIsFrame; /* * Is TRUE if we parsed the complete frame set. */ bool bFramesComplete; /* * is true if were between <noframes> and </noframes> */ bool bInNoframes; /* * If the owner of this widget is a @ref HTMLView then this is a * pointert to the owner, otherwise 0L. */ KHTMLView *htmlView; /* * This is a pointer to the selectede frame. This means that the frame * gets a black inner border. */ KHTMLView *selectedFrame; /* * Flag that indicates wether the user selected this widget. This is only of * interest if the widget is a frame in a frameset. Try Netscape to see * what I mean. * * @see #selectedFrame */ bool bIsSelected; /* * Holds the amount of pixel for the left border. This variable is used * to implement the * <tt><frame marginwidth=... ></tt> tag. * * @see #rightBorder * @see #setMarginWidth */ int leftBorder; /* * Holds the amount of pixel for the right border. This variable is used * to implement the * <tt><frame marginwidth=... ></tt> tag. * * @see #leftBorder * @see #setMarginWidth */ int rightBorder; /* * Holds the amount of pixel for the top border. This variable is used * to implement the * <tt><frame marginheight=... ></tt> tag. * * @see #bottomBorder * @see #setMarginHeight */ int topBorder; /* * Holds the amount of pixel for the bottom border. This variable is used * to implement the * <tt><frame marginheight=... ></tt> tag. * * @see #setMarginHeight * @see #topBorder */ int bottomBorder; /* * This pointer is per default 0L. An instance of @ref JSEnvironment is * created if someone calls @ref #getJSEnvironment. This instance is used * to run java script. */ JSEnvironment *jsEnvironment; KCharsetConverter *charsetConverter; /* * Iterator used to find text within the document */ HTMLIterator *textFindIter; /** * Keeps a list of all pending file. */ QDict<HTMLPendingFile> mapPendingFiles; QPixmap scrollBlobPixmap; QWidget *scrollBlob; QTimer *scrollBlobTimer; enum ScrollType scrollBlobType;};#endif // HTML
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -