Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

203 lines
2.4 KiB

  1. //-----------------------------------------------------------------------------
  2. //
  3. // File: location.inl
  4. // Copyright (C) 1994-1997 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. //
  8. //
  9. //-----------------------------------------------------------------------------
  10. inline
  11. void
  12. CLocation::AssignFrom(
  13. const CLocation &other)
  14. {
  15. m_giId = other.m_giId;
  16. m_TabId = other.m_TabId;
  17. m_View = other.m_View;
  18. m_Component = other.m_Component;
  19. }
  20. inline
  21. BOOL
  22. CLocation::Compare(
  23. const CLocation &other)
  24. const
  25. {
  26. return m_giId == other.m_giId &&
  27. m_TabId == other.m_TabId &&
  28. m_View == other.m_View &&
  29. m_Component == other. m_Component;
  30. }
  31. inline
  32. CLocation::CLocation()
  33. {
  34. m_TabId = NullTabId;
  35. m_View = vNone;
  36. m_Component = cmpNone;
  37. }
  38. inline
  39. CLocation::CLocation(
  40. const CLocation &Other)
  41. {
  42. AssignFrom(Other);
  43. }
  44. inline
  45. CLocation::CLocation(
  46. const CGlobalId &giId,
  47. View view,
  48. TabId tabId,
  49. Component component)
  50. : m_giId(giId), m_TabId(tabId), m_View(view), m_Component(component)
  51. {}
  52. inline
  53. CLocation::CLocation(
  54. const DBID &dbid,
  55. ObjectType ot,
  56. View view,
  57. TabId tabId,
  58. Component component)
  59. : m_giId(dbid, ot), m_TabId(tabId), m_View(view), m_Component(component)
  60. {}
  61. inline
  62. const CLocation &
  63. CLocation::operator=(
  64. const CLocation &Other)
  65. {
  66. AssignFrom(Other);
  67. return *this;
  68. }
  69. inline
  70. int
  71. CLocation::operator==(
  72. const CLocation &Other) const
  73. {
  74. return Compare(Other);
  75. }
  76. inline
  77. int
  78. CLocation::operator!=(
  79. const CLocation &Other) const
  80. {
  81. return !Compare(Other);
  82. }
  83. inline
  84. const CGlobalId &
  85. CLocation::GetGlobalId(void)
  86. const
  87. {
  88. return m_giId;
  89. }
  90. inline
  91. TabId
  92. CLocation::GetTabId(void)
  93. const
  94. {
  95. return m_TabId;
  96. }
  97. inline
  98. View
  99. CLocation::GetView(void)
  100. const
  101. {
  102. return m_View;
  103. }
  104. inline
  105. Component
  106. CLocation::GetComponent(void)
  107. const
  108. {
  109. return m_Component;
  110. }
  111. inline
  112. BOOL
  113. CLocation::IsVisual(void)
  114. const
  115. {
  116. return (m_View == vVisualEditor);
  117. }
  118. inline
  119. void
  120. CLocation::SetGlobalId(
  121. const CGlobalId &gid)
  122. {
  123. m_giId = gid;
  124. }
  125. inline
  126. void
  127. CLocation::SetTabId(
  128. const TabId TabId)
  129. {
  130. m_TabId = TabId;
  131. }
  132. inline
  133. void
  134. CLocation::SetView(
  135. View vView)
  136. {
  137. m_View = vView;
  138. }
  139. inline
  140. void
  141. CLocation::SetComponent(
  142. Component comp)
  143. {
  144. m_Component = comp;
  145. }