2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 package com
.intellij
.injected
.editor
;
22 import com
.intellij
.openapi
.editor
.Document
;
23 import com
.intellij
.openapi
.editor
.RangeMarker
;
24 import com
.intellij
.openapi
.util
.TextRange
;
25 import org
.jetbrains
.annotations
.NotNull
;
26 import org
.jetbrains
.annotations
.Nullable
;
28 public interface DocumentWindow
extends Document
{
29 @NotNull Document
getDelegate();
30 int injectedToHost(int injectedOffset
);
31 @NotNull TextRange
injectedToHost(@NotNull TextRange injectedOffset
);
32 int hostToInjected(int hostOffset
);
35 * Use com.intellij.lang.injection.InjectedLanguageManager#intersectWithAllEditableFragments(com.intellij.psi.PsiFile, com.intellij.openapi.util.TextRange)
36 * since editable fragments may well spread over several injection hosts
40 TextRange
intersectWithEditable(@NotNull TextRange range
);
43 TextRange
getHostRange(int hostOffset
);
45 int injectedToHostLine(int line
);
48 RangeMarker
[] getHostRanges();
50 boolean areRangesEqual(@NotNull DocumentWindow documentWindow
);
54 boolean containsRange(int start
, int end
);