📄 webcorebridge.h
字号:
// IMPORT_C TRect SelectionRect();
// IMPORT_C TRect VisibleSelectionRect();
//- (NSImage *)selectionImage;
//- (DOMNode *)selectionStart;
//- (int)selectionStartOffset;
//- (DOMNode *)selectionEnd;
//- (int)selectionEndOffset;
//void setSelectedDOMRange(DOMRange *)range affinity(NSSelectionAffinity)selectionAffinity;
//- (DOMRange *)selectedDOMRange;
//- (NSSelectionAffinity)selectionAffinity;
//- (NSAttributedString *)attributedStringFrom(DOMNode *)startNode startOffset(int)startOffset to(DOMNode *)endNode endOffset(int)endOffset;
//- (NSFont *)renderedFontForNode(DOMNode *)node;
//+ (NSString *)stringWithData(NSData *)data textEncoding(CFStringEncoding)textEncoding;
//+ (NSString *)stringWithData(NSData *)data textEncodingName(NSString *)textEncodingName;
//- (BOOL)interceptKeyEvent(NSEvent *)event toView(NSView *)view;
IMPORT_C void SetShouldCreateRenderers(TBool aCreateRenderers);
IMPORT_C TBool ShouldCreateRenderers();
IMPORT_C TInt NumPendingOrLoadingRequests();
IMPORT_C void SetDrawsBackground(TBool aDrawsBackround);
IMPORT_C TRgb BodyBackgroundColor();
IMPORT_C TRgb SelectionColor();
IMPORT_C void AdjustViewSize();
//Method to execute a script
IMPORT_C void ExecuteScript(const TDesC& aScriptText);
IMPORT_C static void UpdateAllViews();
//Method to set the scaling factor of the document
IMPORT_C void ScalingFactorChanged(TInt aFactor);
IMPORT_C TBool NavigableNodeUnderCursor(TPoint &aPoint, TWebCoreFocusedElementType &aElType, TRect& aFocusRect) const;
IMPORT_C TBool DetermineCursorPosition(TWebCoreFocusedElementType &aElType, TRect& aFocusRect,TRect& aSearchRect, TPoint &aCursorPosition, TBool aInitialize);
//- (id)accessibilityTree;
//void undoEditing(id)arg;
//void redoEditing(id)arg;
//- (DOMRange *)selectedDOMRangeWithGranularity(WebSelectionGranularity)granularity;
//- (DOMRange *)rangeByAlteringCurrentSelection(WebSelectionAlteration)alteration direction(WebSelectionDirection)direction granularity(WebSelectionGranularity)granularity;
//void alterCurrentSelection(WebSelectionAlteration)alteration direction(WebSelectionDirection)direction granularity(WebSelectionGranularity)granularity;
//- (DOMDocumentFragment *)documentFragmentWithMarkupString(NSString *)markupString baseURLString(NSString *)baseURLString;
//- (DOMDocumentFragment *)documentFragmentWithText(NSString *)text;
//void replaceSelectionWithFragment(DOMDocumentFragment *)fragment selectReplacement(BOOL)selectReplacement;
//void replaceSelectionWithNode(DOMNode *)node selectReplacement(BOOL)selectReplacement;
//void replaceSelectionWithMarkupString(NSString *)markupString baseURLString(NSString *)baseURLString selectReplacement(BOOL)selectReplacement;
//void replaceSelectionWithText(NSString *)text selectReplacement(BOOL)selectReplacement;
//void insertText(NSString *)text;
//void insertNewline;
//void setSelectionToDragCaret;
//void moveSelectionToDragCaret(DOMDocumentFragment *)selectionFragment;
//void moveDragCaretToPoint(NSPoint)point;
//void removeDragCaret;
//- (DOMRange *)dragCaretDOMRange;
//- (DOMRange *)editableDOMRangeForPoint(NSPoint)point;
//void deleteSelection;
//void deleteKeyPressed;
//void applyStyle(DOMCSSStyleDeclaration *)style;
//- (NSFont *)fontForCurrentPosition;
//void ensureCaretVisible;
//- (WebScriptObject *)windowScriptObject;
//- (NSDragOperation)dragOperationForDraggingInfo(id <NSDraggingInfo>)info;
//void dragExitedWithDraggingInfo(id <NSDraggingInfo>)info;
//- (BOOL)concludeDragForDraggingInfo(id <NSDraggingInfo>)info;
//void dragSourceMovedTo(NSPoint)windowLoc;
//void dragSourceEndedAt(NSPoint)windowLoc operation(NSDragOperation)operation;
//- (BOOL)tryDHTMLCut;
//- (BOOL)tryDHTMLCopy;
//- (BOOL)tryDHTMLPaste;
KWQKHTMLPart *Part() const;
IMPORT_C TBool HasPendingLayout() const;
//Method to resolve the URL when the base url and resource url are specified
IMPORT_C static HBufC* ResolveUrlL(const TDesC &aBaseUrl, const TDesC &aResUrl);
IMPORT_C void SetFastFirstDisplayMode(TBool aFastMode);
IMPORT_C TBool FastFirstDisplayMode() const;
IMPORT_C TBool ShowingFastPreview() const;
IMPORT_C void FindLinksOfType(const TDesC& aType, RArray<TWebCoreLinkItem>& aResult);
// set the maximum width used for formatting text
IMPORT_C void SetMaxBidiWidth(TInt aWidth);
// load and replace missing images for the document
IMPORT_C void LoadImages();
IMPORT_C static void SetDefersTimers(TBool aDefer);
IMPORT_C static TBool DefersTimers();
// clear all static data before application exits,
// this function can only be called once.
IMPORT_C static void PrepareForExit();
private:
/**
* C++ default constructor.
*/
CWebCoreBridge(MWebClientBridge& aClient);
/**
* By default Symbian 2nd phase constructor is private.
*/
void ConstructL();
protected: // Data
// KQK part object, owned by the bridge
KWQKHTMLPart *iPart;
// renderer pointer
KHTMLRenderPart *iRenderPart;
// memory pool for the bridge
RenderArena *iRenderPartArena;
// true if a rendering tree is to be build for this bridge
TBool iShouldCreateRenderers;
// pointer to the client side bridge interface
MWebClientBridge* iClientBridge;
};
// CLASS DECLARATION
//
/**
* The MWebCoreBridge interface contains methods for use by the WebCore side of the bridge.
*
* @lib WebCore
* @since ?Series60_version
*/
class MWebClientBridge
{
public:
virtual CArrayPtrFlat<CWebCoreBridge>* ChildFrames() = 0;
virtual CWebCoreBridge *MainFrame() = 0;
virtual CWebCoreBridge *FindFrameNamed(const TDesC& aName) = 0;
/* Creates a name for an frame unnamed in the HTML. It should produce repeatable results for loads of the same frameset. */
virtual HBufC* GenerateFrameName() = 0;
virtual void FrameDetached() = 0;
virtual MWebCoreScrollView& DocumentView() = 0;
virtual void LoadUrl(const TDesC& aURL, const TDesC& aRereferrer, TBool aReload, TBool aUserGesture, const TDesC& aTarget,
TEventCode aTriggeringEvent) = 0;
virtual void PostWithURL(const TDesC& aURL, const TDesC& aRereferrer, const TDesC& aTarget, const RArray<TWebCoreFormDataItem>& data,
const TDesC& aContentType, TEventCode aTriggeringEvent) = 0;
virtual CWebCoreBridge* CreateWindowWithUrl(const TDesC& aURL, const TDesC& aFrameName,
TBool aUserInitiated) = 0;
virtual void ShowWindow() = 0;
virtual TPtrC UserAgentForURL(const TDesC& aURL) = 0;
virtual void SetTitle(const TDesC& aTitle) = 0;
virtual void SetStatusText(const TDesC& aStatus) = 0;
virtual void SetIconURL(const TDesC& aURL) = 0;
virtual void SetIconURL(const TDesC& aURL, const TDesC& aWithType) = 0;
virtual CWebCoreBridge *CreateChildFrameNamed(const TDesC& aFrameName, const TDesC& aURL, const TDesC& aReferrer,
KHTMLRenderPart *aRenderPart,
TBool aAllowsScrolling, TInt aMarginWidth, TInt aMarginHeight) = 0;
virtual TBool AreToolbarsVisible() const = 0;
virtual void SetToolbarsVisible(TBool aVisible) = 0;
virtual TBool IsStatusBarVisible() const = 0;
virtual void SetStatusBarVisible(TBool aVisible) = 0;
virtual TBool AreScrollbarsVisible() const = 0;
virtual void SetScrollbarsVisible(TBool aVisible) = 0;
// virtual CCoeControl* Window() const = 0;
virtual void SetWindowFrame(TRect aFrame) = 0;
virtual TRect WindowFrame() const = 0;
virtual void SetWindowContentRect(TRect aFrame) = 0;
virtual TRect WindowContentRect() const = 0;
virtual void SetWindowIsResizable(TBool aResizable) = 0;
virtual TBool WindowIsResizable() const = 0;
//- (NSResponder *)firstResponder;
//void makeFirstResponder(NSResponder *)view;
virtual void CloseWindowSoon() = 0;
virtual void RunJavaScriptAlertPanelWithMessage(const TDesC& aMessage) = 0;
virtual TBool RunJavaScriptConfirmPanelWithMessage(const TDesC& aMessage, const TDesC& aYes,const TDesC& aNo) = 0;
virtual TBool RunJavaScriptTextInputPanelWithPrompt(const TDesC& aPrompt, const TDesC& aDefaultText, HBufC** returningText) = 0;
//void addMessageToConsole(NSDictionary *)message;
virtual MWebCoreResourceHandle* StartLoadingResource(MWebCoreResourceLoader& aLoader, const TDesC& aURL, CArrayFix<TWebCoreKeyValuePair>* aCustomHeaders) = 0;
virtual MWebCoreResourceHandle* StartLoadingResource(MWebCoreResourceLoader& aLoader, const TDesC& aURL, CArrayFix<TWebCoreKeyValuePair>* aCustomHeaders, const RArray<TWebCoreFormDataItem>& aData) = 0;
virtual void ObjectLoadedFromCacheWithURL( const TDesC& aURL, MWebCoreUrlResponseHeaderInfo* aResponse, const TDesC8& aAllData ) = 0;
//- (NSData *)syncLoadResourceWithURL(NSURL *)URL customHeaders(NSDictionary *)requestHeaders postData(NSData *)postData finalURL(NSURL **)finalNSURL responseHeaders(NSDictionary **)responseHeaderDict statusCode(int *)statusCode;
virtual TBool IsReloading() const = 0;
virtual TDateTime ExpiresTimeForResponse( MWebCoreUrlResponseHeaderInfo* aResponse ) = 0;
virtual void ReportClientRedirectToURL(const TDesC& aURL, TInt aDelaySeconds, TDateTime aFireDate, TBool lockHistory, TBool aIsJavaScriptFormAction) = 0;
virtual void ReportClientRedirectCancelled(TBool aCancelWithLoadInProgress) = 0;
virtual void FocusWindow() = 0;
virtual void UnfocusWindow() = 0;
//- (NSView *)nextKeyViewOutsideWebFrameViews;
//- (NSView *)previousKeyViewOutsideWebFrameViews;
virtual TBool DefersLoading() = 0;
virtual void SetDefersLoading(TBool aLoading) = 0;
virtual void SaveDocumentState(const TArray<TPtrC>& aDocumentState) = 0;
virtual TArray<TPtrC>* DocumentState() const = 0;
virtual void Reload() = 0;
virtual void SetNeedsReapplyStyles() = 0;
// This URL is only used for coloring visited links.
virtual TPtrC RequestedURLString() const = 0;
virtual TPtrC IncomingReferrer() const = 0;
virtual MWebCoreObjectWidget* ViewForPluginWithURL( const TDesC& aUrl,
const CArrayFix<TPtrC>& aAttributeNames,
const CArrayFix<TPtrC>& aAttributeValues,
const TDesC& aBaseUrl,
const TDesC& aMIMEType ) = 0;
//- (NSView *)viewForJavaAppletWithFrame(NSRect)frame
// attributeNames:(NSArray *)attributeNames
// attributeValues:(NSArray *)attributeValues
// baseURL:(NSURL *)baseURL;
//- (BOOL)saveDocumentToPageCache(id)documentInfo;
virtual TInt GetObjectCacheSize() = 0;
virtual TBool FrameRequiredForMIMEType(const TDesC& aMIMEType, const TDesC& aURL) = 0;
virtual void LoadEmptyDocumentSynchronously() = 0;
virtual HBufC* MimeTypeForFileName(const TDesC& aPath) = 0;
//void allowDHTMLDrag(BOOL *)flagDHTML UADrag(BOOL *)flagUA;
//- (BOOL)startDraggingImage(NSImage *)dragImage at(NSPoint)dragLoc operation(NSDragOperation)op event(NSEvent *)event sourceIsDHTML(BOOL)flag DHTMLWroteData(BOOL)dhtmlWroteData;
//void handleAutoscrollForMouseDragged(NSEvent *)event;
//- (BOOL)mayStartDragWithMouseDragged(NSEvent *)event;
virtual TInt HistoryLength() = 0;
virtual void GoBackOrForward(TInt aDistance) = 0;
virtual TBool CanGoBackOrForward(TInt aDistance) = 0;
//void controlTextDidBeginEditing(NSNotification *)obj;
//void controlTextDidEndEditing(NSNotification *)obj;
//void controlTextDidChange(NSNotification *)obj;
//- (BOOL)control(NSControl *)control textShouldBeginEditing(NSText *)fieldEditor;
//- (BOOL)control(NSControl *)control textShouldEndEditing(NSText *)fieldEditor;
//- (BOOL)control(NSControl *)control didFailToFormatString(NSString *)string errorDescription(NSString *)error;
//void control(NSControl *)control didFailToValidatePartialString(NSString *)string errorDescription(NSString *)error;
//- (BOOL)control(NSControl *)control isValidObject(id)obj;
//- (BOOL)control(NSControl *)control textView(NSTextView *)textView doCommandBySelector(SEL)commandSelector;
//- (NSView <WebCoreFileButton> *)fileButtonWithDelegate(id <WebCoreFileButtonDelegate>)delegate;
virtual void SetHasBorder(TBool aHasBorder) = 0;
// virtual TWebCoreKeyboardUIMode KeyboardUIMode() = 0;
virtual void DidSetName(const TDesC& aName) = 0;
//- (NSFileWrapper *)fileWrapperForURL(NSURL *)URL;
virtual void Print() = 0;
//- (jobject)pollForAppletInView(NSView *)view;
//- (NSUndoManager *)undoManager;
//void issueCutCommand;
//void issueCopyCommand;
//void issuePasteCommand;
//void respondToChangedSelection;
//void respondToChangedContents;
//- (BOOL)interceptEditingKeyEvent(NSEvent *)event;
//void setIsSelected(BOOL)isSelected forView(NSView *)view;
//- (BOOL)isEditable;
//- (BOOL)shouldBeginEditing(DOMRange *)range;
//- (BOOL)shouldEndEditing(DOMRange *)range;
virtual TPtrC OverrideMediaType() const = 0;
virtual void WindowObjectCleared() = 0;
// called when document layout changes (from KHTMLView::layout())
virtual void LayoutChanged() = 0;
// called when a new document is created ( CreatDocumentWithEncoding() )
virtual void DocumentStarted() = 0;
// called when parsing the document is finished (from KHTMLPart::slotFinishedParsing() )
virtual void DocumentComplete() = 0;
// called when cursor position changes. aCursorArea is the cotaining rect of the link box
virtual void SetCursorPosition(const TPoint& aCursorPos, TWebCoreFocusedElementType aElementType) = 0;
virtual TBool IsObjectAvailableInDiskCache(const TDesC& aUrl) = 0;
virtual TBool CancelInProgress() = 0;
};
#endif // WEBCOREBRIDGE_H
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -