nsIWebBrowserFocus.h 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/embedding/browser/webBrowser/nsIWebBrowserFocus.idl
  3. */
  4. #ifndef __gen_nsIWebBrowserFocus_h__
  5. #define __gen_nsIWebBrowserFocus_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIDOMWindow; /* forward declaration */
  14. class nsIDOMElement; /* forward declaration */
  15. /* starting interface: nsIWebBrowserFocus */
  16. #define NS_IWEBBROWSERFOCUS_IID_STR "9c5d3c58-1dd1-11b2-a1c9-f3699284657a"
  17. #define NS_IWEBBROWSERFOCUS_IID \
  18. {0x9c5d3c58, 0x1dd1, 0x11b2, \
  19. { 0xa1, 0xc9, 0xf3, 0x69, 0x92, 0x84, 0x65, 0x7a }}
  20. /**
  21. * nsIWebBrowserFocus
  22. * Interface that embedders use for controlling and interacting
  23. * with the browser focus management. The embedded browser can be focused by
  24. * clicking in it or tabbing into it. If the browser is currently focused and
  25. * the embedding application's top level window is disabled, deactivate() must
  26. * be called, and activate() called again when the top level window is
  27. * reactivated for the browser's focus memory to work correctly.
  28. *
  29. * @status FROZEN
  30. */
  31. class NS_NO_VTABLE nsIWebBrowserFocus : public nsISupports {
  32. public:
  33. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBBROWSERFOCUS_IID)
  34. /**
  35. * MANDATORY
  36. * activate() is a mandatory call that must be made to the browser
  37. * when the embedding application's window is activated *and* the
  38. * browser area was the last thing in focus. This method can also be called
  39. * if the embedding application wishes to give the browser area focus,
  40. * without affecting the currently focused element within the browser.
  41. *
  42. * @note
  43. * If you fail to make this call, mozilla focus memory will not work
  44. * correctly.
  45. */
  46. /* void activate (); */
  47. NS_IMETHOD Activate(void) = 0;
  48. /**
  49. * MANDATORY
  50. * deactivate() is a mandatory call that must be made to the browser
  51. * when the embedding application's window is deactivated *and* the
  52. * browser area was the last thing in focus. On non-windows platforms,
  53. * deactivate() should also be called when focus moves from the browser
  54. * to the embedding chrome.
  55. *
  56. * @note
  57. * If you fail to make this call, mozilla focus memory will not work
  58. * correctly.
  59. */
  60. /* void deactivate (); */
  61. NS_IMETHOD Deactivate(void) = 0;
  62. /**
  63. * Give the first element focus within mozilla
  64. * (i.e. TAB was pressed and focus should enter mozilla)
  65. */
  66. /* void setFocusAtFirstElement (); */
  67. NS_IMETHOD SetFocusAtFirstElement(void) = 0;
  68. /**
  69. * Give the last element focus within mozilla
  70. * (i.e. SHIFT-TAB was pressed and focus should enter mozilla)
  71. */
  72. /* void setFocusAtLastElement (); */
  73. NS_IMETHOD SetFocusAtLastElement(void) = 0;
  74. /**
  75. * The currently focused nsDOMWindow when the browser is active,
  76. * or the last focused nsDOMWindow when the browser is inactive.
  77. */
  78. /* attribute nsIDOMWindow focusedWindow; */
  79. NS_IMETHOD GetFocusedWindow(nsIDOMWindow * *aFocusedWindow) = 0;
  80. NS_IMETHOD SetFocusedWindow(nsIDOMWindow * aFocusedWindow) = 0;
  81. /**
  82. * The currently focused nsDOMElement when the browser is active,
  83. * or the last focused nsDOMElement when the browser is inactive.
  84. */
  85. /* attribute nsIDOMElement focusedElement; */
  86. NS_IMETHOD GetFocusedElement(nsIDOMElement * *aFocusedElement) = 0;
  87. NS_IMETHOD SetFocusedElement(nsIDOMElement * aFocusedElement) = 0;
  88. };
  89. /* Use this macro when declaring classes that implement this interface. */
  90. #define NS_DECL_NSIWEBBROWSERFOCUS \
  91. NS_IMETHOD Activate(void); \
  92. NS_IMETHOD Deactivate(void); \
  93. NS_IMETHOD SetFocusAtFirstElement(void); \
  94. NS_IMETHOD SetFocusAtLastElement(void); \
  95. NS_IMETHOD GetFocusedWindow(nsIDOMWindow * *aFocusedWindow); \
  96. NS_IMETHOD SetFocusedWindow(nsIDOMWindow * aFocusedWindow); \
  97. NS_IMETHOD GetFocusedElement(nsIDOMElement * *aFocusedElement); \
  98. NS_IMETHOD SetFocusedElement(nsIDOMElement * aFocusedElement);
  99. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  100. #define NS_FORWARD_NSIWEBBROWSERFOCUS(_to) \
  101. NS_IMETHOD Activate(void) { return _to Activate(); } \
  102. NS_IMETHOD Deactivate(void) { return _to Deactivate(); } \
  103. NS_IMETHOD SetFocusAtFirstElement(void) { return _to SetFocusAtFirstElement(); } \
  104. NS_IMETHOD SetFocusAtLastElement(void) { return _to SetFocusAtLastElement(); } \
  105. NS_IMETHOD GetFocusedWindow(nsIDOMWindow * *aFocusedWindow) { return _to GetFocusedWindow(aFocusedWindow); } \
  106. NS_IMETHOD SetFocusedWindow(nsIDOMWindow * aFocusedWindow) { return _to SetFocusedWindow(aFocusedWindow); } \
  107. NS_IMETHOD GetFocusedElement(nsIDOMElement * *aFocusedElement) { return _to GetFocusedElement(aFocusedElement); } \
  108. NS_IMETHOD SetFocusedElement(nsIDOMElement * aFocusedElement) { return _to SetFocusedElement(aFocusedElement); }
  109. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  110. #define NS_FORWARD_SAFE_NSIWEBBROWSERFOCUS(_to) \
  111. NS_IMETHOD Activate(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Activate(); } \
  112. NS_IMETHOD Deactivate(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Deactivate(); } \
  113. NS_IMETHOD SetFocusAtFirstElement(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFocusAtFirstElement(); } \
  114. NS_IMETHOD SetFocusAtLastElement(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFocusAtLastElement(); } \
  115. NS_IMETHOD GetFocusedWindow(nsIDOMWindow * *aFocusedWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFocusedWindow(aFocusedWindow); } \
  116. NS_IMETHOD SetFocusedWindow(nsIDOMWindow * aFocusedWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFocusedWindow(aFocusedWindow); } \
  117. NS_IMETHOD GetFocusedElement(nsIDOMElement * *aFocusedElement) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFocusedElement(aFocusedElement); } \
  118. NS_IMETHOD SetFocusedElement(nsIDOMElement * aFocusedElement) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetFocusedElement(aFocusedElement); }
  119. #if 0
  120. /* Use the code below as a template for the implementation class for this interface. */
  121. /* Header file */
  122. class nsWebBrowserFocus : public nsIWebBrowserFocus
  123. {
  124. public:
  125. NS_DECL_ISUPPORTS
  126. NS_DECL_NSIWEBBROWSERFOCUS
  127. nsWebBrowserFocus();
  128. private:
  129. ~nsWebBrowserFocus();
  130. protected:
  131. /* additional members */
  132. };
  133. /* Implementation file */
  134. NS_IMPL_ISUPPORTS1(nsWebBrowserFocus, nsIWebBrowserFocus)
  135. nsWebBrowserFocus::nsWebBrowserFocus()
  136. {
  137. /* member initializers and constructor code */
  138. }
  139. nsWebBrowserFocus::~nsWebBrowserFocus()
  140. {
  141. /* destructor code */
  142. }
  143. /* void activate (); */
  144. NS_IMETHODIMP nsWebBrowserFocus::Activate()
  145. {
  146. return NS_ERROR_NOT_IMPLEMENTED;
  147. }
  148. /* void deactivate (); */
  149. NS_IMETHODIMP nsWebBrowserFocus::Deactivate()
  150. {
  151. return NS_ERROR_NOT_IMPLEMENTED;
  152. }
  153. /* void setFocusAtFirstElement (); */
  154. NS_IMETHODIMP nsWebBrowserFocus::SetFocusAtFirstElement()
  155. {
  156. return NS_ERROR_NOT_IMPLEMENTED;
  157. }
  158. /* void setFocusAtLastElement (); */
  159. NS_IMETHODIMP nsWebBrowserFocus::SetFocusAtLastElement()
  160. {
  161. return NS_ERROR_NOT_IMPLEMENTED;
  162. }
  163. /* attribute nsIDOMWindow focusedWindow; */
  164. NS_IMETHODIMP nsWebBrowserFocus::GetFocusedWindow(nsIDOMWindow * *aFocusedWindow)
  165. {
  166. return NS_ERROR_NOT_IMPLEMENTED;
  167. }
  168. NS_IMETHODIMP nsWebBrowserFocus::SetFocusedWindow(nsIDOMWindow * aFocusedWindow)
  169. {
  170. return NS_ERROR_NOT_IMPLEMENTED;
  171. }
  172. /* attribute nsIDOMElement focusedElement; */
  173. NS_IMETHODIMP nsWebBrowserFocus::GetFocusedElement(nsIDOMElement * *aFocusedElement)
  174. {
  175. return NS_ERROR_NOT_IMPLEMENTED;
  176. }
  177. NS_IMETHODIMP nsWebBrowserFocus::SetFocusedElement(nsIDOMElement * aFocusedElement)
  178. {
  179. return NS_ERROR_NOT_IMPLEMENTED;
  180. }
  181. /* End of implementation class template. */
  182. #endif
  183. #endif /* __gen_nsIWebBrowserFocus_h__ */