run highlight visitors for injected fragments
[fedora-idea.git] / platform / platform-api / src / com / intellij / injected / editor / DocumentWindow.java
blobe2c3410e44cccb139ef62d53f587080a51dac15a
1 /*
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.
18 * @author max
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);
34 /**
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
38 @Deprecated
39 @Nullable
40 TextRange intersectWithEditable(@NotNull TextRange range);
42 @Nullable
43 TextRange getHostRange(int hostOffset);
45 int injectedToHostLine(int line);
47 @NotNull
48 RangeMarker[] getHostRanges();
50 boolean areRangesEqual(@NotNull DocumentWindow documentWindow);
52 boolean isValid();
54 boolean containsRange(int start, int end);