зеркало из https://github.com/mozilla/pjs.git
changes to selection
This commit is contained in:
Родитель
8242e39f7f
Коммит
f4b7dee737
|
@ -30,11 +30,7 @@ class nsIDocumentContainer;
|
||||||
class nsIDocumentObserver;
|
class nsIDocumentObserver;
|
||||||
class nsIPresContext;
|
class nsIPresContext;
|
||||||
class nsIPresShell;
|
class nsIPresShell;
|
||||||
#if XP_NEW_SELECTION
|
|
||||||
class nsICollection;
|
class nsICollection;
|
||||||
#else
|
|
||||||
class nsISelection;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class nsIStreamListener;
|
class nsIStreamListener;
|
||||||
class nsIStreamObserver;
|
class nsIStreamObserver;
|
||||||
|
@ -207,11 +203,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Returns the Selection Object
|
* Returns the Selection Object
|
||||||
*/
|
*/
|
||||||
#if XP_NEW_SELECTION
|
|
||||||
NS_IMETHOD GetSelection(nsICollection ** aSelection) = 0;
|
NS_IMETHOD GetSelection(nsICollection ** aSelection) = 0;
|
||||||
#else
|
|
||||||
NS_IMETHOD GetSelection(nsISelection *& aSelection) = 0;
|
|
||||||
#endif
|
|
||||||
/**
|
/**
|
||||||
* Selects all the Content
|
* Selects all the Content
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -63,6 +63,8 @@ public:
|
||||||
|
|
||||||
virtual nsIStyleSet* GetStyleSet() = 0;
|
virtual nsIStyleSet* GetStyleSet() = 0;
|
||||||
|
|
||||||
|
virtual nsresult SetFocus(nsIFrame *aFrame) = 0;
|
||||||
|
|
||||||
NS_IMETHOD EnterReflowLock() = 0;
|
NS_IMETHOD EnterReflowLock() = 0;
|
||||||
|
|
||||||
NS_IMETHOD ExitReflowLock() = 0;
|
NS_IMETHOD ExitReflowLock() = 0;
|
||||||
|
|
|
@ -30,11 +30,7 @@ class nsIDocumentContainer;
|
||||||
class nsIDocumentObserver;
|
class nsIDocumentObserver;
|
||||||
class nsIPresContext;
|
class nsIPresContext;
|
||||||
class nsIPresShell;
|
class nsIPresShell;
|
||||||
#if XP_NEW_SELECTION
|
|
||||||
class nsICollection;
|
class nsICollection;
|
||||||
#else
|
|
||||||
class nsISelection;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class nsIStreamListener;
|
class nsIStreamListener;
|
||||||
class nsIStreamObserver;
|
class nsIStreamObserver;
|
||||||
|
@ -207,11 +203,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Returns the Selection Object
|
* Returns the Selection Object
|
||||||
*/
|
*/
|
||||||
#if XP_NEW_SELECTION
|
|
||||||
NS_IMETHOD GetSelection(nsICollection ** aSelection) = 0;
|
NS_IMETHOD GetSelection(nsICollection ** aSelection) = 0;
|
||||||
#else
|
|
||||||
NS_IMETHOD GetSelection(nsISelection *& aSelection) = 0;
|
|
||||||
#endif
|
|
||||||
/**
|
/**
|
||||||
* Selects all the Content
|
* Selects all the Content
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -63,6 +63,8 @@ public:
|
||||||
|
|
||||||
virtual nsIStyleSet* GetStyleSet() = 0;
|
virtual nsIStyleSet* GetStyleSet() = 0;
|
||||||
|
|
||||||
|
virtual nsresult SetFocus(nsIFrame *aFrame) = 0;
|
||||||
|
|
||||||
NS_IMETHOD EnterReflowLock() = 0;
|
NS_IMETHOD EnterReflowLock() = 0;
|
||||||
|
|
||||||
NS_IMETHOD ExitReflowLock() = 0;
|
NS_IMETHOD ExitReflowLock() = 0;
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
#ifndef nsISelection_h___
|
#ifndef nsISelection_h___
|
||||||
#define nsISelection_h___
|
#define nsISelection_h___
|
||||||
|
|
||||||
#include "nsSelectionRange.h"
|
|
||||||
#include "nslayout.h"
|
|
||||||
#include "nsISupports.h"
|
#include "nsISupports.h"
|
||||||
|
#include "nsIFrame.h"
|
||||||
|
|
||||||
|
|
||||||
// IID for the nsISelection interface
|
// IID for the nsISelection interface
|
||||||
#define NS_ISELECTION_IID \
|
#define NS_ISELECTION_IID \
|
||||||
|
@ -33,37 +33,14 @@
|
||||||
class nsISelection : public nsISupports {
|
class nsISelection : public nsISupports {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/** HandleKeyEvent will accept an event and frame and
|
||||||
* Returns whether there is a valid selection
|
* will return NS_OK if it handles the event or NS_COMFALSE if not.
|
||||||
*/
|
* <P>DOES NOT ADDREF<P>
|
||||||
virtual PRBool IsValidSelection() = 0;
|
* @param aGuiEvent is the event that should be dealt with by aFocusFrame
|
||||||
|
* @param aFrame is the frame that MAY handle the event
|
||||||
/**
|
*/
|
||||||
* Clears the current selection (invalidates the selection)
|
virtual nsresult HandleKeyEvent(nsGUIEvent *aGuiEvent, nsIFrame *aFrame) = 0;
|
||||||
*/
|
|
||||||
virtual void ClearSelection() = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copies the data from the param into the internal Range
|
|
||||||
*/
|
|
||||||
virtual void SetRange(nsSelectionRange * aRange) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copies the param's (aRange) contents with the Range's data
|
|
||||||
*/
|
|
||||||
virtual void GetRange(nsSelectionRange * aRange) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copies the param's (aRange) contents with the Range's data
|
|
||||||
*/
|
|
||||||
virtual nsSelectionRange * GetRange() = 0;
|
|
||||||
|
|
||||||
virtual char * ToString() = 0;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// XXX Belongs somewhere else
|
|
||||||
extern NS_LAYOUT nsresult
|
|
||||||
NS_NewSelection(nsISelection** aInstancePtrResult);
|
|
||||||
|
|
||||||
#endif /* nsISelection_h___ */
|
#endif /* nsISelection_h___ */
|
||||||
|
|
|
@ -227,10 +227,16 @@ nsresult nsLayoutFactory::CreateInstance(nsISupports *aOuter,
|
||||||
refCounted = PR_TRUE;
|
refCounted = PR_TRUE;
|
||||||
}
|
}
|
||||||
else if (mClassID.Equals(kCRangeListCID)) {
|
else if (mClassID.Equals(kCRangeListCID)) {
|
||||||
res = NS_NewRangeList((nsICollection **)&inst);
|
nsICollection *coll;
|
||||||
|
res = NS_NewRangeList((nsICollection **)&coll);
|
||||||
if (!NS_SUCCEEDED(res)) {
|
if (!NS_SUCCEEDED(res)) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
res = coll->QueryInterface(kISupportsIID, (void **)&inst);
|
||||||
|
if (!NS_SUCCEEDED(res)) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
NS_IF_RELEASE(coll);
|
||||||
refCounted = PR_TRUE;
|
refCounted = PR_TRUE;
|
||||||
}
|
}
|
||||||
else if (mClassID.Equals(kCRangeCID)) {
|
else if (mClassID.Equals(kCRangeCID)) {
|
||||||
|
@ -260,11 +266,6 @@ nsresult nsLayoutFactory::CreateInstance(nsISupports *aOuter,
|
||||||
return res;
|
return res;
|
||||||
refCounted = PR_TRUE;
|
refCounted = PR_TRUE;
|
||||||
}
|
}
|
||||||
else if (mClassID.Equals(kSelectionCID)) {
|
|
||||||
if (NS_FAILED(res = NS_NewSelection((nsISelection**) &inst)))
|
|
||||||
return res;
|
|
||||||
refCounted = PR_TRUE;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return NS_NOINTERFACE;
|
return NS_NOINTERFACE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче